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
#!/usr/bin/python | |
from random import randint | |
import hashlib | |
def LCSubstr_len(S, T): | |
m = len(S); n = len(T) | |
L = [[0] * (n+1) for i in xrange(m+1)] | |
lcs = 0 | |
for i in xrange(m): | |
for j in xrange(n): |
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 nerve = require('./nerve/nerve'); | |
var tyrant = require('./tyrant/tyrant'); | |
var querystring = require('./querystring/querystring'); | |
var Mu = require('./mu/mu'); | |
var sys = require('sys'); | |
// combo library | |
function Combo(callback) { | |
this.callback = callback; |
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 sys = require("sys"), | |
http = require("http"), | |
tyrant = require("./tyrant/tyrant"); | |
http.createServer(function (request, response) { | |
response.sendHeader(200, {"Content-Type": "text/plain"}); | |
tyrant.connect(); | |
tyrant.addListener('connect', function() { | |
var startDate = (new Date()).getTime(); | |
tyrant.search(tyrant.is('type', 'blog'), tyrant.sort('time', 'desc')).addCallback(function(answer) { |
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 net = require('net'), | |
sys = require('sys'); | |
var messages = []; | |
var work_in_progress = []; | |
var host = '192.168.175.128'; | |
var port = 8999; | |
var server = net.createServer(function(client_stream) { |
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 mongo = require('../lib/mongodb'), | |
sys = require('sys'); | |
var host = process.env['MONGO_NODE_DRIVER_HOST'] != null ? process.env['MONGO_NODE_DRIVER_HOST'] : 'localhost'; | |
var port = process.env['MONGO_NODE_DRIVER_PORT'] != null ? process.env['MONGO_NODE_DRIVER_PORT'] : mongo.Connection.DEFAULT_PORT; | |
sys.puts("Connecting to " + host + ":" + port); | |
var db = new mongo.Db('test', new mongo.Server(host, port, {}), {}); | |
db.open(function(err, db) { | |
db.collection('players', function(err, collection) { |
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
db.open(function(err, db) { | |
db.collection('rounds', function(err, collection) { | |
var name_letter = 'v'; | |
var map = function() { | |
if (this.score1 > this.score2) { | |
emit(this.player1, this.score1); | |
} else { | |
if (this.score2 > this.score1) emit(this.player2, this.score2) | |
} | |
}; |
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 mongo = require('../lib/mongodb'), | |
sys = require('sys'); | |
var host = process.env['MONGO_NODE_DRIVER_HOST'] != null ? process.env['MONGO_NODE_DRIVER_HOST'] : 'localhost'; | |
var port = process.env['MONGO_NODE_DRIVER_PORT'] != null ? process.env['MONGO_NODE_DRIVER_PORT'] : mongo.Connection.DEF | |
AULT_PORT; | |
sys.puts("Connecting to " + host + ":" + port); | |
var db = new mongo.Db('test', new mongo.Server(host, port, {}), {}); | |
db.open(function(err, db) { |
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
<?php | |
/** | |
* Taken from PHPExcel | |
* | |
* Copyright (c) 2006 - 2009 PHPExcel | |
* | |
* This library is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU Lesser General Public | |
* License as published by the Free Software Foundation; either | |
* version 2.1 of the License, or (at your option) any later version. |
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
from struct import unpack | |
tag_types = { 0 : 'End', | |
1 : 'Byte', | |
2 : 'Short', | |
3 : 'Int', | |
4 : 'Long', | |
5 : 'Float', | |
6 : 'Double', | |
7 : 'Byte array', |
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
from struct import unpack | |
import Image | |
tag_types = { 0 : 'End', | |
1 : 'Byte', | |
2 : 'Short', | |
3 : 'Int', | |
4 : 'Long', | |
5 : 'Float', | |
6 : 'Double', |
OlderNewer