>{ok, R} = re:compile("a+b*a+").
>re:run("abba", R).
{match,[{0,4}]}
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 akka.actor.{ ActorSystem, Actor, ActorRef, Props, PoisonPill } | |
class HelloActor extends Actor { | |
def receive = { | |
case i:Int => println("Int=" + i) | |
case msg => { | |
println(msg + " by MyAkkaActor") | |
sender() ! ("Hello," + msg.toString) | |
} | |
} |
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
KERL_CONFIGURE_OPTIONS="--enable-kernel-poll --enable-threads --enable-dynamic-ssl-lib --enable-smp-support --enable-darwin-64bit --disable-hipe --disable-native-libs --disable-sctp --without-javac --without-odbc --without-wx --without-debugger -without-observer --without-et --with-ssl=/usr/local/opt/openssl" |
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
const next = (x) => { | |
try{ | |
next(x + 1); | |
}catch(e) { | |
setImmediate(()=>{next(x)}); | |
} | |
} | |
next(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 MilkCocoa = require('milkcocoa'); | |
var milkcocoa = new MilkCocoa('guitarib0a5pfk.mlkcca.com'); | |
var ds = milkcocoa.dataStore('loadaverage'); | |
ds.on('push', function(e) { | |
console.log(e); | |
}); | |
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
<div id="leap">Leap Motion was not connected</div> | |
<p>Touched: <span id="touched">…</span></p> | |
<p>Position: <span id="position">…</span></p> | |
<script src="//js.leapmotion.com/leap-0.6.3.min.js"></script> | |
<script> | |
var leapConnectedDom = document.getElementById("leap"); | |
var touched = document.getElementById("touched"); | |
var position = document.getElementById("position"); | |
var div = document.createElement('div'); | |
div.style["background-color"] = "#000"; |
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
/** | |
* @preserve | |
* | |
* .,,,;;,'''.. | |
* .'','... ..',,,. | |
* .,,,,,,',,',;;:;,. .,l, | |
* .,',. ... ,;, :l. | |
* ':;. .'.:do;;. .c ol;'. | |
* ';;' ;.; ', .dkl';, .c :; .'.',::,,'''. | |
* ',,;;;,. ; .,' .'''. .'. .d;''.''''. |
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 milkcocoa = new MilkCocoa('flagi9edsvtg.mlkcca.com') | |
var history = milkcocoa.dataStore('message').history(); | |
history.sort('desc'); | |
history.size(20); | |
// 2015/10/30-2015/11/10のpush()で保存したデータを取得 | |
history.span(new Date(2015,9,30).getTime(), new Date(2015,10,10).getTime()); | |
history.on('data', function(data) { | |
console.log(data); |
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 subprocess | |
import sys, re | |
hostname = 'cassandra host' | |
check = subprocess.check_output(['nodetool', '-h', hostname, 'status']) | |
line = check.split('\n') | |
for l in line: | |
m = re.match(r"DN" , l) |
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
dataStore.stream().next(function(err, data) { | |
if(err) throw err; | |
foo(data.length); | |
}); | |
function foo(size) { | |
//ここでsizeを扱う | |
console.log(size); | |
} |