Friday, February 09, 2007

Hillary Against Vouchers

Here's a disappointing quote from Hillary Clinton:

First family that comes and says 'I want to send my daughter to St. Peter's Roman Catholic School' and you say 'Great, wonderful school, here's your voucher.' Next parent that comes and says, 'I want to send my child to the school of the Church of the White Supremacist ...' The parent says, 'The way that I read Genesis, Cain was marked, therefore I believe in white supremacy. ... You gave it to a Catholic parent, you gave it to a Jewish parent, under the Constitution, you can't discriminate against me. So what if the next parent comes and says, 'I want to send my child to the School of the Jihad? ... I won't stand for it.

Talk about disproving herself. She just showed how government involvement in education at any level is fundamentally flawed. It should not be up to the government to tell parents what kind of school they have to send their children to. Right now everyone who does not send their children to public school is punished since they must pay for the public school and the private school. So right now the government provides disincentive to all scenarios listed by Clinton. They try to stop you from sending your kids to the Catholic school or any other kind of private school. It's not the government's job to determine what kind of school I send my kids to.

What Hillary doesn't realize (or doesn't care, since I'm sure she had the money to send Chelsea to the school of her choice) is that by trying to socially engineer children by forcing them to go to a certain kind of homogenized, government backed (thanks No Child Left Behind) school, it just winds up decreasing the quality of education. That's why the really fortunate children of parents with enough money to pay for both the public school and a private school, have such a huge advantage over their peers.

Thursday, February 08, 2007

Code Fest

I've been tutoring a friend learning Java. Each week they have a different assignment designed to help them learn a particular concept. Just for fun, I decided I would complete the assignment as well. I'm a big believer in revision, i.e. it's more useful to revise a complete program than to just complete it.When you complete it, you're concentrating on getting it to work. This is especially true of an inexperienced programmer. So by writing the program myself, I was better able to suggest revisions that would demonstrate the concepts being taught.

Plus it's fun. I figured out that what would be even more fun would be to write the programs in different languages. So I picked three: C#, C++, and Ruby. I'm doing each assignment myself in those three languages, plus Java, of course. I picked these languages because I know each, but don't use them on a regular basis and they are all "relevant." I know Fortran (or I did in high school,) but what would be the point in that? I also know Perl, but I would rather do most Perl things in Ruby, and I don't know Ruby as well as I know Perl. I am still considering adding Python, a language I don't know at all.

Anyways, here's the first assignment. I am giving each assignment it's own web page, but I will link a blog entry to each. And here's the second assignment.

Tuesday, February 06, 2007

Vista Uneasiness

There's an open call for Vista questions on MSDN Channel 9. This was posted by Microsoft programmer/Technical Evangelist Charles, so theoretically there will be some answers to the many questions being posted.

On another Vista related topic, Apple is warning iPod users not to use Vista as it may damage their iPod. As Dave Winer points out, that is just ridiculous. Shame on Apple for not having readied an iTunes update to go out BEFORE Vista shipped. They had a huge amount of time to resolve this issue, so clearly they chose not to. I would be shocked if they did not already have an iTunes update ready. They probably had it ready a couple of months ago. They clearly chose not to send this out in advance, since they thought they could create some negative press for Vista at its launch. A look at Apple's "Hot News" shows lots of cherry-picked Vista reviews that slam on it. Just when Apple seemed to be concentrating on electronic devices instead of computers, they start acting like a rejected boyfriend yelling "Don't go out with him, I'm the best guy for you!"

Monday, February 05, 2007

Office 2007

I went to a Microsoft Vista/Office launch event last week. I really wanted to hear about XAML support in Vista/Office. I got to hear a little about it, and see some very cool demos of applications that were built using XAML, but it was all in all short on XAML details. Oh well.

As part of the event, I scored a free retail copy of Office 2007 and Groove. I haven't bothered with Groove, but I went ahead and installed Office 2007 on my laptop. I use Outlook all day at work, and now I have this staring at me:

Notice the "Click here to enable Instant Search". That's not just for the inbox...

Pervasive indeed. Of course the "instant search" being referenced here is Microsoft's Desktop Search. I've played with this in the past, but I liked Google's a lot better. Mostly because it handled Firefox and Thunderbird well, but MS's did not. I now also use Google's Desktop sidebar, and I have some gadgets for things like my calendar, iTunes controller, and some RSS feeds.

So I entertained the idea of switching to the MS version of these things. I realized that the vast majority of desktop searches I do are for Outlook emails. So the MS search probably does that as well as the Google one. Most other searches I do are in code using Eclipse. I did occasionally use GDS to search through legacy code back when I worked with lots of legacy code... Also, I thought if nothing else, perhaps it would use less resources (even though Google Desktop is actually pretty darn efficient.) First problem with this idea is that MS does not offer a sidebar for Windows XP. On Vista they have one, but I've heard nothing about them porting it to Windows XP. Perhaps it is dependent on Aero, who knows.

So I thought, well what about Yahoo's Widget Engine + Microsoft's Desktop Search? Maybe that would be a comparable combination. So I tried out YWE, and found widgets that did all the things that my Google ones were doing. They had a much larger memory footprint on my system, around 2-to-1. They also took up more real estate. I only use the Google sidebar at work, where I have a dual monitor setup, so I am very sensitive about desktop real estate.

Anyways, I was unsatisfied with Yahoo's widgets, so I did not even give MS's search a try. Guess I will have to live with the MS Advert. Or maybe there's some option for turning it off.

One other interesting thing about Outlook 2007. It somehow imported all my RSS feeds. I really don't understand how this happened. I suddenly had a huge RSS folder with all my Google Reader feeds, plus a few random ones from Microsoft. My Google Desktop email widget was then overwhelmed with all these RSS files that it thought were emails received via Outlook. I have no interest in a desktop based RSS reader, as I am quite happy with Google Reader. So I deleted all the RSS that Outlook had created and downloaded. I just wish I knew how it did this. Maybe it detected it from Google Reader, who knows.

Update: One more Office 2007 issue. When I loaded Word 2007, I noticed that my PDF maker buttons were gone. These get installed when you install Adobe Acrobat. I did some searching and supposedly they should be in the "Add-Ins" tab of the ribbon. But I had no Add-Ins tab. Just for kicks, I opened up Acrobat and tried to create a new PDF from a Word document. It crashed Acrobat. I went back to Word 2007, and simply printed my document to the PDF Printer that Acrobat creates. That worked great. I also downloaded Microsoft's PDF maker that is an add-on to Office 2007. It also allowed me to easily create a PDF. So I have no problems creating PDFs, which is good since that is how I like to share documentation at work. Still, I'd like my buttons back. Maybe re-install Acrobat? That's a pain, since I have to re-activate it as well...

Sunday, February 04, 2007

XLI

Now that was a heckuva Super Bowl. Well, at least the first quarter. It's hard to remember a more eventful quarter of football, particularly a Super Bowl. I don't think all the fumbling can be blamed on the rain. There was a lot of nerves going on and, of course, a lot of randomness. Yes, the R-word. The thing that people hate more than anything else.

Anyways, it was clear in the first half that the Colts were a much better team. The Bears were very lucky to be so close. It was clear in the second half that Tony Dungy didn't want to blow out his good friend Lovie Smith. The AFC is just a much better and deeper league right now than the NFC. It reminded me of watching Florida crush Ohio State. The SEC has faster, more physical players than the Big Ten. Maybe you can say the same thing about the AFC and NFC.

Speaking of The Gators, I was completely rooting for Chicago because of their Gator connection. So it was particularly painful to watch Rex Grossman. At this point, even I have to admit that it looks like Rex just doesn't have the mental abilities to play quarterback in the NFL. He clearly has the physical talent. His decision making is terrible and you can just see him struggle with the design on some plays. Sometimes I see Rex and get flashbacks to Ryan Leaf...

Friday, February 02, 2007

What's Wrong with Yahoo Mail?

It seems like every time that I go to the Yahoo! home page, it says I have new email -- but I don't.


Notice that the Mail tab says I have 4 new messages, but looking at the preview and it finds none. Now it is possible that I have 4 new messages, but for some reason the dates on the messages are screwed up and thus do not show up in the preview, since the preview is sorted by received date. Not likely, but possible. So I open up mail and lo and behold, no messages:


This happens all the time! I've been very disappointed with Yahoo's mail. It's obviously a clone of Outlook, but anybody who has used Outlook Web Access has used a better Outlook clone. I only use my Yahoo account for things like signing up for websites that I don't quite trust, so it's no big deal that it sucks. Just annoying.

Tuesday, January 30, 2007

FIRE JOE MORGAN

One of my favorite blogs to read is FIRE JOE MORGAN. There's always some funny and insightful rants against baseball talking heads (such as ESPN's Joe Morgan.) I've found an interesting contradiction on there. The writers and reader of FJM are typically fans of sabermetric analysis of baseball. However, many of them are also "anti-steroids", i.e. they like to rail against players who are suspected of steroids use.

Now let me introduce you to two popular sabermetric statistics that FJMers are particularly fond of. The first is OPS+. This is on base percentage plus slugging percentage, adjusted for the park and the league. The second is EqA, equivalent average. This also adjusts for park and league. Both of these stats allow for historical perspective on statistics.

