I hereby claim:
- I am aredington on github.
- I am holy_chao (https://keybase.io/holy_chao) on keybase.
- I have a public key ASBYQU_MVKO_5ezGJL10NtcM9bOr1uslOsTmtIsPSUwu7Qo
To claim this, I am signing this object:
#!/usr/bin/env ruby | |
File.open("Makefile","w") do |f| | |
targets = (1..6).to_a.repeated_permutation(6).map{|a| "t#{a.join}"}.join(" ") | |
f.puts("all: #{targets}\n\n") | |
(1..6).each do |root_target| | |
f.puts "t#{root_target}:\n" | |
f.puts "\tmkdir -p o#{root_target}\n" |
I hereby claim:
To claim this, I am signing this object:
(defn compute-position | |
"returns a map | |
key is a vector -[ <settlement index name> <power primitive name>] | |
value is a map - {<Date representing yyyy-MM> <Double: the positon> } | |
For non power trades, primitive name will be nil" | |
[trade] | |
;;compute postion code) | |
(require '[monotony.core :as m]) | |
(def config (m/local-config)) | |
(defn weekday-hours | |
[conf day] | |
(let [hours (m/bounded-cycles-in conf day :hour)] | |
[(nth hours 0) (nth hours 18)])) | |
(defn weekend-hours |
Add two functions, multiplex and broadcast, to core.async.
Multiplex is a variadic function of n arguments, returning a new single core.async read port which produces values by multiplexing together all of the provided read ports.
Broadcast is a variadic function of n arguments, returning a new single core.async write port which will write values by writing the values it receives to each of the provided write ports.
(def cal (java.util.Calendar/getInstance)) | |
(.clear cal) | |
(.set cal java.util.Calendar/YEAR 2010) | |
(.set cal java.util.Calendar/MONTH 11) | |
(.set cal java.util.Calendar/WEEK_OF_YEAR 1) | |
(.getTime cal) | |
(if (= 2009 (.get cal java.util.Calendar/YEAR)) | |
(throw (IllegalStateException. "WTF? LOOK AT LINE 3!!!"))) |
(defn commatize [n] | |
(apply str | |
(flatten | |
(butlast | |
(interleave | |
(reverse | |
(partition 3 | |
3 | |
() | |
(reverse (seq (str n))))) |