Tuesday, June 2, 2009

All that is necessary for evil to triumph is for good men to do nothing

There is some question as to whether this quote is from Edmond Burke or whether it is a translation of Leo Tolstoy's "War and Peace". Whoever actually coined the phrase the message rings true. It compels me to speak up once again against the ignorance being perpetuated by those unwilling to challenge their own prejudices. Those unwilling to accept responsibility for sins of their / our history.

Mitt Romney recently stated: "The president also claimed on Arabic TV that America has dictated to other nations," Romney said. "No, America has sacrificed to free nations from dictators."

This sentiment is echoed by a chain email I received not too long ago stating that the US soldiers have fought numerous times over the years to free other nations from the grips of tyranny and asked for nothing more than enough land to bury their soldiers.

First, I mean absolutely no disrespect for the men who honorably serve in the armed forces. I carry great esteem for those willing to sacrifice their lives to protect others. I honor the sacrifices of those who have and do fight to enable my ability to freely write this very post. The significance of it is not lost upon me.

That said, I cannot allow the sacrifices and best intents of those very soldiers to be sullied by ethnocentric extremist views like those I mentioned above. Such lies must not be allowed to go unchallenged or we risk proving George Santayana correct:
Progress, far from consisting in change, depends on retentiveness. When change is absolute there remains no being to improve and no direction is set for possible improvement: and when experience is not retained, as among savages, infancy is perpetual. Those who cannot remember the past are condemned to repeat it.
The Life of Reason, vol 1 "Reason in Common Sense"
Let's examine just a small portion US History and see how these statements hold water.

The email, of course is low-hanging fruit.
  • Native North American tribes killed and forcibly relocated to reservations. Remember these telling words from Theodore Roosevelt:
I suppose I should be ashamed to say that I take the Western view of the Indian. I don't go so far as to think that the only good Indians are dead Indians, but I believe nine out of every ten are, and I shouldn't like to inquire too closely into the case of the tenth. The most vicious cowboy has more moral principle than the average Indian. Turn three hundred low families of New York into New Jersey, support them for fifty years in vicious idleness, and you will have some idea of what the Indians are. Reckless, revengeful, fiendishly cruel, they rob and murder, not the cowboys, who can take care of themselves, but the defenseless, lone settlers on the plains. As for the soldiers, an Indian chief once asked Sheridan for a cannon. "What! Do you want to kill my soldiers with it?" asked the general. "No," replied the chief, "want to kill the cowboy; kill soldier with a club."
Hermann Hagedorn, Roosevelt in the Bad Lands (Boston: Houghton Mifflin, 1921), p. 355
  • Add to that our acquisition of half of mexico via the Treaty of Guadalupe Hidalgo. This ceded half of the nation of Mexico to the United States, becoming the bulk of the Western states. The reason for this war? US speculators venturing into Mexico refused to honor the agreements they signed with the Mexican government and declared their independence, seeking help from the US Army.
  • If that isn't convincing enough, how about The Spanish-American War (1889), where we "liberated" Cuba, Puerto Rico, Guam, and the Philippine Islands from Spain then promptly laid claim to them? These became US Territories, which means they are owned and controlled by the US, but are not officially states. I suspect this might be a more politically correct way to describe a colony, since colonization is now taboo.
  • Of course there's always Hawaii, where we overthrew the sovereign monarchy of Queen Lili'uokalani. This action was investigated by President Grover and found to be illegal, but the new government still refused to back down. Hawaii continued as a US Territory until 1959 when it was officially granted statehood.
  • If you want some smaller scale examples, look at the large bases we still maintain in Cuba, Brazil, Iraq, etc. We might say that these are not technically US-owned, but tell that to the local resident staring down the barrel of an M1 Abrams tank. Posession is 9/10ths of the law, right?
So the facts, for anyone who chooses not to ignore them, clearly show that the US has numerous times expanded its territory through conquest. Some of these conquests are under the guise of freeing land from tyrants, but when that land is annexed I believe it is safe to say we claimed more than "just enough space to bury our fallen soldiers". That email can be safely filed in the round bin.

