Skip to content

Instantly share code, notes, and snippets.

View abarth500's full-sized avatar

Shohei Yokoyama abarth500

  • Tokyo Metropolitan University
  • Tokyo Japan
View GitHub Profile
@abarth500
abarth500 / gist:bea5bd5ce8fa910a06f13cd5c99e855d
Created December 20, 2019 02:07
Overpass Turboで指定した範囲内の道を得るクエリ
// https://overpass-turbo.eu/
// 上記のURLに行ってこのコードをペーストし、地図でBBOXを指定し、実行する。
[out:json];
way["highway"]({{bbox}});
foreach((._;>;);out;);
const int ledPin = 7;
const int speakerPin = 9;
void setup() {
pinMode(2, INPUT_PULLUP);
pinMode(7, OUTPUT);
pinMode(9, OUTPUT);
attachInterrupt(0, speaker, FALLING);
}
@abarth500
abarth500 / index.html
Created January 24, 2019 06:51
Blockly workspace.js with XML file loading
Promise.all(
["workspace.xml", "toolbox.xml"].map(async file => {
return fetch(file).then(
(res) => {
return res.text();
}
);
})
).then((xmls) => {
xmls.forEach((xml) => {
@abarth500
abarth500 / lcs.js
Last active January 17, 2018 08:32 — forked from greduan/lcs.js
LCS algorithm in JS. Prettified version of what can be found here: https://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Longest_common_subsequence#JavaScript
// prettified version of what can be found here:
// https://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Longest_common_subsequence#JavaScript
function LCS(a, b) {
var m = a.length,
n = b.length,
C = [],
i,
j;
for (i = 0; i <= m; i++) C.push([0]);
//Parameter K
var k = 30;
//need async and flickr lib
// npm install async
// npm install flickrapi
/* Internal Arguments for the algorithm A
var c = {};
var n = 0;
@abarth500
abarth500 / gist:23c1cd3e4e93399c5cb5
Created December 29, 2015 02:22
ソーシャルビッグデータ演習 演習2コマンド例 ヨーロッパのウィスキー
node execute.js whisky-in-europe.example --bbox=-19.69,36.03,26.37,59.18 --search=whisky --max=10000
@abarth500
abarth500 / gist:980a0a1e939ce8d121b4
Created December 29, 2015 02:17
ソーシャルビッグデータ演習 演習2コマンド例 ディズニーランド
node execute.js Disneyland.example --bbox=-117.928104,33.8034,-117.915487,33.81802 --max=10000
@abarth500
abarth500 / gist:b8d6233ffcea528a3ae4
Created December 29, 2015 02:04
ソーシャルビッグデータ演習 演習2ディレクトリに移動
cd node_modules\bbox2heatmap
@abarth500
abarth500 / gist:4e0f3d4531738114b075
Last active December 29, 2015 02:03
ソーシャルビッグデータ演習 演習2インストール
cd c:\sobig\
npm install bbox2heatmap
@abarth500
abarth500 / start.bat
Created December 29, 2015 01:01
ソーシャルビッグデータ演習:クローラのインストール
start output\index.html