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
case class User(sid: Int, uid: String) extends Ordered[User] { | |
override def compare(b: User): Int = { | |
(this.sid compare b.sid) match { | |
case 0 => this.uid compare b.uid | |
case x => x | |
} | |
} | |
} |
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
Ilyad% hadoop jar ./target/Scoobi_Word_Count-hadoop-0.1.jar /data/shake /data/output-scoobi | |
2011-11-08 15:27:41.856 java[68147:1903] Unable to load realm info from SCDynamicStore | |
11/11/08 15:27:46 INFO mapred.FileInputFormat: Total input paths to process : 1 | |
11/11/08 15:27:46 INFO filecache.TrackerDistributedCacheManager: Creating scoobi.input.mappers in /tmp/hadoop-Alexy/mapred/local/archive/4123907766041581906_1466591507_92422095/file/Users/Alexy/.scoobi/201111081527/dist-objs-work--5404407803082534293 with rwxr-xr-x | |
11/11/08 15:27:46 INFO filecache.TrackerDistributedCacheManager: Cached file:/Users/Alexy/.scoobi/201111081527/dist-objs/scoobi.input.mappers as /tmp/hadoop-Alexy/mapred/local/archive/4123907766041581906_1466591507_92422095/file/Users/Alexy/.scoobi/201111081527/dist-objs/scoobi.input.mappers | |
11/11/08 15:27:46 INFO filecache.TrackerDistributedCacheManager: Cached file:/Users/Alexy/.scoobi/201111081527/dist-objs/scoobi.input.mappers as /tmp/hadoop-Alexy/mapred/local/archive/4123907766041581906_14 |
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
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
# zsh colors -- http://spiralofhope.wordpress.com/2009/04/23/zsh-ansi-prompt/ | |
function precmd { | |
# let's get the current get branch that we are under | |
# ripped from /etc/bash_completion.d/git from the git devs | |
git_ps1 () { |
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 read_lines ?skip ?maxn filename = | |
let ic = open_in filename in | |
let step,ctr = make_step_counter 0 in | |
E.from_while begin fun () -> | |
try | |
match skip,maxn with | |
| (Some s, _) when ctr () < s -> | |
ignore (input_line ic); step (); Some None | |
| (skip, Some n) when n > 0 && ctr () - (Option.default 0 skip) = n -> | |
close_in ic; None |
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 printShowTable: tex -> ?verbose:bool -> | |
('a BatInnerIO.output -> 'b -> unit) -> | |
'c list list -> string -> unit = | |
fun tex ?(verbose=false) printOne table tableName -> | |
let oc = open_out tableName in | |
printTable oc tex printOne table tableName; | |
close_out oc; | |
if verbose then | |
printTable stdout tex printOne table tableName | |
else () |
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
config: {"project.library.path"=>"/opt/local/lib"} | |
vars: {:script "bin/cake" :opts {:default ["deps"] :d [""]} :pwd "/s/w/clojure/cake" :args ["default" "-d" "deps"] :env {"MANPATH" "/s/src/srilm/current/bin:/s/src/srilm/current/bin/macosx/man:/opt/local/share/man:" "OLDPWD" "/Users/alexyk" "Apple_PubSub_Socket_Render" "/tmp/launch-QWcUGb/Render" "USER" "alexyk" "TMPDIR" "/var/folders/mw/mwJSf7ErEa4w8nWyKyyqD++++TY/-Tmp-/" "LC_CTYPE" "en_US.UTF-8" "TERM" "xterm-color" "DARCS_EMAIL" "[email protected] (Alexy Khrabrov)" "SSH_AGENT_PID" "474" "MAGICK_HOME" "/usr/local/ImageMagick" "GEM_HOME" "/Users/alexyk/.jgem" "PROMPT" "%~ " "SHLVL" "1" "__CF_USER_TEXT_ENCODING" "0x1F9:0:0" "LC_ALL" "en_US.UTF-8" "COMMAND_MODE" "legacy" "SHELL" "/bin/zsh" "DISPLAY" "/tmp/launch-VNuY4O/org.x:0" "LOGNAME" "alexyk" "LANG" "en_US.UTF-8" "DYLD_LIBRARY_PATH" "/usr/local/ImageMagick/lib" "PWD" "/s/w/clojure/cake" "PATH" "/opt/ocaml/bin:/opt/ocaml/sbin:/Users/alexyk/.cabal/bin:/opt/brew/bin:/Users/alexyk/bin:/opt/sbin:/opt/bin: |
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
(defn tokyo-read-reps [db-pathname & [proto str-load?]] | |
(let [ | |
proto (or proto Repliers) | |
init-params (let [par {:path db-pathname :read-only true}] | |
(if str-load? par | |
(merge par {:dump protobuf-dump :load (partial protobuf-load proto)}))) | |
db (tc/db-init init-params) | |
_ (tc/db-open db) | |
tc (:db db) | |
r (when (.iterinit tc) |
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
(defn sig [x] | |
(:sig (meta (resolve x)))) | |
(defmulti type-of (comp type first list)) | |
(defmethod type-of :function [thing & _] (sig thing)) | |
(defmethod type-of java.util.List [expr & a] | |
(conj (map #(type-of % (first a)) (rest expr)) |
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 System (getArgs) | |
import Data.Map hiding (map) | |
import Database.TokyoCabinet | |
import qualified Data.ByteString.Char8 as B | |
import Text.JSONb | |
fetch :: String -> Maybe Int -> TCM [(String,B.ByteString)] | |
fetch fileName maxElems = do | |
tc <- new :: TCM HDB -- alternatively you can use BDB or FDB | |
open tc fileName [OREADER] |
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
;; routes.clj | |
(ns winston.ui.routes | |
(:use [clojure.contrib.except :only (throwf)]) | |
(:require [clojure.contrib.string :as str]))) | |
(defn path-for* [routefn route-args] | |
{:pre [routefn]} | |
(let [path (-> routefn meta ::http-path)] | |
(when (not path) |