Why do I bring this up? Well, such league-adjusted stats allow sabermetricians to make objective analysis of players from different eras. Thus a player with a .900 OPS in 2006 is not as impressive as a player with a .900 OPS in 1976. Why? Because the league averages are higher in 2006 than they were in 1976.

So why are they higher? Well first off, it doesn't matter from statistical standpoint. You can adjust regardless of the variances. But from a practical standpoint, ballparks are smaller now, pitching is more diluted because of expansion, and players are bigger. Yep, that's right. Players are bigger, and part of that is because of steroids.

In other words, if steroids affect the entire league, then their effects can be statistically quantified and steroids users are "statistically punished." The crux of this argument is that steroids affect the entire league. So let's assume they don't, i.e. steroid is use rare.

Well most reasonable people think that players like Mark McGwire, Sammy Sosa, and Barry Bonds have all used steroids. We pretty much know that Jose Canseco, Jason Giambi, and Rafael Palmeiro used steroids. So if steroids use is rare, then it seems like is a sure fire way to generate huge offensive numbers. Think about, if only a handful of players were using steroids, then there is a high correlation between steroid use and offensive production. So it would seem like a simple equation "use steroids, hit 40+ home runs." So then wouldn't a lot of players use steroids? But wait, our assumption was that few used them. So that had to be wrong. A lot of players use steroids, including a lot of bad players.

So that means stats like EqA do a very good job of adjusting for steroid use. So steroid using players can easily be compared in a historical context using sabermetrics. The key is abandoning raw numbers like hit/home run/RBI totals, and using contextual numbers instead. You would think this would appeal to any sabermetric loving baseball fan.

Monday, January 29, 2007

Scanner

I was recently helping somebody who is taking "beginning Java" kind of class. It's interesting to see Java as a first language, especially Java 5+. Java is unusual as a first language because of its object orientation. I think Pascal, Basic, or C are probably better choices. They're much less useful choices in the long run, I suppose. Java 5 as a first language is an even stranger choice, because of all that syntactic sugar...

For example, the Java student in question needed to write a program that accepted user input. Enter Java 5's java.util.Scanner. This thing is like C's scanf, but an OOP version of scanf. It's not quite as easy as C++'s cin, but you just can't do cin in Java because you can't overload the operator like you can in C++. I guess reading user input is one that is dramatically more difficult in Java than C++, well at least before Scanner.

One weird thing with Scanner is that it breaks on all whitespace by default. So don't use it's next() method to read strings that might have spaces in them. Instead use nextLine(). It accepts a regular expression for it's delimiter. That's pretty novel. Of course it means that if you want to use something other than the default delimiter, you'll need to understand Java's overly verbose version of regular expressions.

So I'd still prefer Pascal or C as a first language for a new programming, but Java has become more accommodating at least for beginners. The "old way" of reading lines of input was always something like:

String str = null;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
try {
str = br.readLine();
} catch (IOException e) {
e.printStackTrace();
System.exit(1);
}

Talk about ugly! Now with Scanner:

String str = null;
Scanner scanner = new Scanner(System.in);
str = scanner.nextLine();

Or even:

String str = new Scanner(System.in).nextLine();

One of the key things to notice here is that you don't have to catch an IOException. Java has finally started being smarter with exceptions. Scanner's exceptions are not checked, so you don't have to catch them. There's no point in catching exceptions that you can't do anything about. If your program is unable to get input from the command line, it's not like you're going to be able to recover.

Barbaro

I used to be a big horse racing fan. I started going to the track while I was in college. Pasadena is home to Santa Anita race track, arguably one of the most beautiful tracks in the world. It also happened to host The Breeders' Cup while I was there in 1993. My roommate was already a big fan, so it didn't long for me to get hooked.

So I was sad to hear the news that Barbaro was finally put down today. It reminds me of the many times I saw similar happenings while at the track. It's seemed common knowledge back in the early 90's that the combination of heavy inbreeding and the use of "medications" (like Lasix) had severely weakened the breed. There were also numerous trainers notorious for running young horses into the ground all in the name of success in the Triple Crown. The most notorious (and arguably successful) was D. Wayne Lukas.

It's sad that nearly fifteen years later and things seem to have only degenerated even more. I was a little encouraged to see this article on ESPN about some possible reforms to the sport. I would have supported most of these ideas fifteen years ago, but they would have stood little or no chance. Maybe Barbaro's highly public death will motivate the industry. Probably not though. After all, none of these measures would have helped Barbaro. Plus, the horse racing industry is more concerned with slot machines than with the horses anyways.

Saturday, January 27, 2007

Super Bowl

It's about time for my first Super Bowl post. It's really pretty easy for me to make a pick. This is The Year of The Gator after all. So on one hand we have Gator QB Rex Grossman leading the Chicago Bears vs. Tennessee QB Peyton Manning leading the Indianapolis Colts. Clearly I must pick Chicago. 2EZ.

Actually I generally enjoy watching Indianapolis play. It's a pleasure to watch Peyton Manning play at a level that few QBs have ever played at. Peyton is often compared to Dan Marino. It's a very fair comparison, at least in terms of talent and accomplishments. So it was nice to see Peyton beat everybody's golden boy Tom Brady. QB is without a doubt the most important position in football, but too much credit and blame are often assigned to QBs. People who thought Manning "can't win the big one" assigned too much blame to him, just like all the Tom Brady worshipers gave him far too much credit for the Patriots' success. It was all too similar to the kind of things people used to say about Dan Marino and Joe Montana.

Anyways, while it would be a little surprising to see Chicago win (or any NFC team win the Super Bowl,) it would be even more surprising to see them win because of Rex Grossman. They will clearly try to run the ball down the throat of Indianapolis. Rex also seems to have realized that he doesn't have to do so much to wins games for the Bears. They have tremendous talent on defense and solid players on offense.

On the other hand, it would not be shocking at all to see Peyton Manning as Super Bowl MVP. Chicago has been vulnerable through the air. They play a lot of Cover-2 and rely on their front four to get pressure on the QB. That will be tough to do against the Colts fast paced offense.

But hey, Florida was a big underdog against Ohio State a few weeks ago, and we all saw how that turned out... So I will predict that Rex will indeed play well and that Peyton Manning will make some costly mistakes. Chicago 30, Indianapolis 24.

Friday, January 26, 2007

Link Blog

I was playing around with some of the new Blogger features. I was pleased to see you could add different widgets to your blog. I was very interested in looking at the markup code they are using to capture this in your blog's template. I added a couple of widgets to my blog. Most interesting is probably the link blog. I added this by adding a "feed widget" to my blog, and giving it the RSS URL of my link blog from Google Reader. Now whenever I read an interesting article, I just hit "shift-S" and it shows up on my blog.

Sunday, January 21, 2007

Spanking

Each weeknight, I drive home from work and usually talk on my cell phone with Crystal (on my Bluetooth headset.) Earlier this week Crystal asked me if I had heard about a proposed law to ban spanking children under the age of three. I had not heard of it at the time, but I've heard a lot about it since.

This has to be one of the most outrageous laws I've ever heard of. What right does the government have to tell you how to discipline your child? How can we expect parents to be responsible for their children when the government dictates how they raise their children? As horrible as Nazi Germany or Soviet Russia were in terms of oppressive government, did either of them even stoop this low?

Personally, Crystal and I do not spank Michael, Jr. (who turns three in March) or Raymond (age 1.) But that is our decision. If we decide that we need to spank them, then again that is our decision. We have to be responsible for providing care for our children and for teaching and raising them. That is our responsibility.

Now obviously spanking can go too far. Children can be injured by parents who use excessive force to spank them. So maybe we need law to prevent that? Oh wait, we already have one. It's called assault and battery. If I spank my child and hurt him, I have broken a law. Just like if I go out and hit somebody on the street and injure them.

Obviously it's more difficult for a child to report me to the police than it is for a stranger on the street. But if I hurt my child enough that I have to take him to the hospital, doctors and nurses are already instructed to report me to the police.

There's a lot of safeguards already in place. Is it perfect? Of course not. A lot of children still get abused. But even if this ban on spanking was put in place, it's not like that would stop me from beating my children in the privacy of my own home, and obviously that's where most parental discipline occurs. It's a worthless law in terms of being enforceable, but it would catastrophic consequences for all of society. It would tell good parents, you know the ones that don't abuse their children, that they are no longer in charge of their kids. The State of California is instead. They are just there to do what The State tells them to do.

If the state passed this law, and it somehow was upheld by the courts, I would have to leave California. Maybe I would take a job with Microsoft or Amazon and move to Seattle, or maybe somewhere back east. I don't know. But there's no way I could live under a totalitarian regime that will mandate how I raise my children.

Saturday, January 20, 2007

Web APIs: Flickr vs. GMaps

I was doing a little research on web APIs. Two of the better ones (or at least well known and used) out there are Flickr and Google's Map (GMap.) They present two very different ways to enable third party developers to leverage powerful web services. So I thought I'd do a little compare and contrast.

