Skip to content

Instantly share code, notes, and snippets.

'''
Created on 2009-10-25
@author: cfournie
'''
import os
OUTPUT_LOC = '../output/'
COUNTS_LOC = OUTPUT_LOC + 'Counts/'
DOTS_LOC = OUTPUT_LOC + 'Dots/'
Jarvis
Lorry
Alexandre
Manette
Lucie
Ernest
Defarge
Madame
Charles
Darnay
Thomas
Gradgrind
Sissy
Jupe
Josiah
Bounderby
Tom
Louisa
Stephen
Blackpool
@cfournie
cfournie / s-space clone
Created January 19, 2011 21:04
Git clone statement for the S-Space package SVN repo
git svn clone http://airhead-research.googlecode.com/svn/trunk/sspace/ airhead-research-read-only
@cfournie
cfournie / .slate
Created December 18, 2012 16:18 — forked from anonymous/.slate
# Slate config file
# Author: Chris Fournier <chris.m.fournier@gmail.com>
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
# Abstract positions
alias full move screenOriginX;screenOriginY screenSizeX;screenSizeY
alias lefthalf move screenOriginX;screenOriginY screenSizeX/2;screenSizeY
@cfournie
cfournie / .gitconfig
Last active December 10, 2015 00:59
A portion of my usual git config containing aliases picked from http://durdn.com/blog/2012/11/22/must-have-git-aliases-advanced-examples/
[push]
default = current
[alias]
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
lnc = log --pretty=format:"%h\\ %s\\ [%cn]"
lds = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative
le = log --oneline --decorate
filelog = log -u
#!/bin/bash
#
# The "post-receive" script is run after receive-pack has accepted a pack
# and the repository has been updated. It is passed arguments in through
# stdin in the form
# <oldrev> <newrev> <refname>
# For example:
# aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master
fifo="/tmp/gitbotmercuryfifo"
public class AllocateToHeap {
public static void main(String[] args) {
// Using the `new` keyword, I've allocated some objects to the heap
final Integer heapObject1 = new Integer(1);
final Integer heapObject2 = new Integer(2);
// Calling a function, I've passed references to these objects on the stack
output(heapObject1);
output(heapObject2);
}
user@host:tutorial$ ls
AllocateToHeap.java
user@host:tutorial$ javac AllocateToHeap.java
user@host:tutorial$ ls
AllocateToHeap.class AllocateToHeap.java
user@host:tutorial$ java AllocateToHeap
Outputting: 1
Outputting: 2
import java.util.List;
import java.util.LinkedList;
import java.util.Random;
public class AllocateAndGC {
public static void main(String[] args) {
while (true) {
// Allocate some objects
List<Integer> numbers = allocateToHeap(Integer.parseInt(args[0]));