As this post has grown far longer than I intended I'll follow up with another to address Mitt Romney's statement more directly.

Monday, March 16, 2009

My Mysql / PostgreSQL experience

GEEK CONTENT: High

A few months ago I discovered the Portland Postgres User Group (PDXPUG). This group isn't huge, but is a very active, extremely friendly and helpful group of database hackers and general technophiles. I can't even count the number of times I've tweeted a question about PostgreSQL and gotten a faster response than the IRS on Jimmy Hoffa's trail. If you are a twitter user, simply include the Hash Tag #PDXPUG and the Djinni appears with your answer.

Anyway enough of my plug of the group.

Last month it was my turn to present something to the user group. Not being as knowledgeable of database internals as Selena, nor as experienced hacking tools around PostgreSQL as Mark or Gabrielle I was a little intimidated. It turns out, though, that one of my work projects provided a great talking catalyst.

I am a programmer for NVIDIA. No, I am not one of the amazingly brilliant people that can actually visualize the circuitry inside a GPU. I am not even important enough to be in the know on all the best Top Secret Insider stuff, but I love working around smart people and playing with the toys they come up with.

I like to describe my position as the grease that helps important gears turn faster. Whatever software or analysis that one of the NVIDIA engineers needs that we can't buy a solution for off the shelf my team writes. This might be something to help managers plan their hiring practices or something to help lots of engineers share Gigabytes of test results. It might be something the automatically notifies people when one of our proprietary tools appears to be going awry. I enjoy it because every new project is fresh and challenging.

Recently I was given the task to optimize a database system that logs errors with any of our internal tools, including our large farm of servers. The data stored there helps find systematic problems (bad network nodes, slow disk drives, etc.) The database that stores this information runs MySQL and was written about the same time I started working at the company. It has an awful lot of data and when something goes wrong we need to get answers out of it quickly.

My first attempt at gathering some troubleshooting metrics took me four days. This was not an acceptable turn around, so I undertook a rather in depth effort to redesign the database to better meet the demands placed on it. What I initially imagined as a 4-6 week project turned into a five month saga. I learned an awful lot about the tools that use this and even more about MySQL's inner workings and pitfalls.

As I worked on this I keep a running log of design possibilities for porting this to PostgreSQL. It would be a lot of work, but between my IT contact's preference for PostgreSQL and the activity level of PDXPUG it might well pay off.

So when it came time for me to present something to the group I decided this project would provide good fodder. It went much better than I could have imagined. Not only were my challenges shared by others in the group but I got some really useful suggestions both in PostgreSQL and MySQL for working around them. I look forward to presenting a follow-up after I have been able to incorporate them and some of my other plans.

Here is a basic checklist of my current thought regarding the two database implementations based on my current work. I fully expect this list to change over the next few weeks as I do some more broad comparisons between these solutions:

MySQL
CON:
  • Centralized Lock table shared by all databases across the server instance. One misbehaving database can bring all databases on the server to a halt by filling the lock table.
  • Backups are less sophisticated (no incremental backups)
  • Permissions granularity on our version either requires super-user access (against IT policy) or prevents many necessary operations (such as trigger creation)
  • No Local User Groups in PDX
  • Requires deterministic defaults for database fields (no functions such as now()). This means all other defaults must be done with triggers.
  • Significant breaking changes between versions 5.0.x and 5.1.x. This makes IT really reluctant to upgrade, thus making all of the advantages of 5.1.x unavailable.
  • Lots of confusion about which is the "official" current version. Many conflicting development branches.

PRO:
  • Free*
  • Very responsive support from Sun if you pay for the enterprise package.
  • Documentation. the online documentation (with its accompanying comments) is very thorough. It includes a lot of sample code, as well. There are a lot of good books for configuring and maintaining MySQL servers. There are also some great bloggers out there
  • LAMP (Linux Apache MySQL PHP) has a huge following. PHP appears to be the heart and soul behind MySQL's popularity.

