This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [self.motionManager startDeviceMotionUpdatesToQueue:[NSOperationQueue currentQueue] withHandler:^(CMDeviceMotion *motion,NSError *error){ | |
| double gravityX = motion.gravity.x; | |
| double gravityY = motion.gravity.y; | |
| double gravityZ = motion.gravity.z; | |
| NSLog(@"gravityX = %f",gravityX); | |
| NSLog(@"gravityY = %f",gravityY); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| BOOL isCameraValid = YES; | |
| //判断iOS7的宏,没有就自己写个,下边的方法是iOS7新加的,7以下调用会报错 | |
| if(isIOS7AndLater) | |
| { | |
| AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo]; | |
| if (authStatus != AVAuthorizationStatusAuthorized) | |
| { | |
| isCameraValid = NO; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1. 安装Ubuntu Server版本 | |
| 2. 更新软件源 | |
| sudo apt-get update | |
| 3. 安装open-ssh | |
| sudo apt-get install openssh-server | |
| 4. 提升ssh认証时间 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 因为播放器只支持播放NSURL参数的资源,所以要播放本地文件时,需要将路径参数转化为 | |
| 本地路径构造URL,使用NSURL 提供的静态方法fileURLWithPath | |
| Creating an NSURL | |
| – initWithScheme:host:path: | |
| + URLWithString: | |
| – initWithString: | |
| + URLWithString:relativeToURL: | |
| – initWithString:relativeToURL: | |
| + fileURLWithPath:isDirectory: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NSArray *familyNames = [[NSArray alloc] initWithArray:[UIFont familyNames]]; | |
| NSArray *fontNames; | |
| NSInteger indFamily, indFont; | |
| for(indFamily=0;indFamily<[familyNames count];++indFamily) | |
| { | |
| NSLog(@"Family name: %@", [familyNames objectAtIndex:indFamily]); | |
| fontNames =[[NSArray alloc]initWithArray:[UIFont fontNamesForFamilyName:[familyNames objectAtIndex:indFamily]]]; | |
| for(indFont=0; indFont<[fontNames count]; ++indFont) | |
| { | |
| NSLog(@" Font name: %@",[fontNames objectAtIndex:indFont]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pixelmator | |
| http://help.pixelmator.com/#118 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| >>> print "\u624b\u673a\u7c7b\u578b".decode('unicode_escape') | |
| 手机类型 | |
| >>> print "\U65b9\U6cd5method\U4e0d\U5b58\U5728".decode('unicode_escape’) | |
| >>> print "\u65b9\U6cd5method\U4e0d\U5b58\U5728".decode('unicode_escape') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 重启mac声卡 | |
| sudo kextunload /System/Library/Extensions/AppleHDA.kext | |
| sudo kextload /System/Library/Extensions/AppleHDA.kext |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ubuntu查看占用某端口的程序 | |
| sof -i:8888 |