Archive for July, 2008

7/26/2008: 11:21 pm: RobertFood and Drink, Oakland

Linden Street Brewery in Oakland has been throwing open houses on every Friday for the last 6 months or so, with free beer (two beers, usually their Common Lager and a beer from Drake’s), free food (contributions to the basket by the taps help buy next week’s food), and a shared gas grill (my friends and I have used it for bratwurst and tri-tip). It’s gotten to be too much, so William Brand reports on his blog that Adam says they are scaling back to just the first Friday.

Although being able to go there on any Friday was great, I had been wondering how long they could keep it up. I usually made it only once a month anyway due to other plans, so I’ll just have to plan farther in advance.

While I am thrilled they have finished brewing a batch of Black Bottom Lager, I’m even more excited that the city will be inspecting their equipment very soon, possibly this coming week. Hopefully, that will lead to PG&E hooking them up with gas to run the brewery.

7/25/2008: 10:09 pm: RobertMySQL

Today I needed to make the same kind of update to a field in a few rows of a large database table. There were too many rows to do it with a separate SQL update statement per row, so I hunted down the MySQL REPLACE function. Okay, it was only 6 rows, but I needed to make the same change in a dev, QA and production database. The example in the documentation is pretty trivial, but it wasn’t too hard to expand it to conditionally replace the substring.

mysql> help replace;
Name: 'REPLACE'
Description:
Syntax:
REPLACE(str,from_str,to_str)

Returns the string str with all occurrences of the string from_str
replaced by the string to_str. REPLACE() performs a case-sensitive
match when searching for from_str.

URL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html

Examples:
mysql> SELECT REPLACE('www.mysql.com', 'w', 'Ww');
        -> 'WwWwWw.mysql.com'

The UPDATE query below is pretty similar to what I needed to do, i.e., remove some characters from the end of a varchar column. The LIKE clause I’ve used in the query ensures that “cruft” is replaced only if it appears at the end of the string.

mysql> CREATE TABLE tbl (col varchar(20));
Query OK, 0 rows affected (0.41 sec)

mysql> INSERT INTO tbl VALUES ('cruft_front'), ('some_cruft_in_middle'), ('end_cruft');
Query OK, 3 rows affected (0.00 sec)
Records: 3  Duplicates: 0  Warnings: 0

mysql> UPDATE tbl SET col = REPLACE(col_name, 'cruft', '') WHERE col LIKE '%cruft';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> select * from tbl;
+----------------------+
| col                  |
+----------------------+
| cruft_front          |
| some_cruft_in_middle |
| end_                 |
+----------------------+
3 rows in set (0.00 sec)
7/22/2008: 8:37 pm: RobertHurricane Katrina, Python

While analyzing a bunch of US Census data at work to build out an even more comprehensive geographical database for Voxify’s speech apps, I ran into an unexpected error. I wrote a Python script to parse a CSV file that contains population data from 2000 and estimates for 2001-2007. The code extracted the data I was interested in, cleaned it up to remove extraneous data and inserted it into a MySQL database. But, my program got an error when it was inserting the population data for Bay St. Louis, Mississippi.

Apparently, the US Census team was so uncertain of the post Katrina population in Bay St. Louis they used a “Z” in place of a number for 2006 and 2007. They did the same for Pass Christian, Long Beach and Waveland. So then I decided to look at their estimates for nearby cities.

City 2005 2006 2007
Biloxi 50,614 44,624 44,292
Gulfport 73,340 65,296 66,271
D’Iberville 8267 7285 7423
Ocean Springs 17,573 16,813 17,246
New Orleans 453,726 210,198 239,124

The population decrease in New Orleans has been written about quite a bit, but it is still startling to see the numbers next to each other. I don’t remember seeing population data for the Mississippi coastal cities.

I had been looking for an excuse to play around with the Google Charts API. Here’s a graph of the population decreases for some of the cities.

Population decrease for Gulfport, Biloxi, and Ocean Springs

7/20/2008: 6:32 pm: RobertBicycling

Yesterday I rode the 60-mile route of the 2008 Healdsburg Harvest Century bike tour. Some friends and I did it at a very leisurely pace, finishing in a little over 4 hours, which included 20-30 minutes hanging out at the rest stops shoving down piles of food. Or at least I was doing that. The hills were short and not steep at all, so it was a pretty easy ride. Traffic was bad only in a few spots.

I did see the aftermath of two accidents just after the rest stop at West Side school. The road there was in especially bad shape. One person crashed on the descent and got some minor cuts and bruises. While the EMTs were treating that person, someone else crashed in almost the same spot. She looked very stunned while sitting by the side of the road being treated. The EMT said her injuries were fairly minor, too. I hope they both were okay, since that is a sucky way to end a ride, which I know from experience.

The food at the rest stops was extensive and tasty (melon, oranges, grapes, bananas, pretzels, cookies, Odwalla energy bars, PB&Js on wheat, etc.). Lunch included delicious veggie pizza, pasta salad, black bean salad, sparkling juice drinks from Sonoma Sparkler, ice cream sundaes from Clover, and lots more. At first, I thought I must have put on weight due to all the food I ate, but I ended up breaking even.

: 2:25 pm: RobertFood and Drink

Going Belgian

Love this cartoon by Ben Sargent on the InBev acquisition of Anheuser-Busch. Over the last few months I’ve turned on quite a few friends to the rich and varied aroma and flavors of Belgian beers. Although it’s just a cartoon, I agree with William that you obviously shouldn’t stereotype the palette of a person based on their appearance. I’ve met plenty of people whose appearance belies their appreciation for food and drink of complex flavors. And, of course, many highly sophisticated people who are content with rarely straying from the bland likes of fast food, Coke, Pepsi, Bud and Corona.