PostgreSQL
CON:
  • No single point of contact for Enterprise support. Many managers like knowing whose throat they can wring when something goes horribly wrong, so a lack thereof can make this solution a harder sell.
  • No Unsigned integers (though I hear this is soon to be).

PRO:
  • Free*
  • Documentation
  • Nearly any language can be used to implement stored functions / procedures. This means you can leverage Perl for string parsing, for example, which it does extremely more efficiently than databases.
  • PDXPUG is an excellent help resource
  • Very active development community. I first saw @MagnusHagander quote this from a Percona discussion:
MySQL has a community. PostgreSQL is a community.

Another interesting point that came up after my presentation was Oracle's announcement that it would purchase MySQL. Is this a Pro or a Con for MySQL? Time will tell.
The final result of my presentation can be seen here (warning lots of geek-oriented material inside):



*Free is a relative term. My first car was a 1974 Ford Pinto station wagon. My step-dad gave it to me when I turned 16. At the time it had no compression in one cylinder and partial in another. I spent the greater part of a summer rebuilding that engine under the careful guidance of my boss at the gas station where I worked. Was the car free? Yes. Was it without cost? No. It cost me a lot of hours, bloody knuckles, and money for tooling and parts. It would have cost a heck of a lot more had I not had a generous boss who let me use his tools, draw on his expertise, and commandeer an empty bay when he could afford it.

You Can't Always Get What You Want

GEEK CONTENT: Low
SENTIMENTAL CONTENT: Medium

I recently had a conversation with my wife in which I said something along the lines of "I feel like a I've lost a large piece of me over the last few years."

What did I mean? What was I missing?

The part that loved to play basketball or racquetball with my buddies instead of watching TV. The part that used to meet my buddies in the park or at a gym a couple times a week and compare martial arts styles. The part that climbed mountains carrying everything he needed on his back. The part that took a break to admire the sheer silent beauty as he sipped the most wonderful water flowing off a glacier. The part that rode a bike down that mountain through mud and muck, hollering at the top of his lungs for sheer joy.

I don't mean to say that I've been held back or have had no exciting experiences. Our White-water rafting trips (though less frequent with the gas increases and strain on vacation time) and showboarding trips attest to that fact. What I mean is that for many reasons, mostly dealing with time and money, these are a much smaller part of my life than they were when I was, say at 22.

The difference has been brought to high relief recently by my increased lethargy and weight gain. Last winter I worked so hard to drop my weight to qualify for insurance. I was lifting weights and running three times a week. I had energy and felt alive. A year later now...

So we decided to invest in a gym membership and I vowed to start riding my bike to work again once daylight and work hours aligned so I wouldn't have to ride in the dark. Not that I distrust the drivers after dark, but... well yeah that's pretty much it. I am allergic to pain -- I break out in girlie sobs.

Fade in the scene to my living room Saturday evening a few weeks ago. I'm on the sofa reading "The Color of Magic" when a member of the bishopric arrives. After some discussion he asks me if I would be willing to serve as the Venture crew advisor for our scout troop. For those unfamiliar with Venture Scouting. It is a high-adventure arm of the Boy Scouts of America. This is the group that does things like rock climbing, outback camping, white-water sports, canyoneering, etc. In essence paragraph one above.

It does mean that I need to postpone my planned trip to Mexico at the end of April to conserve vacation for the Summer's activities, but fortunately I hadn't bought tickets yet.

The solutions to my melancholy that came to my mind were things like joining a martial arts school or getting ski passes or buying a raft (which means building a shed to hold it). None of these are financially viable now.

It's nice, sometimes, to know that somebody knows better than me. Sometimes the Rolling Stones get it right. "If you try sometimes you might find that you get what you need".

Sunday, December 7, 2008

Christmas Season Starts

Twas two weeks before Christmas and all through my bed not a sound disturbed the cobwebs in my head. My pillows were all propped up to cradle me with care in hopes that no urgent business soon would be there. Suddenly at the crack of 10am my wife informs me that it's time to get going on our Christmas preparations. After recovering from that traumatic awakening I managed to get my boots and hat on the right ends so we could start the Christmas season. This entailed retrieving the boxes (and boxes and boxes) of decorations from the Attic, a trek to the Christmas Tree farm, and the ever-challenging house light hanging ritual.

