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* | |
[matcher__780__auto__ | |
(compojure.http.routes/request-matcher :get "/foo")] | |
(clojure.core/fn | |
[request__781__auto__] | |
(clojure.core/if-let | |
[route-params__782__auto__ | |
(matcher__780__auto__ request__781__auto__)] | |
(clojure.core/let | |
[request__781__auto__ |
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
int roboslider (int *b,int *bm, int *p, float *bw) | |
{ | |
int r,c,ct,ct2,ok=0,x,mv,cur; | |
for(mv=0;(!ok)&&(mv<7);mv+=2) | |
for(x=0; (!ok)&&(x<10) ;x++) | |
{ | |
for(ct=mv+1; (!ok)&&(ct<3+mv) ;ct++) | |
{ | |
ps->torc(p[x],&r,&c); |
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
### Ruby version ### | |
#!/usr/bin/ruby | |
File.read(ARGV[0]).split("\n").each do |line| | |
if line =~ /Found \d/ then | |
puts "=== #{line}" | |
end | |
m = /Between lines (\d+) and (\d+) in (.*)/.match line |
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 bytes2hex [^bytes bytes] | |
(.toString | |
(let [alpha "0123456789ABCDEF"] | |
(areduce bytes idx ret (StringBuilder.) | |
(doto ret | |
(.append (.charAt alpha (int (bit-shift-right (aget bytes idx) 4)))) | |
(.append (.charAt alpha (int (bit-and (aget bytes idx) 0xf))))))))) | |
(def byte-table | |
(delay ;don't generate the byte array unless needed |
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() { | |
$('.autosize').each(function() { | |
var jThis = $(this); | |
if (jThis.find('tr').first().width() > $(window).width()) { | |
jThis.addClass('scroll'); | |
jThis.height($(window).height() - 50); | |
} | |
}); |
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
TEMPDIR=`mktemp -d /tmp/install-sqljdbc.XXX` | |
cd "$TEMPDIR" | |
URL="http://download.microsoft.com/download/D/6/A/D6A241AC-433E-4CD2-A1CE-50177E8428F0/1033/sqljdbc_3.0.1301.101_enu.tar.gz" | |
TARBALL=install.tar.gz | |
curl -o $TARBALL "$URL" | |
tar -xzf $TARBALL | |
mvn install:install-file -Dfile=`find $TEMPDIR -name sqljdbc4.jar` -DgroupId=com.microsoft -DartifactId=sqljdbc4 -Dversion=3.0 -Dpackaging=jar | |
rm -rf "$TEMPDIR" |
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
user=> (use 'clj-stacktrace.repl) | |
nil | |
user=> ("foo") | |
java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IFn (NO_SOURCE_FILE:0) | |
user=> |
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 dot-points | |
"Return a seq of points that would be good places to print a progress dot when doing n things" | |
[n] | |
(map first | |
(partition (inc (int (/ n 10))) | |
(range n)))) | |
(defn map-progress | |
[f coll] | |
(let [n (count coll) |
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
# by John Cromartie | |
# idea from http://blog.jgc.org/2010/12/write-your-passwords-down.html | |
# via http://news.ycombinator.com/item?id=2016608 | |
alpha = ("A".."Z").to_a | |
chars = alpha + 'abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(){}[]-+=.,;:~'.chars.to_a | |
class Array | |
def rand_el |
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
(def *indent* 0) | |
(def *real-println* println) | |
(defmacro with-indent | |
[& body] | |
`(binding [*indent* (inc *indent*) | |
println (fn [& xs#] | |
(let [indent# (apply str (take *indent* (repeat " ")))] | |
(*real-println* (str indent# (apply str (interpose " " xs#))))))] | |
~@body)) |