Repeating commands in bash: per line, per word, and xargs

In bash (the default shell on Mac), today we wanted to execute a command over each line of some output, separately. We wanted to grep (aka search) for some text in a file, then count the characters in each matching line. For future reference… Perform a command repeatedly, once per line of input: grep “the” … Read moreRepeating commands in bash: per line, per word, and xargs

Talk: Concurrency Options on the JVM

or, “Everything You Never Wanted to Know About java.util.concurrent.ExecutorService But Needed To” from StrangeLoop, 18 Sep 2014 Abstract: A careful design lets you write a concurrent application without thinking about deadlock or synchronization. Getting to that design takes a lot of thinking. This session delivers the background you need to make good decisions about concurrency … Read moreTalk: Concurrency Options on the JVM

TDD with generative testing: an example in Ruby

Say I’m in retail, and the marketing team has an app that helps them evaluate the sales of various items. I’m working on a web service that, given an item, tells them how many purchases were influenced by various advertising channels: the mobile app, web ads, and spam email. The service will look up item … Read moreTDD with generative testing: an example in Ruby

TDD is Dead! Long Live TDD!

Imagine that you’re writing a web service. It is implemented with a bunch of classes. Pretend this circle represents your service, and the shapes inside it are classes. The way I learned test-driven development[1], we wrote itty-bitty tests around every itty-bitty method in each class. Then maybe a few acceptance tests around the outside. This … Read moreTDD is Dead! Long Live TDD!

The power of embedded developers

Meet my friend Sean. Sean is one of the most powerful developers I know. Not best, not brilliantest, but most powerful because: he provides more business value than some 50-person teams. What is the job title of such a powerful developer? It isn’t “ninja” (although maybe it should be). It’s “Accounting Manager.” WAT. Program: runs … Read moreThe power of embedded developers

May I please have inlining for small dependencies?

Franklin Webber[1]  went on a quest to find out whetherutility code was better or worse than core code in open sourceprojects. Utility code is defined as anything necessary but not directly related to the application’smission. Franklin found that overall quality of utility code was higher, perhaps because this code changes less. He also found a lot … Read moreMay I please have inlining for small dependencies?

Quick reference: monads and test.check generators

Combine monads with test.check generators to build them up out of smaller generators with dependencies: (require ‘[clojure.test.check.generators :as gen])(require ‘[clojure.algo.monads :as m])(m/defmonad gen-m   [m-bind gen/bind    m-result gen/return]) (def vector-and-elem  (m/domonad gen-m    [n (gen/choose 1 10)     v (gen/vector gen/int n)     e (gen/element v)]    [v, e])) (gen/sample vector-and-elem);; ([[0 0] 0]     [[0 -1 1 0 -1 0 -1 1] 0]   … Read moreQuick reference: monads and test.check generators