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
def hover | |
puts "hello" | |
end | |
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 itertools import permutations, imap, product | |
from datetime import datetime, timedelta | |
from random import random, choice | |
import string | |
basetime = datetime(2010,5,5) | |
airports = map(lambda a: ''.join(a), permutations(string.ascii_uppercase, 3)) | |
flights = [] | |
for i in xrange(1,500000): | |
td = timedelta( |
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 events = require('events'); | |
exports.Promise = function () { | |
exports.EventEmitter.call(this); | |
this._blocking = false; | |
this.hasFired = false; | |
this._values = undefined; | |
}; | |
process.inherits(exports.Promise, events.EventEmitter); |
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
// YQL serves JSONP (with a callback) so all we have to do | |
// is create a script element with the right 'src': | |
function YQLQuery(query, callback) { | |
this.query = query; | |
this.callback = callback || function(){}; | |
this.fetch = function() { | |
if (!this.query || !this.callback) { | |
throw new Error('YQLQuery.fetch(): Parameters may be undefined'); | |
} |
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
map{$s=0;for$i(1..$_-1){$s+=$_% $i eq 0?$i:0}print"$_\n"if$s==$_}1..10e3 |
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
D <- function(n) sum((1:(n-1))[n%%1:(n-1)==0])==n | |
(2:9000)[sapply(2:9000,D)] |
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
primes = (1..10000).to_a.delete_if {|n| ('1' * n) =~ /^1?$|^(11+?)\1+$/} | |
bases = Hash.new | |
(2..20).each do |i| | |
ary = [] | |
primes.each do |j| | |
str = j.to_s(i) | |
mid = str.length / 2 | |
p1 = str[0..mid-1] | |
mid = str.length % 2 > 0 ? mid + 1 : mid |
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
import re | |
import json | |
def get_lvl(line): | |
return len(re.findall("\t",line)) | |
def get_tree(f): | |
global i | |
outline = [] |
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
library(foreign) | |
setwd("\\\\wrjfiler\\wgx\\07183 - UVM TRC\\Signature #2\\data\\rundata\\CarDataREADONLY") | |
geo_files <- list.files(pattern=".*GEO.csv", recursive=T) | |
geo_tables <- c() | |
for(idx in 1:length(geo_files)){ | |
runid <- sub(".*RUN_(\\d+).*", "\\1", geo_files[idx], perl=T) | |
mode(runid) <- "integer" | |
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
/* | |
* Sets up the schema for support of Rhino.Security. | |
* This script assumes that you already have a Users table containing an int primary key of 'Id' | |
*/ | |
USE Northwind | |
GO | |
/****** Object: ForeignKey FKBBE4029387CC6C80 Script Date: 03/12/2009 15:45:24 ******/ | |
IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'FKBBE4029387CC6C80') AND parent_object_id = OBJECT_ID(N'security_EntityReferences')) |
OlderNewer