This file contains hidden or 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 main | |
| import "fmt" | |
| type EvalFunc func(interface{}) (interface{}, interface{}) | |
| func BuildLazyEvaluator(evalFunc EvalFunc, initState interface{}) func() interface{} { | |
| retValChan := make(chan interface{}) | |
| loopFunc := func() { |
This file contains hidden or 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
| 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 |
This file contains hidden or 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
| 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 |
This file contains hidden or 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'); | |
| 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/'); | |
| }); |
NewerOlder