The way a crow
Shook down on me
The dust of snow
From a hemlock tree
Has given my heart
A change of mood
And saved some part
Of a day I had rued.
February 3rd, 2011 § Comments Off § permalink
January 30th, 2011 § Comments Off § permalink
If you can keep your head when all about you
Are losing theirs and blaming it on you;
If you can trust yourself when all men doubt you,
But make allowance for their doubting too:
If you can wait and not be tired by waiting,
Or, being lied about, don’t deal in lies,
Or being hated don’t give way to hating,
And yet don’t look too good, nor talk too wise;
If you can dream—and not make dreams your master;
If you can think—and not make thoughts your aim,
If you can meet with Triumph and Disaster
And treat those two impostors just the same;
If you can bear to hear the truth you’ve spoken
Twisted by knaves to make a trap for fools,
Or watch the things you gave your life to, broken,
And stoop and build’em up with worn-out tools;
If you can make one heap of all your winnings
And risk it on one turn of pitch-and-toss,
And lose, and start again at your beginnings,
And never breathe a word about your loss;
If you can force your heart and nerve and sinew
To serve your turn long after they are gone,
And so hold on when there is nothing in you
Except the Will which says to them: “Hold on!”
If you can talk with crowds and keep your virtue,
Or walk with Kings—nor lose the common touch,
If neither foes nor loving friends can hurt you,
If all men count with you, but none too much;
If you can fill the unforgiving minute
With sixty seconds’ worth of distance run,
Yours is the Earth and everything that’s in it,
And—which is more—you’ll be a Man, my son!
January 25th, 2011 § Comments Off § permalink
This is as much a reminder for myself as anything. I needed to create 31 folders named 00 through 31 for each day of the month in a web-directory used to store audio files from CAPE-1 transmissions. The first thought that came to mind was to write a quick one-liner bash command/script to create those folders. So, without much thought, I quickly typed the following into a shell on my web server:
for ((x=1;x<=31;x+=1)); do mkdir $x; done
OK, well that did create 31 directories, but the first 9 were named 1, 2, 3, etc. instead of 01, 02, 03 like I wanted. After a quick search on zero-padding in bash it seemed no one had posted anything about it except to say it was tricky. Being a C programmer before a bash script writer, I thought to myself, “Wouldn’t it be nice if I could use a printf() statement in bash?” Then I remembered that you can, only usually it is used for formatting user interface statements. I could not think of any reason it would not work to deliver the argument to a mkdir statement, so I tried:
$ for ((x=1;x< =31;x+=1)); do mkdir `printf "%02d" $x`; done
01 03 05 07 09 11 13 15 17 19 21 23 25 27 29 31
02 04 06 08 10 12 14 16 18 20 22 24 26 28 30
And it works! Breaking the command down gives a standard bash for loop with the mkdir command as the internal command inside the loop. As an argument to the mkdir command, however, is a printf statement which given the formatting prints a zero-padded (the 0 after %) two-character long (the 2 after the 0) integer, x. Remember, the `s are back-ticks (below the tilde on most keyboards), not single quotation marks (‘).
It seems like there should be a better way of doing this, but quickest way I found to add zero padding to a number in bash is to use the provided printf which uses the same formatting as the C language printf statement. More usage and examples are available at the ss64.org bash printf reference page.
December 11th, 2006 § Comments Off § permalink
Nick and I had the day off since CAPE1′s testing went so well. We decided to take a drive up the coast and snapped these photos.
There’s a short video of the seal at YouTube.
December 10th, 2006 § Comments Off § permalink
December 8th, 2006 § Comments Off § permalink
August 18th, 2006 § Comments Off § permalink
Just claiming my space in the technorati blobosphere. Nothing to look at here—move along.
View my Technorati Profile
August 11th, 2006 § Comments Off § permalink
It was originally my intention to complete a design theme for this site before going live. However, I needed somewhere to publish the CAPE Subversion System article and I wanted it to be on the new site, so I launched prematurely I guess you could say. Well, things came up and I have not had the time to work on the site. So, now I am committing myself to at least a partial, but fully usable theme by the end of this month. At first it will probably just be a CSS design based on the Sandbox theme by Scott Wallick. Eventually, I would like to add a little of the functionality of K2 and probably slim down some of the PHP of Sandbox just to make it a little more focused to the needs of this site.