Friday, September 18, 2009

Are you a User or a Consumer?

One of my favorite quotes is, "There are only 10 types of people in the world: Those who understand binary, and those who don't" (ThinkGeek) It seems we have a common tendency to divide ourselves into groups. This lets us easily compare and contrast our tendencies with others. I propose yet another way to divide people: Users and Consumers.

What is a User?
You know the type. They see something useful in everything around them, even if it was never intended to be used that way. These people are the ones that answer, "Why yes I have a Dingle-Hopper. Did you need a right or left-handed one?" Then rummage through a pile of dusty parts until they find it.

Users collect stuff on the off chance that they will need it later. Old bike parts, plumbing pieces or lumber stacked along the driveway, even useful chunks of code saved off on floppies in case they ever need to write a program in ML again. Each new project a User takes on moves them slightly ahead because they can cut costs by using things they've already accumulated and because the extra materials from this new work adds back into the stockpile for future projects.

MacGyver is the ultimate User. Give him a stick of gum, a paper clip, and a bullet and he can solve any problem.

Users follow the addage to "Use, Repair, and Reuse". These people are tinkerers. The question of why they would want to learn how to fix some rusty old piece of junk never crosses their mind. They often "color outside the lines", espousing creativity over convention.

What is a Consumer?
Consumers live streamlined lives with no room for waste. Any extraneous habits or items are discarded or donated. "If you haven't used it in the last six months (or year or two years) you don't need to keep it around." Consumers would rather buy a $10 item every three years rather than waste the valuable space it takes to store it in the interim.

Comsumers live by the rule of specialization. If another can do a skill faster and more efficiently than Consumer then they will let the other do it and dedicate their own efforts to those things at which they excel." Adam Smith (The Wealth of Nations, 1776) would be proud of these driven, focused people. Capitalism seems to urge people towards a consumer mentality.

Consumers feel comfortable by the structure their way of life brings, but have a difficult time "thinking outside the box" when a new challenge comes around. Their initial reaction is to seek a new specialist for the situation. As a large group Consumers support themselves, but individually they are vulnerable. Their inter-dependence is both their strength and their weakness.

The world needs both Consumers and Users. Each has their place, though they often chafe at the other group's attitudes.

So which are you?

Wednesday, June 3, 2009

.XXX domain for internet porn sites

I saw a group today trying to drum up support for a new Top Level Domain (TLD). For readers not familiar with this term a TLD is the top level grouping of a set of internet addresses. Some others are:
  • .COM - Generally thought as the default TLD this was intended for commercial purposes.
  • .NET - This generally includes domains whose function deals with communication, such as Internet Service Providers (ISP).
  • .ORG - These would be community addresses, such as charity organizations or not-for-profit efforts.
  • .EDU - These are educational addresses
  • .GOV - US Government sites.
There are TLDs for different countries, as well:
  • .UK - United Kingdom
  • .CA - Canadia (lol)
The Internet Corporation for Assigned Names and Numbers (ICANN) is the organization that keeps track of which TLDs exist and what their stated purpose is. They have been petitioned a few times to create a .XXX TLD, most recently the board discussed and rejected the request on 20 March, 2007. You can read their Meeting Notes to see the specific arguments affecting their decision.

Their reasons for rejecting the petition echo my own thoughts when I initially heard about this effort. Here are a few of my concerns

1) Who will be in charge of policing this policy?
- US vs International entities
It is easy for us to forget that the Internet is an international entity. No single government controls its functions, though many governments have laws regarding the manner in which its citizens are allowed to use Internet content. This means that while my kingdom of Topheria may consider the use of "coke" and "delicious" in the same sentence as grounds for public flogging, the United States has no such law. Who is to say that CokeLovers.com, which was created by somebody in Ukraine should or should not change their content because it offends me?