Via William Brand’s blog via Jay Brook’s blog.

7/13/2008: 11:01 pm: RobertArts and Education, Food and Drink, Oakland, Reviews

Last Friday my wife and I celebrated our 15th anniversary by going to Linden Street Brewery for their Friday afternoon open house and then the Oakland Museum of California for the Best of the East Bay party. Both were excellent. Some of our friends brought a penne pasta salad with fresh-grated parmesan and grilled tri-tip on the Linden Street grill.

The Best of the East Bay party blew me away. It’s estimated that over 4,000 people attended. There were four stages with live bands playing all night. Lots of delicious foods and drinks (I enjoyed a very nice macchiato from Julie’s Coffee & Tea Garden) were available. The whole museum, except the parts they are refurbishing, was open. There was a mini skateboard park with ramps just below the sculpture gardens. Splash Circus was there with a roughly 35-feet tall tripod from which girls were performing acrobatics on ropes and fabric, a la Cirque du Soleil. Kid’s band performances, a guy typing out poems on an old typewriter, film screenings, bands like The Uptones and Flipper, and much more.

And most amazingly, we didn’t see a single security guard or policeman the entire time, and we also didn’t see a single sign of trouble anywhere. Everyone was in a great mood. So forget what you think you know about Oakland.

Saturday night we opened up a 1993 Boony Doon Le Cigare Volant. Lately I have had bad luck with some of my older wines being corked, but this wine was in great shape. It was very smooth and had a delicate cherry taste.

7/9/2008: 10:28 pm: RobertFood and Drink

We had a huge harvest from our Blenheim apricot tree four years ago, and this year the tree is bearing a similar amount of fruit. Rogue backyard animals got 30 or so, we’ve picked about 60 and I think there are another 75 apricots on what is now a very old tree. It had been on a three year cycle in previous years, but this was by far the biggest harvest since 2004.

As the trunk continues to deteriorate rapidly, I’ve had to prune the limbs back severely to keep the tree from leaning over too much. Maybe I unknowingly did a great pruning job last fall. If so, it was complete luck.

: 10:19 pm: RobertBicycling, Earthquake

Maybe this is the year I finally buy a cyclo-cross bike and experience the gut wrenching thrill of shouldering my bike up a steep, muddy hill, bouncing down trails through the trees, and then afterward drinking Belgian beers and eating grilled sausages with the people who lapped me repeatedly.

The July issue of Wired has a review of a couple of cyclo-cross bikes. The review was written by a member of Team Oakland, which I’m also a member of, and the reviewers were racers from the racing team part of our club, Kaiser Permanente/Team Oakland, including one of my friends. I think the $6,000 Moots Psychlo-X is way more bike than I need, though I do love the name.

7/8/2008: 9:22 am: RobertLinux, Mac

Now, if that name doesn’t make a product just sell itself, I don’t know what would. Anyway, I bought a D-Link DNS-323 NAS from a friend who I trust to do all the necessary research. He bought it, but because he is really picky and it didn’t do exactly what he wanted, he built up his own NAS.

I put two Seagate 750GB ST3750330AS SATA drives in it in a RAID 1 configuration. He recommended the drives and a D-Link DGS-2205 Gigabit switch. Like I said, he does the necessary research. So far, I’m mostly loving it all. You should be able to get the NAS for a little under $200, the drives for about $120 each, and the switch for around $30. Having a GB switch is nice, since it greatly speeds up file copies, assuming your computers have Gigabit Ethernet interfaces.

In addition to acting like a file server on my home network, the D-Link NAS has an iTunes server, USB print server, FTP server and a few other goodies running on its Linux operating system. Even better, since it’s running Linux, the community was able to build add-on utilities.

Though the rating on Amazon is only 3.5 stars, this is one of those times you have to read the reviews. A lot of the negative comments refer to issues that have been fixed in newer firmware versions. Though, I have to admit that the user and group permissions design is mediocre and the administration UI for permissions even worse.

There is an especially annoying permission issue if you are using Windows. When you connect to the NAS, you can’t edit the username in the login dialog. So, you have to create a user with the same name on the NAS. This is especially bad if you have multiple Windows boxes on which you use different usernames. At least, this is what happened on my neighbor’s Windows boxes. When I connected to a file share on the NAS from my Fedora Linux desktop, I could change the username. Same for my Macbook Pro.

One of the biggest negatives for me is that the iTunes server won’t serve up Ogg Vorbis encoded music files, and I’ve encoded most of my collection that way. Grrr. I’ll have to look at other community built software for streaming audio or hack the GPL’d source from D-Link, since the iTunes server is also GPL’d. It’s based on mt-daapd by Ron Pedde. I’m kind of puzzled, since the ogg.c file in the src I downloaded makes it look like it should work. It’s successor, Firefly, definitely supports transcoding ogg files.

7/5/2008: 12:07 am: RobertSpeech

There’s a very detailed (and long) article on the state and future of speech recognition and speech synthesis in the New York Times from late June. Although the prognosis is not that positive, it is written almost with the challenge of a Turing test for speech recognition, i.e., a computer recognizing the semantics of human speech as well as a human. Also, quite a bit of the article focuses on the detection of type and level of emotion from a speaker’s speech.

The article might give a reader the impression that not much is going on with advancements in emotional speech prosody in commercially available text-to-speech engines, but anyone who has listened to a demo of the Loquendo TTS engine would tell you differently.