Skip to content

Instantly share code, notes, and snippets.

(def data
(try
(read-dataset
"./uptime2.csv"
:header true)
(catch FileNotFoundException e
(dataset ["time" "up?"]
[]))))
(defn view-errors []
(let [table (data-table (get-data))
frame (view table)
running (atom true)]
(.addWindowListener frame (proxy [WindowAdapter] []
(windowClosing [event]
(reset! running false))))
(loop []
(when @running
(set-data table ($where {:down? {:$nin #{0}}} (get-data)))
(def dns-cache (new Cache))
(defn lookup-dns
"Does a DNS lookup with no cache"
[host]
(let [dnsLookup (new Lookup host)]
(. dns-cache clearCache)
(. dnsLookup setCache dns-cache)
(. dnsLookup run)
(. dnsLookup getResult)))
require 'rubygems'
require 'nokogiri'
require 'open-uri'
require 'digest/md5'
require 'fastercsv'
require 'json'
require 'curb'
require 'pp'
data = []
@seancron
seancron / depthrange.py
Created December 28, 2010 06:08
kinect depth range filter
#My implementation:
for i in xrange(0, 480, 3):
for j in xrange(0, 640, 3):
if depth[i,j] > 900:
final[i,j] = depth[i,j]
@seancron
seancron / gist:906284
Created April 6, 2011 19:00
Thinkup TestOfConfig Error
TestOfConfig.php
1) uses db config value at [/home/terrance/www/ThinkUp/tests/TestOfConfig.php line 142]
in testDBConfigValues
in Config class test
FAILURES!!!
Test cases run: 1/1, Passes: 21, Failures: 1, Exceptions: 0
@seancron
seancron / .vimrc
Created April 12, 2011 18:50
My .vimrc
set t_Co=256
set showmatch
set expandtab
set tabstop=8
set softtabstop=4
set shiftwidth=4
set number
set hls
set backspace=indent,eol,start
set incsearch
[15:50:25][Locker] lservicemanager lockerPortNext = 18042
[15:50:25][Locker][ERROR] mongod err: execvp(): No such file or directory
[15:50:25][Locker][ERROR] mongod did not start successfully.
node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Cannot call method 'kill' of undefined
warning: CRLF will be replaced by LF in Ops/Dashboard/date.js.
diff --git a/Ops/Dashboard/date.js b/Ops/Dashboard/date.js
index 59dd98a..17334d8 100644
--- a/Ops/Dashboard/date.js
+++ b/Ops/Dashboard/date.js
@@ -7,13 +7,13 @@
*
*/
-/**
[17:25:29][Locker] lservicemanager lockerPortNext = 18042
[17:25:29][Locker] Fri May 27 17:25:29 Mongo DB : starting : pid = 25707 port = 27017 dbpath = /home/sean/mygit/Locker/Me/mongodata master = 0 slave = 0 32-bit
** NOTE: when using MongoDB 32 bit, you are limited to about 2 gigabytes of data
** see http://blog.mongodb.org/post/137788967/32-bit-limitations for more
[17:25:29][Locker] Fri May 27 17:25:29 Mongo DB : starting : pid = 25707 port = 27017 dbpath = /home/sean/mygit/Locker/Me/mongodata master = 0 slave = 0 32-bit
** NOTE: when using MongoDB 32 bit, you are limited to about 2 gigabytes of data