Skip to content

Instantly share code, notes, and snippets.

@x1024
x1024 / gist:988699
Created May 24, 2011 13:30
BitTorrent task solution
#include<stdio.h>
#define BOWLS 40
#define ORANGES 9
int count = 0;
// All the places in which an orange can't be placed are 1's
int used[BOWLS];
// A list of the oranges already placed.
@x1024
x1024 / gist:794143
Created January 24, 2011 22:46
NodeJS Socket.IO logic test
var http = require('http'),
should = require('should'),
io = require('socket.io'),
decode = require('.npm/socket.io/0.6.8/package/lib/socket.io/utils').decode,
encode = require('.npm/socket.io/0.6.8/package/lib/socket.io/utils').encode,
WebSocket = require('.npm/socket.io/0.6.8/package/support/node-websocket-client/lib/websocket.js').WebSocket;
exports['Socket.IO mocking'] = function(assert){
var _server = require('http').createServer(function(){});
// A mock client object.