If you trust me, do this:
curl https://raw.github.com/gist/3868967/30ed8db63ea701e1ad18dabbecfc8df0ffd8b195/install.sh > install.sh
sh install.sh
// requires ace editor + https://github.com/creationix/step | |
/* INTERACTIVE INTRODUCTION */ | |
var sec = 600; | |
var typewriter_pauses = [ | |
{match:/[,\-(]/, pause:0.2*sec} | |
, {match:/[.!?:]/, pause:0.4*sec} | |
, {match:/[\t]/, pause:0.8*sec} | |
, {match:/[\n]/, pause:0.4*sec} | |
, {match:/.*/, pause:0.035*sec} |
var http = require('http'); | |
var choices = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam erat augue, molestie accumsan vulputate ut, imperdiet ut nunc. Nunc convallis magna sed dolor suscipit placerat faucibus felis tempus. In in odio arcu, a fringilla tellus. Mauris molestie, nibh non pretium condimentum, lacus mi hendrerit erat, ac ornare dui arcu ut ipsum. Pellentesque luctus venenatis orci et feugiat. Praesent dictum bibendum fermentum. Integer aliquam erat ut dolor semper auctor. Ut sed justo sit amet orci convallis ultrices. Maecenas egestas aliquet diam. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.'.split(' '); | |
http.createServer(function (req, res) { | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
var no = false; | |
console.log(req); | |
req.on('close', function() {no=true; res.end();}); | |
//req.on('end', function() {no=true; res.end();}); | |
if (req.url == '/') { | |
import urllib2 | |
try: | |
d = {} | |
for line in urllib2.urlopen('http://192.168.201.133:1337/6'): | |
split = line.split(',') | |
d[split[2]] = d.get(split[2], 0) + 1 | |
except KeyboardInterrupt: | |
for v,k in sorted(((v,k) for k,v in d.items()), reverse=True): | |
print k,',',v |
def static_lcs(one,two): | |
lcs, candidate = '', '' | |
for o,t in zip(one, two): | |
if o == t: | |
candidate = candidate + o | |
if len(candidate) > len(lcs): | |
lcs = candidate | |
else: | |
candidate = '' | |
return lcs |
class Request(object): | |
def __init__(self, host, path): | |
self.get_host = lambda:host | |
self.get_full_path = lambda:path |
# | |
# Version 1 | |
# | |
# - data stored as node and edge sets | |
# - frontier is set of (src, dst, weight) | |
# - far too many O(n) loops | |
# | |
# Load graph | |
nodes = set() |
__all__ = ( | |
'frequency_histogram', | |
'endode_simple', | |
'decode_simple', | |
'huffman_tree', | |
'encode_character', | |
'encode_huffman', | |
'hist2dot', | |
'tree2dot', | |
) |
confusion.glm <- function(data, model) { | |
prediction <- ifelse(predict(model, data, type='response') > 0.5, TRUE, FALSE) | |
confusion <- table(prediction, as.logical(model$y)) | |
confusion <- cbind(confusion, c(1 - confusion[1,1]/(confusion[1,1]+confusion[2,1]), 1 - confusion[2,2]/(confusion[2,2]+confusion[1,2]))) | |
confusion <- as.data.frame(confusion) | |
names(confusion) <- c('FALSE', 'TRUE', 'class.error') | |
confusion | |
} |
from django.core.exceptions import ImproperlyConfigured | |
from django.core.management.base import BaseCommand, CommandError | |
from django.core import serializers | |
from django.utils.datastructures import SortedDict | |
from optparse import make_option | |
class Command(BaseCommand): | |
option_list = BaseCommand.option_list + ( | |
make_option('--format', default='json', dest='format', |