View WindyCityRails

For all exercises, let’s make sure we’re collaborating, not just submitting as quick as possible. We are a community of professionals - let’s learn from each other!

While we need working software, we also want well-crafted software. So once we’ve got a working solution, let’s see how we can improve it for flexibility and maintainability, rather than jumping right to the next one.

  • Driver: Lean on your team! Talk through your reasoning! Pass the keyboard in 5 minutes or less!
  • Navigators: Ask questions! Suggest improvements empathetically!
  • Narrator: Nudge folks as needed! Stick with the Easy difficulty setting!

Example Exercises, with extra credit ideas/prompts


Keybase proof

I hereby claim:

  • I am trptcolin on github.
  • I am trptcolin ( on keybase.
  • I have a public key whose fingerprint is 67E5 7A31 E9E0 2368 EEAC 5CCF BB1D BD36 16F1 DDB9

To claim this, I am signing this object:

View runq.d
#!/usr/sbin/dtrace -s
* runq.d - run queue sizes by CPU.
* This prints the average, min, and max run queue count by CPU each second. A
* consistently large run queue count is a sign of CPU saturation.
* USAGE: runq.d
View dispqlen.d
#!/usr/sbin/dtrace -s
* dispqlen.d - dispatcher queue length by CPU.
* Written using DTrace (Solaris 10 3/05).
* 14-Feb-2006, ver 0.90
* USAGE: dispqlen.d # hit Ctrl-C to end sample
* NOTES: The dispatcher queue length is an indication of CPU saturation.

Double Barrier Confusion


The way I'm reading the Zookeeper Double Barriers recipe, the exit condition (for Leave) is that all children of the barrier node must be deleted before any given client process can complete the Leave operation.

So it seems to me that if a client process Enters the barrier after the minimum number of processes have joined the barrier, it can hold up previously-Entered client processes. I feel like a typical implementation of barriers might have the minimum # of processes equal to the total # of processes, so maybe this is an edge case? And maybe this is all totally OK and normal; I'm just looking to confirm/disconfirm my interpretation.

  1. Am I thinking about this right? If so, is there actually a problem here? If not, why not?


View core-test.clj
;; test/foobar/core_test.clj
(ns foobar.core-test
(:require [clojure.test :refer :all]
[foobar.core :as foobar]))
(deftest formats-intervals-properly
(is (= "1" (foobar/format-interval [1])))
(is (= "1-2" (foobar/format-interval [1 2])))
(is (= "1-3" (foobar/format-interval [1 2 3]))))
View gist:2d713df94f292c832685
# a little ditty for osx
function voices() {
say -v "?" | cut -d" " -f1,2 | sed -e 's/ *$//'
function shuffle_for_stupid_osx_that_doesnt_have_it_built_in() {
perl -MList::Util=shuffle -e 'print shuffle(<STDIN>);'
View gist:18739a6e1739513dcfc5

Found way fewer than I expected with bibliographies. But also way fewer 2009-present books. The select few w/ nice beefy bibliographies:

  • The Joy of Clojure (Fogus/Houser)
  • The Linux Programming Interface (Kerrisk)
  • Systems Performance (Gregg)
  • The Art of Multiprocessor Programming (Herlihy/Shavit)
  • Machine Learning (Flach)

I counted 8/18 tech books on my shelf since 2009 with bibliographies - way fewer than I'd have guessed. This is even w/ some selection bias towards the type of book that would have a bibliography, I suspect.

View gist:e428b0f80e3335757c33
# Hackery idea
- Github API (get/use an api key - otherwise really limited)
$ curl -u 'USERNAME_HERE' -d '{"scopes":["repo"],"note":"help example"}'
- find all your organizations (paginated)
- find all usernames (grouped by org name) who are in that group
with you
View gist:12f43c4b9c3cd51c9519
user=> (sequence (comp (map inc) (map #(* % %))) (range 10))
(1 4 9 16 25 36 49 64 81 100)
user=> (map (comp inc #(* % %)) (range 10))
(1 2 5 10 17 26 37 50 65 82)