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
$sudo apt-get update | |
$sudo apt-get install vim zsh git ibus-mozc | |
#zshをデフォに | |
$which zsh | |
/usr/bin/zsh | |
$chsh | |
#GoogleDrive経由でsshやらgitとかconfigをzipでもらってunzipして配置 |
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 x = 5 | |
for(i <- 0 to x){ print(i) } | |
//012345 | |
for(i <- 0 until x){ print(i) } | |
//01234 |
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 -L git.io/nodebrew | perl - setup | |
#export ~~~を追記するようにって出るから.zshrcに追記、sourceでリロード | |
$nodebrew install-binary v0.10.24 | |
$nodebrew use v0.10.24 | |
$node --version | |
v0.10.24 | |
$npm --v | |
1.3.21 |
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
## gpio ## | |
#http://elinux.org/RPi_Low-level_peripherals | |
#gpio7でled点灯 | |
root@raspberrypi:~# echo 7 > /sys/class/gpio/export | |
root@raspberrypi:~# echo out > /sys/class/gpio/gpio7/direction | |
root@raspberrypi:~# echo 1 > /sys/class/gpio/gpio7/value | |
root@raspberrypi:~# echo 0 > /sys/class/gpio/gpio7/value |
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 http = require('http'); | |
http.createServer(function(req,res){ | |
res.writeHead(301,{'Location': 'http://twitter.com/kam1yan___'}); | |
res.end(); | |
t.updateStatus('誰か来た(n回目)', null, function (data) { | |
}); | |
}).listen(process.env.PORT || 3333); | |
var twitter = require('twitter'); | |
var util = require('util'); |
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
web: node server.js |
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 scalatan | |
import util.Random | |
import math._ | |
object Main { | |
def main(args: Array[String]): Unit = { | |
def create() : Stream[Double] = { | |
Stream.cons(Random.nextDouble(),create()) | |
} |
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 scala.collection.immutable.IndexedSeq | |
object EightQueen { | |
def main(args:Array[String]):Unit = { | |
val DISABLE = "X" | |
//Queen pattern | |
val Identifier = "Q" | |
def upToDown(x:Int, y:Int) = (for(i <- 0 - {if(x < y) x else y} to 7 - {if(x > y) x else y}) yield (x + i,y + i)) | |
def downToUp(x:Int, y:Int) = (for(i <- 0 - {if(x < 7 - y) x else 7 - y} to 7 - {if(x > 7 - y) x else 7 - y}) yield (x + i,y - i)) |
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 scala.util.Random | |
object Stick { | |
def printMaze(m:Map[(Int,Int), String])(implicit size:(Int,Int)) = { | |
val w = size._1 | |
val h = size._2 | |
for(j <- 0 until h) | |
{ | |
for(i <- 0 until w){ | |
m.get((i,j)) match { |
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 scala.util.Random | |
object Digging { | |
def printMaze(m:Map[(Int,Int), String])(implicit size:(Int,Int)) = { | |
val w = size._1 | |
val h = size._2 | |
for(j <- 0 until h) | |
{ | |
for(i <- 0 until w){ | |
m.get((i,j)) match { |
OlderNewer