Tuesday, July 26, 2016

How to fix your Mac not waking from sleep

There may be an issue that some iMac users experience where after being in sleep for a period of time, their systems will no longer respond to keypresses or other input, and even though pressing the power button should similarly wake the system, doing this similarly has no effect. With this problem, affected systems require either the power button be pressed and held for ~10 seconds, or the power cord is pulled to shut the system down and reset it.
Recently MacIssues reader Ken H. wrote in about this problem happening on a Late 2013 model iMac, running the latest versions of Yosemite and all other installed software. While the system would wake properly if immediately put into sleep and then woken, if left in sleep mode for a prolonged time, then it would simply refuse to wake up.
In general, this type of issue suggests a power management problem or other hardware-based configuration fault that can usually be tackled by the generic troubleshooting steps of resetting the Mac’s Parameter RAM (PRAM) or its system management controller (SMC).  However despite Ken resetting the these features, the problem continued, suggesting the default values for these controllers is allowing the issue to persist.


After investigating this problem further, Ken found it revolves around the handling of hibernation mode.

When your Mac sleeps, it will initially enter a standard low power sleep mode that keeps memory active so you can quickly resume your work. However, if power is lost in this mode then your system will lose its memory contents and have to start back up from scratch. To prevent this, hibernation mode (aka standby mode) will write the contents of memory to your Mac’s hard drive and then shut off, allowing you to resume work in the face of lost power. Since this mode uses no power, it is required to be on by default for some systems in some countries.
Unfortunately it appears that some systems may have troubles with hibernation mode, so if you are finding your Mac unable to wake from sleep, then are three potential fixes you can try:
Turn off system hibernation
Since hibernation mode’s only real benefit is to allow you to resume from sleep in the face of a power loss, a simple solution may be to turn hibernation mode off by running the following two commands in the OS X Terminal (enter your password when prompted–it will not show):
sudo pmset standby 0
sudo pmset autopoweroff 0
These commands will turn off the hardware settings that will put your Mac into hibernation mode. The first is Apple’s main standby mode option, and the second is an implementation required for European energy regulations. To reverse these commands, you can again either reset your Mac’s system management controller, or re-run the commands but use “1” as the value instead of “0.”
Disable and re-enable FileVault
The writing and restoring of memory contents from disk may conflict with FileVault or other full disk encryption routines. Technically when waking from hibernate mode the system should allow you to authenticate and then load the contents of the hibernation file, but if a bug prevents this from happening, then your Mac may not be able to load the hibernation file, and could hang.
To hopefully overcome this, first try disabling your full-disk encryption routines. After your disk is fully decrypted (this may take a while) test hibernate mode to see if it works properly, and then re-enable disk encryption and test again.
Remove your the system’s hibernation file
A final approach you can try is to remove the system’s hibernation file, which is the hidden file that is written to whenever your Mac goes into hibernation mode. While the system will recreate this file if it is missing, if present then it will just write to the existing file. As a result, any damage to this file may prevent the system from reading it when waking from sleep. To fix this, you can force OS X to recreate it by deleting it, which can be done by running the following command in the Terminal:
sudo rm /var/vm/sleepimage
Again supply your password when prompted, and then see if hibernate mode works properly.

Special thanks to Ken for writing in about this issue.

Friday, July 15, 2016

android studio github

1) enable git, choose git, click ok


2)share on github,   type the project name, it will create on github.com



















That is it. Done












Monday, July 11, 2016

samsung android usb driver, unknow device, usb device disconnect constantly


 samsung android usb driver, unknow device, usb device disconnect constantly

MTU usb driver, not installed properly.


Samsung OEM micro usb cable is the ultimate cause,  when you move or touch the cable around, it get disconnected, device manger constantly refreshing, constantly scan for hardware change.

Replace Samsung  OEM micro usb cable with any other brand will fix all problem.


==========================================================

For my HP Desktop.


1) repeat press F10 when power on, get into BIOS configure.

2) on top menu - advanced  - device option - USB 3.0 support (enable it), default is disabled.




3) sometime device manager refresh scan for hardware change, then unknow device,

this is because windows install driver from windows update, should disable it, should let windows install driver from samsung driver folder only,


Disable Searching Windows Update for Device Drivers

  1. Click Start, right-click Computer, and then click Properties.
  2. In the Tasks list, click Advanced System Settings.
  3. On the System Properties dialog box, click the Hardware tab, and then click Windows Update Driver Settings.
  4. Select Never check for drivers when I connect a device.
  5. Click OK twice, and then close the System dialog box.





I believe this is the real cause for all trouble, such as MTU usb driver not installed properly, samsung android device not recognized by PC,  android usb device constantly disconnect and reconnect and failed to recognized. etc.....





--------------------------

if you use android simulator, must enable bios vt-x visualation technology from bios

bios - security - system security - visualation technology - enable.

Leeds VT enable.jpg








below are try may not be the cause.

=====================================================



try:

1) remove previously installed blue tooth usb device. (or SD card), they may be the problem.


2) remove google androic studio ( maybe problem )

3) unplug internet. ( I see samsung continuing removed add, remove add, not sure if computer keep removing hardware)




=========================

windows, device manager, 'scan for hardware change' constantly , android device disconnect constantly,




1. Scroll to the right and type 'Power Options' in the search field and click on it.
2. Click 'Change plan setting' on your chosen plan.
3. Click 'Change advanced power setting' on your chosen plan.
4. Find 'USB settings' and open.
5. Find 'USB selective suspend setting' and change it to disabled.



