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
//VideoCameraはGPUIMageVideoCameraのインスタンス | |
let output = videoCamera.captureSession.outputs[self.videoCamera.captureSession.outputs.endIndex - 1] as! AVCaptureVideoDataOutput | |
let setting:NSDictionary = output.videoSettings | |
let width = (setting["Width"] as! NSNumber).longValue | |
let height = (setting["Height"] as! NSNumber).longValue |
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
public final static String TIME_FORMAT = "yy/MM/dd HH:mm:ss"; | |
//UTC標準時刻をローカル時間のテキストに変換する。 | |
public String toLocalTime(String utcTime) { | |
try { | |
Time t = new Time(); | |
t.parse3339(utcTime); | |
long msec = t.normalize(false); | |
Date d = new Date( msec ); |
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
kill -KILL `cat tmp/unicorn.pid` |
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
$mysql>create database [データベース名] character set utf8; | |
$mysql>create user 'ユーザ名'@'localhost' identified by 'パスワード'; | |
$mysql>grant all privileges on [データベース名].* to 'ユーザ名'@'localhost'; |
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
Rack::Utils.multipart_part_limit = 0 |
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
import android.graphics.Bitmap; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.OutputStream; |
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
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; | |
[dateFormatter setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"UTC"]]; | |
//"2014-09-05T03:37:21.000Z" | |
dateFormatter.dateFormat = @"yyyy-MM-dd'T'HH:mm:ss.000Z"; | |
NSDate * lastDate = [dateFormatter dateFromString:@"2000-12-31T12:12:12.000Z"]; |
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
#define isJapanes() [[[NSLocale preferredLanguages] objectAtIndex:0]isEqualToString:@"ja"] |
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
//Logging macro | |
//if release mode, undfeine this macro | |
#ifdef DEBUG | |
#define NSLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) | |
#else | |
#define NSLog(fmt, ...) | |
#endif | |
//assertion macro |
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
#!/bin/sh | |
# | |
# check Home Local LAN or other place, wifi or company office | |
# if access from home LAN, out Home LAN IP address, otherwise return global IP addrress | |
# Author Takuya Inoue | |
#GROBAL IP address | |
IP_ADDR=xxx.xxx.xxx.xxx | |
# network is 192.168.0.0/24 |
NewerOlder