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
// YUV形式からrgbに変換して戻します。 | |
public static void decodeYCbCr(final int[] rgb, final byte[] yuv, int width, int height) { | |
int y = 0, u = 0, v = 0, r = 0, g = 0, b = 0; | |
int yp = 0, uvp = width * (height - 1); | |
for (int j = 0; j < height; j++) { | |
if ((j & 1) == 0) { | |
uvp += width; | |
} | |
for (int i = 0; i < width; i++) { | |
if ((i & 1) == 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
var _ = require('underscore'); | |
_.mixin(require('underscore.string').exports()); | |
var crypto = require('crypto'); | |
// log output function | |
var log = (function(msg){ | |
var base = new Date().getTime(); // start time | |
return function(msg){ | |
var now = new Date().getTime(); | |
console.log([msg, ':', now - base, 'msec'].join('')); |
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 java.net.URL; | |
import java.io.BufferedReader; | |
import java.io.InputStreamReader; | |
import java.net.HttpURLConnection; | |
import java.net.Socket; | |
import javax.net.ssl.HttpsURLConnection; | |
import javax.net.ssl.KeyManager; | |
import javax.net.ssl.KeyManagerFactory; | |
import javax.net.ssl.SSLContext; | |
import javax.net.ssl.SSLSocketFactory; |
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 | |
# | |
TWEET=$(echo "$*"|cut -c -140) | |
curl -X POST --silent --data "_t=${STREWGATE_TOKEN}" --data-urlencode "msg=${TWEET}" http://stewgate-u.appspot.com/api/post/ > /dev/null |
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 timeit | |
code = ''' | |
import redis | |
r = redis.StrictRedis() | |
r.flushdb() | |
kv = {str(j):j for j in range(10000)} | |
r.mset(kv) | |
''' | |
print(timeit.timeit(code,number=1)) |