- Manpower to search the Internet for adult content.
The Internet is not a single entity. It is the sum of every individual that puts any content on any networked computer anywhere in the world. the Transmission Control Protocol / Inter networking Protocol (TCP/IP) was designed to allow an arbitrarily large number of computers to "talk to each other" and it is used by a plethora of computers now. My laptop, on which I test my web page code is just as much the Internet as Google's data center up the Colombia Gorge. Who is going to hire and support the army of billions it will take to inventory every piece of information on every computer that ever connects to any other computer via TCP/IP?

2) How will we define the types of content that belong in this TLD?
- Nudity?
Perhaps the most difficult part of this idea is determining what exactly is "Adult Content" (AKA Pornography). Is nudity pornography? How much exposure is required before somebody is considered nude? Some people believe it is indecent for a woman to show her ankles or even her face in public. Others believe it is perfectly acceptable to wear only a loin cloth. Who gets to decide for every web site in the world what percentage of visible skin is considered nude?

For argument's sake let's say that nudity means that the person in question is wearing absolutely no clothes at all. Many museums and art galleries must now move their internet content to this .XXX domain. Most of Michelangelo's most recognizable works include people wearing no clothing at all. It looks like the Vatican will have to move their Sistine Chapel site now.

- Audio / Text content?
Perhaps we are missing an important set of content here. Adult content can be transmitted with words and sound files, too. Should we consider anything that has anatomical references subject to this new TLD? What about educational content, such as medical in formation about Venerial Disease? What about clothing advertisements that cover those areas of the body? Does my wife need to now go to a .XXX domain in order to find out if the new bra she heard about has better support than the one she currently uses?

How about the unexpected side effects of global content? One word may be perfectly acceptable in one country but extremely vulgar in another. Perhaps the words sound identical but have completely different meanings in different languages. Perhaps a word was considered vulgar 100 years ago but is commonplace now or vice versa. Who will determine the context within which this content is categorized

- Is sexual content the defining criteria?
Often this type of discussion fixates on sexual content, making it synonymous with "Adult Content". If we are interested in filtering inappropriate connect from our children (or ourselves) then what about violence? What about content that promotes hatred and prejudice or illicit drug use? Aren't those just as offensive and damaging as sexual references?

- Degree of separation?
There are obviously extremes that are easily classified. Some Internet sites are clearly intended to deliver prurient content, while others are clearly intended to deliver completely benign content. with only two classifications available (.XXX or everything else), it's the area in between those extremes that become very difficult. We simply cannot meet the needs of the general population if our only options are black and white.

My solution
The left-brained part of me agrees It would be nice to have a simple way to categorize Internet content I consider offensive. I would love to filter it with a single button. I simply don't see this proposal as a comprehensive solution. The sites that would register themselves under the new TLD are already identifying themselves in such a way that existing products, such as Cyber Patrol or Net Nanny already filter them. why go through the expense and effort of re-inventing something that already works as well as the new one would?

The best way to protect our children, IMNSHO (In My Not So Humble Opinion), is to educate them. We cannot always shelter them from the existence of offensive or inappropriate material. This becomes painfully obvious by spending a few hours in public. I regularly experience R-rated life from the basketball court next to my daughter's soccer practices. Adult themes often play out in the mall. Should I lock my kids up in the house so they never have to experience such things?

No I should teach them proper boundaries, teach them how to appropriately react when confronted with people exceeding these boundaries, and practice the very same habits myself that I want my kids to learn. When they stumble onto a website, book, television show, or conversation that is offensive to their sensibilities they need the ability to close it, change it, leave. Simply sheltering them from the existence of such things will cause either curiosity or paralysis when they are inevitably confronted with it.

When they encounter predatory behavior in any of these topics (be it harassment, drug dealers, or whatever) they need the ability to protect themselves and report the behavior. Pretending such things don't exist will not stop predators from appearing. It simply adds to the tally of available victims.

This is how we protect our children. Teach them. We arm them with skills and knowledge. We show them by our own examples

Tuesday, June 2, 2009

