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/bash | |
cat *.plist \ | |
| grep '<string>' \ | |
| sed 's/<\/string>//g; s/<string>//g; s/\t//g;' \ | |
| sed '$!N; s/\n/\t/g;' \ | |
| awk -F"\t" '{print $2 "\t" $1 "\t短縮よみ"}' |
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
package com.example | |
import android.graphics.Bitmap | |
import android.graphics.Canvas | |
import android.graphics.Paint | |
import android.graphics.Point | |
object BitmapUtil { | |
fun leftBottom(src: Bitmap): Point { | |
val height = src.height - 10 |
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
package com.m3.coreapi.servlet.util; | |
import java.lang.reflect.Method; | |
import java.lang.reflect.ParameterizedType; | |
import java.lang.reflect.Type; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.Set; | |
public class GPT<T> { |
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
val f = Future { 5 } | |
val g = f.map { case x => x + 1 } foreach println | |
// 6 が表示される | |
val h = f.flatMap { case x => Future { x + 1 } } foreach println | |
// 6 が表示される | |
val f = for { | |
x <- Future { 5 } | |
y <- Future { x + 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
var promise = new Promise(function(resolve, reject) { | |
... // 重い処理 | |
if (success) { | |
resolve(result); | |
} else { | |
reject(error); | |
} | |
}); | |
promise.then( |
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
// | |
// to load script, extension api needs deeeeeep nest of callback functions. | |
// this utility provides simple way to load external scripts. | |
// | |
// Usage: | |
// | |
// loadScripts(["js/....", ...], "foobar.initialize();", function() { console.log("done."); })(); | |
// | |
function loadScripts(scriptFiles, finalScript, callBack) { |
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
<%@page import="org.apache.commons.httpclient.*"%> | |
<%@page import="org.apache.commons.httpclient.methods.*"%> | |
setConnectionTimeout only : not connected<br/> | |
<% | |
long start = System.currentTimeMillis(); | |
int timeout = 1000; | |
try { | |
final HttpClient client = new HttpClient(); |