guest-post Archive

Software Development and Pirates

This is a guest post from Nick Urban. Full bio at the bottom.

Guiding Stars

One of the great discoveries of modern business is that even small decisions can be made empirically, by means of simple experiments.

The act of starting a business is hence transformed from divination to navigation. Diviners who found water by ‘signs’ may or may not have been frauds, but their methods were certainly not as robust as the compass and sextant. Similarly, web designers who change their sites based on gut feelings will not be as effective as those who use analytics to measure user behavior, and base their decisions on that.

The recognition of the importance of empiricism in business is the basis for powerful practices such as A/B testing, and at a broader level for the whole philosophy of “ship early, ship often”. Both are ways of incorporating feedback into the decisionmaking process as soon and as frequently as possible. In deference to navigation, I call these techniques “guiding stars”.

Warning Bells

Where guiding stars tell us if we’re going the right way, warning bells help us avoid dangerous obstacles. We say “due west” or “rename column” and they cry “here be dragons!”.

As developers, our most comprehensive warning bell is integration testing. It tells us whether our program works, almost as if someone were actually using it. If we’re very clever, we might use integration testing as part of a Behavior-Driven-Development process, which would help ensure not only that we arrive safely, but that we arrive at the right port. Integration testing encourages us to think at the level of use cases, and hence doubles as a guiding star.

Unit testing, likewise, is mandatory for any sailor worth his salt. Unit testing checks the implementation details of a project and the edge cases that integration tests doesn’t reach. It makes us look at our interfaces as skeptical buyers rather than proud parents. From that perspective, it’s obvious where we tied a square knot and where a granny.

Fire Alarms

It’s a sad fact, but the dragons of our lives do not always stay within the bounds marked for them on our painstakingly-drawn maps. Luckily, most “dragons” are merely little drakes or pitiful whelps of a missing semicolon. The worst they do is cough sparks and rattle the china. Yet if we don’t notice them, they may still fire the ship. That makes the job of fire-watch an important one. Luckily for us, some clever tinkerers have invented a mechanical parrot that squawks when it smells smoke. It’s called an “exception tracker”, and our hosts today are the purveyors of some of these fine talkers. I’ve used Exceptional‘s tracker for several months, and their alerts have saved me on many occasions.

Unforeseen Treasures

Once you’ve followed your guiding stars, heeded the warning bells, and fed your fire alarm, you’ll be in pretty good shape. You’ll know where you’re going and how to stay out of trouble. But if you’re still not sold, here’s a benefit you may not have thought about.

From time to time, when you’re sailing the ocean of entrepreneurship, you’ll get wind of a chest of doubloons buried in some nearby sandbar. All you have to do is sail over and dig it up. But what if there are pirates? What if you can’t make it to port? Or worse, what if there were tranquil seas and clear sailing, but you acted the coward and crept home when you could have been playing the Count of Monte Cristo?

If the hatches are battened and your parrot’s been freshly oiled, then you’ll likely have the confidence to seize that gold. And if there’s trouble, you’ll be in good shape to handle it. As Seneca says, luck is the crossroads of preparation, opportunity, and havin’ some powder in yer pistol.

Build quality, feel confident, act boldly.

That may not be the motto of the Queen’s Navy, but it works for me.

 

Nick Urban is Chief Engineer at Bespoke Post, a philosope, and a baritoneFind him online at nickurban.com

 

 

 

April 9th, 2013  |  Published in guest-post

Exploring Everyday Things with R and Ruby.

This is an invited guest post from Sau Sheong Chang. After meeting Sau we fell in love with his creative love of Ruby and R. We have an exclusive preview of his new book, Exploring Everyday Things with R and Ruby: Learning About Everyday Things [Paperback].

Getting your heart rate using R and Ruby

The heart rate, or the rate at which your heart beats, is one of the measurements you’ve probably heard most about in relation to exercise. It’s also often a good indication of your health, because a heart rate that is too high or low couldindicate an underlying health issue. The heart rate is usually measured in beats per minute (bpm) and varies from 40 to 220 bpm. An average healthy person at rest has a heart rate of 60–90 bpm, while conditioned atheletes have a resting heart rate of 40– 60 bpm.

A popular and fast way to effectively get the heart rate is pulse oximetry. A pulse oximeter is a device placed on a thin part of a person’s body, often a fingertip or earlobe. Light of different wavelengths (usually red and infrared) is then passed through that part of the body to a photodetector. The oximeter works by measuring the amounts of red and infrared light absorbed by the hemoglobin and oxyhemoglobin in the blood to determine how oxygenated the blood is. Because this absorption happens in pulses as the heart pumps oxygenated blood throughout the body, the heart rate can also be determined.

We are not going to build an oximeter, but in this post we’ll use the same concepts used in oximetry to determine the heart rate. We will record a video as we pass light through our finger for a short duration of time. With each beat of the heart, more or less blood flows through our body, including our finger. The blood flowing through our finger will block different amounts of the light accordingly. If we calculate the light intensity of each frame of the video we captured, we can chart the amount of blood flowing through our finger at different points in time, therefore getting the heart rate.


Read the rest of this entry »

July 31st, 2012  |  Published in guest-post