"Institutions will try to preserve the problem to which they are the solution." -- Clay Shirky
This file contains 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
# This was a minor addition to the provided code_event.rb class | |
def dir_name | |
File.dirname(file_name) | |
end |
This file contains 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
(fn [sos] | |
(letfn [ | |
(combine [x y] | |
(let [diff [nil (.toUpperCase (str (clojure.set/difference x y)))] ] | |
(conj (clojure.set/intersection x y) diff))) | |
(remove-dontcares [minterms] (set (remove vector? minterms))) | |
(get-off-by-ones [all-minterms [current-key current-vals]] | |
(let [ | |
off-by-one | |
(map #(combine current-key %) |
This file contains 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
for f in $(ls); do table="${f%.*}"; mv "${table}.csv" "${table}_DATA_TABLE.csv"; done |
This file contains 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
#!/bin/sh | |
# script to automate the load and export to CSV of an oracle dump | |
# This script assumes: | |
# * you have the vagrant published key available locally in your .ssh directory | |
# * You have the Oracle VirtualBox image running locally | |
# ** ssh port-forwarding is configured for host port 2022 -> guess port 22. | |
set -e |
This file contains 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
s/NUMBER(22,0)/BIGINT/ | |
s/NUMBER(9,0)/INT/ | |
s/NUMBER(8,0)/INT/ | |
s/NUMBER(6,0)/MEDIUMINT/ | |
s/NUMBER(5,0)/SMALLINT/ | |
s/NUMBER(3,0)/TINYINT/ | |
s/NUMBER(2,0)/TINYINT/ | |
s/NUMBER(1,0)/BIT/ | |
s/NUMBER(16,2)/DECIMAL(16,2)/ | |
s/NUMBER(11,2)/DECIMAL(11,2)/ |
This file contains 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
:cp /Users/jabley/.m2/repository/com/google/code/gson/gson/2.1/gson-2.1.jar | |
import java.io.{OutputStreamWriter, FileOutputStream, FileReader} | |
import com.google.gson.{GsonBuilder, JsonParser} | |
val gson = new GsonBuilder().setPrettyPrinting().create() | |
val json = new JsonParser().parse(new FileReader("get-menu-and-start-order.json")) | |
val fos = new FileOutputStream("get-menu-and-start-order.pretty.json") | |
val writer = new OutputStreamWriter(fos) | |
gson.toJson(json, writer) |
This file contains 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
#!/bin/sh | |
# Script to generate logging output | |
while true; do | |
echo $(date +%Y-%m-%dT%H-%M-%S) "WARN Here is a log message about events" | |
sleep 1; | |
done |
This file contains 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
function findResult(fns, args, fallback) { | |
var result; | |
for (var i = 0; i < fns.length; ++i) { | |
result = fns[i].apply(null, args); | |
if (result) { | |
return result; | |
} | |
} | |
return fallback; | |
} |
This file contains 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
// Investigating http://www.w3.org/2010/05/video/mediaevents.html | |
// Firefox creates pause and play events when seeking / seeked on a playing video, Chrome does not. | |
// Execute this script in Firebug console or similar to capture events | |
var script = document.createElement("script"); | |
script.src = "http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"; | |
document.getElementsByTagName("head")[0].appendChild(script); | |
$("#video").bind("play", function() {console.log("play " + new Date()); }) | |
$("#video").bind("pause", function() {console.log("pause " + new Date()); }) |