Skip to content

Instantly share code, notes, and snippets.

View taka011239's full-sized avatar

takafumi tsuchida taka011239

View GitHub Profile
package main
import "fmt"
type EvalFunc func(interface{}) (interface{}, interface{})
func BuildLazyEvaluator(evalFunc EvalFunc, initState interface{}) func() interface{} {
retValChan := make(chan interface{})
loopFunc := func() {
plus :: Int -> Int -> Int
plus m 0 = m
plus m n
| n > 0 = plus m (n - 1) + 1
| n < 0 = plus m (n + 1) - 1
minus :: Int -> Int -> Int
minus m 0 = m
minus m n
| n > 0 = minus m (n - 1) - 1
@taka011239
taka011239 / treepredict.py
Created February 12, 2013 09:37
集合知プログラミング7章
from PIL import Image, ImageDraw
my_data = [line.split('\t') for line in file('decision_tree_example.txt')]
class decisionnode:
def __init__(self, col = -1, value = None, results = None, tb = None, fb = None):
self.col = col
self.value = value
self.results = results
self.tb = tb
self.fb = fb
@taka011239
taka011239 / hello.js
Created November 24, 2012 11:22 — forked from shigeki/hello.js
第1回Node.js入門勉強会 レポート課題
var http = require('http');
server = http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
server.close();
});
server.listen(8080, 0, function () {
console.log('Server running at http://localhost:8080/');
});