All that is necessary for evil to Triumph... Part 2

Following up on my last post let's move on to Mitt Romney's statement:
"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."

Let's avoid the current hotbed of the Middle East and take a brief tour of the Caribbean.

I mentioned the Spanish-American War of 1889 in my previous post. This might easily fall into Romney's category of "freeing nations from dictators". Cuba, Puerto Rico, Guam, and the Philippines were Spanish colonies. Any cursory reading of the US Revolutionary War is sufficient to show that colonies are bad. Colonies are exploited by the colonizing nation and should be free. So the US determined to gree these island nations from Spain. In turn these became US Territories, which they remain with the exception of Cuba.

What is a Territory?
U.S. Territory. The term U.S. Territory means the Virgin Islands, Guam, American Samoa, the Commonwealth of the Northern Mariana Islands, and Palau, until the Compact of Free Association with Palau is ratified.
Some time I would like to get a more detailed explanation of the differences between States and Territories, but as I understand it a territory is controlled by the US, but lacks elected representation on Capitol Hill. They may or may not have taxes and their governments are always subject to US approval. Hm. This sounds suspiciously like a colony.

So how has being a US Territory helped Cuba?

Cuba:
  • 1898 US takes control of Cuba, Puerto Rico, Guam, and the Philippines from Spain via Spanish-American War.
  • 1901 Platt Amendment declares undisputed US right to intervene in Cuba. This caused an awful lot of discontent across Cuba, where people did not want foreigners that didn't even speak their own language to syphon off their resources and change the way they live. Wait a minute, is this 1900's Cuba or 2000's California? Hm...
  • The next 50 years saw a series of US-backed leaders, both from elections and from military coups. Batista being one of the most consistent figures. These governments were rife with corruption and alternatively recriminated their opponents' excesses and restricted the freedoms of the general populace.
  • 1953 Fidel Castro, who had worked with Batista and other political leaders becomes disgusted with the rampant corruption in the government and begins his revolution.
    Castro implements his idea of a socialist government, though remains as a de facto tyrant. He suspends due process, freedom of speech, property rights. He also implements mandatory military service and education, leading to a 90% literacy rate in the nation today.
  • 1961 Bay of Pigs: Kennedy's failed attempt to overthrow Castro's government with US-trained and backed Cuban exiles.
  • Embargo, Cuban Missile Crisis, Cuba / Soviet Union relations, Etc.
So Cuba didn't fare so well as a US Territory. What about some of the other sovereign nations, Those that liberated themselves from Spain without any US aid or obligation?

Panama:
Panama was part of the nation of Colombia (and Nueva Granada) after Simon Bolivar liberated it from Spain. This was done without any help from Washington DC, though it was solicited at the time. The US decided to stand back and see who would come out on top rather than risk angering Spain by aiding a neighboring colony. Panama also happens to contain the narrowest strip of land between the Pacific and the Caribbean. For centuries ships docked at either end of this land and paid mule teams or trains to pack their stuff over the mountains to avoid the time and danger of sailing all the way around South America.

Many international businessman had their eye on building a canal across Panama, but several attempts failed due to the harsh geography and malaria. In 1903 US Secretary of State John M. Hay tried unsuccessfully to get a 99 year lease to the canal zone from Colombia. When the Colombian government refused the US "happened" to hear about a disgruntled Colombian that was interested in liberating Panama. The US coincidentally sent a couple large ships into the area "on exercises" at the very time this revolt happened. The US formally recognized the new country three days later and Phillipe Bunau-Varilla (Chief Engineer of the French canal company and newly appointed ambassador from Panama to the US) signed the agreement that the US was unable to do previously.

The Canal was completed, though the locals saw very little benefit from it. The workers were shipped over from the West Indies because they spoke English and the US engineers could not be bothered to learn Spanish so the locals could work on the project. After the canal was completed tens of thousands of English-speaking West Indies natives were left for Panama to deal with.