The children were all nestled all snug in their sweaters (except for my oldest daughter who was off to a Band competition) in hopes that their old man soon would get his lazy butt out of bed. I was down to 2/3 of my normal resources for cheap manual labor, but it would have to do. The boxes came down pretty easily. I even found the bag that had been concealing my wife's present from last year. Shhh don't tell her where my hiding spot is.

I was dressed all in cotton from my head to my foot and my clothes all devoid of ashes and soot. I retrieved rope, a saw, and my gloves (I hate getting sap all over my hands). Almost half as fast as eagles my chitlins they came and I whistled and shouted and called them by name. Then we dashed away dashed away dashed away all. We climbed in the van and took the 1/4 mile trip up Miller hill to a small, but well-stocked Christmas tree farm, where all the trees are just $10.

I immediately found this tree upon stepping out of the van:

It looked perfect to me. Nice symmetry. Just the right height, no holes. I left my string on it to cast my vote.

I should have known it would not be that quick and easy. We had to make sure there wasn't a better tree out there, so I shouldered the saw again and dutifully followed the others in search of a more perfect specimen.






After just a few minutes we found this one, which got another vote and the search was on in earnest. Now that we'd seen two quality trees we had to get the absolute best tree possible. So I made sure this tree was flagged visibly and followed along again, fingering the blade of my saw.

Two more high quality trees showed up in rapid succession. Each getting one vote. Now we had four options. It was time to make a decision. We did another round to each of the trees, taking pictures so we would not forget what the last looked like when it came time to compare them.

Strategies for hanging ornaments and the star came into play. Each tree had to pass the olfactory test.



There was heated debate. My tree was number 2 and went down in the first round of debates, but received an unexpected 11th hour resurgence. Trees were inspected for defects, excessive dead needles. Oh no, my youngest tried to sneak in a last minute contender.

We shot that idea down with extreme prejudice.

Finally we had a winner.

So I grabbed the saw and laid down under the tree in the work pants that my wife so pointedly made fun of that morning. I got a good grip on the saw and began the Paul Bunyon routine. Meanwhile the kids took turns balancing on the fallen trunk of another Christmas tree. Thanks to my manly muscles I felled that monster in 30 seconds flat.

After recruiting a bit of child labor to get the tree back to the van and tied down we were on our way home.

I decided to tackle the house lights before the tree since we were not quite ready to move the tree into the house. As the dry leaves before the wild hurricane fly was not anything like my ascent to the house-top.

I tossed up extension cords, boxes and bags of lights, and a handful of extra clips. I spoke not a word but went straight to my work. I pulled at the lights and gave them a jerk. Within no time I was elbow deep in the spaghetti that the gremlins make out of all Christmas tree lights after we stow them away with great care. I am convinced that the same person that invented the guillotine and the rack invented those icicle lights. Not only do you have the long strand every set of lights has, but you have extra lengths from 4 - 12 inches long that manage to tangle themselves around everything in sight -- including themselves.

My only consolation was the smug knowledge that my unfairly defamed work pants came in amazingly handy in keeping my extra clips, leaving both hands free to struggle with the lights and my tongue free to offer encouraging French phrases towards them to cow them into submission.

I also had the satisfaction of throwing each empty box off the roof once I had finally rid them of their mess of lights. Something very satisfying about seeing your mortal enemies fly through the air to land ten feet below you.

I really did wish I had that Rose Suchak Ladder when I realized I had forgotten a box of the lights. Finally they were all in place, connected, and ready to fire up. And laying a finger aside of my nose and giving a nod I scratched that itch that had been bothering me while clambering down from the roof.

I flipped on the power and viola! they lights did not all turn on. I practiced speaking in tongues a little more as I discovered that these lights are designed with two different sizes of light bulbs. I would need to take a trip to the store and find some replacements. Now I know why people lay out their lights and plug them in before they hang them all along the house.

