Archive for October, 2005

Civ 4

Civilization is probably the only game I’ve ever played in four different versions. I don’t buy too many games, but I like the series enough that I figured this couldn’t be too bad. The game design is extremely deep. There is more to this game than any game I’ve ever played. This is good and bad. You can invest a huge amount of time in developing optimal strategies and learning how the game works, but it also takes a long time to play a game. A full game can easily take 6-10 hours. Thankfully, there’s now a Quick mode which is probably twice as fast, but that is still a long time. I have to give this game a thumbs up because it’s got such a great legacy and it lives up to it. I do have to say though, that even though the design is great, the game itself is programmed badly. I’m surprised they released it because it leaks memory so quickly you can barely play an hour or two before you have to restart the game to make it fast again. And it crashes more than I would expect, bad programming again. I hope they put out a patch soon.

Comments off

Vanity AdWords

Mike had the idea of buying Vanity AdWords. Brilliant. No need to wonder if your friends can vanity search for you anymore, just pay for the service. Thankfully, my name is pretty unusual and so buying AdWords for it is nearly free. A one time $5 setup fee, plus $.05/click is all it took. Now of course the AdWords system is pretty flexible so I set up a $1/day max on the cost of my clicks. But based on the past few days I am getting about 5 impressions(which is the number of times an ad was displayed) per day. A typical clickthrough rate would be about %0.5 So that means I’d need about 200 impressions to get a clickthrough. On average I’ll get one click every 40 days for about 5 cents, well worth the entertainment value if nothing else. Mike has a tougher time because Michael Lewis is the famous author of The New New Thing and Moneyball, so his clicks cost something like $.25 and he’d get a few a day, but still just fun to have. Search engine advertising is fun. My sister-in-law is going to want a bit of search engine help too, so I figured I’d set it up for myself and try it out. Google makes it easy of course because it’s their core revenue generating product. They have some pretty good tools to help you spend money and spend it effectively.

Comments off

Excellent baby shower

We had an excellent baby shower today. Exactly what I wanted, no baby games, just a nice lunch with a bunch of people at The Elephant Bar. It’s really a nice place, they treated us really well. The service was great and the price was really reasonable for the 30-ish people we had. The only downside was that when we reserved it, they had asked us to be there only from 11-1pm which isn’t that long for a party of that size. So we had most of the area cleared by 1:30 or so, but they didn’t complain at all. Got to talk with all my friends and just generally hang out. Tracy’s family is in town. Her brother drove in from Phoenix and was here for about 12 hours before he had to drive back(it’s about an 11 hour drive each way). That’s kind of insane if you ask me, but he must really enjoy the drive. Anyways, thanks everyone for coming, we got some great gifts that baby will be very happy to barf on.

Comments off

How not to Powerball

This week there was a very large $340m Powerball jackpot with a single winner. This got me to reading up on in at Wikipedia. It’s pretty well known that your odds of winning the jackpot are fixed at 1 in 147 million(until they change the structure which they have been known to do). Anyone with solid math skills understands that your expected payout is not determined just by the size of the jackpot, but the number of tickets sold for that particular drawing. The number of tickets sold has a significant effect on your Expected Value because a payout can be split among multiple winners. You need to hedge against the real danger that you will not win it all. You also need to factor in the non-jackpot payouts, the lump sum vs 20 year payout, and taxes to make a true guess at the EV. And of course we’re working under the assumption that the lottery is not rigged in any way.

With this in mind, when browsing Wikipedia I took an interest in the fortune cookie payout where many many people hit the same secondary jackpot because they all used the same numbers from a fortune cookie. So I’m warning people, using fortune cookies is a terrible terrible way to play for the jackpot. And don’t use the now popular numbers from Lost because you are significantly decreasing your expected payout if those numbers do happen to hit the lottery. Just let the random number generator pick for you. I’m guessing people tend to use the numbers 1-12 slightly more often because of calendar birthdays, and there are probably some other common things like #7 being particularly lucky. Don’t let those psychological effects choose numbers for you, you’re just hurting your own chances at the big payout.

As a note, I don’t play the Powerball just because we don’t sell it here in California. I’d buy a couple of tickets for the Mega millions if the jackpot was large and I remembered it, but I don’t have the time or will to actually go to the trouble of trying to buy out of state lottery tickets, although now that I think about it there could probably be some favorable tax loopholes to that.

Comments off

Haven’t we evolved beyond rdbmses

I have been using Hibernate and MySQL lately. Relational databases seems like such old technology, can’t we do better? Yes, RDBMSes have excellent speed and are well understood and they have transaction, failover and other niceties. But they require a different mode of thought and a different programming paradigm. I don’t like thinking relationally, especially when we’ve been trained for years to program with objects and now I have to map one paradigm into another. OO databases seem like a good idea, what is wrong with them? I’ve heard they are slow, but that was years ago and hardware has not stopped improving. Mostly I just like complaining about SQL.

Comments off

Intellectual Property industries

Nothing has to be scarier to the pharmaceutical industry than the news that Taiwan will openly ignore patent law to clone a bird flu anti-viral drug.