The glut of labor caused severe depression and massive poverty among the general populace, though the new elite benefited richly from their association with the US efforts.

Rutgers has put together a fairly comprehensive Timeline of US Intervention in Panama. Anyone that thinks Panama was an unsullied American success needs to review it.

Nicaragua:
Nicaragua endured years of tyranny until Daniel Ortega (leading the FSLN) overthrew the government with the help of the military. Like many of its neighbors, Nicaragua suffered from extreme social stratification. The few elite controlled nearly all of the nation's arable land and reaped riches by leasing the land to foreign fruit companies. Ortega enacted many reforms to bring basic rights to the nation. Rights we take for granted in the US, such as due process and access to land (90% of which was controlled by 10% of the population). In 1981 Reagan branded Ortega a Marxist for his efforts, but in 1984 Ortega was democratically elected by his people, capturing 63% of the vote.

Reagan and his cronies decided it was time to replace this government so they sold weapons to Iran to raise funds for backing guerrilla 'Contra' groups to overthrow Ortega. The Tower commission appointed by US Congress to investigate the issue, leading to many convictions of criminal acts (including Oliver North). Most of those convicted were pardoned by Reagan or George HW Bush and reinstated. Reagan managed to evade impeachment because though they hinted that Reagan kind of knew and would have approved, he did not directly order his underlings to do these sales.

The UN International Court of Justice tried the US and found it guilty of numerous wrongs, but the US refused to accept the court's authority. Here are a few notable findings:
  • By twelve votes to three: Decides that the United States of America, by training, arming, equipping, financing and supplying the contra forces or otherwise encouraging, supporting and aiding military and paramilitary activities in and against Nicaragua, has acted, against the Republic of Nicaragua, in breach of its obligation under customary international law not to intervene in the affairs of another State;
  • By fourteen votes to one:Decides that, by the acts referred to in subparagraph (6) hereof the United States of America has acted, against the Republic of Nicaragua, in breach of its obligations under Article XIX of the Treaty of Friendship, Commerce and Navigation between the United States of America and the Republic of Nicaragua signed at Managua on 21 January 1956;
  • By fourteen votes to one: Finds that the United States of America, by producing in 1983 a manual entitled Operaciones sicológicas en guerra de guerrillas, and disseminating it to contra forces, has encouraged the commission by them of acts contrary to general principles of humanitarian law;
  • By twelve votes to three: Decides that the United States of America, by the attacks on Nicaraguan territory referred to in subparagraph (4) hereof, and by declaring a general embargo on trade with Nicaragua on 1 May 1985, has acted in breach of its obligations under Article XIX of the Treaty of Friendship, Commerce and Navigation between the Parties signed at Managua on 21 January 1956;
It amazes me how quickly the US public has managed to forget these things. The countryside was ravaged by war for years because of Reagan's campaign against Ortega. Entire villages were decimated; peaceful people accused of government collaboration and murdered. Ironically this situation is not just a "past mistake". George Washington University has assembled a surprising overview of Iran-Contra ties today.


Guatemala:
Now it is true that the US did not install a dictator in Nicaragua, so Mr. Romney might be technically proven correct there. The case of Guatemala completely destroys his argument, though. Here the nation's elite (5% of the population) had allowed foreign companies like the United Fruit Company in the US to control 90% of the arable land in the nation. This means that 90-95% of the people had neither the ability to raise their own food as the had done for generations nor access to support themselves any other way. These people were rounded up and compelled to work on foreign-controlled fruit plantations in inhumane work conditions, often paying back half of their wages for the right to stay in plantation barracks while they worked.

In 1945 Juan Jose Arevalo was democratically elected president and was democratically succeeded by Jacobo Arbenz. Both attempted to enact land reform and basic human rights for the unlanded poor. His plan was to revoke the contracts granted to the UFC on land that they were not using and to divvy that land out to the poor so they could return to subsistence farming. The UFC sent representatives to Capitol Hill, complaining about a communist incursion in Central America.