Flickr's API is a classic procedural library. There are calls for almost any action you could possibly do with all things Flickr : photos, account, tags, sets, etc. You can upload photos, access photo streams, search by tags ... pretty much anything you can do on Flickr's site. Each call is a different HTTP request. You can send the package of your request in a variety of formats: REST, XML-RPC, and SOAP. The REST and SOAP follow the usual patterns for these formats. The REST requests are "pure" HTTP requests. Flickr's XML-RPC is very true to the RPC mode. It uses simple XML to specify a procedure to call along with it's parameters.

You can also specify the format of the response you get back from Flickr. Since they support REST, XML-RPC, and SOAP for requests, it's not surprising they support all these for responses. They recently added JSON and PHP as response formats. I was pleased to see JSON. I can imagine that if I was going to use Flickr's API, I would probably choose to use REST+JSON. Make a pure HTTP request and get back a JavaScript object. Seems like the lean-mean approach to me. I was surprised to see PHP as a response type. In this case, they are referring to serialized PHP objects. The structure of these objects is identical to the JSON structures.

GMaps is different in many ways to Flickr. Instead of supporting procedural calls to Google, everything is object oriented JavaScript. You include a library from Google and then use their objects. Many of their objects provide methods for making calls similar to what you see in Flickr. For example, you can geo-code a location, calculate directions, etc. But you don't make the HTTP request and you don't parse a response. Google's JavaScript objects do these for you.

The differences in these web APIs reflect the differences in these web services. Flickr is more of a pure data service. You can modify data (photos) and query that data (search for photos, etc.) Flickr wants to be your photo database. As such, they give you a number of ways to access your data. What you do with the data is up to you. Show your pics on a website, provide tools for uploading, print the pics, make aprons, whatever...

GMaps wants to draw maps for you. They don't want to give you mapping data for you to do whatever for it. They want to draw. They'll take your data and draw maps with it. They always draw the map, so they give your users a familiar interface that also integrates into Google. All roads lead back to Google.

Thus the APIs to these services are very appropriate for the services. I don't know for sure, but I'd wager they also reflect the programming design behind the services. It seems pretty obvious that Flickr is written in PHP and that Google Maps is written in Java (maybe the last one is less obvious, but I do have a little inside information on that one.) So it's not really surprising that a PHP site would have a very flexible, procedural API, and that a Java site would have more closed, object-oriented API.

Thursday, January 18, 2007

Java Properties and Generics

If you've done much Java programming, you've probably used a Properties object at some point. It's been around since JDK 1.0. It's always been backed by a Hashtable. With Java 5, the Hashtable became genericized, just like all the other Java datastructures. The Properties object was always "genericized" in a way. It's getProperty and setProperty methods only took and returned Strings. So it would seem logical that Properties would extend a Hashtable<String,String>, right?

Nope, it's still a Hashtable<?,?>, i.e. a Hashtable<Object,Object>. Where is all this going? Well I had a class that had a Properties object as a member variable. I had a method that needed to return all the property names of that Properties object. I thought it would make sense for my method to return a Collection<String>. Since Properties extends Hashtable, I could just return it's keySet() method. This is a Set of all the keys in the Hashtable backing the Properties, thus it is a Set of Strings (Set<String>) and thus a Collection<String>. Too easy.

Wrong again. The return type of the keySet() method is a Set<object>, because Properties extends Hashtable<Object,Object>. You cannot case a Set<Object> to a Set<String>. I was very surprised by this. I expected to have throw a @SuppressWarning("unchecked") annotation on my method, but I did not expect that it would be a compilation error. I figure this is because I would be casting a generic interface. I guess. I could do something completely ridiculous:

return (HashSet<String>)new HashSet(myProps.keySet());

This worked with a good 'ol @SuppressWarning("unchecked") annotation. I had to copy my keySet() into a concrete Set object, and then I could cast. Totally ridiculous.

This all came because my Properties object was being injected with Spring. In other words I had a Spring context file with something like:

<property name="myProps">
<props>
<prop key="a">1</prop>

...

I simply replaced this with a map:

<property name="myProps">
<map>
<entry key="a" value="1">
....

I could then make myProps into a Map<String,String> instead of a Properties object, and simply return it's keySet() without any casting. Very nice. So this just brings me back to the original question of why doesn't Properties extend Hashtable<String,String>?

Friday, January 12, 2007

Review: Carnavas by Silversun Pickups


I found Carnavas as an Amazon recommendation. I've had a pretty good history with Amazon recommendations. The Amazon review mentioned influences from Smashing Pumpkins and Built to Spill -- both favorites of mine. So I was quick to give this a listen.

I was definitely reward as this is probably the best CD Amazon has recommended to me. It is an outstanding recording. Silversun Pickups have a very unique sound. It definitely has its roots in My Bloody Valentine, but is more melodic with more emotional vocals. But like My Bloody Valentine, Smashing Pumpkins, and Built to Spill, Silversun Pickups absolutely rock. Melodies, vocals, textures, etc. never get in the way of rocking out. It's probably more of a headphones CD than a big speakers CD, mostly from their loud-soft dynamics (did somebody mention Smashing Pumpkins?) but it's infectious rock however you listen to it.

Thursday, January 11, 2007

iPhone -- Redux

It seems the collective shine has begun to fade on the iPhone. A lot of people are having the same questions same questions I had about it. I was disappointed to see Steve Jobs say he wants to keep the iPhone closed. I guess this shouldn't come as a surprise. I've always thought that the biggest reason for Microsoft's greater success than Apple was that Microsoft was always much friendlier to developers. Even if they thought of us as pawns, they still treated us better than Jobs & Co. I was also interested in Cedric's take that MacWorld 2007 signaled Apple's waving of the white flag as a computer company. Kind of seems that way to me, too. Still, their moves have been pleasing to shareholders.

Tuesday, January 09, 2007

Baseball HOF

I wasn't surprised to see Mark McGwire not get into the Hall of Fame today. ESPN had already published the results of a poll they did among HOF voters, and it was clear McGwire was not going to get in. That's a shame. I listened to Jime Rome say that he just wishes McGwire would talk about the past. He had on Sports Illustrated's Tom Verducci, an HOF voter, who said that McGwire had denied ever using steroids back in 1998 and he doesn't understand why he doesn't do that now.

So if McGwire would just say "I've never taken steroids" then he would be voted into the HOF? I guess we just want to believe that McGwire got that huge naturally. Give us our blissful ignorance and we'll put you in the HOF.

Look, we all know he took steroids. We all knew it back then. People need to grow up and realize that McGwire did exactly what we wanted him to do. He got huge so he could hit the ball 500+ ft. and break records. That's what everybody wanted. It gave us the most magical moment in baseball in recent history. It healed all the damage done by the 1994 strike. And it was powered by steroids. Now we need to all just get over that and give McGwire his due.

The iPhone

People have been conjecturing for years about Apple making a cell phone. Then they finally do it, and yet they were still able to blow away people's expectations. That's pretty amazing.

As for the phone itself... Well is there any piece of technology out there that looks sexier? I'm really curious just how functional it's user interface is. It certainly seems like a leap forward and Apple has a pretty good track record of making UIs that people fall in love with.

I'm also incredibly curious about just how much computing power the thing has. Jobs claimed it is running OSX. Clearly it is a lighter version of OSX, a la Windows Mobile vs. Windows. It seemed to have some Apple widgets, but what kind of apps? Will it be able to open Word documents and PDFs? Maybe Excel spreadsheets? It can obviously sync, but can you edit contacts, etc? And speaking of sync, will it sync with Outlook. Or will you have to do some kind of dance like where you use iTunes to put contacts from Outlook onto your iPod? With its high price point, it's going to competing with smart phones that all can do many of the above things.

Personally it's a very tempting gadget! Would it really replace my iPod? If so, then maybe the money would be worth it. It doesn't have enough to storage to be a good video iPod, but I have little interest in that kind of iPod anyways. The $499 iPhone has the same memory as my iPod Nano (4 GB,) though I would assume that a good chunk of that gets eaten by OSX-lite and phone related stuff. Would I be comfortable strapping my $500 phone to my arm and running for two hours with it? Would I be willing to switch from Verizon to Cingular also? Ask me in ten months when my Verizon contract is up...

Monday, January 08, 2007

41-14

What more can I say? I honestly feel bad for Ohio State. They are a great team that had a lot of bad luck and didn't know how to respond. It reminds me of when Florida got thumped by Nebraska in 1996.

