start new:
tmux
start new with session name:
tmux new -s myname
| """Genetic Algorithmn Implementation | |
| see: | |
| http://www.obitko.com/tutorials/genetic-algorithms/ga-basic-description.php | |
| """ | |
| import random | |
| class GeneticAlgorithm(object): | |
| def __init__(self, genetics): | |
| self.genetics = genetics | |
| pass |
#A Collection of NLP notes
##N-grams
###Calculating unigram probabilities:
P( wi ) = count ( wi ) ) / count ( total number of words )
In english..
| class Graph: | |
| def __init__(self): | |
| self.nodes = set() | |
| self.edges = defaultdict(list) | |
| self.distances = {} | |
| def add_node(self, value): | |
| self.nodes.add(value) | |
| def add_edge(self, from_node, to_node, distance): |
| class Node(object): | |
| """ | |
| Tree node: left and right child + data which can be any object | |
| """ | |
| def __init__(self, data): | |
| """ | |
| Node Constructor | |
| @param data node data object | |
| """ | |
| self.left = None |
| #!/usr/bin/python | |
| # Head ends here | |
| import heapq | |
| class Node: | |
| def __init__(self, point,parent=None): | |
| self.point = point | |
| self.parent = parent | |
| def nextMove( x, y, pacman_x, pacman_y, food_x, food_y, grid): |
| <?hh | |
| async function helloAfter($name, $timeout) { | |
| // sleep asynchronously -- let other async functions do their job | |
| await SleepWaitHandle::create($timeout * 1000000); | |
| echo sprintf("hello %s\n", $name); | |
| } | |
| async function run() { | |
| $joe = helloAfter('Joe', 3); |