Development GuRu

Saturday, July 18, 2009

You may be wondering, what is the most popular car color? For seven years, silver was the most popular car color. It was seen as both a high-tech color and one that was safe for resell—not as many people would be turned off by a silver car as would be turned off by, say, a green car.

Buyers in 2007, however, broke the mold by buying more white cars than cars in any other color. Why? Well, it’s been said that a high-tech color like silver isn’t popular anymore. I disagree. I don’t think silver is a high-tech color anymore. Looking at the popularity of iPods, iPhones and other Apple products, I’d say white is going to be the color of technology for some time.

In 2007, nineteen percent of cars manufactured were white. Twenty-two percent of luxury cars were white. Eighteen percent of all cars were silver and sixteen percent were black.

Of course, given years of popularity, silver cars will still outnumber autos of other colors for awhile.

The word wine has its root from the ancient Greek word for vines, vinos. Grapevines produces lush grapes which are then fermented to create the popular yet sophisticated alcoholic drink we know as wine. In many areas, the English word wine and its synonyms in different languages are protected by law, as other beverages similar to wine can be produced from fruits, rice, flowers and honey.

At the highest end, rare, super-expensive wines are often the costliest item on the menu, and exceptional vintages from the best vineyards may sell for thousands of dollars per bottle. Expensive red wines with their complex subtleties are traditionally more costly than other expensive wines.

Here are the most expensive wines in the world.

1992 Screaming Eaglearound $80,000

At Auction Napa Valley 2008, a charity event, a lot of six magnums of Screaming Eagle were sold for $500,000. In addition to the wine, the lot included a dinner at the winery. The lucky purchaser was Chase Bailey, an executive at Cisco Systems.

1945 Chateau Mouton-Rothschild Jeroboam$114,614

Sold to an anonymous buyer at a Christie’s auction in 1997, this bottle comes from what is considered by wine enthusiasts to be one of the finest vintages of the 20th century.

“Th.J” 1787 Chateau Lafitte$160,000

A bottle of 1787 Chateau Lafitte which sold at Christie’s London in December of 1985, this wine was originally reported to be from the cellar of Thomas Jefferson, the former US President, and this most expensive bottle of wine had the initials Th.J etched into the glass bottle. It made its way into the hands of American tycoon Bill Koch, who became suspicious of the origins of the four bottles he had purchased. Eventually, he instigated the investigation that debunked the supposed origin of what was, at the time of purchase, the most expensive wine in the world.

Shipwrecked 1907 Heidsieck$275,000

These hundred year old bottles of Champagne from the Heidsieck vineyard in Champagne took over eighty years to reach their destination. Shipped to the Russian Imperial family in 1916, a shipwreck off the coast of Finland caused this champagne to be lost at sea until divers discovered over 200 bottles in 1997. Now they’re finally being sold—to wealthy guests at the Ritz-Carlton hotel in Moscow, at least. Of course, the wine’s extraordinary tale and incredible age are what makes it the world’s most expensive wine.

This will open a tunnel, listening on localhost:3307 and forwarding everything to mysqlserver:3306, and doing it all via the ssh service on the gateway machine.

This example shows us specifying port 3307 on the local end of the tunnel; I did this because I run a MySQL server on my home machine, so I can't re-use the default MySQL port.

You'll now have a terminal open on the gateway machine, but you don't need it for this procedure, so set it aside.

Now, on your local machine, execute a mysql connection like so:

mysql -u username -p -h 127.0.0.1 -P 3307 databasename

In other words, mysql thinks it's connecting to localhost, but on a different port. In fact, the connection is being made securely to the remote mysql server, via the gateway machine and the local "mouth" of the ssh tunnel on your own machine.

Friday, July 17, 2009

The MySQL Optimize Table command will effectively de-fragment a mysql table and is very useful for tables which are frequently updated and/or deleted.

Example:

We have a table called articles which has many thousands of rows which are often inserted, updated and deleted. We can see from the table description below that the table contains variable length column data types:

This has the effect of defragmenting the table and reducing the size of the table on disk down to 105MB. It also has a very positive affect on query performance, reducing the select query response time from 0.63 to 0.39 seconds. N.B. the mysql query cache was turned off to demonstrate.