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
base = 10 | |
def radix_sort(x, max): | |
radix = 1 | |
while radix < max: | |
x = counting_sort(x, radix) | |
radix *= base | |
return x | |
def counting_sort(a, radix): |
This file has been truncated, but you can view the full file.
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
aron | |
aaronic | |
aarp | |
aasvogel | |
abac | |
abacate | |
abacaxi | |
abacay | |
abacinate | |
abacination |
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/ruby | |
#require "rubygems" | |
#require "gruff" | |
db={} | |
#g = Gruff::Bar.new("600x480") | |
#g.minimum_value=0 | |
#g.maximum_value=20000 |
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
class Module | |
def subclasses | |
classes = [] | |
ObjectSpace.each_object do |klass| | |
next unless Module === klass | |
classes << klass if self > klass | |
end | |
classes | |
end | |
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
# Usage: | |
# user = ActiveDirectoryUser.authenticate('boopathi','password') | |
# user.first_name # => "Boopathi" | |
# user.flanderized_first_name # => "Boopathi Rajaa" | |
# user.groups # => ["Mac Users", "Geeks", "Ruby Coders", ... ] | |
require 'net/ldap' # gem install ruby-net-ldap | |
class ActiveDirectoryUser | |
### BEGIN CONFIGURATION ### |
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 | |
# This doesn't mean threading in ssh. What it means is, every thread | |
# that this program spawns, creates a new subprocess to perform the | |
# system "ssh" command. | |
# Sample Usages | |
# ============= | |
# | |
# 1. |
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 node_static = require('node-static'); | |
var node_static_file = new(node_static.Server)('./client'); | |
var http = require('http'), | |
players = {}, | |
server = http.createServer(function(req, res) { | |
// static file server | |
req.addListener('end', function () { | |
node_static_file.serve(req, res); | |
}); | |
}).listen(80); |
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
upstream thin { | |
server unix:/tmp/thin.0.sock; | |
server unix:/tmp/thin.1.sock; | |
server unix:/tmp/thin.2.sock; | |
} | |
server { | |
listen 80; | |
server_name my-domain-name.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
#!/usr/bin/python2.7 | |
import httplib, urllib | |
from os import chdir, path | |
from subprocess import Popen, PIPE | |
# Change the script's working directory to | |
# the script's own directory | |
chdir(path.dirname(path.abspath(__FILE__))) |
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 os | |
import os.path | |
import sys | |
from graphite.render.hashing import ConsistentHashRing | |
## Settings | |
# Absolute path to the Graphite Data Directory | |
DATA_DIR = '/data/graphite/whisper/' | |
## You need not modify anything below this |