I recently got into a discussion about software piracy and it got me thinking about how similar pharmaceutical companies are to software companies. They both spend a lot of upfront development time on their products and then they have to use intellectual property laws to protect their market share. Unfortunately intellectual property laws are not consistent around the world and so they both have problems exporting their goods while maintaining their huge profit margins. So there is a consistent issue in both industries that foreign economies have vastly different pricing than the same products in the US. Both drug and software companies have to wrestle with justifying pricing policies that consumers can’t really come to grips with. Buying MS Office at American prices would cost many consumers months of wages, which is no surprise why in certain countries like China the software piracy rate is well over %80. In other countries, prescription drug are sold at a fraction of the US prices so US consumers are attempting to import them at discount prices. Meanwhile drug and software companies spend millions on lobbying to encourage IP protections and enforcement. Consumers think the companies are gauging them, companies are just protecting their interests.

The big difference of course is that access to pharmaceuticals sometimes has an immediate life or death impact, while it’s hard to argue that access to software is life or death(or any other digital content really). You have to be sympathetic to Taiwan’s position that a public health problem trumps the need to abide by Roche’s patent, assuming that there were some good faith negotiations.

All this leads to the conclusion that pricing intellectual property is tricky, and it will continue to be so as long as there are wide gaps in industrial levels throughout the world.

Comments off

Java performance

Brian Goetz is one of my favorite Java experts(he’s also a pretty solid poker player too with a streak of gambool). He does an excellent job of keeping people updated on real world Java performance issues. In the article above he describes some real world situations where Java will outrun C++. In particular note Brian’s comment that these days object pooling in Java is almost always a bad idea.

I knew that Java can run faster than C++, and I’d been searching for example code which would show it. Ironically, the example was in an area where people(including myself) thought C++ would really do better than Java: memory allocation. It just goes to show that in the fast changing world of software, today’s gospel may be tomorrow’s urban legend.

I wrote up a quick test to confirm that Java did indeed outrun C++, the results are below. The summary is: on my desktop Linux 2.4 machine doing a billion new/free operations on a tiny class takes almost 2 mins in C++ but with Java using JDK 1.5 it took less than 30 seconds. I’m curious how it performs on other systems as well.

hubt{4:41pm}hubert[~/test]:; uname -aLinux hubert 2.4.21-32.0.1.EL #1 Wed May 25 14:36:20 EDT 2005 i686 i686 i386 GNU/Linuxhubt{4:41pm}hubert[~/test]:; cat a.cc#include <stdlib.h>class A {  int j;};

int main(int argc,char **argv) {  system("date");  for(int i = 0; i < 1000*1000*1000; i++) {    A *a = new A();    delete a;  }  system("date");}hubt{4:41pm}hubert[~/test]:; g++ a.cchubt{4:41pm}hubert[~/test]:; g++ --versiong++ (GCC) 3.2.3 20030502 (Red Hat Linux 3.2.3-52)Copyright (C) 2002 Free Software Foundation, Inc.This is free software; see the source for copying conditions.  There is NOwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

hubt{4:41pm}hubert[~/test]:; ./a.outSun Oct  9 16:41:29 PDT 2005Sun Oct  9 16:43:10 PDT 2005hubt{4:43pm}hubert[~/test]:; cat A.javapublic class A {  int i;  public static void main(String []args) {    System.out.println(new java.util.Date());    for(int i = 0; i < 1000*1000*1000; i++) {        A a = new A();    }    System.out.println(new java.util.Date());  }}

hubt{4:43pm}hubert[~/test]:; javac A.javahubt{4:43pm}hubert[~/test]:; java -versionjava version "1.5.0_01"Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)Java HotSpot(TM) Client VM (build 1.5.0_01-b08, mixed mode, sharing)hubt{4:43pm}hubert[~/test]:; java ASun Oct 09 16:43:40 PDT 2005Sun Oct 09 16:44:06 PDT 2005

Comments off

Google Reader

Being an avid news/blog reader I immediately went to check out the new Google Reader. My initial impression is that it’s fine, but not that amazing. It’s in beta so this is not the final word. I did like that it had some sort of integration with Flickr so it could display images inline. I also found this Yahoo RSS usage paper interesting. The summary is that despite the buzz around blogosphere not many people use RSS, and the vast majority of them don’t know that they do because they are doing it through My Yahoo!. And most RSS users are going for traditional trusted news sources anyways. Once again hype > reality, it’s like the dot blog boom.

Comments off

Baby education

We took our first in a series of baby classes this week. I’m happy to go and help Tracy, but I’m sort of the opinion that hey nature has been doing this for millions of years for without intelligence or consciousness, how hard can it be? Now the parenting stuff I’m sure we could use some help with, but the baby having part doesn’t seem like there’s much for me to do. That being said, I did learn about some interesting things like meconium, the mucus plug, and false labor.

Comments off

Fun prank for the day

Go to someone’s open machine, open Google and change their language preference to something they don’t understand(my personal favorite is Amharic) and then save their preferences and see how long it takes them to get back to a language they do understand.

Comments off