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
| // | |
| // UIColor+Hex.h | |
| // | |
| // | |
| // Created by 超 沈 on 11-12-31. | |
| // Copyright (c) 2011年 __MyCompanyName__. All rights reserved. | |
| // | |
| #import <UIKit/UIKit.h> |
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
| // | |
| // 原文: http://my.csdn.net/sxjiake/code/detail/13833 | |
| // | |
| // 感谢 sxjiake | |
| // | |
| #include <stdio.h> | |
| #include <stdint.h> | |
| #include <stdlib.h> | |
| #include <locale.h> |
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
| void printViewsInViewHierarchyWithRootView(UIView *rootView) | |
| { | |
| NSCAssert(nil != rootView, @"rootView is nil!"); | |
| static NSInteger indentationLevel = -1; | |
| ++indentationLevel; | |
| NSMutableString *indentation = [NSMutableString stringWithCapacity:(NSUInteger)indentationLevel]; | |
| NSInteger indentationLevelCopy = indentationLevel; |
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
| #import <libkern/OSAtomic.h> | |
| #import <dispatch/dispatch.h> | |
| #import <objc/runtime.h> | |
| @implementation MySingleton | |
| + (void) load | |
| { | |
| // check for weak-linked libdispatch symbols | |
| if ( dispatch_queue_create != 0 ) |
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
| http://devstreaming.apple.com/videos/wwdc/2013/710xfx3xn8197k4i9s2rvyb/710/710-HD.mov?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2013/202xdx2x47ezp1wein/202/202-HD.mov?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2013/200xdx2x35e1pxiinm/200/200-HD.mov?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2013/413xdx5x97itb5ek4yex3r7/413/413-HD.mov?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2013/612xax4xx65z1ervy5np1qb/612/612-HD.mov?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2013/221xex4xxohbllf4hblyngt/221/221-HD.mov?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2013/220xbx4xipaxfd1tggxuoib/220/220-HD.mov?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2013/711xcx4x8yuutk8sady6t9f/711/711-HD.mov?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2013/404xbx2xvp1eaaqonr8zokm/404/404-HD.mov?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2013/505xbx4xrgmhwby4oiwkrpp/505/505-HD.mov?dl=1 |
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
| #import <Foundation/Foundation.h> | |
| /** | |
| * 根据第 18 位校验指定中华人民共和国居民号码的合法性。 | |
| * | |
| * @param IDNumber 待校验的身份证号码。 | |
| * | |
| * @return YES 表示合法,NO 表示非法。 | |
| */ | |
| BOOL validateIDNumber(NSString *IDNumber) |
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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| typedef struct Node_t | |
| { | |
| struct Node_t *next; | |
| int data; | |
| } Node; | |
| /** |
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
| #include <stdio.h> | |
| /** | |
| * 有一个数组,它的元素先上升后下降,请用二分法找出拐点元素的下标。 | |
| * | |
| * There is an array whose elements first ascend and then | |
| * descend. Please find the index of the inflection point | |
| * element using binary search. | |
| */ |
This file has been truncated, but you can view the full file.
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
| __SSTOKENSTRING = "@generated SignedSource<<dbe928e1275c495c1922c1bf063ffb70>>"; | |
| ! function(e) { | |
| function t(e) { | |
| function t() { | |
| var t = Array.prototype.map.call(arguments, function(e) { | |
| if (null == e) return null === e ? "null" : "undefined"; | |
| if ("string" == typeof e) return '"' + e + '"'; | |
| try { | |
| return JSON.stringify(e) | |
| } catch (t) { |
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
| extension String { | |
| func size(withAttributes attrs: [String:AnyObject], constrainedTo box: NSSize) -> NSRect { | |
| let storage = NSTextStorage(string: self) | |
| let container = NSTextContainer(containerSize: NSSize(width: box.width, height: box.height)) | |
| let layout = NSLayoutManager() | |
| layout.addTextContainer(container) | |
| storage.addLayoutManager(layout) | |
| storage.addAttributes(attrs, range: NSMakeRange(0, storage.length)) | |
| container.lineFragmentPadding = 0.0 | |
| let _ = layout.glyphRangeForTextContainer(container) |
OlderNewer