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
class LossyCounting(object): | |
''' | |
Implements the "lossy counting" algorithm from | |
"Approximate Frequency Counts over Data Streams" by Manku & Motwani | |
Experimentally run-time is between 1-3 microseconds on core i7 | |
''' | |
def __init__(self, epsilon=0.001): | |
self.n = 0 | |
self.d = {} # {key : (count, error)} |
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
<script src="http://www.cedexis.com/widget.js"></script> | |
<a class="radar-report" width="320" href="http://cedexis.com/country-reports">Cedexis Radar Reports</a> |
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
var express = require('express') | |
, cp = require('child_process') | |
, app = express()//require('app') | |
, router = ''//require('./lib/proxy-client').connect('10.0.0.4') | |
, hostname = ''; | |
router = new (function() { | |
return { | |
allocate: function() { | |
console.log('...'); |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" | |
"http://www.w3.org/TR/2001/REC-xhtml11-20010531/DTD/xhtml11-flat.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> | |
<head> | |
<title>elowel.org: have fun, be creative, don't die</title> | |
<meta http-equiv="Content-type" content="application/xhtml+xml; charset=utf-8" /> | |
<link rel="stylesheet" media="screen" href="/elowelcss9_27_07.css" type="text/css" /> | |
<link rel="stylesheet" media="handheld" href="/elowelcss9_27_07hh.css" type="text/css" /> | |
</head> | |
<body class="logged_%logged_in%"> |
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
var Q = require('q') | |
, components = {} | |
, dependencies = {}; | |
module.exports.require = function(dependency, callback) { | |
Q.all(getDependencies(dependency)).then(callback); | |
} | |
module.exports.resolve = function(dependency) { | |
var value = dependency in dependencies ? Q.all(dependencies[dependency]) : true; |
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
var mongoose = require('mongoose'); | |
var TestSchema = new mongoose.Schema(); | |
TestSchema.static('test', function(schema) { | |
schema.static('subTest', function() { | |
console.log('win'); | |
}); | |
}); |
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
app.helper({ | |
dateFormat: function(date) { | |
return dateFormat(date, "dddd, mmmm dS, yyyy, h:MM:ss TT"); | |
} | |
}); |
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
var http = require('http') | |
, net = require('net'); | |
var proxy = http.createServer(function(req, res) { | |
handleRequest(req, req.connection); | |
}).on('upgrade', handleRequest); | |
function handleRequest(req, sock, head) { | |
var sub = net.createConnection(8008, '10.0.0.208') | |