Skip to content

Instantly share code, notes, and snippets.

View jbyman's full-sized avatar

Jake Byman jbyman

View GitHub Profile
@bishboria
bishboria / springer-free-maths-books.md
Last active April 25, 2024 06:27
Springer made a bunch of books available for free, these were the direct links
@cburgdorf
cburgdorf / gist:9713936
Last active March 3, 2020 00:42
A simple example of how to use async/await with hack-lang to perform non-blocking async tasks.
<?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);
@jamiees2
jamiees2 / ucs.py
Last active September 17, 2016 07:14
Uniform Cost Search in python
#!/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):
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
@econchick
econchick / gist:4666413
Last active December 22, 2023 13:32
Python implementation of Dijkstra's Algorithm
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):
@ttezel
ttezel / gist:4138642
Last active May 7, 2024 13:34
Natural Language Processing Notes

#A Collection of NLP notes

##N-grams

###Calculating unigram probabilities:

P( wi ) = count ( wi ) ) / count ( total number of words )

In english..

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 19, 2024 13:25
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@bellbind
bellbind / genetic.py
Created December 15, 2010 10:46
[python]Genetic Algorithm example
"""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