Original text from http://lists.warhead.org.uk/pipermail/iwe/2005-July/000130.html
From: Mark Jason Dominus <mjd@plover.com>
Date: Jul 28, 2005 11:16 PM
Subject: Re: HOP -vs- SICP
#################################### | |
# BASIC REQUIREMENTS | |
# http://graphite.wikidot.com/installation | |
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/ | |
# Last tested & updated 10/13/2011 | |
#################################### | |
sudo apt-get update | |
sudo apt-get upgrade |
// ==UserScript== | |
// @name Hide who to follow on twitter | |
// @namespace http://blog.markfeeney.com | |
// @version 0.1 | |
// @description Hide the who to follow thing on twitter. | |
// @match https://twitter.com/* | |
// @copyright 2012+, Mark Feeney | |
// ==/UserScript== | |
// 2 seconds ought to be enough for anyone |
Original text from http://lists.warhead.org.uk/pipermail/iwe/2005-July/000130.html
From: Mark Jason Dominus <mjd@plover.com>
Date: Jul 28, 2005 11:16 PM
Subject: Re: HOP -vs- SICP
def time[R](block: => R): R = { | |
val t0 = System.currentTimeMillis | |
val result = block // call-by-name | |
val t1 = System.currentTimeMillis | |
println("Elapsed time: " + (t1 - t0) + "ms") | |
result | |
} | |
val list1 = 1 to 10000 toList | |
val ary1 = 1 to 10000 toArray |
(def person1 {:fname "John" :mname "Q" :lname "Doe"}) | |
(def person2 {:fname "Jane" :mname "P" :lname "Doe"}) | |
(defn fname-compare [p1 p2] | |
(do | |
(println "Comparing fname") | |
(compare (:fname p1) (:fname p2)))) | |
(defn lname-compare [p1 p2] | |
(do |
(ns exp.cache | |
"I keep screwing myself up on this and need to write it out. | |
Caching impl with these constraints: | |
- caching is layered onto oblivious source fns | |
- data to cache is some unparsed source data that is transformed in a non-trivial way | |
- thr raw source data is not interesting to most users and shouln't mess up the api | |
- caching the final transformed thing is not desireable since we often change the transformation fn | |
- not all source data should be cached |
~/tmp/units-2.11$ make clean | |
rm -f *.o units units.fn units.ky units.pg units.tp \ | |
units.vr units.log units.dvi units.1 units.cp distname .chk \ | |
units.toc units.aux units.cps units.op units_cur_inst units_cur | |
~/tmp/units-2.11$ time (./configure && make) | |
checking for gcc... gcc | |
checking whether the C compiler works... yes | |
checking for C compiler default output file name... a.out | |
checking for suffix of executables... |
mark@mark-pc2:~/tmp/patterns$ cat Test.scala | |
sealed trait Foo | |
case object A extends Foo | |
case object B extends Foo | |
object Test { | |
def f(foo: Foo) { | |
foo match { | |
case A if true => | |
println("A") |
public <A extends java/lang/Object, B extends java/lang/Object> B apply(A, scala.Function1<A, B>); | |
flags: ACC_PUBLIC | |
Code: | |
stack=3, locals=7, args_size=3 | |
0: aload_2 | |
1: aload_1 | |
2: invokeinterface #77, 2 // InterfaceMethod scala/Function1.apply:(Ljava/lang/Object;)Ljava/lang/Object; | |
7: astore_3 | |
8: aload_1 | |
9: ifnull 37 |
(ns foo.core | |
"Looking at ways to mock out records when testing and also using schema." | |
(:require | |
[schema.core :as s])) | |
;; approach 1 (problematic for mocks) -------------------------------------------------- | |
(s/defrecord Thing | |
[name :- s/Str | |
age :- s/Int]) |