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"), | |
querystring = require("querystring"), | |
htmlparser = require("htmlparser"), | |
soupselect = require("soupselect"), | |
irc = require("irc"); | |
/** | |
* Wrapper for making an HTTP request, reading the data, instantiating a htmlparser.Parser | |
* and parsing the page. htmlparserHandlerFunction will be passed to htmlparser.DefualtHandler. |
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 fabric.api import local | |
import jinja2 | |
import sys | |
import os | |
import os.path | |
import webbrowser | |
proj_base_path = sys.path[0] | |
pages_path = os.path.join(proj_base_path, 'pages') | |
build_path = os.path.join(proj_base_path, 'build') |
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
using System.IO; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
class Program | |
{ | |
static void Main() | |
{ | |
int[] elements = { 1, 8, 9, 13, 2, 7 }; |
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
data FeatureVec = | |
FeatureVec { cls :: Int, feat :: [Bool] } | |
deriving (Show) | |
data ValueVec = | |
-- TODO: Need a better name for vals | |
ValueVec { cnt :: Int, vals :: [Int] } | |
deriving (Show) | |
type ProbVec = [Float] |
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
; Assembly hello world for OSX | |
; So I can remember how to do basic shit in OSX | |
; | |
; $ nasm -g -f macho -o test.o test.asm | |
; $ ld -o a.out -e _main test.o -lSystem | |
bits 32 | |
section .data | |
message db "Hello, world!", 10, 0 |
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/gui | |
(require sgl) | |
(require sgl/gl-vectors) | |
(define (render canvas dc) | |
(send canvas with-gl-context | |
(lambda () | |
(gl-matrix-mode 'projection) | |
(gl-load-identity) | |
(gl-ortho -10 10 -10 10 -1 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
In [1]: import sys | |
In [2]: def test(): | |
...: foo = "Hello, world!" | |
...: try: | |
...: raise Exception() | |
...: except Exception, e: | |
...: trace = sys.exc_info()[2] | |
...: return trace | |
...: |
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
ian@dreadnought > virtualenv venv; . venv/bin/activate.fish | |
New python executable in venv/bin/python | |
Installing setuptools, pip...done. | |
(venv)ian@dreadnought > pip install urllib3 | |
Downloading/unpacking urllib3 | |
Downloading urllib3-1.10.2-py2-none-any.whl (77kB): 77kB downloaded | |
Installing collected packages: urllib3 | |
Successfully installed urllib3 | |
Cleaning up... | |
(venv)ian@dreadnought > mkdir foobar |
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
#!/bin/sh | |
set -e | |
# Build the bootloader | |
cd src/bootloader | |
nasm -f bin main.asm -o ../../build/bootloader.bin | |
cd ../.. | |
# Build the kernel | |
cd src/kernel/asm |
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 threadpool, math, os | |
randomize() | |
proc setRand(k: int, vals: var seq[int]) = | |
vals[k] = k * 2 | |
if k < 7: | |
sleep(random(1000)) | |
vals[k+1] = k * 2 |
OlderNewer