#Generate cities data
wget http://download.geonames.org/export/dump/cities15000.zip
unzip cities15000.zip
node geonames.js cities15000.txt
The result is json array of cities in the following format:
{
_id:
/* Written using http://en.wikipedia.org/wiki/Heapsort pseudocode */ | |
function Sorter() { | |
var array; | |
this.heapsort = function(a) { | |
array = a; | |
heapify(); |
ul.menu a { | |
border-bottom: 1px solid #888; | |
} | |
ul.menu > li:last-child { | |
border-right: 1px solid #888; | |
} | |
ul.menu > li { | |
float: left; |
function Point(x, y) { | |
this.x = x; | |
this.y = y; | |
} | |
function Figure(position) { | |
this.position = position; | |
} | |
function Line(position, endPosition) { |
.calendar { | |
position: fixed; | |
width: 210px; | |
height: 200px; | |
background: #DAD9DD; | |
font-family: Helvetica; | |
color: #3F4E5E; | |
font-weight: bold; | |
display: block; | |
} |
from urlparse import parse_qs | |
from datetime import datetime | |
def dates(environ, start_response): | |
dates = parse_qs(environ['QUERY_STRING']) | |
get_date = lambda d: datetime.strptime(dates[d][0], '%m/%d/%Y') | |
try: | |
start = get_date('start') | |
end = get_date('end') |
import sqlite3 | |
from bottle import route, run, request | |
from datetime import datetime | |
import re | |
from cgi import escape | |
def articles_json(articles_tuple): | |
articles = list(({'date': escape(date), | |
'title': escape(title), |
/* | |
Pascal scanner | |
*/ | |
var Lexeme = function(name, type, nextLexemePos) { | |
this.name = name; | |
this.type = type; | |
this.nextLexemePos = nextLexemePos; | |
} |
import math | |
import matplotlib.pyplot as plt | |
def tdma(a, b, c, d): | |
''' | |
a[i] * x[i-1] + b[i] * x[i] + c[i] * x[i+1] = d[i] | |
''' | |
length = len(a) | |
for i in xrange(1, length): | |
tmp = a[i] / b[i-1] |
#Generate cities data
wget http://download.geonames.org/export/dump/cities15000.zip
unzip cities15000.zip
node geonames.js cities15000.txt
The result is json array of cities in the following format:
{
_id: