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
const double a = 6378245.0; | |
const double ee = 0.00669342162296594323; | |
static BOOL outOfChina(double lat, double lon){ | |
if(lon < 72.004 || lon > 137.8347){ | |
return true; | |
} | |
if(lat < 0.8293 || lat > 55.8271){ | |
return true; |
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
switch (scope) { | |
case 0: | |
if (maskTime >= 0) { | |
// ๆฅๅบ | |
if (_ispanGesture) { | |
_imageLayer0.alpha = ((float)(perTime - abs(maskTime)))/perTime; | |
_imageLayer1.alpha = 1; | |
}else{ | |
[self setimageLayer:_imageLayer0 byAlpha:((float)(perTime - abs(maskTime)))/perTime]; | |
[self setimageLayer:_imageLayer1 byAlpha:1]; |
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
<!DOCTYPE html> | |
<html lang="en-US" prefix="og: http://ogp.me/ns#"> | |
<head> | |
<meta charset="utf-8"> | |
<title>{% if is_home %}{{ site.author }}{% elif is_post %}{{ post.title }}{% elif is_link %}{{ link.title }}{% elif is_page %}{{ page.title }}{% endif %} | {{ site.name }}</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta name="apple-mobile-web-app-capable" content="yes" /> | |
<meta name="apple-mobile-web-app-status-bar-style" content="black" /> |
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
NSFileManager *fileManager = [NSFileManager defaultManager]; | |
NSError *error; | |
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); | |
NSString *documentsDirectory = [paths objectAtIndex:0]; | |
NSString *documentDBFolderPath = [documentsDirectory stringByAppendingPathComponent:@"templates"]; | |
NSString *resourceDBFolderPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"templates"]; | |
if (![fileManager fileExistsAtPath:documentDBFolderPath]) { | |
//Create Directory! | |
[fileManager createDirectoryAtPath:documentDBFolderPath withIntermediateDirectories:NO attributes:nil error:&error]; |
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
{ "channel" : 1, | |
"content" : "์ฐ๋ฆฌ ์ฃผ๋ณ์ ๋ค์ํ ์ฌ๋๋ค์ ์ถ์ ์ง์ํ๊ฒ ๋ณด์ฌ์ฃผ๋ ๋คํ๋ฉํฐ๋ฆฌ๋ก 2001๋ 2์ 13์ผ์ ์ฒซ ๋ฐฉ์ก์ ์์ํด์ ์์์ผ๋ถํฐ ๊ธ์์ผ๊น์ง ๋งค์ผ ๋ฐฉ์ก์ ํ๊ณ ์๋ ์ฅ์ ํ๋ก๊ทธ๋จ์ด๋ค. ๋ค์ํ ์ฌ๋๋ค์ ๋งค์ฐ ์ง์ํ ๋ชจ์ต์ ๋ด์๋ด๋ ๊ฒ์ด ํน์ง์ด๋ค. ใ์ธ๊ฐ๊ทน์ฅใ์ ๋งค์ฃผ ์ ~ ๊ธ ์์นจ 7์ 50๋ถ์์ 8์ 25๋ถ๊น์ง KBS ์ 1TV์์ ๋ฐฉ์ก๋๊ณ ์๋ ํ ๋ ๋น์ ํ๋ก๊ทธ๋จ์ด๋ค. 2000๋ 5์ 1์ผ์ ๋ฐฉ์ก์ ์์ํ์ฌ ํ์ฌ๊น์ง ๋ฐฉ์ก๋๊ณ ์๋ค.", | |
"cover_img" : "http://tv1009.anydev.net/uploads/tv_info/2013072410074133367.jpg", | |
"create_time" : "2013-07-17 18:53:56", | |
"hit" : 2040, | |
"hour_minute" : 28200, | |
"id" : 472, | |
"is_over" : 0, | |
"last_term" : "20140327", | |
"last_update" : 1395923383, |
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
NSMutableArray *resultArray = [NSMutableArray new]; | |
NSArray *groups = [self.survey.questions valueForKeyPath:@"@distinctUnionOfObjects.type"]; | |
for (NSString *groupId in groups) | |
{ | |
NSMutableDictionary *entry = [NSMutableDictionary new]; | |
[entry setObject:groupId forKey:@"type"]; | |
NSArray *groupNames = [self.survey.questions filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"type = %@", groupId]]; | |
[entry setObject:groupNames forKey:@"values"]; |
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
AVURLAsset *asset1 = [[AVURLAsset alloc] initWithURL:[info objectForKey:@"UIImagePickerControllerMediaURL"] options:nil]; | |
AVAssetImageGenerator *generate1 = [[AVAssetImageGenerator alloc] initWithAsset:asset1]; | |
generate1.appliesPreferredTrackTransform = YES; | |
NSError *err = NULL; | |
CMTime time = CMTimeMake(1, 2); | |
CGImageRef oneRef = [generate1 copyCGImageAtTime:time actualTime:NULL error:&err]; | |
UIImage *one = [[UIImage alloc] initWithCGImage:oneRef]; |
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
_MimeTypes = @{ | |
@"text/plain": @{ @"icon": @"txt-big", @"ext" : @[@"txt", @"text", @"conf", @"def", @"log", @"list", @"ini"] }, | |
@"text/css": @{ @"icon": @"css-big", @"ext" : @[@"css"] }, | |
@"text/javascript": @{ @"icon": @"js-big", @"ext" : @[@"js"] }, | |
@"text/html": @{ @"icon": @"ie-big", @"ext" : @[@"html", @"htm"] }, | |
@"text/xml": @{ @"icon": @"xml-big", @"ext" : @[@"xml", @"xsl", @"xslt"] }, | |
@"text/csv": @{ @"icon": @"csv-big", @"ext" : @[@"csv"] }, | |
@"text/x-vcard": @{ @"icon": @"vcf-big", @"ext" : @[@"vcf"] }, | |
@"text/calendar": |
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
static NSDictionary *titleMapping = nil; | |
if (!titleMapping) { | |
NSString *(^const format)(NSUInteger, NSString *, NSString *) = ^(NSUInteger value, NSString *singular, NSString *plural) { | |
return [NSString stringWithFormat:@"%d %@", value, (value == 1 ? singular : plural)]; | |
}; | |
titleMapping = @{ | |
@"Scratches" : ^(MyClass *target) { | |
return format([target numberOfScratches], @"Scratch", @"Scratches"); | |
}, |
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
{ | |
data={ | |
cards=({ | |
"_id"=549f70766b0760c934a07df2;"comment_count"=2;cover="http://img.iyuanzi.net/cardCover/2014-12/b23ebe43-27b1-4941-8838-aa2ce9691d34";"create_at"="1\U4e2a\U6708\U524d";description="";"favorite_count"=4;id=549f70766b0760c934a07df2;index=0;isFavorited=0;isPraised=0;isTop=1;owner={ | |
"_id"=549d1d2e566d41e412eef816;avatar="http://img.iyuanzi.net/userAvatar/2014-12/d5cb4c03-10ff-45d2-adbd-5871e724898e";id=549d1d2e566d41e412eef816;"nick_name"="\U852c\U83dc\U5988\U5988"; | |
};"praise_count"=10;"shared_count"=4;title="\U7ed9\U7238\U7238\U7684\U543b";"update_at"="16\U5929\U524d"; | |
}, | |
{ | |
"_id"=549f70736b0760c934a07dec;"comment_count"=4;cover="http://img.iyuanzi.net/cardCover/2014-12/8657281e-978f-470f-92c0-7f7a8ab926fb";"create_at"="1\U4e2a\U6708\U524d";description="";"favorite_count"=2;id=549f70736b0760c934a07dec;index=0;isFavorited=0;isPraised=0;isTop=1;owner={ | |
"_id"=549d1d2e566d41e412eef816;avatar="http://img.iyuanzi.net/userAvatar/2014-12/d5cb4c03-10ff-45d2-adbd-5871e724898e";id= |