This file contains 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
NSMutableString *pinyin = [name mutableCopy]; | |
if (!CFStringTransform((__bridge CFMutableStringRef)pinyin, 0, kCFStringTransformMandarinLatin, NO)) { | |
DDLogWarn(@"拼音转换[步骤1]失败: %@ -> %@", name, pinyin); | |
} | |
if (!CFStringTransform((__bridge CFMutableStringRef)pinyin, 0, kCFStringTransformStripDiacritics, NO)) { | |
DDLogWarn(@"拼音转换[步骤2]失败: %@ -> %@", name, pinyin); | |
} |
This file contains 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
- (void)rotateView:(UIView*)view ToAngle:(CGFloat)angle animated:(BOOL)animated | |
{ | |
NSParameterAssert(angle <= 360 && angle >= 0); | |
CGFloat radians = atan2f(view.transform.b, view.transform.a); | |
CGFloat degrees = radians * (180 / M_PI); | |
if ( fabs( degrees - angle ) < FLT_MIN) { | |
return; | |
} |
This file contains 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
#!/usr/bin/env python | |
import os | |
image_file_types = ['.jpg', '.png'] | |
def is_image_file(file_name): | |
fileName, fileExt = os.path.splitext(file_name) | |
for type in image_file_types: |