This file contains 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
package quickcheck | |
import common._ | |
import org.scalacheck._ | |
import Arbitrary._ | |
import Gen._ | |
import Prop._ | |
abstract class QuickCheckHeap extends Properties("Heap") with IntHeap { |
This file contains 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
trait RNG { | |
def nextInt: (Int, RNG) // Should generate a random `Int`. We'll later define other functions in terms of `nextInt`. | |
} | |
object RNG { | |
type Rand[+A] = RNG => (A, RNG) | |
// ?? What does _ mean in this syntax? Access to the RNG trait? | |
val int: Rand[Int] = _.nextInt |
This file contains 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
$("video").playbackRate = 2 |
This file contains 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
;2.17 | |
;(last-pair (list 23 72 89 124 34)) ; should be (34) | |
(define (last-pair x) | |
(if (atom? (cdr x)) | |
x | |
(last-pair (cdr x)))) | |
(display (last-pair (list 23 72 89 124 34))) | |
(newline) |
This file contains 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
var http = require("http"), | |
url = require("url"), | |
path = require("path"), | |
fs = require("fs") | |
port = process.argv[2] || 8888; | |
http.createServer(function(request, response) { | |
var uri = url.parse(request.url).pathname | |
, filename = path.join(process.cwd(), uri); |
This file contains 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
;helpers | |
(define (identity x) x) | |
(define (plus1 x) (+ 1 x)) | |
; recursive | |
(define (product term a next b) | |
(if (> a b) | |
1 | |
(* (term a) | |
(product term (next a) next b)))) |
This file contains 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
_.each($(".editInPlace"), function(g){g.click()}) | |
// wait a second for ajax to finish | |
_.each($("input[type=checkbox]:checked"), function(c) {c.click()}) | |
_.each($("input[type=radio][value=1]"), function(e) {e.click()}) | |
_.each($("input[type=radio][name=mailing_list_status][value=0]"), function(e) {e.click()}) | |
_.each($("input[type=radio][name=evRemind][value=1]"), function(e) {e.click()}) | |
_.each($("form[method=POST]"), function(f) {$.post(f.action, $(f).serialize(), function(e) {console.log("Unsubscribed from " + f.action)})}) | |
This file contains 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
🕜 o@ombp ~/eng/labs/miri (master)* $ time rline rental_entry.dump | |
caf478db3e705152013e7055807526ee rentjungle.com 2013-05-03 Cooper Square NEW YORK NY 10003 40.7284617 -73.9907367 dfaade06187ed9790ce60a8f07854932 **NO FEE**STUNNING NOHO TWO BEDROOM**LUXURY CORNER PENTHOUSE**NO FEE** dfaade06187ed9790ce60a8f07854932-2.0-null 2.0-null 2 2 12000 12000 f fapartment | |
real 0m0.041s | |
user 0m0.025s | |
sys 0m0.014s | |
🕜 o@ombp ~/eng/labs/miri (master)* $ time wc -l rental_entry.dump | |
4924266 rental_entry.dump | |
real 0m1.478s |