The official record from State.gov tells us what happened next:
"U.S.-backed group led by Col. Carlos Castillo Armas invaded the country from Honduras in 1954 and quickly took over the government. Gen. Miguel Ydigoras Fuentes took power in 1958 following the murder of Colonel Castillo Armas."

Armas began more than thirty years of bloody dictatorships, backed by CIA money and US military. Tens of thousands of Guatemalans became Desaparecidos. This term refers to those who simply disappear. They are sometimes taken to prison. Sometimes they are killed outright and left in the jungle. These atrocities are well-documented, though generally ignored by the general US public.

In 1992 On the eve of the 150th anniversary of Columbus's journey to the new world Rigoberta Menchu was awarded Nobel prize for her efforts to document the true plight of the native peoples in Central America. She learned Spanish, since her native language was Quechua, in order to publish her story to the outside world. To anyone interested in the actual situation of the poor in Guatemala I strongly recommend her book Me Llamo Rigoberta Menchu (I, Rigoberta Menchu in English).

This era of US intervention is criminally cruel. We overthrew a peaceful, democratically-elected government whose sole crime was to purge its nation of the extreme abuse and tyranny that had plagued it for generations. In its place we directly instituted and supported dictators of the worst sort. The government of Guatemala is still plagued by corruption and violence. Would Arevalo and Arbenz have successfully brought the population of Guatemala to anywhere near the standard of life that the poorest sectors of the US enjoy? I don't know, but I do know that they had zero chance with US weapons, soldiers, and money stacked against them.

El Salvador:
From colonial times until the 1970s a very small group (approximately a dozen Criollo/Mestizo families) ruled El Salvador and controlled 100% of the land and money. tens of thousands of native inhabitants relied on subsistence farming and government neglect (not asserting their ownership of arable land) to survive. After the travesties of US policy in Guatemala and Nicaragua during the 40s and 50s and with the rise of the Soviet Union, the United States became ever more paranoid about "Marxist movements" in Latin America.

A civil war broke out in El Salvador as natural consequence of the higly stratified population. The few ruling parties relied on monopolizing income from leasing arable land to foreign fruit companies to support them. When commodity prices dropped they tried to pass on the pressure to the other 99% of the population who lived barely above starvation levels. General revolt ensued which the ruling families labeled "Communist Uprising" and received hundreds of millions in money and weapons from the US.

During to the carnage that ensued thousands were murdered and half a million Salvadorans fled the violence to the US. Note that none of these refugees were afforded the same asylum granted to Cambodians fleeing the Khmer Rouge or Cubans fleeing Castro because the government dictators killing and raping them were the "Good guys".

Now the US holds discussions about how best to get rid of all these illegal aliens. We complain that our schools and social services are being overrun by them. We claim that just because they can't earn a livable wage in their country doesn't make it our responsibility to support them here.

Here's a visual for you. If we set off a nuclear bomb in Vancouver, BC. Does it make sense for us to complain about the nuclear fallout that drifts over our border? The US was directly responsible for decimating thousands upon thousands of people in El Salvador, Guatemala, and Nicaragua (I haven't even touched on Argentina, the Dominican Republic, Puerto Rico or Brazil). Now we complain about the few survivors that made it through the destruction to seek some kind of peaceful existence in the US.

So Mr Romney.

"I take issue with President Obama's recent tour of apology," Romney said. "It's not because America hasn't made mistakes -- we have -- but because America's mistakes are overwhelmed by what America has meant to the hopes and aspirations of people throughout the world."

Obama has expressed regret while traveling abroad for America's leadership failures and other past conduct.

-Fox News

You need to pick your battles better. Anyone having gone through AA can tell you that the first step in recovery is admitting you have a problem. That said Obama appears to be one step ahead of you in this regard. It's time we admitted our mistakes and began the process of changing our actions to meet our stated beliefs.

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?"