But forget Ohio State. This is all about The Gators. Chris Leak goes out on top of a historic career. Who wants to claim that Michigan deserved to be there instead of Florida now? I had to listen to so much pre-game hype about how much better Ohio State was than Florida. This was supposed to be a coronation of King Troy Smith, and instead he got destroyed. The Florida pass rush was devastating. It seemed like Ohio State thought they would control the line of scrimmage (they're the bigger, stronger team, right?) and that Florida would have to blitz to get pressure. Wrong!

Florida's offense benefited from lots of great field position, but also from a tentative Ohio State defense that played a ton of zone. They were too obsessed with not giving up the big play that they let Florida do whatever they wanted to offensively. Maybe that could have worked if Florida would not have been playing on the Ohio State side of the field all night. I thought that Ohio State might be vulnerable because they would be overconfident and conservative on offense, but it was actually on defense where this happened.

So Florida reigns supreme, both in basketball and football. That's never happened before. I think it really shows the importance of coaching.

Finally, I hope that Ron Zook takes some pleasure in tonight's victory. A lot of The Gators were recruited by Zook, especially Chris Leak. The team definitely has a lot of guys recruited by Urban Meyer, and he deserves all the tremendous credit coming his way. But Zook was a great recruiter, and all the Gator Nation should feel a debt to him tonight.

Gator Day

Pardon the crazy colors on the blog. I had to change them for today, since this is Gator Day. My kids and I are all donned in Gator gear. I am planning on leaving work early so I can be home in time for the kickoff of tonight's Championship Game.

This will be the third time for Florida in a BCS Championship Game. I remember the other two times quite well. Actually this year is similar in many ways to their first title game against Nebraska in 1996. That game was also in Tempe, AZ and the Gators were playing a heavily favored midwest team with a Heisman Trophy winning quarterback ("Touchdown" Tommie Frazier.) Let's just hope that's where the similarities end and that this year has more in common with 1997, when the Gators won the BCS Championship in the Sugar Bowl by crushing Florida State.

So how can the Gators beat the heavily favored Ohio State Buckeyes? Well, first I'm hoping for a little help from Ohio State. I'm hoping they will be overconfident and play conservatively. They have a great running game and Jim Tressel has been known to lean on that running game heavily against teams that he thinks his team "should" beat. I'm hoping that he employs that strategy against Florida, because Florida can stop the run. Just ask Arkansas.

I'd love to see Chris Leak get a chance to really do what he does best -- throw the ball all over the place. However, Chris has not had his best games against tough defenses. The Ohio State - Michigan game showed that you can run against Ohio State if you have speed. So I expect to see a lot of Deshawn Wynn and lots of running plays or screens to the wide receivers. Ohio State will be paranoid about Percy Harvin, so don't be surprised if Bubba Caldwell has some opportunities on reverses and screens. Harvin is going to get the ball, though. It doesn't matter that Ohio State may be the first team this year to gameplan specifically for him. I expect to see some kind of trick play involving him catching the ball deep. Maybe from Tim Tebow?

Florida hasn't blown out too many teams this year, and they're not going to start with Ohio State. If Ohio State plays conservatively, I think the game will stay close and that Florida has the advantage in such a game. I'm most worried about Ohio State coming out like they did against Michigan, spreading the field and throwing the ball a lot. Florida's strategy against that kind of offense this year has been to say "you may make some big plays against us, but we'll force some negative ones too." I think they would play the same way against Ohio State, I'm just not sure if they could cause enough negative plays to negate the big plays that Ohio State is capable of. I'm also worried that Ohio State could actually run the ball in that scenario.

Sunday, January 07, 2007

Thanks Nancy

I've been a registered Democrat since I turned 18. I voted for Bill Clinton twice, Al Gore, and John Kerry. Still, I generally disagree with the Democratic at least as often as I agree with them. That didn't stop me from being encouraged when the Democrats won control of Congress in November.

When I heard about the First 100 Hours Agenda, I wasn't overly impressed. I am definitely not a fan of raising the minimum wage or lowering student loan interest rates, for example. However, with President Bush preparing to announce his plan to increase troop levels in Iraq, I am relieved to finally see the Democrats stand up on Iraq. It's been one of the most disappointing things as a Democrat. They've been so afraid of being labeled unpatriotic or soft on terrorism that they've never gone out and demanded a withdrawal from Iraq. Granted a few Democrats have done this on their own, but the whole party. Pelosi is (supposedly) going do just that. No more "let's adopt the whatever-commissions recommendations" blah blah blah... Instead the Dems are goings to finally deliver the message their constituents have been shouting at them: "Get out of Iraq."

Friday, January 05, 2007

Blogging from Google Docs

I had heard about using Google Docs to blog. This seemed like it could be promising, since Google Docs has a little nicer interface than Blogger. Also, one had to figure the integration should work really well given that my blog is on Blogger -- which is also part of Google. I'm actually writing this blog using Google Docs (what used to be Writely.)

Setting up the integration wasn't quite smooth. I entered my blog as a Blogger(beta) (even though I thought it isn't a beta anymore...) and it told to optionally list the name of the blog. I put in "Programming and Politics." I hit the "test settings" button and it said everything worked. I then wrote a blog and published it to my blog. It was posted to the wrong blog: Mike's Photo Blog . I had misspelled the title "Programming and politics" so it instead defaulted to the first blog it found under my account: Mike's Photo Blog. Once I corrected the title, it posted to the right blog. It would have been nice if it would have told me I got the name wrong, or if it would have provided me a list of blogs to pick from (seems like that would be the best solution, and it show just be a simple AJAX call.)

Next issue was the title. Supposedly it would use the title of the document for the title of the blog if your blog "supported titles." Certainly my blog has titles to its document. I titled the blog, but it's title did not go through to the blog. So I had to re-edit it inside Blogger to give it the right title.

Next issue was tags. Blogger calls tags labels, but Google Docs calls them tags (like the rest of the world, and other Google apps.) It claimed that any tags for the document would become tags for the blog. Only problem was that there was no tagging option from either the edit doc or publish doc screen. It actually does exist from the "Active Documents & Spreadsheets" screen.

One other kind of frustrating thing is spell checking. One thing I really like about Firefox 2.0 is that it checks spelling for you automatically. When I want to fix the spelling, I just right click on the misspelled word. Only Google Docs takes over the contextual menu. So instead I have to use it's own spell checker. I can understand them taking over the contextual menu, but they should put spelling corrections as part of it. That's MS Word does, too, of course.

Thursday, January 04, 2007

Disappointing Dolphins

Yesterday's news that Nick Saban had left Miami for Alabama was not surprising. It was yet another disappointment in a season of the for Miami. The Dolphins finished so strong last season that I really thought they would be a playoff team this season. When they traded for Daunte Culpepper, I thought they could go deep in the playoffs, depending on how well Daunte had recovered from knee surgery.

Then reality struck. Daunte was nowhere near ready. The offense struggled because of his knee problems, but that wasn't all there was to blame. Losing offensive coordinator Scott Linehan really hurt too. Joey Harrington at QB made the Dolphins passing game roughly equivalent to what it had been at the end of last season, except that Chris Chambers was now missing. I have no idea what happened to him. He looked like he could be the best receiver in the game at the end of last season and that was with nobody throwing to him. Harrington was no worse than Gus Frerotte. Frerotte's QB rating last season was 71.9 while Harrington's rating this season 68.2. Not a huge difference. One can only imagine that if Chambers was playing at anywhere near the level he had played at in 2005 that Harrington's rating would have certainly been higher.

The only good news was that the defense stayed solid. It was another good year for veterans Jason Taylor and Zach Thomas. I think Taylor has a good shot at NFL Defensive Player of the Year, especially since his top competitor, Shawn Merriman, has a steroid cloud hanging over his head. Of course now Taylor is talking about retiring... Having your coach quit probably isn't going to help convince him to stay.

As for Saban going to Alabama... It sucks he has to go to an SEC team! He's a good coach. He's not really getting any more money there, I think he just wanted an easier job. The NFL was too much for him. So it's probably a good thing for Miami in the long run. An offensive minded coach is really needed in Miami. I think Culpepper can still come back as can Chambers. Ronnie Brown definitely progressed this year, and could blow up with a good passing game around him.

Tuesday, January 02, 2007

Digital Holidays

The holidays are over, but hopefully we all have fond memories from the time we spent with our friends and families. The modern spin on this is that it's really easy to digitize those memories now, in this day and age of digital photography. It's easy for everyone to take tons of digital pictures. No more running out of film, and you don't have to wait to get the photos developed. A lot of printers now support direct printing -- just plug in your camera once you're done snapping up shots of the kids opening their presents and print them out to mail them to grandma.

A company downstairs from my company, Presto, has an even easier way to share those digital pictures with grandma. Buy grandma a Presto/HP printer and she'll get a Presto email address. Send your pics to her and they'll print out on her HP printer automagically.

I like to download my pics to my computer still. I usually use Picasa and then upload the pics to Flickr. My friend Terry often has good tips on digital photography in his blog.

Note: This post is sponsored by HP.

Monday, January 01, 2007

NFL Season: Thoughts

The season is over. The playoffs start next week, but first some thoughts about the 2006 regular season.