-------------

This fixed ALL my USB 3.0 issues. Not mentioned anywhere else!

Its a BIOS ISSUE. Hopefully your computer has this option.

Go into your BIOS and TURN OFF "Legacy USB Support".

If you want even more speed, (there is a catch), Switch from "quick remove" to Buffering. BUT YOU HAVE TO DISCONNECT THE DRIVE WITH THE REMOVE USB DEVICE OR POWER DOWN THE COMPUTER FIRST. 


------------------

hey guys here is the fix if you are having trouble with your Windows 8.1 all USB devices keep disconnect / reconnect with power saving off ... this took me two days to try to figure out what the heck was going on so i luckily found the fix hope this saves you alot of time an you dont have to downgrade to windows 7 if you love windows 8.1 good because its not what virgin of windows you have it dosnt matter what OS your on its clearly your BIOS so i suppose many people having this problem has an ASUS motherboard so heres the fix 

1. restart your computer an go into your BIOS Press F2 repeatedly or THE DEL Key for those who dont know how to go to BIOS

2.Go into Advanced mode in your BIOS by clicking F7 on keyboard 

3.Go to Advanced Tab Scroll down to USB Configuration Scroll down to XHCI Mode yours Will probably be on Smart Auto or Auto so Disable it Completely an Save changes F10 an click yes an exit it will auto restart your computer an BOOM You have Fixed the Problem by simply reading this post Hope this helps guys 

Wednesday, July 6, 2016

xcode github existing project upload



Open Terminal and switch to the project’s parent folder
to do the initial setup of a repository, open up a terminal window, and CD to the project directory. once there, type


git init
git add . 
git commit -m "Initial commit"


Notice that there’s a period after a space on the end of the second command. Don’t forget to include it.


Confirm your local repositoryReopen Xcode, and hit the ‘Source Control’ menu. You should now see the options are active.





Add a Remote in Xcode

in Xcode go to Source Control > your branch name > Configure. Then click the Remote tab > "+" button > Add remote. Fill in your repository name and address.
enter image description here


Push your project to GitHub

Go to Source Control > Push. You will have to enter your GitHub user name and password the first time.
That's it. Now any time you make changes in Xcode, all you have to do is Commit and Push.



Add a remote repositoryLocal repositories are great, and may be enough for your needs, but for ultimate protection (such as against disk loss or failure), you might want to add remote back up. To do that, you’ll need an account with a service like GitHub or Bitbucket. My own personal preference is Bitbucket, largely because they allow you to have private repositories on a free account. Steps for adding your existing project to a remote repository can be found on your chosen service’s website. If you’re using Bitbucket, the general method is first create a new repository on the Bitbucket site and copy the link. Then, enter each of the following in Terminal, replacing the dummy text in square brackets with your actual values (remove the square brackets, too).
cd [path to your repo]
git remote add origin [url to your repository]
git push -u origin --all
git push -u origin --tags
After that, re-open your project in Xcode and you should be all set up. Check by ensuring the remote path is shown in Source Control > –> master > Configure…

Friday, July 1, 2016

ios not loading remote json or tile or anything


error:

The resource could not be loaded because the App Transport Security policy requires the use of a secure connection




I have solved it with adding some key in info.plist. The steps I followed are:
  1. Opened my Projects info.plist file
  2. Added a Key called NSAppTransportSecurity as a Dictionary.
  3. Added a Subkey called NSAllowsArbitraryLoads as Boolean and set its value to YES as like following image.

enter image description here
Clean the Project and Now Everything is Running fine as like before.
EDIT: OR In source code of info.plist file we can add that:

NSAppTransportSecurity
NSAllowsArbitraryLoads NSExceptionDomains yourdomain.com NSIncludesSubdomains NSThirdPartyExceptionRequiresForwardSecrecy


google map iOS get current map view bound

// work only on real device, not work on simulator



- (void)mapView:(GMSMapView *)mapView
idleAtCameraPosition:(GMSCameraPosition *)cameraPosition {
    

    
    
    // show current map view bound
    GMSVisibleRegion visibleRegion = [mapView_.projection visibleRegion];
    GMSCoordinateBounds *bounds = [[GMSCoordinateBounds alloc]initWithRegion:visibleRegion];
    
    CLLocationCoordinate2D northEast = bounds.northEast;
    CLLocationCoordinate2D northWest = CLLocationCoordinate2DMake(bounds.northEast.latitude, bounds.southWest.longitude);
    CLLocationCoordinate2D southEast = CLLocationCoordinate2DMake(bounds.southWest.latitude, bounds.northEast.longitude);
    
    CLLocationCoordinate2D  southWest = bounds.southWest;
    
    
    NSLog(@"NORTH-EST: %.5f",northEast.latitude);
    NSLog(@"NORTH-EST: %.5f",northEast.longitude);
    
    NSLog(@"NORTH-WEST: %.5f",northWest.latitude);
    NSLog(@"NORTH-WEST: %.5f",northWest.longitude);
    
    NSLog(@"South-EST: %.5f",southEast.longitude);
    NSLog(@"South-EST: %.5f",southEast.latitude);
    
    NSLog(@"SOUTH-WEST: %.5f",southWest.latitude);
    NSLog(@"SOUTH-WEST: %.5f",southWest.longitude);
    

}