How to run a successful start-up?
The bay area is populated with fanboys who read (blogs?!) about start-ups, talk about start-ups, write about start-ups, go to start-up shindigs. They talk big… real big. It’s like some weird unhealthy infatuation with all that could be.
Yet, hanging out at their day jobs, they do not produce at all. Reminder: step 1 is to actually do stuff.
Why pride of workmanship matters
Before you can be good at something, you have to want to be good at something. Discovered this today little turd in my codebase today.
This is the work of someone who just doesn’t care. So you could argue “what’s the harm, the guy got the work done.” But if you adhere to that approach the fall out is well understood: your system is poorly designed and it creaks and groans under every attempt to change it. And so you have to live with it, in some horrible bizarro universe where ill designed system proscribes your creativity.
And now I have to re-do someone else’s work to prep it for doing my own work. Mediocrity is expensive.
The farmer and the pig
Found while scanning through one of my old books in search of some notes on constrained nonlinear optimization techniques.
(a) At t=0, a pig, initially at the origin, runs along the x axis with constant speed v. At t=0, a farmer, initially 20 yd north of the origin, also runs with constant speed v. If the farmer’s instantaneous velocity is always directed toward the instantaneous position of the pig, show that the farmer never gets closer than 10 yd from the pig.
(b) Now suppose that the pig starts over from x=0, y=0, and t=0 and starts running at speed v. The farmer still starts 20 yd north of the pig but can now run at a speed of 3v/2. The farmer is assisted by his daughter who starts 15 yd south of the pig at t=0 and can run at a speed of 4v/3. If both the farmer and the farmer’s daughter always run toward the instantaneous position of the pig, who catches the pig first?
(c) At t=0 a pig initially at (1, 0) starts to run around the unit circle with constant speed v. At t=0, a farmer initially at the origin runs with constant speed v and instantaneous velocity directed toward the instantaneous position of the pig. Does the farmer catch the pig?
This is exercise 1.30 from Advanced Mathematical Methods for Scientists and Engineers (1978).
Enumerable#avg is an average method for ruby’s enumerable module
Surprisingly, ActiveSupport’s core extensions don’t define a helpful average function in the Enumerable module.
wart:x3 huned$ script/console
Loading development environment (Rails 2.3.4)
>> [1,2,3,4].avg
NoMethodError: undefined method `avg' for [1, 2, 3, 4]:Array
from (irb):1
The absence of an average method is strange given that Enumerable#sum is defined and that it’d be trivially simple to implement. So monkeypatch config/initializers/enumerable.rb thusly:
Now we’re good.
wart:x3 huned$ script/console Loading development environment (Rails 2.3.4) >> [1,2,3].avg => 2.0 >> [1,2,3,4,5,6].avg => 3.5
Note that unlike ActiveSupport’s Enumerable#sum this method doesn’t accept an optional block.


