This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Simple representation of a turing machine | |
Machine := Object clone | |
Machine tape := list() | |
Machine rule := Map clone | |
Machine pos := 0 | |
Machine state := nil | |
Machine moveLeft := method ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var autofocus = autofocus || {}; | |
autofocus.tasks = []; | |
autofocus.colours = {}; | |
autofocus.save = function() { | |
localStorage.tasks = JSON.stringify(autofocus.tasks); | |
} | |
autofocus.load = function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Program to compute the first 1000 Hamming numbers. | |
* i.e. numbers of the form 3**i4**j5**k. | |
* Challenge from programming Praxis: | |
* http://programmingpraxis.com/2011/08/30/hamming-numbers/ | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// A sample from DrawPane.m/h | |
// Created by John Trengrove | |
// | |
#import <UIKit/UIKit.h> | |
@class Letter; | |
@class Dot; | |
@class AppDelegate; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'smart_colored/extend' | |
filter = nil | |
def usage | |
puts "usage: 'notes [filter]'" | |
end | |
# add some more command line options like -d for different directory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library("ggplot2"); | |
library("grid"); | |
theme_ice <- function () | |
{ | |
theme( | |
text = element_text(size=16, family="Ubuntu Condensed"), | |
plot.title = element_text(size=16, family="Ubuntu Condensed"), | |
legend.title = element_text(size=14, family="Ubuntu Condensed", face = "italic"), | |
legend.position = c(.9, .5), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ggplot(mpg, aes(x = cty, y = hwy, color = factor(cyl))) + | |
geom_jitter() + | |
labs(x = "City mileage/gallon", | |
y = "Highway mileage/gallon", | |
color = "Cylinders") + theme_ice() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat stores.txt | jq '.[] | .store_state+","+.title' | tr -d '"' | header -a "State,Store" | csvsql --query 'SELECT State,count(*) AS Count FROM stdin group by State order by Count desc' | csvlook |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var w = 500, | |
var h = 300, | |
var svg = d3.select("svg") | |
.attr("width", w) | |
.attr("height", h) | |
.style("background-color", "#fefefe") | |
.style("display", "block"); | |
var circle = svg.selectAll("circle") | |
.data([19,30,18,20,22,29]); |
OlderNewer