Oh well. On to the next project. Lights along the pathway. I stole some stakes from our pup tent and got the rope lights secured in much less time than the others had taken. By this time it was the tree's turn. I hacked off a few inches from the bottom of the tree to give it a clean cut for soaking up water. I grabbed a hammer and drove the spikes on the tree holder into the trunk, and carried the whole thing into the house.

After recruiting some help from my aforementioned child labor (one of which was now home from her competition) the tree was in place, straight, and filled with water. This was done in just the right way as to show my wife that it didn't belong in front of the window, but in the opposite corner of the room when she returned.

I left the tree and headed out to perform the last lawn mowing of the season so I could drain the mower of gas and prevent another carborator rebuild in the spring. It took a bit longer than I expected to drain it, so I finished the entire lawn and half of the field behind the house before it sputtered its last.

I settled in for a cold one (of the caffeinated kind), thinking my part was done. After my wife's revelation about the tree position I returned to the front room. A few moments later the front room was dismantled with the furniture stacked out of the way and we dragged the tree (full base of water and all) accross to its new resting place. A bit more maneuvering and the tree now faced the right direction.

After a trip to the store for more lights and replacement bulbs I was left with only two sections of icicles still not lit up outside, but enough lights to cover the tree. And the tree did look better in the other corner. We decided to hold off on the rest of the decorations.

All that was left to do at that point was to tease the cat with a bit of string leftover from tree marking.



Once the cat and I were both exhausted it was time to call it a day.

I slumped to my sofa with a wheezing whistle and away flew my energy like the down of a thistle. And I swear I heard as I drifted off to sleep "can you take out the recycling and the garbage, please?"






Monday, November 3, 2008

Unexpected Treasure

I found a treasure trove tonight. I was cruising around Facebook and discovered a post on Jackie Chan's page, advertising his newly remodeled official web page. I have loved Jackie Chan for years since long before I studied Kung-Fu myself. I love the old classic Chan movies -- The ones with the 20 minute fight scenes and horribly dubbed voice-overs. I love seeing him with a young (and skinny) Sammo Hung and even his appearance as the crazy subaru driver in Canonball Run. I admire his skill as a martial artist, I am in awe of his self-deprecating sense of humor in the face of all his success. I dream of joining his troupe of expert martial arts stunt men.

I wandered over to his new site hoping to find pictures, video clips, perhaps a press release or two. What I found, though, was his online diary! This stuff is great. It's such a free, mostly unfiltered look into his daily experiences.

