Skip to content

Instantly share code, notes, and snippets.

View kazimuth's full-sized avatar
🕷️
numbers aren't real

james gilles kazimuth

🕷️
numbers aren't real
  • Detroit, MI
View GitHub Profile
@kazimuth
kazimuth / gist:948e1580ee4a21333893
Last active August 29, 2015 14:02
Loaded libraries when a SketchServiceProcess runs
SketchServiceProcess: Starting sketch runner process.SketchServiceProcess: Running:
[/home/james/dev/processing/build/linux/work/java/bin/java, -Xms64m, -Xmx1024m, -Djava.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib, -cp, /home/james/dev/processing/build/linux/work/java/lib/rt.jar:/home/james/dev/processing/build/linux/work/lib/ant-launcher.jar:/home/james/dev/processing/build/linux/work/lib/ant.jar:/home/james/dev/processing/build/linux/work/lib/antlr.jar:/home/james/dev/processing/build/linux/work/lib/com.ibm.icu_4.4.2.v20110823.jar:/home/james/dev/processing/build/linux/work/lib/jdi.jar:/home/james/dev/processing/build/linux/work/lib/jdimodel.jar:/home/james/dev/processing/build/linux/work/lib/jna.jar:/home/james/dev/processing/build/linux/work/lib/org-netbeans-swing-outline.jar:/home/james/dev/processing/build/linux/work/lib/org.eclipse.osgi_3.8.1.v20120830-144521.jar:/home/james/dev/processing/build/linux/work/lib/pde.jar:/home/james/dev/processing/build/linux/work/core/libra
@kazimuth
kazimuth / gist:c4747f15809f2562184b
Created July 24, 2014 14:18
Jython importing session
Jython 2.7b3+ (default:0c21916a620a, Jul 17 2014, 10:01:34)
[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.7.0_65
Type "help", "copyright", "credits" or "license" for more information.
>>> dir()
['__doc__', '__name__', '__package__']
>>> from java.util import *
>>> dir()
['AbstractCollection', 'AbstractList', 'AbstractMap', 'AbstractQueue', 'AbstractSequentialList', 'AbstractSet', 'ArrayDeque', 'ArrayList', 'Arrays', 'BitSet', 'Calendar', 'Collection', 'Collections', 'Comparator', 'ConcurrentModificationException', 'Currency', 'Date', 'Deque', 'Dictionary', 'DuplicateFormatFlagsException', 'EmptyStackException', 'EnumMap', 'EnumSet', 'Enumeration', 'EventListener', 'EventListenerProxy', 'EventObject', 'FormatFlagsConversionMismatchException', 'Formattable', 'FormattableFlags', 'Formatter', 'FormatterClosedException', 'GregorianCalendar', 'HashMap', 'HashSet', 'Hashtable', 'IdentityHashMap', 'IllegalFormatCodePointException', 'IllegalFormatConversionException', 'IllegalFormatException', 'Il
@kazimuth
kazimuth / gist:bcccb28fc4ccd477508b
Last active August 29, 2015 14:04
More fun with imports
Jython 2.7b3+ (default:0c21916a620a, Jul 17 2014, 10:01:34)
[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.7.0_65
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> import os
>>> sys.path.append("/Users/james/Dev/processing/build/macosx/work/Processing.app/Contents/Java/core.jar")
>>> sketchbook_library_folder = "/Users/james/Dev/sketchbook/libraries"
>>> library_folders = map(lambda f: sketchbook_library_folder + "/" + f, os.listdir(sketchbook_library_folder))
>>> for lib_folder in library_folders:
... jar_folder = lib_folder + "/library"
@kazimuth
kazimuth / main.rs
Last active August 29, 2015 14:08
Copy problems
// ...
#[deriving(Copy)]
pub struct PrefixTree {
children: [Option<Box<PrefixTree>>, ..26]
}
// ...
fn foo(){}
fn main() {
// No error
let _: fn() = foo;
// fnp.rs:11:27: 11:36 error: mismatched types: expected `core::option::Option<fn()>`, found
// `core::option::Option<fn() {foo}>` (expected fn pointer, found fn item)
// fnp.rs:11 let _: Option<fn()> = Some(foo);
// ^~~~~~~~~
import math
import lib601.util as util
sonarMax = 1.5
class DynamicRobotMaze:
ROBOT_DIAMETER = 0.44
ROBOT_RADIUS = ROBOT_DIAMETER / 2
INITIAL_BELIEF = .3
@kazimuth
kazimuth / hello.py
Created July 17, 2015 04:52
hacker level: The One
# This is an extremely complicated script.
# Use at your own risk.
print "What is your name?"
name = raw_input()
print "Hi, " + name
@kazimuth
kazimuth / test.sh
Created July 29, 2015 22:32
Shell incompatibilities
#!/bin/sh
A="HI!" B="$(sh -c 'echo $A')" sh -c 'echo $A $B'
# $ bash test.sh
# HI! HI!
# $ dash test.sh
# HI!

Let's talk about how git works. There are lots of tutorials explaining how to use git, and they're all great; this is just trying to give you an intuition as to why it works the way it does.

There are lots of 'version control systems', and they're all different. I'm using git here for two reasons: 1, it's ubiquitous right now; and 2, I understand it pretty well. No value judgement of any other tool.

(Everything here is true for a given value of true. It's true enough to use; if you need to know deeper specifics, check out the git tutorial site, which is wonderful.)

So, what is git?

Let's say you've worked in a group on some sort of computer-based project before. You have a folder full of (vital) files:

@kazimuth
kazimuth / cruftmas.py
Last active November 8, 2015 03:30
Cruftmas
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
import smtplib
import string
import csv
import random
import itertools as it
from datetime import datetime