Surprise Team: Obviously this has to be the New Orleans Saints. I definitely underestimated Drew Brees. I didn't think he had a pro arm. Honestly, I'm still not completely convinced. His season reminds me of Kurt Warner's monster seasons with the Rams. Warner didn't have a pro-arm, benefited from playing in a dome, was surrounded by great talent, played in a great offensive system, and was extremely smart and accurate. That combined for two regular season MVPs (would have been three if his finger wouldn't have been broken) and a Super Bowl MVP. This year's Saints aren't quite as good as those Rams. Brees is as good as Warner, but their combo of McCallister and Reggie Bush is not equal to Marshall Faulk. Marques Colston may be as good as Torry Holt, but Joe Horn is no Isaac Bruce at this point (remember Bruce was #1 with a bullet on that Super Bowl team.) They don't have the O-Line that the Rams had either. The other big surprise to me was how well the Eagles played down the stretch.

Disappointing Team: Pittsburgh Steelers. Yeah I know they had a tough schedule, but it's to understand what happened to them. Their defense was good, but not as good as they were last year (or the year before or the year before that or...) I don't think a tough schedule is enough to justify them being #20 in Pass Defense, especially given their record. The bigger problem though was Roethlisberger. It seemed like he was really becoming a dominant QB in the playoffs last year, and his stats in his first two seasons were excellent. But a 75 QB rating this year is just terrible. Everybody fretted over them losing Jerome Bettis, but Willie Parker was #6 in the NFL in rushing and was tied for 4th in rushing TDs. That's huge. No, the problem on offense was the QB. Pittsburgh proved that the passing game is the most important thing in pro football. They ran the ball well, and they did a great job in stopping the run (#3 in the NFL at 88 ypg,) but they did not throw the ball well and they did not stop the pass well. The result was an 8-8 season. Of course I was also very disappointed with my team, the Miami Dolphins. I'll have to devote an entire blog to that though.

Surprise Players: As mentioned earlier, Drew Brees was a big surprise, as was Jeff Garcia at the end of the season. Frank Gore was awesome for the 49ers. Norv Turner is the greatest RB coach, ever. Look at the amazing success he had with Emmitt Smith, Stephen Davis, Ricky Williams, Lamont Jordan, and now Frank Gore. Sure Emmitt and Ricky Williams were great talents, but even they clearly had their best years playing for Turner. Steven Jackson was also dominant at the end of the season for St. Louis. Who would have guessed that Mike Furrey would have 98 catches? Or that Lee Evans would have 1292 receiving yards. I thought that future Hall-of-Fame WR Marvin Harrison would decline some this year, but instead he had 95 catches, 1366 yards, and 12 TDs. Wow. And what about Aaron Kampman? That's a lot of sacks on a bad team.

Disappointing Players: Also as mentioned, Ben Roethlisberger was a huge disappointment. Same thing for Eli Manning and Michael Vick. The Giants made the playoffs in spite of Manning, and Vick shows no sign of ever being able to quarterback a pro team. His QB rating entering the season was 75.7 and his rating for the season was... 75.7. At leas that was a little better than last year's dismal 73.1. He set a record for QB rushing with 1039 rushing yards. A lot of good that did. He had a career high in rushing attempts and interceptions. Funny that. Other disappointing non-QBs: Shaun Alexander, Willis McGahee, Randy Moss, and Chris Chambers.

MVP: Obviously it's Ladanian Tomlinson. He lead the league in rushing, had a great 5.2 yards/carry, and of course he set a new TD record. He was also the best player on the team with the most wins. Drew Brees was amazing as well, and so was Peyton Manning for that matter. It's easy to take him for granted, but he had less running game and his defense stunk at stopping the run, yet look at all the wins. It's amazing that his team could be so bad against the run, and he could post a 100+ QB rating at the same time.

Playoff Predictions: Super-upset... Kansas City over Indianapolis. Peyton Manning is supposed to be a choker. Indianapolis can't stop the run, and Larry Johnson is a pretty good running back. Dallas also has a good chance against Seattle, who never seemed to play all that well this season. Dallas didn't play so well down the stretch, but at least they looked good at times. There's no way the Jets will beat the Patriots. It's hard to imagine the Giants beating Philadelphia, mostly because of how good the Eagles have played down the stretch and how bad Eli Manning has been... Chicago is very vulnerable in the next round, and I hate to say it, but it's because of Rex Grossman. You just can't turn the ball over like Rex does and win in the playoffs. San Diego definitely seems like the team to beat. They have great balance. Philip Rivers has played great this year, but you have to wonder what he'll do if he's asked to win a game late in the 4th quarter. So... San Diego over New Orleans in the Super Bowl? That's too chalky, so I'll pick San Diego over Philadelphia instead.

Sunday, December 31, 2006

2007 Resolutions

  1. Continue to lose weight. I should get down to my target weight of 185 lbs. this year.
  2. Run a half-marathon. Maybe the SF Marathon this summer?
  3. Pay off college loans. Finally...
  4. Scripting languages. I've dabbled in Groovy, and have written some small webapps with Ruby (and Rails of course.) Time to write something that's actually complex this year.
  5. Organize my documentation. I write a lot of documentation, I can't help it. I need to be more organized with it, though. Documentation (always before coding) really helps me think through my design, but the lack of organization makes it less than useful to others.
  6. Play more chess. I started to play a little this year, but then stopped. I need to hone my skills, since I'll need to teach it to Michael, Jr. pretty soon.
  7. Bike to work. Not everyday, but at least once or twice this year when it's warmer. My big problem with it is not biking to work, but biking back home at the end of the day. I'll just need to bike home before dark one day, or early enough to catch the train.

Favorite CDs of 2006

I mentioned before that the Red Hot Chili Peppers' Stadium Arcadium had to be my favorite CD of the year. I bought it in May, and the two discs have continuously occupied slots #3 and #4 in my car's changer pretty much ever since (after I had ripped the discs with CDex of course.) A lot of people criticize it for being a double-CD. Double-CDs are always a little indulgent, and everyone can always make their personal list of what songs should have been included in an-even-better single CD. Of course usually everyone's list are slightly different. Stadium Arcadium has a ton of really great songs that are more and more rewarding on subsequent listens. That defines a great CD to me. My favorite songs on it are "Especially in Michigan," "Snow (Hey Oh)," "Wet Sand," "Desecration Smile," "Stadium Arcadium," "Tell Me Baby," and yes, "Dani California." Here's my other favorites, in no particular order:

Hip Hop is Dead by Nas -- My favorite CD of 2005 was Kanye West's Late Registration. I wondered if it represented a return of great hip hop CDs. The answer is no. Hip Hop is Dead is a very good CD, but it's pretty much the only really good hip hop CD this year. I kind of like Snoop's new one, too, but it's nothing too special.

The Crane Wife by The Decemberists -- I really liked last year's Picaresque, but The Crane Wife is even better. Much better actually. If it wasn't for the Peppers' opus, this probably would have been my favorite of the year.

St. Elsewhere by Gnarls Barkley -- Yeah there are other songs on here besides "Crazy." None as good, but several very enjoyable ones.

Pearl Jam by Pearl Jam -- Maybe I was biased on this one. This is a very good CD, but I probably like it more just because it's by Pearl Jam and it's their first good CD in awhile. Still, you could make a good case for this being the soundtrack of the political changes in America in 2006.

Taking the Long Way Home by The Dixie Chicks -- What is this, country music on my list? This CD is fun and relaxing at the same time, with several memorable songs. The popular "I'm Not Ready To Make Nice" is a great anthem, but I really love "Lullaby." It makes me think of my two sons. What can I say, I'm getting old.

Boys and Girls in America by The Hold Steady -- This CD rocks. It's great to listen to driving or running. I love the singer's voice.

Friday, December 29, 2006

XML Schema Parsing

You might have heard that XML Schema is dead. I read that, and the article it links to as proof, a couple of weeks ago, and was not overly impressed. Not that I don't agree that RELAX is generally easier, but the proof that "everybody with a choice picks RELAX" just does not cut it as a logical argument. It is a classic appeal-to-authority logical fallacy, where the authority here is the collective unconscious of the technology world.

Recently I had a surprisingly difficult problem to solve. I had an input document that was very simple. It looked like this:

<doc>
<param1>val1</param1>
<param2>val2</param2>
...
</doc>

Then I had metadata that mapped param1 to an XPath for a target document. For example, param1 -> /foo/schmoo/do/wop/dee , etc. I needed to generate an XQuery that would take my input document and produce the target document with the correct values (val1, val2, etc.) inserted into it.

Seems pretty easy. It gets a little harder because this is also possible for the input document:

<doc>
<param1>val1<param1></param1>
<param1>val1a</param1>
<param1>val1b</param1>
...
</doc>

I still have the same XPath for param1, i.e. something like /foo/schmoo/do/wop/dee. Obviously there's some repeating elements in my target document, but where does the repeating occur? From the above information, you could have a target doc like:

<foo>
<schmoo>
<do>
<wop>
<dee>val1</dee>
<dee>val1a</dee>
<dee>val1b</dee>
...

Or:

<foo>
<schmoo>
<do>
<wop>
<dee>val1</dee>
</wop>
<wop>
<dee>val1a</dee>
</wop>
<wop>
<dee>val1b</dee>
</wop>
...

Obviously there are even more possibilities than this, but you get the point. There's no way to be sure. But I was armed with two more bits of information.

First, and this is big, I knew that there could only be one repeating element in a given XPath. Of course this is not true in the abstract, but for my particular problem it was true. So either wop repeated or dee repeated, but not both. Next, I knew the XML Schema of the target document. So I could figure out if it was wop or dee that repeated. That is enough information to create the XQuery.

Now all I had to do was parse the XML Schema for the target document. No problem, right? There are a lot of Java XML Schema parsers out there. I was already using Sun's JAXB Reference Implementation, and it included Sun's XSON XML Schema Parser. So I decided to give that a try.

XSON is a pretty pure implementation of the XML Schema specification. It's objects correspond directly the ones you see in the spec, as do the relationships between these objects. And there's the problem. The spec is very complex. It has the smell of a class "design by committee" spec.

In a design by committee, everybody has their own ideas on how to do things. So the design winds up being "all-inclusive" so that everyone's ideas are present, and nobody gets their feelings hurt. Such all-inclusive designs are complete Frankensteins. XML Schema is definitely a Frankenstein.

My task was really simple. I knew the name of an element from the XPath. I just needed to get the cardinality of this element. First thing first though, I had to parse the schema. This wound up being trickier than I expected. The schema I needed to parse referenced two other schemas. Here's its references:

<xs:include schemalocation="includedSchema.xsd">
<xs:import namespace="urn:my:namespace" schemalocation="importedSchema.xsd">

The schemas were sitting in the same package as the schema I was parsing. I knew that this was going to be an issue, so I wrote a simple EntityResolver that would use a ClassLoader to load these schemas. Only that did not work. My EntityResolver would not get invoked at all. Instead, XSOM would throw an exception complaining about relative URLs being used with no base URL being set.

This was aggravating. If it would only give the EntityResolver chain a chance, then all would be resolved. But no. So I had to change the include and import statements:

<xs:include schemalocation="http://complete.garbage/includedSchema.xsd">
<xs:import namespace="urn:my:namespace" schemalocation="http://complete.garbage/importedSchema.xsd">

Amazingly this worked. Now it invoked the EntityResolver chain, and my custom resolver loaded the referenced schemas. Here's my parsing code:

EntityResolver resolver = new MyCustomResolver();
XSOMParser parser = new XSOMParser();
parser.setEntityResolver(resolver);
// load the initial schema into an InputStream
parser.parse(myInputStream);
XSSchemaSet schemaSet = parser.getResult();
XSSchema mySchema = parser.getSchema("myNamespace");

Now back to finding the cardinality of the element. To find the root element turned out to be very easy:

XSElementDecl rootElement = mySchema.getElementDecl("root_from_xpath");

That's easy. No need to check the cardinality of the root element, as it cannot be greater than one. It turns out that even if I wanted to check it, I could not. Why? Because in XSD, Elements do not have cardinality. Only Particles have cardinality. A Particle can be an Element, but the relationship is not reflexive, i.e an Element cannot be a Particle.

Unless you are already familiar with XSD, you're probably thinking what I thought: WTF!?!? What is the point of this non-reflexivity? Every Element except the root one is in fact a Particle. So by disallowing a symmetric relationship, you've only made sure that you can't get a Particle for the root Element. That's all you've bought. And what have you suffered? Well instead of finding an Element and getting it's Particle to get its cardinality, you must find a Particle that happens to be the Element that you want, and check that Particle's cardinality. It's like you descend to the lowest level of a tree to check some metadata, then go back up a level to get the other metadata that you need. I did find a nice diagram that shows this relationship, though it doesn't make it look as diabolical as it really is:



So back to the problem. As I descend an XPath, I need to find the Particle in the tree representing to the Element whose name corresponds to the name in the XPath. So I need the ComplexType of the current parent Element. Obviously some recursion is needed, so I defined a XSComplexType variable called current to use for the recursion:

XSComplexType current = rootElement.getType().asComplexType(); // initial value

Then at each step in the XPath, I had a string localName that was the element name:

XSContentType content = current.getContentType();
XSParticle particle = this.findParticleForElement(content.asParticle(), localName);
XSElementDecl element = particle.getTerm().asElementDecl();
if (particle.isRepeated()){
return element.getName();
} else {
current = element.getType().asComplexType();
}

The key is the findParticleForElement method:

private XSParticle findParticleForElement(XSParticle particle, String elementName){
XSTerm term = particle.getTerm();
if (term.isElementDecl() &&
term.asElementDecl().getName().equals(elementName)){
return particle;
} else if (term.isModelGroup()){
for (XSParticle p : term.asModelGroup().getChildren()){
XSParticle temp = findParticleForElement(p, elementName);
if (temp != null){
return temp;
}
}
} else if (term.isModelGroupDecl()){
for (XSParticle p : term.asModelGroupDecl().getModelGroup().getChildren()){
XSParticle temp = findParticleForElement(p, elementName);
if (temp != null){
return temp;
}
}
}
return null;
}

You might wonder why the extra recursion in the find method. Well XSD allows for inheritance, and this is what causes the extra recursion. An element can have a ModelGroup as a child, and the children of that ModelGroup can be ModelGroups themselves. So you could have to descend several ModelGroups before finding the target element, just to find a direct child element.

Sunday, December 24, 2006

Favorite Songs of 2006

I was picking songs to listen to on my iPod last night, and thought about my favorite songs of the past year. Here they are, in no particular order:

Supermassive Black Hole -- Muse
Vicarious -- Tool
Crazy -- Gnarls Barkley
Where'd You Go? -- Fort Minor
Out Here All Night -- Damone
Had a Bad Day -- Daniel Powter
Upside Down -- Jack Johnson
Hip Hop is Dead -- Nas
Paralyzed -- Rock Kills Kid
Gold Lion -- Yeah Yeah Yeahs
Think I'm in Love -- Beck
The Joker and The Thief -- Wolfmother
Snow (Hey Oh) -- Red Hot Chili Peppers
Especially in Michigan -- Red Hot Chili Peppers

I could probably list a lot more songs from the Red Hot Chili Peppers' Stadium Arcadium. That was definitely my favorite CD of the year. Maybe I'll make a list of other good CDs later next week.

Saturday, December 23, 2006

Bose Quiet Comfort 3 Headphones

My company bought everybody Bose Quiet Comfort 3 Headphones as holiday gifts. I thought that was a pretty nice gift. I think last year my old employer gave me a flashlight as a holiday gift... I wear headphones a lot, especially while programming. So I was pretty happy about this gift. The thing is, I already had some pretty good headphones.

I've been using Sony MDR-V600 headphones since high school. I remember in 1990, when I was a sophomore in high school, and a friend of mine had just gotten back from his first year at UF. He had his Discman with him and told me "dude you have to hear this." It was Nine Inch Nail's Pretty Hate Machine. It blew me away. What also blew me away was my friend's headphones: Sony MDR-V600's. I knew I had to have both that CD and those headphones. I got the CD a couple of days later, and the headphones the next year ($100 headphones aren't the easiest to come by for a high school kid, especially back in 1990.)

I've been a huge NIN fan ever since, and I had those V600's for eleven years. They were with me on numerous cross country trips from my home in Florida back to Caltech in L.A. By 2002, they were in terrible shape, and my girlfriend bought me a new pair (just a few months before we got married.) I've had those for almost five years now. So I've been a V600 listener for almost sixteen years.

But now I have those fancy Bose headphones. At first, I didn't think they sounded as good as my V600's. I think part of that was because I had been listening to the same headphones for sixteen years. Another reason was because the QC3's needed different equalizer settings the V600's. Again, when you've used the same headphones for sixteen years, you forget about changing the equalizer. For what it's worth, the QC3's needed more treble and less midrange than the V600's. Finally, the QC3's are less sensitive than the V600's. It's a common stereo salesman trick to use the higher sensitivity of a speaker as a way to "prove" the speakers sound better and are worth the extra $$$.

Now I actually think the QC3's sound as good as the V600's. I think the midrange and treble are a little clearer on the QC3's, but the V600's have a little more detail on the low-end. The QC3's are punchy on the low-end, but lack some detail. This is pretty typical of Bose, from what I hear. These are the first Bose products I've owned.

The QC3's are really comfortable and the noise cancellation is excellent. They also seem like they will be more durable. I've gotten a lot of use out of the V600's, but their headbands and ear cushions fall apart pretty easily.

Thursday, December 21, 2006

The End of Computer Viruses

Remember back when the news was filled with stories of some new computer virus or worm that was wreaking havoc with corporate networks and home computers all over the country and world? Remember Melissa, I Love You, Code Red, Slammer, Blaster, and MyDoom? Of course you do, it was only two years ago when "malicious" code and "outbreaks" were in the headlines on a regular basis.

Do those days seem long gone? We really haven't seen any kind of "outbreak" in the last two years. The last worm that got any kind of press was Zotob. One can argue that the only reason it got a lot of press was because it hit CNN's website.

So what's happened? Are people much better at keeping their OS updated with the latest security fixes? Do we all have anti-virus software that is also frequently updated? Those things are probably true. You have to give credit to Microsoft, too. The mighty XP Service Pack 2 (and Server 2003 Service Pack 1) plugged a lot of holes. It turned on firewalls and it annoyed the crap out of you if you didn't have the latest patches and an updated anti-virus program always running.

Vista is even more secure than XP-SP2, with Microsoft finally realizing that having every user as an administrator by default is a flawed strategy. However, is the extra security even needed? Maybe it will provide extra deterrence to spyware, but the age of the computer virus appears to be over.

I'm not just saying this because of the lack of notable outbreaks over the last two years. I recently had coffee with a friend of mine who works for a major security software company. He told me the entire emphasis in the company has switched from viruses to spam. It's not nearly as high-profile. There's not going to be a story on CBS about spam making it into your inbox, but that's where the money is now. The only capitalist conclusion is that viruses are dead. Of course to put my money where my mouth is, I should turn off the antivirus software on my computers...

Wednesday, December 20, 2006

Sharefare Update: Ludi Labs & Roost

Six months ago, I posted that I had left Vitria and was working for a start-up called Sharefare. I couldn't say too much about what we were doing at the time, since we were in classic stealth mode. I've gotten some pings from a couple different folks lately about Sharefare, and there's been a lot going on, so I figured it was a good time for an update.


First, Sharefare changed its name to Ludi Labs (I think this still points to the old Sharefare site, be patient.) Ludi Labs comes from Herman Hesse's The Glass Bead Game. The name change was made official about a month ago, and I even have a fancy business card with the new name.

Update, February 2: The CEO of my company has asked me to temporarily remove the information I had provided in this post. I was quite surprised by this request, since I didn't really think there was anything revealing, but c'est la vie.

Sunday, December 17, 2006

Christmas Shopping @ Circuit City

Saturday I finished up my Christmas shopping. I was researching a certain product and found it very cheap at Circuit City. What was bizarre was that it was $10 cheaper to buy online than at the store. Circuit City offers in-store pickup at no extra cost, so basically I could save $10 by buying it online and picking it up at the store. So that's what I did.

They gave me a confirmation number to use. Of course the Circuit City site suggested I print out the confirmation number, I probably would usually (trees be damned, heh.) But at the time, my wife was in the middle of printing a ton of Christmas stuff. The confirmation number was emailed to my GMail account. So I figured that even if I really needed the number, I would just get it off my GMail via my cell phone. However, I didn't really think I would need the confirmation number.

So I went to Circuit City, where I had to battle crazy Christmas traffic just to find a parking spot. I finally did, and waltzed into the store. There I was greeted with a long line to customer service, and there was a sign indicating that customer service was where I needed to go for "web pickup." Fine. So I waited in the line, and finally got the customer service counter. There the clerk asked me for my confirmation number.

I told him I didn't have it, so he asked for the credit card I used to buy the item online. This was exactly what I expected. I handed him my credit card, but after swiping it he said there was "no hit." He asked for the phone number I had used when I placed the order. I gave him this number, but again "no hit." He then preceded to lecture me on how I should have printed out my confirmation number.

At this point, I brought out my cell phone only to see the dreaded "no service" indicator. How could this be? My phone is through Verizon and Circuit City sells Verizon phones! I've had the phone for a year and I've never lost service on it anywhere in the Bay Area. I've taken it to the east bay, San Francisco, all over the penisula, and of course all over Silicon Valley. Never any problems. I've biked in the hills south of San Jose, up to Calero Reservoir, and never had problems there. But for some reason at Circuit City in South San Jose... no service. The ever-so-helpful then suggests that I go use "the broadband terminal" to retrieve the confirmation number from my email.

I was annoyed to say the least. I see the "broadband terminal" and of course there's a ton of people there. So I went outside, where I had some spotty service, and retrieved the number. Then I stood in line -- again -- and finally met with the same clerk, but this time with confirmation number in hand. Finally I got my purchase.

Amazing how I can pick up eTickets for thousand dollar plane tickets with just the credit card used to purchase the tickets, but this is not good enough at Circuit City. I'm not sure what bothers more -- that this did not work, or that the guy tried to use it and it did not work. I'm not so sure I'll be doing the in-store pickup again at Circuit City anytime soon.

Wednesday, December 13, 2006

Hacking My A950

About a year ago, I switched my wireless service to Verizon and bought a Samsung SCH-A950. It has a lot of nice features, but in typical Verizon fashion, some of these were crippled.

First off, it is a music player, but Verizon made it where it could only play WMA files, not MP3s. I had read that Samsung included an MP3 player, but Verizon just disabled.

Next, while it is a Bluetooth phone, it only supports Headset and Hands-free profiles. In particular, it does not support Dial-up networking. That's a real shame given the EVDO network it can connect to.

I had found this link on enabling MP3 and DUN, but it seemed like too much trouble. But today I cam across this gem. I enabled the "Hidden Menu" by simply punching in 1475369126874#*. From there it was easy to enable MP3 playback. I haven't tried the DUN option yet, since it's not over Bluetooth and thus it's not as interesting to me.

Monday, December 04, 2006

BCS -- The Final Chapter

So it was a good weekend for the Gator Nation. I was surprised to see USC fall, though they've really been pretty shaky at many time this year. I was pleased to see how well Florida played against Arkansas, particularly the Florida defense holding Arkansas to 130 yards total on the ground. I still thought that there was a very good chance that Michigan would get a re-match with Ohio State for the BCS Championship.

Then I saw a lot of people lobbying for Florida on Saturday nigth and in the papers on Sunday morning. I think the thing that held weight for a lot of people was that a team playing for the national title should have won it's conference. A Big 10 vs. SEC championship just made a lot of sense to people, so even though they may not have liked Florida, they moved them up to #2 in the polls. That turned out to be enough, and now Florida will play Ohio State on January 8.

I'll be the first to admit that Florida may not be as good as Michigan. However, I don't think Michigan could do any better the second time against Ohio State than they did the first. It is usually harder to beat a team twice, but Michigan was lucky to be within 3 points at the end of that game. A neutral field would help them, no doubt, but I think Ohio State would have won by double digits. Maybe Florida doesn't have a chance either, but I think their defense will give Ohio State some problems. Ohio State has not played against any team with anywhere near the speed of Florida's. But whatever. Florida deserves a shot at the title more than Michigan, who has already had their chance to beat #1. We all know that a playoff is needed, and now they'll be a lot of people from Michigan behind that idea. The entire SEC has been behind the idea ever since what happened to Auburn a few years ago.

Tuesday, November 28, 2006

MP3 CDs


One of the nice features of my car is that it's stereo plays MP3 CDs. However, the display is kind of annoying. One of the great things about MP3s is that they have embedded metadata. So notice that the artist (A Tribe Called Quest) is being displayed on left side of the display and that the name of the current song ("Butter") is also being displayed. So what is up with "TITLE 004"? What ID3 tag is being used for this? Why doesn't it say the title of the song ("Butter") there instead? Also, up in the right corner notice FOLDER 04. What should be there?


The CD in question was made using iTunes. Admittedly, iTunes' support for MP3 CDs is not exactly extensive. It burns them just fine, but it doesn't expose the folder concept. The only way to get folders on the MP3 CD is to sort the playlist by the Artist. If you do this, iTunes will create a folder per artist, and the inside that folder, a folder per CD. So in the case above, there was a "A Tribe Called Quest" folder and it contained a folder called "The Low End Theory." The song "Butter" was in this folder. So instead of FOLDER 04, I would have really liked it to say THE LOW END THEORY.

Anyways the TITLE 004 is more annoying. Even if it said the title of the song, it's still weird. There are four fields for displaying data, but only three logical pieces to show (song title, artist, and folder/CD.) I guess you could also show something else like genre or year, but that doesn't seem like what my stereo is trying to do.

So maybe there is better software out there for creating MP3 CDs. I have used Nero, and manually created the folder structure. I got similar results to what I got with iTunes, but obviously spent a lot more time creating the CD. Time to do some research...

Monday, November 27, 2006

JRockit and Tomcat

I decided to try out BEA's JRockit JVM a try as my server JVM. It bills itself as being a much faster JVM on x86 machines. So far it doesn't seem that much faster, except when running the JVM in debug mode. For that, it seems to launch much faster than HotSpot did. Actually there seems to be little difference in its startup time in debug mode vs. "normal" non-debug mode.

The only weird thing was that when I attached Eclipse to it, Eclipse complained about some line numbers not being reported by the code. This had no effect on any of the breakpoints I had set. Those worked flawlessly. It seemed to be around CGLIB enhanced byte-code, but there were obviously no breakpoints set in such code. I set a breakpoint in code that I knew would be CGLIB enhanced, but that still worked fine.

Just for kicks, I decided to also use JDK 1.6. I had a colleague tell me that "Mustang" was a lot faster than JDK 1.5. I was in for quite a surprise. My application threw an NPE while starting up. Why would changing JVMs cause an NPE? The startup was indeed much faster, but that was because the NPE caused less things to load. The NPE happened while Spring was "gluing" together several beans. I investigated a little, but found nothing obvious. Maybe I will dig deeper later.

Update: Not sure what caused the above problem, but since the official release of Mustang, I've switched over to using very successfully. There are definitely some big performance improvements, both in the client and server modes. I'm looking forward to making use of its scripting language features.

Sunday, November 26, 2006

This Week's BCS Musings

I have to admit, I was more relieved that Florida beat FSU than thrilled. It wasn't because I'm getting caught up in the hopes of a national championship for the Gators, it's just because it was so obvious that Florida was a much better team, yet the game almost got away. The Seminole defense really rallied at halftime and the team played with a lot of emotion. That was scary. Having two drives deep into FSU territory that resulted in zero points in the first half was scary. Picking off FSU three times in the third quarter and getting nothing from it was even scarier. Losing Deshawn Wynn and Percy Harvin (Harvin's injury particularly scary) was even scarier. So it was a relief to watch Chris Leak being allowed to just drop back and throw the ball down the field and put up a go-ahead TD in the fourth quarter. Coach Meyer let Leak do what he does best, and Leak responded with a huge day overall and a clutch performance in the fourth quarter.

Once the feeling of relief was over then it became a thrill to have beaten FSU three years in a row. Then it was time to start thinking about the BCS. The big game was Notre Dame at USC, of course. The "smart" thinking is that USC needed to knock off Notre Dame and then lost to UCLA if Florida was to have a chance of going to the BCS title game. Well USC took care of Notre Dame. Yay.

There were a lot of other BCS storylines this weekend though. First, LSU knocking off Arkansas was probably a bad thing for Florida. It means that beating Arkansas next week (big assumption there by the way) will not boost Florida's BCS standing as much as it would have if Arkansas had beaten LSU. Of course it shouldn't matter if Team A beats Team B, as long as Team C beats them both, right?

Still the LSU win was part of several wins that show just how tough Florida's schedule has been. LSU, a team Florida beat, is a top ten team and they beat another top ten team. South Carolina, another team Florida beat, defeated a top 25 team in Clemson. Georgia, another victim of Florida, beat another top 25 team, Georgia Tech. Tennessee, a team Florida beat on the road, beat a seven-win team in Kentucky. Altogether, teams that lost to Florida earlier in the season knocked off four teams with a combined record of 33-10. Interestingly, 33-10 is also the combined record of LSU, South Carolina, Tennessee, and Georgia if you leave out their losses to Florida.

So what was I saying about not getting caught up in the BCS madness? I'm really not. Numbers are just interesting to me. Florida has very little chance of playing Ohio State. I will be happy if they just beat Arkansas next week. Arkansas's McFadden is the scariest player the Gators have faced this year, and that's saying a lot. Hopefully the Gators can force Arkansas into passing, because that's obviously a weakness for them. If so, it will be Florida's first SEC championship since Spurrier left, and that's a big deal.

I really think that Florida's offense is two (no, not one) years away from being the explosive offense that Meyer can produce. Chris Leak is a great quarterback, but he is a bad fit for Meyer. I think that Meyer has done a poor job of making use of Leak, Dallas Baker, and Andre Caldwell. They aren't his kind of players (Caldwell can fit into his offense, but it's not a great fit) and he hasn't done a good job of adjusting to them. Next year he will have Tim Tebow in there, but I really think it will be 2008, with Tebow as a junior, that the offense will put up huge numbers.

The defense is championship caliber this year, though. People love offense though, hence all the talk of "style points" and Florida's lack of them. Could Florida run the tables in a playoff? It's hard to say. The defense has been great, but in all fairness, they haven't played any really elite offenses. Tennessee is the best offense they've played, and they were very good against them. LSU is also a good offense. They will be tested next week against Arkansas, but it's hard to say if they could shutdown an elite offense like Ohio State, Michigan, USC, or Notre Dame. Maybe we'll get to find out in the Sugar Bowl...

Saturday, November 25, 2006

Food, food, food

I changed my diet and lifestyle in August of 2004. Since then I've lost 135 lbs. and I'm planning on losing another 20 lbs. or so. That doesn't change the fact that I love food. My "diet" has been counting my calories and fat very closely during the week, but eating pretty much whatever I want on weekends. Since this is Thanksgiving weekend, I thought I would write about some interesting eats I've had recently.

Last weekend, my sister Jeana was visiting from Florida. She's been out here several times over the years, so she's seen most of the typical tourist things in the Bay Area. We decided to take a little trip down to Santa Cruz. It's the off season there, but as somebody who grew up in beach town, I know how pleasant it can be to visit the beach in the winter.

I could write about a lot of things in Santa Cruz, but this is about food. We had lunch a little Mexican place right across from the Boardwalk called El Paisano Tamales. The remarkable thing about this place was its giant burritos -- fifteen inches. I had to order one. It was a pretty good burrito, and it was huge. I've had better burritos, but never a bigger one.

Next, back at the Boardwalk they had the kind of food you usually find at carnivals and fairs. That included a fried cheesecake. I had to give one of these a try. It was a lot like fried ice cream, but with cheesecake inside the fried tortilla instead of ice cream. It was good, but I think it could have been better if the cheesecake would have been cooler.

For Thanksgiving, I like to make a pie every year. Other people make the traditional pumpkin pies, so I try to do something a little different. Last year I made a cherry-red raspberry pie. I liked it, but everyone else seemed to think it was too tart. I probably needed to reduce the filling more than I did, which would have sweetened it up. This year I decided to make an easier pie, a traditional apple pie. I found a great recipe that was both really easy and very good. The key ingredient was applesauce. More gourmet recipes use Cortland apples that reduce into an applesauce during cooking, so this is kind of a shortcut to accomplish the same thing.

This was a Paula Deen recipe. My wife and I were watching her show and she had an interesting recipe for the classic cheeseburger and fries. We tried those this weekend, and they were great. We only made "one level" burgers instead of the giant duplexes from Mrs. Deen's recipe, but they were still delicious.

Wednesday, November 22, 2006

Eclipse Tuning

Everybody loves Eclipse, right? It's become ubiquitous, right? It's been my primary IDE for a couple of years now. Lately, I've run across some issues with it though. And when I say issues, I mean crashes.

Eclipse has a relatively easy to find log file (in $project_home/.metadata/.log) and I quickly found the problem:

!MESSAGE Failed to execute runnable (java.lang.OutOfMemoryError: PermGen space)

The dreaded Java out of memory problem. I found a couple of interesting bits on this particular variant of the out of memory problem, i.e. PermGen space. This article points to using the JVM flags for increasing PermGen size, while this one claims that HotSpot has garbage collection problems on long running processes (I have Eclipse open all day usually) but that JRockit does not have these problems.

I have some experience with tuning my JVM, so I decided to tune Eclipse as my first option. To do this, you just have to edit $eclipse_home/eclipse.ini. Here is what mine looks like now:

-vmargs
-Xms256m
-Xmx512m
-Xmn128m
-XX:+UseParallelGC
-XX:MaxPermSize=128m

This seems to work pretty good. I haven't had any crashes since then and Eclipse launches much more quickly. I threw the UseParallelGC in there to take advantage of the extra core on my CPU, but I'm thinking of removing that. Seems like Eclipse is a little less responsive with that option, but that's very subjective.

Monday, November 20, 2006

Another Year, Another BCS Controversy

I wasn't too worried about the "what if Rutgers goes undefeated" talk and how they would "deserve" a shot at the BCS title. However, as I suspected, Michigan's loss to Ohio State only dropped them to #2 in the BCS standings.This has caused Urban Meyer to go crazy about the possibility of a rematch between these two teams.

First off, I don't think Michigan should be #2 in the BCS. They only lost by a field goal, but the game really was not that close. They stayed in the game because of Ohio State turnovers, and they were lucky to get two of those three turnovers. They had luck on their side and they still needed a late TD + 2pt conversion to get within a field goal. If it wasn't for the turnovers, they would have been blown out. Ohio State was clearly the better team. If the two teams do play again in January, there is no question that Ohio State will win by double digits.

That being said, Michigan is probably just as deserving as anybody else out there, where anybody else is USC, Florida, Arkansas, and Notre Dame. I would love for Florida to play Ohio State, even though I would also be very nervous that they too would get blown out. However, USC has the inside track, current BCS standings be damned. Michigan is done. USC's ranking will go up if they beat Notre Dame and UCLA, and they don't have go up much to put them ahead of Michigan. They control their destiny.

Things only get crazy if USC loses. I don't think Notre Dame will go ahead of Michigan or the SEC champion. It seems very unlikely that The Irish will play Ohio State. It seems like the SEC champion should move up to pass Michigan, but it's a little bit of a crap shoot. Certainly if something bizarre happened like Florida lost to FSU, but then beat Arkansas would lead to the Big 10 rematch.

I still think it's unfair to Ohio State that they would have to beat Michigan twice, but Michigan would only have to split with them to win the national championship. However, I think Ohio State would handle Michigan easily, but who knows. Many people have pointed that Florida State faced a similar situation in 1996 when they had to play Florida again the Sugar Bowl. That was probably unfair for FSU, but that was also one of the "problems" that the BCS was supposed to solve. That year, FSU was #1 and Ohio State was #2, but they did not play because the Big 10 did not participate in the BCS at the time. So Ohio State went to the Rose Bowl and was upset by the Jake Plummer lead Arizona State. The next day, FSU played #3 Florida in the Sugar Bowl, and was completely crushed by the Gators. It only became a national championship game because of Ohio State's loss. If Ohio State had won the Rose Bowl, then they would have been national champions without having to beat the #1 team, FSU. So a lot of things were messed up then.