I laughed out loud (earning a disgruntled noise as I disrupted my oldest daughter's Manga book) as I read about his first time checking luggage with a laptop last week. I guess he is known among his friends as being as far from techie as possible, so they all doubled over laughing when he showed them the laptop.

He talks openly about the time he spends with his dogs and cats, the tedium of all day meetings, and the help his friends and staff give him to keep up with his hectic schedule. He discribed how often he gets pulled over by police so they can shake his hand and take a few pictures. (I should have been a police officer!) I must say I wrongly envisioned him spending most of his days in a gymn or preferably out in a pine grove practicing his Kung-Fu. This candid view of his thoughts and experiences is so refreshing, though.

It turns out he's in New Mexico filming a new movie for the next couple months. I dreamed of taking a road trip to visit my brother there and "accidentally" bumping into Jackie Chan.

Apparently Jackie has been doing this online journal for a very long time. I see entries dating back to June of 2005. I can't believe I didn't discover this long ago. In any case, I know what my spare time will be spent reading for the net few days.

Monday, October 13, 2008

Never get involved in a land war in Asia...

From The Princess Bride:
Ha ha! You fool! You fell victim to one of the classic blunders! The most famous is never get involved in a land war in Asia, but only slightly less well-known is this: never go in against a Sicilian when death is on the line!

I propose that the next classic blunder is the holy war called Language Standardization. I am on a committee at work to evaluate programming languages, Libraries, and Development platforms to determine which get the official stamp of approval for our team to use. I agree there is great merit in having a limited number of software tools to support. The alternative is a morass of unmaintainable widgets written with whatever utility or language struck the individual's fancy at the time. The ensuing spaghetti code becomes what is often referred to as "Write only" code because it is impossible to figure out how it works by reading it.

That said the effort of creating said standard is a philosophical landmine that rivals The Crusades in its fanatical implications. Just try getting a Ruby programmer in the same room as a C# programmer and you will see the fireworks start flying. Nothing is sacred in these battles as Cross-platform compatibility, centralized support, flexibility or efficiency of expression, or even the personal quirks of the original designers are bandied about as evidence of our chosen tool's superiority. Nowhere can a team of intelligent, experienced engineers descend into kindergarten bickering so fast as when their pet language is on the chopping block.

I must admit a certain morbid fascination with the whole process. I have always been a bit of a generalist in regards to IT and Software Engineering, so I have no especial attachment to any particular option. I like the ease with which Visual Studio allows C# and Windows development to happen. I like the ease with which my Perl, Python, or Java code runs on Windows, Linux, or Mac. I curse Microsoft and Postgres equally depending on which asinine implementation I must work with at the moment.

Unfortunately this means I don't have a lot of in depth information to add to the discussion. I think it uniquely places me in a position to fairly weigh the arguments of my colleagues as they present the best about their personal bias.

What will we decide?

I don't know, but I plan to enjoy the debate much more than anything the presidential candidates or WWF can come up with.

Sunday, October 12, 2008

Why I like Fry's

Fry's Electronics is mostly a West USA phenomenon, though apparently they have a few stores in Illinois, Indiana, and Georgia. It is often referred to as Disneyland for geeks. They carry everything you could want for your computer, rows upon rows of other electronics and appliances, games, movies...

Fry's has been criticized from time to time for their mediocre customer service, highly targeted advertising (including suing people that post pictures of their newspaper ads online), and convoluted rebate processes. They were extremely late entering the game with the Frys Online website, having to buy the domain name once they finally decided to create a page. Considering their target market that last is probably a near-deal-breaking point. A significant portion of Fry's inventory appears to be returned or refurbished items (I have contributed to those returns probably 1/3 of the time I purchased from Fry's).

I must say that for most of my computer component purchases I will research using Pricewatch and often buy from a local group, such as ENU.

Why, then do I love Fry's so much, then?

1) Eye candy!

I love browsing the aisles and seeing what new toys are available. I should clarify that "toy" in my vocabulary might just as easily include a Surround Sound speaker set, Big screen TV or Wi-Fi sensing keychain as it would a new Wii game or Radio-controlled helicopter. Fry's has no end of product displays to start any geek salivating.

In addition to the products, there are always the themes in certain stores. Our Portland store is pretty boring, but I love hitting one of the themed stores when I travel to California.



Whether it be the Mayan temple in San Jose.







The Alice in Wonderland themed one in Woodland Hills




The Alien Invasion themed one in Burbank









Or the City of Industry store










Each offers a fun distraction while you peruse the latest gadgets.

2) Special Deals

Every so often Fry's has unbeatable deals. My favorite is the paper special they do every couple months. 1 ream for $.99. When this is on I give each kid a dollar and hit a different cashier. This is a trick I remember my mother doing with us on Safeway deals growing up.

3) Free "rental" program

My friend Jon mentioned this one to me and I thought it was a stroke of genius. Not sure whether you are ready to buy that new widget? Is your thingamajig being repaired? Try Fry's free rental program. Since Fry's has so many returns their return policy is wonderfully simple. Return it within the given time for any reason and you get a full refund. As long as you take care of the item and keep all the packing material, manuals, and pieces this offers a great way to try before you buy. Thank you, Jon, for the inspiration!

So no I don't buy all my stuff from there and no I don't always trust their pricing, but I still love trips to Fry's whenever I am in the neighborhood. My car regularly experiences a mysterious pull to the right as we near the Wilsonville offramp. If you have a Fry's nearby, especially a themed one, I strongly recommend a trip. If not, I'll take you to mine the next time you are in town.