F#
- works in the express editions https://github.com/mausch/Fleece
- JSON lib, based on Aeson
.net 4.5 - immutable collections, nuget package - developed by microsoft. core library source available - including roslin, compiler as a service.
{-# LANGUAGE NoMonomorphismRestriction #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
module Data.Yaml.Extended (module Data.Yaml.Extended, lift) where | |
import Data.Yaml | |
import qualified Data.Text as T | |
import Control.Monad.State.Strict (StateT, runStateT, unless, lift, get, modify) | |
import qualified Data.HashMap.Strict as HM (null, delete, keys) | |
import Data.List (intercalate) |
$s = Time.now | |
$logger = Object.new | |
def $logger.method_missing(sym, *args) | |
puts "[%s, %.3f] %s" % [sym.to_s.upcase, Time.now - $s, args.join(' ')] | |
end |
#! /bin/sh | |
BASEDIR=`dirname $0` | |
JAVA_OPTS="-Xmx2048m -Xms2048m -Xmn512m -server" | |
MAIN="start" | |
CP=$BASEDIR/../lib/jruby.jar:$BASEDIR/../lib/jgrapht-jdk1.5.jar:$BASEDIR/../lib/ped-assign.jar | |
java -cp $CP $JAVA_OPTS $MAIN $* |
$logger = Object.new { | |
#now I want to override stuff in here | |
def foo | |
"bar" | |
end | |
} |
class PedAssignOptions < Struct.new(:links_file, :access_file, :walk_int_file, :output_file); end | |
class ParseFail < Struct.new(:reason); end | |
class ArgvParser | |
def parse argv | |
if argv.size == 1 and ['-h','--help'].include? argv.first then | |
return :help | |
end | |
if argv.length != PedAssignOptions.members.size then | |
return ParseFail.new("Incorrect number of arguments, got #{argv.size} expected #{PedAssignOptions.members.size}") |
# Creates a new window to run selecta over list-windows, then selects the result. | |
bind-key g new-window -n "__SELECTA__" "tmux list-windows | grep -v __SELECTA__ | selecta | sed s/:.*// | xargs -I {} tmux select-window -t {}" | |
# The same in a split (this is probably better). 21 is how high selecta is by default, 1 line for the prompt, 20 for results | |
bind-key g split-window -l 21 "tmux list-windows | selecta | sed s/:.*// | xargs -I {} tmux select-window -t {}" |
class LotsOfData < Struct.new(:field1, :field2, :field3, :field4, :value) | |
def as_accumulation | |
# Group by field1, then the pair of field2 and field3, then field4, finally summing all the values | |
{ field1 => { [field2, field3] => { field4 => Plus.new(value) } } } | |
end | |
end | |
many_data = [ | |
LotsOfData.new(:a, :b, :c, :d, 15), | |
LotsOfData.new(:a, :b, :c, :d, 20), |
F#
.net 4.5 - immutable collections, nuget package - developed by microsoft. core library source available - including roslin, compiler as a service.
∴ cabal test | timestamp | |
10:02:42 Building dredd-0.1... | |
10:02:42 Preprocessing library dredd-0.1... | |
10:02:43 In-place registering dredd-0.1... | |
10:02:43 Preprocessing executable dredd for dredd-0.1... | |
10:02:43 Linking dist/build/dredd/dredd ... | |
10:02:46 Preprocessing test suite tasty for dredd-0.1... | |
10:02:46 Linking dist/build/tasty/tasty ... | |
10:02:49 Running 1 test suites... | |
10:02:49 Test suite tasty: RUNNING... |