Skip to content

Instantly share code, notes, and snippets.

View LeslieK's full-sized avatar

LeslieK LeslieK

  • New Jersey, USA
View GitHub Profile
@LeslieK
LeslieK / Seam Carver
Last active December 30, 2015 04:09
SeamCarver_10_05 is an ipython notebook that visualizes the carving of a 768x432 png image by removing 10 vertical seams and 05 horizontal seams. Much more impressive with the removal of 200 vertical seams! (Too much data for github.) You can see how the seams carve around the important parts of the image.
This file has been truncated, but you can view the full file.
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@LeslieK
LeslieK / MaxFlow
Last active December 30, 2015 04:19
This ipython notebook visualizes the NYC Citybike network using Matplotlib. Edges are created to build a network; edge capacities are assigned based on max bikes at each station. Max flow is calculated using the FordFulkerson algorithm. Min cost edges that sever the source from the destination are identified. Cool.
{
"metadata": {
"name": "MaxFlow"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@LeslieK
LeslieK / STRINGS
Last active December 30, 2015 12:49
Fun with string sorting and searching algorithms (suffix arrays, radix sorts, Knuth-Morris-Pratt).
{
"metadata": {
"name": "STRINGS"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@LeslieK
LeslieK / SeamCarver_50_20
Last active December 30, 2015 12:59
SeamCarver_50_20 is an ipython notebook that visualizes the carving of a 768x432 png image by removing 50 vertical seams and 20 horizontal seams. Much more impressive with the removal of 200 vertical seams! (Too much data for github.) You can see how the seams carve around the important parts of the image.
This file has been truncated, but you can view the full file.
{
"metadata": {
"name": "SeamCarver_50_20"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@LeslieK
LeslieK / BinarySearchTrees
Created March 23, 2014 03:58
Binary Search Trees vs Red-Black Tree Experiments
{
"metadata": {
"name": "BinaryTrees"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@LeslieK
LeslieK / RedBlackTreePlots
Created March 23, 2014 04:07
Investigating Heights: Binary Search Tree vs Red-Black Tree
{
"metadata": {
"name": "RedBlackTreesPlots"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@LeslieK
LeslieK / Python3.3UnicodeWindowsConsole
Last active August 29, 2015 13:58
Python 3.3: Windows Console Behavior with Unicode
{
"metadata": {
"name": "Python3.3WindowsConsoleUnicode"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@LeslieK
LeslieK / HashTableExperiments
Last active August 29, 2015 14:00
Plotting cost of inserting keys into a hash table using double hashing linear probe open addressing
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@LeslieK
LeslieK / CPython33Dict
Last active November 25, 2015 17:07
Routines that examine the internals of a CPython dictionary for python 3.3 (modification of Brandon Rhodes' code _dictinfo.py) (See comment at bottom.)
"""Routines that examine the internals of a CPython dictionary using python 3.3."""
from ctypes import Structure, c_ulong, POINTER, cast, py_object, CFUNCTYPE, pointer, c_ssize_t, c_void_p
#from math import log
UMAX = 2 ** 32
def cbin(n):
"""Return `n` as a clean 32-bit binary number, without a leading '0b'."""
@LeslieK
LeslieK / Python33DictExperiments
Created May 2, 2014 16:41
Python33DictExperiments
{
"metadata": {
"name": "Python33DictionaryExperiments"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{