Wednesday, May 07, 2008

Harmonic Vibes


My latest YouTube opus.

Monday, April 21, 2008

The Nature of Things

There seems to be a debate going around as to whether war and violence are part of human nature. The argument for seems to go like this: "Look, ants do it. Ants are natural."

At the same time we discover that 300,000 US soldiers now have mental health problems coming out of Iraq. That's almost 1 in 5. How natural is that?

Killing, not just other humans but anything, goes against our nature. Anyone who has ever killed an animal for food or otherwise, but not made a habit of it, will understand. I have killed animals for food and even killing a fish brings a pang of guilt and bitterness. One can be conditioned not to feel guilt at killing. However, it precisely this need for conditioning that proves that it is not part of our nature.

Now, if you don't believe me, and there are always unbelievers, go to your local pet shop, buy a bunny, take it home, kill it, and have it for dinner. Then, reflect on your feelings.

Sunday, April 13, 2008

This will Go Down in History

Or go down the memory hole I'm not sure which.
It happens to be the first discharge of a firearm on a commercial flight by one of the crew. And, it happens to have been an accident (at least in the United States and since the permitting of guns to pilots). An accident, who didn't see that coming? Pilots wanting to carry guns to work are required to take a psychological examination and firearms training. Evidently these measures are not enough.

Greg Alter of the Federal Air Marshal Service said, "We know that there was never any danger to the aircraft or to the occupants on board." Are we to understand, then, that flying bullets are not a danger? Why not let everyone carry guns on board? Except the terrorists of course.

Handguns are always a bad idea. Why, I myself almost shot my foot off once. Hint: Don't use your left hand, unless you're left handed.

Wednesday, April 02, 2008

Guest Blogging

Will guest blogging kill this blog?

Sunday, March 23, 2008

Walden

...for not a pickerel or shiner picks an insect from this smooth surface but it manifestly disturbs the equilibrium of the whole lake. - Thoreau

I finished Walden today sitting on Gulliver's hat. After, I hopped around the hat three times that precious cargo might be bestowed upon me.

Read Walden, and read Civil Disobedience. I looked up Walden Pond on Google earth but it sent me to a Walden Pond in New Hampshire. I was only a little dissappointed since the state motto is "live free or die".

It snowed on Easter this year just as it snowed on Easter last year. This produced some excitement in our drive through the mountains.



For the next few weeks I will be guest blogging at The Citizen's Bulletin. This blog will be sadly neglected. Expect no change.

Sunday, March 16, 2008

Teaching Perl Not to Be So Greedy

This post is not of general interest, but perhaps it will help some unfortunate person, like me, who finds himself struggling to tame regular expressions.

I was faced with the following text from which I desired to clean the Microsoft artifacts leaving only the pure html and English:

<HTML xmlns:o= "urn:schemas-microsoft-com:office:office"><BODY><P class=normal style="MARGIN: auto 0cm">Text not to mention other stuff that I need to clean up</HTML>

To do this I meant to use Perl, namely the substitution operator ($x =~ s///;).
The problem is that Perl's regular expressions are greedy. A code like s/<HTML.*>/<HTML>/ (which says, "0 up to infinity of anything until you reach >) turns the entire block into "<HTML>" because the regular expression matches everything from the first < all the way up to the last >

"Why don't you just convert the the &gt;s to >s and the &lt;s to <s and use this, s/<HTML[^>]+>/<HTML>/;," you ask.
([^>]+> means one or more of anything that is not a > until you reach a > and is one common way to solve greedy behavior.)

There are two reasons, first because < and > are used elsewhere for legitimate purposes, hence wherever I convert these characters I will have to convert them back, and second because I want a simple solution that I don't have go cross eyed over.

So, I tried s/&lt;HTML[^(&gt;)]+&gt;/&lt;HTML&gt;/; which doesn't work for reasons unknown to me.

I found the answer, at last, somewhere on the Internet.
This does work for reasons unknown to me: s/&lt;HTML.*?&gt;/&lt;HTML&gt;/;.
In English it says, "0 or 1 of 0 up to infinity of anything until you reach &gt;"
The key to curbing greedy behavior is .*? followed by the closing string.

If you are wondering why you bothered to read this, I can only say that you had fair warning that it was not of general interest.

Labels: , ,

Wednesday, March 05, 2008

La Casa Helada de la Lucha por Steamboat

The citizens of a small town in northwest Colorado are being terrorized by their DA.
One of these citizens, deciding that enough is enough, has built a protest igloo (facilitated by more than 300 inches of snow this year) on the county courthouse lawn. From this icy hut, he hopes to rouse the sleepy residents of the mountain village into action and enlighten the powers-that-be to the people's discontent. This is his story: www.thecitizensbulletin.com,

and this is his igloo: