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
// The grand poobah of code loading. | |
(function($){ | |
_.extend(propublica.app, { | |
VERSION : '0.3.3', // update on commit | |
live : [], | |
held : [], | |
initialize : function(){ | |
if(window.pp_initialized) return false; | |
function render(ctor, name){ |
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
// The inspiration for this class is grounded in Jeremy Ashkenas's work with | |
// DocumentCloud. The concept of **bindings** is especially brilliant and is a | |
// large portion of what makes **Glass.js** tick. | |
// | |
propublica.View = Base.extend({ | |
// jquery object for our target | |
el : null, | |
// list of bindings to listen in on | |
bindings : {}, |
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
// The primary function of a **Model** is to manipulate and query data. For example filtering | |
// an array-type object should happen in a subclass of Model. Another great candidate | |
// for a **Model** is any object that requires an external resource such as an ajax call. | |
// | |
// Basically, any long running or long blocking operation should happen in a model. | |
// | |
// **Models** are bindable as well, so you can subscribe to notifications by calling | |
// `bind` with a callback and an event to subscribe to recieve events from another object. | |
// | |
// **Models** are usually encapsulated in **Views** and rarely, if ever, stand alone. |
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
# server | |
require 'rubygems' | |
require 'sinatra' | |
get '/temp' do | |
content_type :json | |
temp = `./temper` | |
bits = temp.split(' ') | |
"{ \"time\" : #{bits[0]}, \"fahrenheit\" : #{bits[2].gsub(/F/,'')}, \"celcius\" : #{bits[3].gsub(/C/,'')} }" |
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
- Whisky notes: http://www.whisky-pages.com/ | |
*** http://weka.wikispaces.com/Use+Weka+in+your+Java+code | |
- http://cran.r-project.org/web/views/Bayesian.html - a metric shit tonne of packages for R | |
- http://www.celiagreen.com/charlesmccreery/statistics/bayestutorial.pdf - Greate illustrated guide to bayesian trees | |
- http://www.cs.waikato.ac.nz/~remco/weka_bn/bayesnet.html | |
- http://en.wikipedia.org/wiki/Chain_rule_(probability) - Chain Rule of probablity | |
- http://aima.cs.berkeley.edu/ - AI a Modern Approach (full HTML online) | |
- http://www.labmedinfo.org/sites/default/files/file/publications/lmi339.pdf - Hierarchical Bayes Clasifiers for Uncertain Data | |
- http://people.csail.mit.edu/jrennie/papers/icml03-nb.pdf - Naieve Bayes Text Classifiers | |
- https://www.cra.com/pdf/bnetbuilderbackground.pdf - |
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
# These are my notes from the PragProg book on CoffeeScript of things that either | |
# aren't in the main CS language reference or I didn't pick them up there. I wrote | |
# them down before I forgot, and put it here for others but mainly as a reference for | |
# myself. | |
# assign arguments in constructor to properties of the same name: | |
class Thingie | |
constructor: (@name, @url) -> | |
# is the same as: |
- Bytes and Blobs by David Flanagan
- Conference Wifi Redux by Malte Ubi
- Sashimi - https://github.com/cramforce/Sashimi
- Run Your JS everywhere with Jellyfish by Adam Christian - http://jelly.io Project
- Fighting Crime and Kicking Apps with Batman.js by Nick Small
- Hello Jo by Dave Balmer - Project - http://joapp.com
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 pp(object, depth, embedded) { | |
typeof(depth) == "number" || (depth = 0) | |
typeof(embedded) == "boolean" || (embedded = false) | |
var newline = false | |
var spacer = function(depth) { var spaces = ""; for (var i=0;i<depth;i++) { spaces += " "}; return spaces } | |
var pretty = "" | |
if ( typeof(object) == "undefined" ) { pretty += "undefined" } | |
else if ( typeof(object) == "boolean" || | |
typeof(object) == "number" ) { pretty += object.toString() } | |
else if ( typeof(object) == "string" ) { pretty += "\"" + object + "\"" } |
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
// Create the logger singleton | |
window.logger = { | |
"messages": [], | |
"debug": function(msg, object) { window.logger.log("debug", msg, object); }, | |
"warn": function(msg, object) { window.logger.log("warn", msg, object); }, | |
"error": function(msg, object) { window.logger.log("error", msg, object); }, | |
"log": function(level, msg, object) { | |
window.logger.render(level, msg, object) | |
window.logger.messages.push([level, msg, object]); | |
}, |