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
brianm@binky:~/src/ning-recommender$ svn log -vr 44982 | |
------------------------------------------------------------------------ | |
r44982 | brianm | 2008-12-31 14:48:38 -0800 (Wed, 31 Dec 2008) | 1 line | |
Changed paths: | |
M /recommender/branches/1.0/network-searcher/pom.xml | |
A /recommender/branches/1.0/network-searcher/src/main/java/ning/recommend/service/Recommender.java | |
M /recommender/branches/1.0/network-searcher/src/main/java/ning/recommend/service/RecommenderService.java | |
M /recommender/branches/1.0/network-searcher/src/main/java/ning/recommend/service/RecommenderServiceModule.java | |
M /recommender/branches/1.0/network-searcher/src/main/java/ning/recommend/service/Recommendlet.java | |
A /recommender/branches/1.0/network-searcher/src/main/java/ning/recommend/service/Search.java |
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
brianm@ufo:~$ sudo port install py25-simplejson | |
---> Fetching py25-simplejson | |
---> Attempting to fetch simplejson-2.0.5.tar.gz from http://distfiles.macports.org/python | |
---> Verifying checksum(s) for py25-simplejson | |
---> Extracting py25-simplejson | |
---> Configuring py25-simplejson | |
---> Building py25-simplejson | |
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_python_py25-simplejson/work/simplejson-2.0.5" && /opt/local/bin/python2.5 setup.py build " returned error 1 | |
Command output: Traceback (most recent call last): | |
File "setup.py", line 10, in <module> |
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
f = open(filename, 'rw') | |
fcntl.flock(f, fcntl.LOCK_EX) | |
cs = cjson.decode(" ".join(f.readlines())) | |
cs.append(comment) | |
f.seek(0) | |
s = cjson.encode(cs) | |
f.write(s) | |
fcntl.flock(f, fcntl.LOCK_UN) |
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 cgi | |
import cgitb; cgitb.enable() | |
import simplejson | |
import fcntl | |
import os | |
import re | |
import datetime | |
form = cgi.FieldStorage() |
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 org.joda.time.DateTime; | |
import org.joda.time.DateTimeZone; | |
import org.joda.time.format.DateTimeFormat; | |
import org.joda.time.format.DateTimeFormatter; | |
import org.testng.annotations.Test; | |
import static org.testng.Assert.assertEquals; | |
public class TestDateParse | |
{ | |
@Test |
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 org.skife.jdbi.v2.tweak.Argument; | |
import org.skife.jdbi.v2.StatementContext; | |
import java.sql.PreparedStatement; | |
import java.sql.SQLException; | |
import oracle.sql.ArrayDescriptor; | |
import oracle.sql.ARRAY; | |
/** |
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
open Printf | |
let i = int_of_string Sys.argv.(1);; | |
let a = ref 0 in | |
for j = 1 to i do | |
a := (!a + j) | |
done; | |
printf "%i\n" !a;; |
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
let fib n = | |
let phi = (1 + sqrt 5)/2 in | |
floor (((phi^n) - ((1-phi)^n)) / (sqrt 5)) |
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
public void testUsefulArgumentOutputForDebug() throws Exception { | |
try { | |
h.createStatement("insert into something (id, name) values (:id, :name)") | |
.bind("name", "brian") | |
.bind(7, 8) | |
.bindFromMap(new HandyMapThing().add("one", "two")) | |
.bindFromProperties(new Object()) | |
.execute(); | |
} | |
catch (StatementException e) { |
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
public class Waffle | |
{ | |
public static void main(String[] args) { | |
$(); | |
} | |
public static void $() { | |
System.out.println("no way!"); | |
} |