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
| xmlNodePtr cur = ...; | |
| /***** | |
| (1) | |
| */ | |
| xmlChar *prop = xmlGetProp(cur, (const xmlChar *) "nil"); | |
| // xmlChar *prop = xmlGetNsProp(cur, (const xmlChar *) "nil", (const xmlChar *) "http://www.w3.org/2001/XMLSchema-instance"); | |
| NSLog(@"prop : %p", prop); | |
| if (prop != NULL) { |
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
| $ brew install openssl | |
| ==> Downloading http://openssl.org/source/openssl-1.0.1e.tar.gz | |
| ######################################################################## 100.0% | |
| ==> perl ./Configure --prefix=/usr/local/Cellar/openssl/1.0.1e --openssldir=/usr/local/etc/openssl zlib-dynamic shared darwin64-x86_64-cc | |
| ==> make | |
| ==> make test | |
| ==> make install MANDIR=/usr/local/Cellar/openssl/1.0.1e/share/man MANSUFFIX=ssl | |
| ==> Caveats | |
| To install updated CA certs from Mozilla.org: |
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
| $ brew install tmux | |
| ==> Installing tmux dependency: pkg-config | |
| ==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/pkg-config-0.27.1.mountainlion.bottle.tar.gz | |
| ######################################################################## 100.0% | |
| ==> Pouring pkg-config-0.27.1.mountainlion.bottle.tar.gz | |
| /usr/local/Cellar/pkg-config/0.27.1: 9 files, 624K | |
| ==> Installing tmux dependency: libevent | |
| ==> Downloading https://github.com/downloads/libevent/libevent/libevent-2.0.20-stable.tar.gz | |
| ######################################################################## 100.0% | |
| ==> ./configure --disable-debug-mode --prefix=/usr/local/Cellar/libevent/2.0.20 |
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 "GANTracker.h" | |
| /* | |
| Google Analytics's Macros | |
| http://d.hatena.ne.jp/ninjinkun/20110115/1295074900 | |
| http://tkyk.name/blog/2011/09/19/iOS-Xcode-iphone_google-analytics-for-ios/ | |
| http://d.hatena.ne.jp/diveintounlimit/20120512/1336837189 | |
| */ | |
| #define GA_DEBUG_FLAG 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
| /* | |
| CREATE文における各種データ型の設定 | |
| 擬似的にBOOLEAN型を設定 | |
| */ | |
| CREATE TABLE IF NOT EXISTS tests (id INTEGER PRIMARY KEY AUTOINCREMENT, | |
| memo TEXT, | |
| image BLOB, | |
| type INTEGER, | |
| favorite BOOLEAN NOT NULL DEFAULT 0 CONSTRAINT testsFavorite CHECK (favorite IN (0, 1) OR favorite IS NULL), | |
| createdAt DATETIME |
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
| $ brew install subversion | |
| ==> Installing subversion dependency: pkg-config | |
| ==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/pkg-config-0.27.1.mountainlion.bottle.tar.gz | |
| ######################################################################## 100.0% | |
| ==> Pouring pkg-config-0.27.1.mountainlion.bottle.tar.gz | |
| /usr/local/Cellar/pkg-config/0.27.1: 9 files, 624K | |
| ==> Installing subversion dependency: neon | |
| ==> Downloading http://www.webdav.org/neon/neon-0.29.6.tar.gz | |
| ######################################################################## 100.0% | |
| ==> ./configure --prefix=/usr/local/Cellar/neon/0.29.6 --enable-shared --disable-static --with-ssl |
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
| @implementation AppDelegate | |
| - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
| { | |
| // Override point for customization after application launch. | |
| NSLog(@"%s", __func__); | |
| UIViewController *controller = self.window.rootViewController; | |
| NSLog(@"frame >>>>>>>>>>> %@", NSStringFromCGRect(controller.view.frame)); | |
| NSLog(@"bounds >>>>>>>>>>> %@", NSStringFromCGRect(controller.view.bounds)); | |
| return YES; |
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> | |
| @interface KMDevice : NSObject | |
| @property (nonatomic, readonly) NSString *uuid; | |
| @property (nonatomic, readonly) NSString *deviceToken; | |
| + (KMDevice *)sharedDevice; | |
| - (void)registerDeviceToken:(NSData *)devToken; |
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
| /** | |
| 乱数生成 | |
| */ | |
| // 一般的な方法 | |
| srand((unsigned int)time(NULL)); // 初期化 | |
| int r = rand() % 10 + 1; | |
| // または | |
| int r = arc4random() % 10; |
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
| - (IBAction)capture:(id)sender | |
| { | |
| UIImage *image = [self imageByCapture:self.view]; | |
| self.imageView.image = image; | |
| } | |
| - (UIImage *)imageByCapture:(UIView *)view | |
| { | |
| UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.opaque, 0.0); | |
| [view.layer renderInContext:UIGraphicsGetCurrentContext()]; |