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
map.mapTypes.set("GsiMaps", { | |
name:"標高タイル", | |
tileSize:new google.maps.Size(256,256), | |
minZoom:14, // 標高タイルは Lv:14 しか用意されてないので | |
maxZoom:14, | |
getTile:function(tileCoord, zoom, ownerDocument) { | |
// 普通は img だけど、標高タイルは CSV で画素毎の標高値が取得できるので、 | |
// クライアント側で描画するために Canvas を使う | |
var canvas = ownerDocument.createElement("canvas"); |
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 class ClikcableSpanTestActivity extends Activity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
final List<Pair<String, String>> data = new ArrayList<Pair<String,String>>(); | |
data.add(new Pair<String, String>("りんご", "隠し味としてカレーに入れます")); | |
data.add(new Pair<String, String>("みかん", "あぶりだしに使います")); | |
data.add(new Pair<String, String>("すいか", "種を食べると盲腸になります(嘘)")); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style type="text/css"> | |
html { height: 100% } | |
body { height: 100%; margin: 0px; padding: 0px } | |
#map { height: 100% } | |
</style> | |
<script src="http://maps.google.com/maps/api/js?v=3&sensor=false" |
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 static int metersToEquatorPixels(GoogleMap map, LatLng base, float meters) { | |
final double OFFSET_LON = 0.5d; | |
Location baseLoc = new Location(""); | |
baseLoc.setLatitude(base.latitude); | |
baseLoc.setLongitude(base.longitude); | |
Location dest = new Location(""); | |
dest.setLatitude(base.latitude); | |
dest.setLongitude(base.longitude + OFFSET_LON); |
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 fs = require("fs") | |
, path = require("path") | |
, dir = process.argv[2] || '.'; //引数が無いときはカレントディレクトリを対象とする | |
var walk = function(p, fileCallback, errCallback) { | |
fs.readdir(p, function(err, files) { | |
if (err) { | |
errCallback(err); | |
return; |
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
curl -XPUT 'http://localhost:9200/myvenues/' | |
curl -XPUT 'http://localhost:9200/myvenues/venue/_mapping' -d ' | |
{ | |
"venue" : { | |
"properties" : { | |
"pin" : { "type" : "geo_point" } | |
} | |
} | |
}' |
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
// 指定した Priority の ThreadFactory を生成して返す | |
private ThreadFactory makeThreadFactory(final int priority) { | |
return new ThreadFactory() { | |
@Override | |
public Thread newThread(Runnable r) { | |
Thread thread = new Thread(r); | |
thread.setPriority(priority); | |
return thread; | |
} |
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
- (IBAction)buttonDownWithArc:(id)sender { | |
NSString* path = @".../bigdata.img"; | |
for (int i = 0; i < 10000; i++) { | |
NSData* data = [NSData dataWithContentsOfFile:path]; | |
[NSThread sleepForTimeInterval:0.5]; | |
data = nil; | |
} | |
} |
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 void singleThreadExecutorBasicTest() throws Exception { | |
final ExecutorService executor = Executors.newSingleThreadExecutor(); | |
Log.d(TAG, "Primary ThreadID:" + Thread.currentThread().getId()); | |
executor.submit(new Runnable() { | |
@Override | |
public void run() { | |
Log.d(TAG, "Run task A. ThreadId:" + Thread.currentThread().getId()); | |
} | |
}); |
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.io.BufferedWriter; | |
import java.io.File; | |
import java.io.FileOutputStream; | |
import java.io.OutputStream; | |
import java.io.OutputStreamWriter; | |
import android.content.Context; | |
import android.os.Environment; | |
import android.test.InstrumentationTestCase; | |
import android.util.Log; |