Wicked Cool FizzBuzz in Perl
The FizzBuzz problem is a simple coding demonstration to write an application in any language that counts from 1 to 100: Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and …
August 22, 2012 Wednesday at 9:34 pm
Bulk fix a list of words to the proper case
Problem Given a long list of upper-case words (one word per line), such as: MARY JOE SCOTT FRED … (for thousands of rows) … You want to change this to Mary Joe Scott Fred (etc) Solution Use perl from the command line. Assume all your names are in a file called ‘names.txt’. We’re going to send the output to a …
August 9, 2012 Thursday at 4:02 pm
Don’t Call Yourself A Programmer
I’ve always hated the term “Programmer.” Like a craftsman, I’m a Developer. Patrick McKenzie has a great writeup on this: Engineers are hired to create business value, not to program things: Businesses do things for irrational and political reasons all the time (see below), but in the main they converge on doing things which increase revenue or reduce costs. … …
July 3, 2012 Tuesday at 3:28 pm
What are your top commands?
Sometimes it is interesting to navel-graze. What commands do you type the most? history | awk ‘{a[$2]++}END{for(i in a){print a[i] ” ” i}}’ | sort -rn | head Here’s mine: 95 ll 93 git 67 cd 37 vi 29 identify 15 find 12 agvtool 11 history 11 exit 10 cat “ll” is an alias for ls -l Interesting that I’ve …
December 15, 2011 Thursday at 7:00 am
App Development in the Real World
When developing applications for mobile phones, it is easy to get tricked into thinking the emulator will accurately represent how a user will interact with the application. This is dangerous for a few reasons. I ran into one reason today: real devices move around. They rotate, yaw, pitch and jiggle. The emulator does not. Sure, you can rotate it and …
December 14, 2011 Wednesday at 12:46 pm
