This file contains hidden or 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
factorial: func(n: Int) -> Double { | |
result: Double = 1 | |
while(n != 0) { | |
result *= n | |
n -= 1 | |
} | |
return result | |
} |
This file contains hidden or 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
ooc Google Summer of Code project ideas | |
======================================= | |
- rock backend (llvm, javascript, jvm?) | |
- testing framework | |
- ooc-web improvements | |
- true exception support | |
- game/graphics engine (maybe bind ogre or start from scratch?) | |
- reincarnate and/or package store | |
- database library (couchdb, mongodb, sql) |
This file contains hidden or 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
HeaderMap: class extends HashMap<String> { | |
init: func ~headermap { | |
init(100) | |
} | |
init: func ~headermapWithCapacity (capacity: UInt) { | |
T = String | |
super(capacity) | |
} | |
} |
This file contains hidden or 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 text/regexp/Regexp | |
main: func { | |
r := Regexp new("^test$") | |
if (r matches("test")) { | |
"match!" println() | |
} | |
} |
This file contains hidden or 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 threading/[Runnable, Thread] | |
MyRunnable: class extends Runnable { | |
run: func { | |
// do work here | |
} | |
} | |
t := Thread new(MyRunnable new()) | |
t start() |
This file contains hidden or 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
diff --git a/gtk/Gtk.ooc b/gtk/Gtk.ooc | |
index 54679fd..a94890d 100644 | |
--- a/gtk/Gtk.ooc | |
+++ b/gtk/Gtk.ooc | |
@@ -19,7 +19,7 @@ Gtk: cover { | |
/** | |
* Start the Gtk main loop | |
*/ | |
- main: extern(gtk_main) static func | |
+ start: extern(gtk_main) static func |
This file contains hidden or 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
Animal: class { | |
eat: func -> String { return "eating stuff" } | |
} | |
Bird: class extends Animal { | |
eat: func -> String { return "eating worms" } | |
} | |
main: func () { |
This file contains hidden or 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
define: func -> Func { | |
return func { printf("X is %d\n", 28) } | |
} | |
f: Func | |
f = define() | |
f() |
This file contains hidden or 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/env python | |
import sys, os, time, atexit | |
from signal import SIGTERM | |
class Daemon: | |
""" | |
A generic daemon class. | |
Usage: subclass the Daemon class and override the run() method |
This file contains hidden or 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/env python | |
# Usage: trim <url to shorten> | |
# A simple script that trims long urls using tr.im | |
# Requires the shorty library (http://github.com/joshthecoder/shorty-python). | |
# This script is public domain. | |
# Author: Joshua Roesslein | |
import sys | |
from shorty import Trim, ShortyError |