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 gevent import monkey | |
from gevent import wsgi | |
monkey.patch_all() | |
PORT = 8080 | |
SIMPLE_PAGE = """<html><head><title>Simple Page</title></head><body><h1>Hello World</h1><p>Simple Gevent Page</p></body></html>""" | |
def application(env, start_response): |
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 gevent | |
from gevent import monkey | |
from BeautifulSoup import BeautifulSoup | |
import os | |
import urllib2 | |
monkey.patch_all() | |
front_page = "http://www.reddit.com/r/fffffffuuuuuuuuuuuu/" |
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
(defun atom? (x) | |
(not (listp x))) | |
(defun lat? (x) | |
(cond | |
((null x) t) | |
((atom? (car x)) (lat? (cdr x))) | |
(t nil))) | |
(defun member? (a lat) |
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
(defpackage #:hello-world-sdl | |
(:use :cl) | |
(:export :main)) | |
(in-package :hello-world-sdl) | |
(defparameter *screen-width* 640) | |
(defparameter *screen-height* 480) | |
(defparameter *bg-color* sdl:*black*) | |
(defparameter *text-color* sdl:*white*) |
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
#include <stdio.h> | |
#define ___VERSION 406001 | |
#include "gambit.h" | |
#include "somescheme.h" | |
#define SCHEME_LIBRARY_LINKER ____20_somescheme__ | |
___BEGIN_C_LINKAGE |
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 curses | |
import time | |
class Direction(object): | |
NORTH=0 | |
EAST=1 | |
SOUTH=2 | |
WEST=3 | |
class Position(object): |
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
#lang racket | |
(define (my-sum-1 lst) | |
(cond | |
((null? lst) 0) | |
(else (+ (car lst) (my-sum-1 (cdr lst)))))) | |
(define (my-sum-2 lst) | |
(define (my-sum-iter res lst) | |
(cond |
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 sqlite3 | |
import os.path | |
import tornado.httpserver | |
import tornado.ioloop | |
import tornado.web | |
class TestApplication(tornado.web.Application): | |
def __init__(self): | |
handlers = [ |
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
package main | |
import ( | |
"net/http" | |
"fmt" | |
) | |
func main() { | |
http.HandleFunc("/", indexHandler) | |
http.HandleFunc("/about", aboutHandler) |
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
;; This is based on the solution given here http://programmingpraxis.com/2009/04/21/probabilistic-spell-checking/2/ | |
;; just ported to common lisp | |
(defvar *k* 7) | |
(defvar *m* 1000000) | |
(defvar *bloom* (make-array *m* :initial-element nil)) | |
(defun key (i word) | |
(let* ((c (string (code-char (+ i 96)))) |
OlderNewer