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 Promise = require('bluebird'); | |
const scores = require('./lib/db'); | |
var LineByLineReader = require('line-by-line'), | |
lr = new LineByLineReader('scores.json'); | |
lr.on('line', function(line) { | |
var data = JSON.parse(line); | |
var id = data['_id']; | |
console.log(id, data.revisions.length); |
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
// Hellofs implements a simple "hello world" file system. | |
package main | |
import ( | |
"flag" | |
"fmt" | |
"log" | |
"os" | |
"bazil.org/fuse" |
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 ArraySet() { | |
this._items = []; | |
} | |
ArraySet.prototype.add = function add(item) { | |
if (this._items.indexOf(item) > -1) { | |
return false; | |
} | |
this._items.push(item); | |
return 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
function parseCSV(str) { | |
var arr = []; | |
var quote = false; | |
for (var row = col = c = 0; c < str.length; c++) { | |
var cc = str[c], nc = str[c+1]; | |
arr[row] = arr[row] || []; | |
arr[row][col] = arr[row][col] || ''; | |
if (cc == '"' && quote && nc == '"') { arr[row][col] += cc; ++c; continue; } | |
if (cc == '"') { quote = !quote; continue; } |
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 iters = 100000; | |
// Many require calls | |
var start = process.hrtime(); | |
for (var i = 0; i < iters; i++) { | |
require('fs'); | |
} | |
console.log('Many require calls: ' + process.hrtime(start)[1]/1000000 + ' milliseconds'); | |
// Many noop function calls |
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
using System; | |
using System.Collections.Generic; | |
// From http://visualstudiomagazine.com/articles/2012/11/01/priority-queues-with-c.aspx | |
public class PriorityQueue<T> where T : IComparable<T> { | |
private List<T> data; | |
public PriorityQueue() { | |
this.data = new List<T>(); | |
} |
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
ruleset foursquare_checkins { | |
meta { | |
name "Foursquare Checkins" | |
description << | |
Foursquare Checkins | |
>> | |
author "" | |
logging off | |
use module a169x701 alias CloudRain | |
use module a41x186 alias SquareTag |
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
using System; | |
using System.Diagnostics; | |
using System.Collections.Generic; | |
namespace Simplex { | |
class Simplex { | |
private double[] c; | |
private double[,] A; | |
private double[] b; | |
private HashSet<int> N = new HashSet<int>(); |
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
ruleset twilio { | |
meta { | |
use module b505206x2 alias LocationData | |
} | |
rule nearby { | |
select when location new_current | |
pre { | |
checkin = LocationData:get_location_data("fs_checkin"); |
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
[{"title":"Masterminds of Programming","subtitle":"Conversations with the Creators of Major Programming Languages","authors":["Federico Biancuzzi","Shane Warden"],"publisher":"\"O'Reilly Media, Inc.\"","publishedDate":"2009","description":"Provides interviews with the creators of a variety of programming languages, covering the processes that led to specific decisions, their goals, and how their experiences have made an impact on computer programming.","industryIdentifiers":[{"type":"ISBN_13","identifier":"9780596515171"},{"type":"ISBN_10","identifier":"0596515170"}],"pageCount":480,"printType":"BOOK","categories":["Computers"],"averageRating":3.5,"ratingsCount":22,"contentVersion":"preview-1.0.0","imageLinks":{"smallThumbnail":"http://bks3.books.google.com/books?id=uECbAgAAQBAJ&printsec=frontcover&img=1&zoom=5&edge=curl&source=gbs_api","thumbnail":"http://bks3.books.google.com/books?id=uECbAgAAQBAJ&printsec=frontcover&img=1&zoom=1&edge=curl&source=gbs_api"},"language":"en","previewLink":"http://books.google. |