Sunday, November 19, 2006

Milton Friedman 1912-2006

This week saw the passing of the great economist, Milton Friedman. There is a nice homage to him on Cato. I can proudly say that I am one of the many people influenced by Friedman. I double majored in economics for three years in college, before I wimped out and settle for a single degree in math. The economics classes at Caltech were definitely tilted to the highly analytical theories of Keynes. I would often find myself dreaming of IS-LM curves. I knew about Hayek and the Austrian School, but they seemed to be saying "it's too hard to use math on economics, so don't even try." A lot of their theories were reactionary ones to the rise of fascism and communism as well, so they seemed dated in the 90s. Then I read Friedman.

Actually it was Friedman's writings on health care and the AMA that really got to me. When I learned this was from his book Free to Choose, I had to read that. It made me question some of the "traditional" interpretations of the causes of the Great Depression. It occurred to me that it was a revisionist view that the Depression was caused by "capitalism gone wild" and that it was government regulation, particularly the Federal Reserve monetary policy, that had really aggravated the Depression. Suddenly the Depression was no longer an IS-LM consequence, and the kind of "solution" implied by that kind of analysis actually made the Depression worse.

Now I can't say that Friedman turned me into a Republican or even a Libertarian. I know he advised Regan, but I really don't think Reagan's economic policies reflected the kind of theories presented by Friedman in Free to Choose. I am still convinced that despite Friedman's opposition to communism, that his theories were totally incompatible with Reagan's policies towards the former Soviet Union. Embargo and massive military spending had no place in Free to Choose. I will say that my opposition to public education is tied to my interpretation of Friedman's theories.

So I must pay my respects to Friedman. A lot of people claim that times has shown that Friedman was wrong and that Keynes was right. What's funny to me is the revisionism at work. The great success of capitalism in the 90s has been racked up to successful monetary policy. They say that Keynes stood for this, not the fiscal policy of the New Deal or the socialist democracies of Western Europe. That's the real legacy of Friedman. He's caused history to change its version of Keynes.

Tuesday, November 14, 2006

BCS

It's that time of year again. Time for BCS controversy. I have a particular interest this year, as the Florida Gators are ranked #4 in the BCS. Clearly the winner of this weekend's Michigan vs. Ohio State game will be #1, so the question I am most interested in is, can Florida make it to #2?



It seems to me they will need some luck. Their final two regular season games are against Western Kentucky and FSU. Now in most years a game against FSU would be a chance to improve your BCS ranking, but not this year. The Seminoles are only 5-5 going into this week and just came off a game where they were shutout at home. In the BCS view of teams, they are a cupcake, only slightly better than Western Kentucky.



So that would leave the SEC Championship game as Florida's best chance to improve its BCS standing. Indeed, Florida could play Arkansas, another one loss, top ten team. A win over Arkansas would be huge, and could really push Florida forward.



Still, I think Florida needs to hope for USC to lose. They have home games against Cal and Notre Dame is ranked similarly to Arkansas, and Cal is far ahead of Western Kentucky or FSU. So if they "take care of business" it would seem like they would stay ahead of Florida. If they lose to Notre Dame, the Irish would seem like they would have a decent chance of passing Florida. It would be close, but I think Florida would stay ahead.



Of course the other wildcard in things is the loser of the Ohio State/Michigan game. Would it be too far fetched to see the loser of a close game, particularly if it was BCS #1 and road team Michigan, stay ahead of USC and Florida? It would seem kind of unfair for the winner of that game to have beat the other team twice to win a National Championship. That's what FSU couldn't do in 1996 to setup Florida's only National Championship. How many more years like this before we finally get a playoff...

Monday, November 13, 2006

Slideshow Software

This past weekend was Raymond's first birthday party. One of the things I did for Michael's first party was make a slideshow video of the best of the many, many pictures we had taken of Michael. Of course a lot of the pictures were really cute, and it's also interesting to see him grow up in the pictures. I thought I would do the same thing for Raymond.

When I did Michael's slideshow, I used my G5 with the iPhoto/iDVD integration. It's been almost two years since then, and I am no longer a Mac user. I didn't think something as simple as making a slideshow would be require very sophisticated software. I decided to try Windows Photo Story. This was a disaster.

It was easy enough to add photos, edit photos, etc. It was the music that became the first problem. First, you have to place the music in the slideshow manually, i.e. pick which picture to start each song on. There is no fit to music. It default to 5s durations per slide. So you basically have to either pick enough music to take 5s * number of pictures or edit the duration of each slide. If you go the second route, it gets worse. There is no way to change the duration for all the slides or even two slides at a time. That's right. If you wanted to make it 6s per slide and had 200 slides, then you have to change this one at a time on all 200.

But wait, it gets worse. Photo Story incorrectly calculates the length of variable bit rate mp3s. If you're like me and use LAME to rip most of you music, then most of your mp3s are variable bit rate mp3s. So for example, I wanted to include the song "Close to Me" by The Cure. If I look at this song in iTunes, it correctly shows it as being 3:40 long. In Photo Story, it was convinced the song was over 6 minutes long. So in my editing of the slideshow, it showed what slide the song would end on. Of course I picked the next slide to begin the next song, and what did I get? Three minutes of slides with no music behind them.

I thought about trying Windows Movie Maker instead, but then I figured that a more general purpose program for Microsoft would probably not be any better at a specialized task. So at the advice of my wife, I tried using Adobe Photoshop Elements.

We use Picasa for organizing our pictures, but before we switched to using Picasa, we used Adobe Photoshop Album which then became Adobe Photoshop Elements. This was a much better experience. First off, it had the coveted "fit to music" feature. However, it still had issues with vbr mp3s. All was not lost. It allowed me to simply edit how long each song was to play. So I could look at iTunes and see how long each song really was, edit it to play for that much time, hit the fit to music button and I easily had seamless music for my slideshow.

There were some things that were nice about Photo Story. It automatically did the Ken Burns effect, something I liked from using iPhoto. I'm not sure if there was an option for this in APE. I liked Photo Story's UI a little better too.

Now it was time to burn my little slideshow so I could play it at the party. Here is where things were not so good again. APE did not have any kind of DVD burning option. It did have a VCD option, so I thought I would give that a try. First it converted the slideshow to Windows Media Video file (why oh why this option) and then it tried to burn it to a CD. It took forever for it to make the WMV file and then it had an error burning the CD. I couldn't just put in a new CD for it to try again, it had start over. This was really annoying.

So instead of doing the burn VCD option, I decided to just export to WMV so that at least the fruits of the labor would be persistent. Again this took a long time. I had done this on Photo Story and it was much faster (and gave a lot more options on the quality, and it was encoding a slideshow with the aforementioned Ken Burns effect enabled, which would seem like a more complex encoding task.) The encoding did seem to make use of both cores on my computer, keeping one core maxed out and the other at around 70%, but it still took close to an hour to encode a 20 minute video.

Once I had the video, I decided to use Nero to burn it. My only option with a WMV on Nero was a Super VCD, so I went with that. Again, Nero had to decompress the video before burning it, which took awhile. Once it did that, it burned rapidly. The quality was really not that great. The WMV movie looked very good, but the burned result was so-so. I made the WMV at 800x600, the highest quality offered by APE and a much higher resolution than Super VCD supports. Still the encoding-decoding-encoding process is going to be lossy, no way around that.

So all this made me really miss my Mac! It was so nice being able to create the slideshow in iPhoto, then just export it to iDVD. The DVD it would burn was really nice, and of course I could do other fun things like create menus, etc. for my DVD. The WMV creation with Photo Story was definitely a lot faster than the similar step on the Mac, but was painfully slow from the Adobe program. I'm not sure if it was slower than the same thing on the Mac. The other steps were a lot faster than they were on the Mac, but again I'm comparing a first generation G5 Power Mac to a year old, custom built Athlon 64X2. Still, I would have gladly traded a slower encode/burn process for an easier creative process.

Now there are other software packages out there. I used Roxio Easy Media Creator at the recommendation of my brother-in-law. It was an incredibly slow program to use, and seemed very unstable. Perhaps it is better now. Still, it's really disappointing that there's not an easy way to do something like this on Windows.

Sunday, November 12, 2006

Data Islands

My company's resident JavaScript guru likes to use a technique called Data Islands. While I can roll some JS and have even been known to make asynchronous calls before there buzzwords to describe such a thing, I had never heard of this term until a few months ago.

The idea is simple. You have some server side technology that is serving up data as (drum roll please) XML. This XML is consumed by the client side. If you're doing a lot of AJAX after the initial page load, then you might already have client side assets for reading XML and rendering it in the browser. This technique leverages the same thing, only the XML comes over with the initial load of the page.

So how to embed XML? Well somebody at Microsoft apparently decided it would be great just to have an XML tag in the page and dump it all inside that tag. Hence the term data island.

Surely you see where this is going. The data island is a Microsoft thing and its corresponding implementation via the XML tag is only understood on IE. Still it seems like a technique with some merit, and there are ways to get it to work on Mozilla based browsers, too.

Mozilla will ignore the XML tag as just some unknown HTML tag. However, it will try to show the contents of the tag (and the child tags) so first thing for cross browser support is to give your island an invisible style (style="visibility:hidden".) Next you can slurp up the contents of the tag since it still part of the page DOM. You can pass the contents into a DOM parser, a voila!

A couple problems, though. Mozilla still thinks everything is HTML and "reads" it that way first. So if you have a tag that shares its name with an HTML (or JavaScript) tag/reserved word, you'll have issues. No label or title tags. In fact, even an image tag won't work because of it's use in JavaScript. Similarly, no self closing tags like . If you do it like it won't cause problems, but it will be ignored completely, like it wasn't even there.

That's a lot of baggage to deal with. I investigated some alternatives.
  1. Load the island asynchronously. Chances that the reason you would use the data island technique is that you are also using AJAX for updates to your page, thus you wanted to re-use script written for that XML. In that case, you could just load the data island with a separate AJAX call after the page loads. Obviously the big drawback here is that you have to make a second call to your server to load the page.
  2. Emebed your XML as a JavaScript string instead of an HTML tag. In this case Mozilla won't try to read it as HTML, so it won't give you all the weird things mentioned above. The big drawback is that this is not as efficient on IE, since you aren't making use of the special mechanism, and you have to make sure to make your XML string JavaScript string friendly.
  3. If you're going to go the route in #2, then you might just consider going one step further. Don't use XML at all, and just make your data into a JSON string that is evaluated when your page loads. I didn't do any testing, but this would seem like it has to be pretty close to being as fast on IE as the data island, while still being cross browser. Maybe I'll put that hypothesis to the test. Obviously the big drawback is that you'll want all your client-server communication to use the same mechanism, so you don't have redundant code. Thus you'll probably want to use JSON for your AJAX calls.
I'm kind of partial to #3, which is probably the biggest mutation of the data island technique. I can hear a lot of people saying "well you shouldn't try to make use of an MS extension to HTML anyways..." Don't forget that XMLHttpRequest was once an IE-only extension from MS, but became a "standard" that is now the cornerstone of so many web applications. The data island technique is very complimentary to AJAX, so maybe it will see the same kind of adoption.

Friday, November 10, 2006

San Jose and Pro Sports

There's been a lot of interesting south bay/pro sports developments recently. There's been a lot of speculation that the Oakland A's would move to Fremont, and that seems to be coming true. I was near the proposed site of the new ballpark, just a few weeks ago. I was eating at what used to be my favorite restaurant when I was in college. It should be a great place for a ballpark. Their is already a lot of progress in widening 880, the freeway that would run by the park, and BART is being expanded down there, too. There is speculation about a name change for the A's, to either the Silicon Valley A's or San Jose A's. I like the latter. I don't know of any pro sports team named for a region instead of a city (or a state, and the California A's seems unlikely.)

The more surprising news was that the San Francisco 49ers want to move to Santa Clara. I'm not sure if this is just a scare tactic to getting a new stadium in San Francisco, but really it makes sense for them, just as it makes sense for the A's. The San Jose/Silicon Valley area has more people than San Francisco or Oakland, and more importantly, they are more affluent. There's a lot more land in the valley. There's a lot of rich companies who could be corporate sponsors for stadiums, scoreboards, whatever. More money and more people ... what's not to like about that? The Sharks have been very successful in San Jose. Now we just need the Warriors to move down here, since Larry Ellison failed to bring the Sonics here. I'm guessing the 49ers might want to keep their name, but I like the sound of the San Jose 49ers.

Election Results

There's a lot of happy Democrats these days. Tuesday's elections could not have gone much better for them. Crazybob pointed out that a big win on Tuesday was not necessarily a good thing in terms of winning in 2008. I'm generally pleased. Many libertarians like to point out that gridlock is a good thing in Washington. I'll more or less agree with that.

Of course part of me wonders why it took two years for people to realize what a terrible mistake Iraq was. That's the real difference between now and 2004, right? There are a lot more people willing to say something negative about us being in Iraq now, but in 2004 such people would be quickly labeled unpatriotic. So what's changed? It may sound glib, but I don't think most people are that bothered by the American casualties and they certainly don't give a damn about the Iraqi casualties. So I guess the main reasons are just the general lack of progress and probably more importantly, the fading of the blood lust inspired by 9/11.

Tuesday, November 07, 2006

Election 2006 -- Propositions

I didn't get to post this before I voted this morning. So here's how I voted on the many state propositions.

1A -- Yes. It's amazing this is even needed.
1B -- Yes. More roads are badly needed.
1C -- No. I don't need the state to support urban development.
1D -- Yes. This was a hard one for me. Public education is a disaster, thus it is easy for me to say no on this. However, a vote either way on this will not make it more/less likely for education to be privatized. So the positives outweigh the negatives.
1E -- Yes.
83 -- No. It doesn't make sense to me that the GPS monitoring of citizens can be constitutional. Right now it might just be "sex offenders" (which can include an 18 yr old boy who has consensual sex with a 17 yr old girl,) but maybe tomorrow it's speeders or whatever.
84 -- Yes.
85 -- Yes. As a parent, I would expect my consent to be needed for my child to have any kind of operation. Parents need to be responsible for their children.
86 -- No. A classic case of trying to use a tax to impose one group's opinion ("smoking is bad") on another.
87 -- No. I could actually stomach a big tax that made gasoline cost more. However, I can't stomach the money going to some new state bureaucracy.
88 -- No. Property tax is already ridiculous, especially given the housing market in California. Maybe my no vote here cancels my yes vote on 1D.
89 -- No. Tax payers should not pay for political campaigns, and citizens should not be prevented from making their opinion ("I want to vote for Mr. Smith") heard.
90 -- Yes. The anti-Kelo measure. Eminent domain has always been abused, but maybe this can decrease the number of instances of its abuse.

Saturday, November 04, 2006

Election 2006 -- California State Races

Next up on my look at who/what I will be voting for on Tuesday are the state elections. Might as well start off with the big one.

Governor
Back in May I voted for Steve Westly over Phil Angelides in the Democratic Primary. I probably would have voted for Westly over Schwarzenegger, but there is no way I would for Angelides over Arnold. Honetly it would have been a tough call between Arnold and Westly, and I may have voted for Arnold anyways. I've agreed with most everything he's done the past couple of years. As for the Libertarian candidate, Art Oliver ... His stance on immigration is too extreme. Plus he likes to quote "think tanks" such as Cato and Reason way too much. Think for yourself, or at least pretend to. He strikes me as somebody who embraces the Libertarian philosophy simply as a means to an end. That's the exact kind of Libertarian I dislike, and the kind that is willing to support the massacre in Iraq all in the name of lower taxes.

Lt. Governor
Does this position matter? Anyways... First the usual Dem. v. Rep. ... In this case it's John Garamendi vs. Tom McClintock. I really don't like McClintock from the recall of Gray Davis. I agree with him on a few things, but there are too many things that I completely disagree with him on. Garamendi isn't that great either, but he'll probably get my vote. What about third party candidates? Well, the Libertarian candidate, Lynette Shaw, is interesting to say the least. Her major issues are medical marijuana and amnesty for illegal immigrants. I actually agree with both of these stances. However, she seems very ... out there. Her website rambles quite a bit, and it's just hard to take her serious. American Independent candidate Jim King wants to do away with the state income tax. That sounds good. However, he's also all about the family-unit. That smells like bigotry. All in all, no good choices. So I'll probably vote against McClintock, thus vote for Garamendi.

Secretary of State
This is an interesting race just because its a position that emphasizes the regulation of elections. In general I favor electronic voting. I don't have the paranoia about this that most Democrats do. Embrace technology. We should know who wins an election within minutes of the polls closing. I don't favor requiring photo ID to vote. I think that would just lower the number of voters in some demographics, and I don't see how that can be viewed as a good thing. Finally, I don't favor public financing of elections. If I want to run for office, I should be able to spend as much money as I want to get the word out. Similarly, if my friend is running, I should be able to spend as much as I want to get the word out. That's freedom of speech. So the candidate closest to my positions is probably the incumbent, Bruce McPherson. I guess my stance is actually pretty close to "status quo."

Attorney General
One last interesting position. There are a lot of candidates with interesting stances. Green Party candidate Michael Wyman and Peace and Freedom candidate Jack Harrison both oppose the death penalty, as do I. However, they both want to "prosecute corporate thieves" and I hate that kind of demagoguery. Ken Weissman has a degree in math and is a Libertarian. He's against victimless crimes like prostitution and drugs. However, he's pro-death penalty, and it's hard for me to accept a Libertarian who is pro-death penalty. Next up are the "major" candidates. First there's Jerry Brown, Democrat. He puts "controlling greenhouse emissions" and "protecting a women's right to choose" as high on his list of priorities. Should those be priorities for Attorney General? Just seems like party line BS. Finally there's Republican Chuck Poochigian. His priorities include sex offenders, gangs, and the three strikes law. There's no way I'd vote for this guy. I'm especially opposed to the three strikes law. So, I think I'll vote for Weissman.

Monday, October 30, 2006

Election 2006 -- Local Races

It's election time again. The election is just over a week away, and I have a lot of candidates and propositions to read up on and make some decisions. I've been using SmartVoter to start my research on some of the lesser known candidates and issues. Here's my take on a few of the things I've read so far...

State Board of Equalization, District 1

Reading through the list of candidates, first I came to the incumbent, Betty Yee, Democrat. She sounded OK. She is endorsed by teachers. That's a red flag to me. After all, teachers have a huge vested interest in a regulatory position such as this one. Next was David Neighbors, Republican. He looked interesting. He's from San Jose and is very much in favor of tax and government reduction. Finally, I came to Kennita Watson, Libertarian. Now here's somebody to get excited over. She's went to MIT. I liked her position on some of the propositions that are being voted on. She wants to use technology to make paying taxes/regulations easier and the tax-collecting bureaucracies more transparent. She does seem a little naive, but what the heck, she's getting my vote.

State Assembly, District 24

Jim Beall, Democrat is the incumbent. He's big on funding education, a big negative in my book. His ideas for universal health care don't sound nearly as terrible as most such proposals. Kind of a wash overall. His website has issues, and that makes me think he's a little sure he's going to get re-elected. If there's one place where a candidate's website matters, it's Silicon Valley. Lionel Silva, is the Libertarian candidate. Unlike Ms. Watson, he doesn't seem like a libertarian I can agree with as much. He's against the Kelo eminent domain abuse, which is good. He's also in favor of "neutral" redistricting. That's one of those classic red herrings to me. Finally, there's Lawrence Hileman, Republican. He's a programmer, and wants to lower taxes. Those are good. But he's too caught up in immigration reform for me to vote for him. I think I will go with Beall, mostly for lack of a better alternative.

Mayor of San Jose

Ah yes, Chuck Reed vs. Cindy Chavez. This has been a pretty nasty campaign here in San Jose. Basically Reed played the "you're a buddy of Ron Gonzales" with great effectiveness, until Chavez found records of Reed making very questionable expenses as a city councilman. Reed re-paid the questionable expenses, but he had lost the moral high ground. So it comes down to issues. Reed is pro-business and development to combat housing prices. Chavez is big on law-enforcement and education. Not all of her education ideas are terrible (corporate sponsored scholarships sounds ok), but they are not great. Reed definitely seems like the smarter candidate as well, so he gets my vote.

Measure A

This is a local measure to place extra restrictions on "rural" lands. Reading the for/against arguments still leave this as a confusing issue. For me, extra regulation on land use is generally bad. Plus, it tries to make a county regulation to override municipal ones. I'd rather leave things up to the municipalities. So I will vote against Measure A.

Next I will look at some of the state races.

Thursday, October 26, 2006

More on Firefox 2.0

I upgraded my home computer with Firefox 2.0 when it became GA this week. The other critical factory in the upgrade was that the del.icio.us extension was upgraded to work with FF2. My wife and I both use this extension, so this was necessary if I was going to upgrade our home computer. That's when the trouble started.

The del.icio.us extension does indeed work with FF2. However, I immediately began having issues with it in combination with the Google Toolbar. My wife also uses the Google Toolbar, and she had the same problem. Disabling either one of the extensions seemed to solve the problem. We both chose to disable del.icio.us, as we both found the Google Toolbar more useful. She likes it's autofill for forms (I like this too) and I use its site search a lot. That's an invaluable tool for searching for things on open source forums. Those forums often provide their own search, but just using Google to search their site is almost always more effective.

Anyways, things didn't stop there. I was buying some stuff from Amazon, and FF2 froze up. This really annoyed me, especially since I had already entered in a credit card number in the order process. Of course Amazon is good at dealing with this kind of problem. I killed FF2, launched Flock (it's still FF 1.5 thankfully) and went back to Amazon. All was well, as my order was in my cart, and all I could pick up the checkout process right where I had left off.

So at this point I went ahead and disabled all my other extensions: Google Toolbar, Google Browser Sync, FireBug, and FireFTP. Maybe I'll try re-enabling them one at a time, to try and determine what was causing the instability. Hopefully the answer won't be "don't blame the extensions, blame FF2."

Friday, October 20, 2006

Hibernate Tools for Eclipse

There are a lot of Hibernate/Eclipse plugins out there. One that I used recently was the Hibernate Tools plugin that is part of the JBoss IDE. I'm paranoid about installing plugins in Eclipse, since I've used some that caused a lot of instability (XMLSpy comes to mind,) so I only installed the Hibernate Tools plugin, not all of the JBoss IDE plugins.

It seems to be very good for maintaining/upgrading Hibernate artifacts. It was very easy to configure a Hibernate console by using an existing Hibernate configuration file. This file specified annotated classes. I had made some changes to the database, but I was easily able to connect to the DB and generate new artifacts (new annotated classes, i.e. EJB3 Entity Beans.) This served my purposes perfectly.

I could also load a separate Hibernate configuration file, this one that specified classes mapped with good 'ol HBM XML files. I could easily generate Entity Beans for these classes as well (or new HBMs, etc.)

I also gave it a try at reverse engineering from an existing schema. This worked very well. I still like Middlegen's interface for this, since it allows you to easily customize data types (like specifying java.util.Date instead of java.sql.Timestamp) and relationships (removing inverses, etc.) Still, this seems to be a great all-around tool.

IE7 Released To The Masses

I got a "critical" Windows Update today to install: IE7. Yep, Microsoft has not only released it to the masses, but as expected, is pushing it as a critical update for all XP users. I had been using it on my work computer for awhile now, though I had kept IE6 on my home computer. I have been mostly pleased with IE7, so I will go ahead and upgrade it on my home computer as well.

Now that IE7 is out, I figured it was time to test its performance. I read this bit about how it performed a lot better than IE6 on sites heavy with JavaScript and DHTML. So I treid it against my favorite JS benchmark, BenchJS. I decided to pit it against the other "modern" browsers, Firefox 2.0 RC3 and Opera 9.0.

First I ran IE7. I stripped it down by disabling all add-ons and by stripping down all the XP chrome and effects. The last time I had ran IE6, it had taken around 19-20 seconds for BenchJS. IE7 did it in 9.3 seconds. This seemed similar to what the Zimbra blogger had said, that it was about twice as fast IE6.

Next I ran Firefox 2.0 RC3. Why FF 2.0, and not 1.5? Mostly because 2.0 is what I have installed on my work computer. Second, it seemed more fair to compare Mozilla's latest against Microsoft's latest. My old numbers on FF 1.5, had it clocking BenchJS at around 12-13 seconds. FF 2.0 did it in 6.4 seconds. It looks like Mozilla has also doubled up their speed.

Finally, I brought in the ringer: Opera 9. Opera always kills the compettition on BenchJS. This time it turned out BenchJS in 5.5 seconds. That was actually a little bit slower than last time I had ran Opera, but only by a couple of tenths of a second.

So Opera still holds the speed crown, but Firefox is suddenly only about 1 second behind. IE7 is a nice improvement over IE6, but FF 2.0 is also a nice improvement over FF 1.5! I'm sure the Mozilla devs were feeling a lot of pressure to stay ahead of IE and keep their momentum going. Looks like they've done just that. Microsoft will have to hope that IE's new UI is viewed as an improvement over Firefox. Otherwise, it is still behind the Fox.


technorati tags:, ,

Blogged with Flock

Wednesday, October 18, 2006

Random Bits

A few random things I came across while eating my lunch today.

First, there's this hilarious video about a guy and his struggles with his Mac.

As a former Mac user, I knew exactly what this guy was talking about. I'd still say that OSX crashes less often than XP (though still more often than Linux,) but definitely hangs just as often if not more. I definitely did a "Force Quit" on my old G5 on a regular basis. It definitely seemed to have extended (greater than 5 seconds) hangs that it would recover from as well. I often mused that the reason Apple pushed multi-CPU machines was because it was easier than fixing pre-emptive scheduling in OSX.

Next, there's this little nugget from Cato. It's not surprising to me to see that public schools spend more per student than private ones. Government run businesses are notoriously inefficient. Can a government run business ever be efficient? The USSR never seemed to have any luck, and our school system seems to be striking out as well. Of course there's more to the story than Cato or the Goldwater Institute would like to admit. Public schools include lots of "special need" students that may not be as common in private schools (maybe even non-existent?) It seems likely that per-student spending on such kids is much higher than on other kids. In general, having to support diverse groups of children is going to cause a lot of inefficiencies. Of course you can argue that's just more proof that public schools should be discarded.

Finally, Monday night I watched the MNF game, Chicago at Arizona. A lot of people were blown away by how Arizona "found a way" to lose a game where they had a big lead. That wasn't the most memorable thing to me though. I came away from that game thinking "ESPN has to get rid of Tony Kornheiser."

Now a lot of people have really liked him on MNF. This was easily the mos interesting game of the year so far on MNF, and it showed the problems with a guy like Kornheiser. He is obvious and unoriginal. He does not have insights, and simply looks to contradict the other commentators.

For example, there were a couple of times late in the second quarter where Chicago made bad turnovers. Arizona had chances to really build their lead. It could have been 35-0, but instead it was 20-0. That's a big difference. Theismann and the visiting Charles Barkley tried to raise the possibility of this being a potential turning point in the game. Arizona did not have the killer instinct to put away Chicago, and this was going to lead to a Chicago comeback. You can argue if that was insightful of them or not, but all Kornheiser could say was "Hey look at the scoreboard! Arizona is up by 20! There is no turning point!"

Later, Theismann first wanted Arizona to let Matt Leinart throw the ball more, since that was the only way they had success. Then after some incomplete passes, Theismann warned about how incomplete passes were stopping the clock and leaving Chicago with time to make a comeback. Of course Kornheiser had to point out the contradiction by Theismann, but that's all he did. He had nothing more insightful like "Just run the ball, even if you get 0 yards and go three-and-out" or "Don't worry about stopping the clock just stay aggressive, and have confidence in your defense." Theismann wanting to have it both ways is annoying, but Kornheiser just being "hey you screwed up, nyah nyah" is much worse.

Kornheiser is like the guy you watch an action movie with who is always pointing out how such and such stunt is impossible. Eventually you stop inviting that guy to watch movies with you. ESPN probably can't make that call, yet, but they will have to. He's OK in games that are blow-outs, where ragging on the team being blown out is one of the only wayts to keep it interesting. He just doesn't work in a game where the game itself is interesting. His negativity is just annoying.

Tuesday, October 10, 2006

GoogleTube

The big news in the Valley is Google's acquisition of YouTube for $1.65B. I gotta say that I was pretty surprised, like most people.  YouTube certainly has its share of naysayers. Mark Cuban thought only a moron would buy YouTube because of the possible copyright lawsuits that could erupt. Actually he has a lot of negative blogs on YouTube. Many other people point YouTube's lack of a business model.

So are they all wrong and Google right? Maybe. One would guess that Google has some ideas on how to monetize YouTube while maintaining its huge user base. Google is the king of non-invasive but effective online ads. So the question becomes, will Google get sued like crazy for all the copyright material on YouTube? Is YouTube really just the new Napster?

That's the million dollar question, or I should say the $1.65B question. What's interesting is that Napster got slammed by lawsuits before they had made much (any?) money. The music industry was more concerned that they were losing money because of Napster than they were with making money from Napster.

Thus can we say that YouTube is not viewed as having a negative effect on the TV and movie industries? Those mediums have certainly suffered in recent years. So one would think that if they thought that YouTube was hurting them, they would have sued already and shut them down. Of course, it may be a question of timing. Maybe YouTube just hasn't been around long enough. Maybe those kind of lawsuits would have happened next year.

Or maybe not. Maybe YouTube has little effect on movies. Most of its effect is probably on TV. I would guess that any effect it has on TV is insignificant compared to the effects of DVRs and audience fragmentation caused by the proliferation of cable content. Killing YouTube would not have helped the major networks.

That doesn't mean they won't go after Google/YouTube, given Google's deep pockets. But it would hardly be an easy fight. You must assume that Google would not have made the YouTube purchase if it was not prepared to fight. It would be a costly fight for the TV networks, and time is on Google's side.

No, even as Mark Cuban admits, Google would have more to fear from small content creators than from the major networks. He even thinks lawyers would upload content to YouTube just to build a case against them. Maybe he is right. The RIAA has shown that a big company taking on lots of people is not effective, even if they win most of the lawsuits.

Still, it seems like Google could prepare for this and try to make it as difficult as possible for these people. Setup some kind of system for taking down the content, thus forcing plaintiffs to jump through all kinds of hoops. As most customer service departments know, if you make it difficult enough, most people will give up.

On another note, Terry points out that Google's acquisition seems like an admission of failure for Google Video. I think that's right on. Google Video was a pain for personal content, unlike YouTube. Of course it also tried to double as a paid video service, competing with iTunes Video. I think that's the real story here. Google couldn't do amateur video as good as YouTube, and they couldn't do "professional"(paid) video as good as iTunes. Apple is winning the video download market, just as they've won the audio download market.

technorati tags:, ,

Blogged with Flock

Sunday, October 08, 2006

The Yankees and A-Rod

I was surprised as anyone to see the Yankees go down in four games to Detroit. I knew that New York's pitching was very suspect, but I thought that Detroit's pitching was hurting a little and that the best offense in baseball would get to it. Boy, was I wrong. Sure the Yanks got to them in game 1, but that was because Detroit's rotation was not setup for the playoffs. Detroit had battled Minnesota for the AL Central crown and had gone to extra-innings on the last day of the season trying to hold off the Twins. Once their big three starters got into the series in game 2, things changed.

Detroit was lead all year by Justin Verlander, Kenny Rogers, and Jeremy Bonderman. Verlander and Bonderman looked tired at the end of the season, Verlander sported a 5.82 ERA in August and September, while Bonderman had a 4.98 ERA. Meanwhile Rogers had struggled against the Yankees in the past. It didn't look good for the Tigers.

But you know the saying, that's why they play the game. The big three were 2-0 with a 2.10 ERA, 1.125 WHIP, and 17K in 21.1 IP in the ALDS. That's dominant. That was the story of the ALDS. The Yankees offense was silenced by the Tigers pitching.

So now things get interesting. Not just because we get a very interesting ALCS between Oakland and Detroit (though I'm guessing Fox is wishing New York was still in there,) but because we get the ultimate soap opera. Once the Yankees have fallen short and we get the soap opera of Steinbrenner trying to fix his team. Already we're hearing that Joe Torre is out, which is pretty shocking. But the big drama is around Alex Rodriguez.

A-Rod's 1-14 ALDS punctuated a season where Yankee fans have been furious with A-Rod. That despite A-Rod putting up huge numbers once again, and just a year after he won the AL MVP. All A-Rod has heard has been boos because "he doesn't come through in the clutch." This is only going to get an order of magnitude worse with A-Rod's 1-14 in the Yankees' ALDS loss.

So what should the Yankees do about A-Rod? Of course the whole thing is ridiculous. A-Rod is one the best offensive players in the game. He's going to challenge many career records for home runs, RBIs, etc. However, it is quite possible that because of all the negative feelings towards him, he may have an even harder time playing to his ability in New York. This is the fault of the Yankee fans and of Joe Torre. Torre should have left A-Rod in the cleanup spot no matter what this year. Playing him the 8th spot against Detroit is unacceptable.

Thus the Yankees may have to trade A-Rod, even though it is a stupid thing to do. Obvously they need pitching. Any team with a promising young pitcher would be fools NOT to trade for A-Rod -- if they can afford him. That's the rub. There aren't many teams that can take on 25M/year salary. So the Yankees will probably have to take on part of A-Rod's salary in order to trade him. I think a Matt Cain for A-Rod trade would be interesting. Maybe the Cubs can convince them to take Mark Prior for him.

A Roy Oswalt for A-Rod trade would be pretty interesting too. A-Rod's stats have suffered in Yankee Stadium (as was predicted by many when he was traded there) because it is a tough place for a right-handed power hitter. His numbers would explode at Minute Maid Park in Houston. Lance Berkman and A-Rod would make for the most lethal 3-4 combo in baseball. Oswalt would not only be the ace of the staff for the Yankees, he would put up huge numbers because he would suddenly have run support. Plus, he's thought of as a "clutch" pitcher who has performed well in the postseason. Again, the Yankees would have to pay part of A-Rod's salary, since there's no way Houston could afford to pay him.

That's only part of the story for the Yankees. They need to figure out if Jason Giambi can play 1st base or not. If not, they need a 1st basemen and they need to trade either Gary Sheffiled or Hideki Matsui (or Bobby Abreu, but I doubt that one.) Sheffield looked terrible at 1st base. That's another strike against Joe Torre.

They also need to move Randy Johnson out of the starting rotation. He cannot hold up for a full season at his age. He could be a terrific relief pitcher, though obviously Mariano Rivera is going to close games as long as his health allows. Mussina and Wang are the only two pitchers that should be in the rotation next year. They should throw some money at Jason Schmidt. That could be a nice rotatoion: Oswalt-Schmidt-Mussina-Wang-whatever.

Blogged with Flock

Thursday, October 05, 2006

My Experience with Vonage (and Comcast)

I saw this article recently on Slashdot. A similar thing happened to my wife, too. We are Vonage and Comast customers. Comcast called our house trying to get us to switch to Comcast VOIP. She made the same retort mentioned in the /. article, saying Vonage is cheaper. They tried to throw the same FUD at her. It didn't work.

We've been very happy with Vonage. Our call quality is excellent. It helps to have a high bandwidth connection (4 megabit.) We have our VOIP box configured to get max quality, even if that means slower connection speed on the computers in our home network. It's never been an issue. Voice quality is always good, and our internet connection is always fast.

VOIP is sometimes looked as a disruptive technology, but it doesn't even qualify I think. Usually disruptive techs are not as good as the techs they are disrupting. They're "almost" as good, and a lot cheaper. In a lot of ways, VOIP is better. It's nice being able to get email notifications that you got voicemail, and then be able to listen to the voicemail online. It's nice being able to re-direct calls automatically to a cell phone when we are away from home (particularly on vacation.)

We switched to Vonage a couple of years ago, when we lived in Concord. We moved to San Jose at the beginning of last year, but because of VOIP, we were able to keep the same number (a 925 area code, even though 408 is the area code in San Jose.)

There are a few things I'd like to see from Vonage. I would like them to setup service in Bakersfield and Panama City, FL -- where our families are. Then we could have virutal numbers in each of those cities, allowing our families to make local calls to us. Again this is something that convential telephone services can't provide. The only thing stopping it from happening is that Vonage doesn't have service in those two cities. I'd also like call blocking on blocked caller IDs, but that's a minor thing.

Oh the big thing that Comcast tried to claim over Vonage was all about 911 service. As long as you make sure that your home address is accurate in Vonage, then you can dial 911 and the police/fire/ambulance/whatever will show up at your door.

technorati tags:, ,

Blogged with Flock

Ruby Time

I started a small project using Ruby recently. It is indeed a Rails project, though the code I am writing for it has little to do with Rails. I like Ruby, but I think that's because I like Java and Perl. I think of Ruby as Perl for Java. Of course there's Groovy now (which I am also a fan of) which is kind of like Ruby for Java (oh wait, isn't that JRuby?)

Anyways, since I think of Ruby in much the way I think of Perl, I figured I would write my code in a simple text editor (notepad2 to be exact) and do everything comman line with Rake. Then I realized there are some great tools out there for doing Ruby development. Ruby on Windows ships with FreeRIDE, a nice little IDE for Ruby. Well actually, the developers are quick to say that it "cannot yet be called a real IDE" but it's pretty close.

But wait, there's more. There are a couple of nice Ruby plugins for Eclipse. Yes, Eclipse. It is my theory that many Ruby developers come from Java, as opposed to other dynamic web languages like PHP and Python. Thus it's not surprising there would be Ruby plugins for Eclipse. All those Java devs wanting to experiment with Ruby can't live without Eclipse!

First there is the Ruby Development Tool or RDT. This is very similar to FreeRIDE, but with some extra features that Eclipse using Java devs have come to expect. Its debugger is just like the Java debugger that is one of the strengths of Eclipse. It also has built-in support for JUnit-like unit testing (Test::Unit.) For Java devs, they will find some limitations. Code completion and error catching are not as good, but that is simply because Ruby is dynamic.

RDT is a lot like the standard Java tooling that is core to Eclipse. For Java web development, there's the Eclipse sister project, Web Tools Platform (WTP.) Similarly RDT has a web development platform called RadRails. This is for Rails, of course, since that seems to be the only web development option for Ruby developers.

As I mentioned, I'm not doing a whole lot of Rails development on this project (yet.) So I haven't played around with RadRails too much. It looks very straightforward, with wizards for creating new Rails projects, target web servers, and databases, etc.

One of the big strengths of Ruby is that it is a fun language to program in. RDT (and presumably RadRails) make this even more enjoyable.

Finally, one last Ruby note. Spring 2.0 was finally released this week. One of the cool features it has is support for Groovy, BeanShell, and Ruby (via JRuby.) It seems a little odd to write a Java interface and then implement it in Ruby, but I can already think of scenarios where it could be useful.


technorati tags:, , , , ,

Blogged with Flock

Tuesday, October 03, 2006

Apple Software Update and iTunes 7.0.1 (Rant)

Recently I installed iTunes 7.0. One of the options it included was to install Apple Software Update. At first I thought, great just what I need, more garbage on my hard drive and eating up memory. Then I thought about how annoying it was to do updates of iTunes. Sure iTunes tells you there is an update available, but all it does is direct you to a web page on Apple's site. From there you have to download the file and run it manually, making sure to shut down iTunes (which is probably running since it was what prompted you to do the update) so that the installer can proceed. Then afterwards I always have to delete QuickTime links it puts all over the place (no option in the installer to not drop these links) and remove QuickTime from my system tray (the installer does not look at the preferences from the old version of QT, or just chooses to reset them.) It's definitely the worst user experience from an Apple product, and it's the most popular Apple product by far (since every iPod owner has iTunes.)

So I decided to install Apple's Software Update, in hopes that it would make this process better. What should a software update program do? Well it would be nice if it could do incremental updates, particularly when the software package is pretty big (and iTunes clocks in as a 35+ MB download these days.) That's pretty hard, though, and few programs pull this off. Next it should be able to download/process the update in a transparent manner to the end user. If it needs to shutdown the program being updated, then it should allow you to do this from within the software update program. If it is going to require a restart after it is done, it should warn you this ahead of time.

So today I load up iTunes and get a warning telling me I need to update iTunes to 7.0.1. This is exactly the same kind of warning I got pre iTunes 7.0. So why did I install this Apple Software Update program? I actually decided to launch it, and it claimed my software was up-to-date.

So of course I had to go through the above painful process, one more time. But wait, it gets worse. When I ran the installer for 7.0.1, it tried to install iTunes in a different place than where it was currently installed. I didn't remember previous versions screwing that up. Next, it asked me if I wanted to install the Apple Software Update program! Of course that program is already installed... Finally, once I got done it told me I needed to reboot Windows. Great, thanks for warning me ahead of time.

All in all, a very disappointing experience. It seems that iTunes is taking steps backwards, not forwards. Maybe Apple should concentrate more on basic software functionality instead of re-designing their UI to compete with Vista... (I know Vista copied OSX, but does that mean you have to change things?)

MLB Playoff Picks

National League

It's a shame that the Mets and Dodgers meet in the NLDS. The Mets were clearly the class of the NL this year, but statistically the Dodgers are right behind them. Their offense scored only 14 less runs than the heralded Mets offense. That's especially impressive since Dodger Stadium is the usually one of the toughest ballparks for hitters. The Dodgers are the pick here. They were a hot team down the stretch. The Mets pitching is going to hurt without Pedro Martinez. The Mets are more of a long-ball team than the Dodgers. Such teams often struggle in the postseason. Dodgers in four games.

If only the Mets could play either San Diego or St. Louis. They would dominate either team. St. Louis limped into the postseason, but they sport arguably the league's best hitter (Albert Pujols) and best pitcher (Chris Carpenter.) They are a much better offensive team than the Padres, who relied on having the best pitching in the league. It's tempting to say "great pitchig beats great hitting." That's garbage though. The Padres will struggle to score against the Cardinals, and that will be their undoing. They will suffer if they pitch around Pujols too much (you just can't put one hitter on base 2-3 times a game, every game, and not give up some runs.) So St. Louis in four games.

So if I'm right so far, we'll have a Los Angeles vs. St. Louis NLCS. I won't go into too much analysis of such a speculative matchup, but I would pick Los Angeles in five games.

American League

What a great season it's been for Detroit. It's probably about to come to a crashing halt though, as they play the Yankees in the ALDS. Detroit struggled against teams with good hitting all year, and the Yankees have the most potent offense in baseball by far. They scored 60 more runs than anybody else.  It's tempting to look at Detroit and see shades of the world champion Florida Marlins from a couple of years ago. Y'know, the team that beat the Yankess in the World Series. The Tigers are coached by Jim Leyland, have the great Ivan Rodriguez catching, and have some great young pitching, all things in common with the Marlins. The Marlins had a better offense (Miguel Cabrera, Derek Lee, Mike Lowell, Juan Pierre, etc)  and Detroit's young pitching has struggled down the stretch (tired arms?) Their bullpen is probably better than Florida's, but it won't be enough. Yankess in four games.

Oakland and Minnesota always seem to lose to the Yankees in the ALDS. This year, they get each other. They are the two hottest teams in the AL. I was leaning towards picking Oakland, especially after seeing Rich Harden crush pitchers in two starts recently after coming off the DL all year. However, Harden struggled in the last game. Still, it's going to be a tough battle. The A's will not be able to touch Santana, and that will be the difference. Twins in five games.

In the theoretical Yankess vs. Twins... I'd like to say it's time for the Twins to kill the witch... but the Yankees were effective against Santana this year, just as they've always been. Without two wins from Santana, the Twins have little chance. So the Yankees in six games.

A Yankees-Dodgers World Series is every TV exec's dream. The Yankees are the better team on paper. If Randy Johnson is back and pitching effectively (two very big IFs) then they should definitely win. Otherwise, the bombers may find it very hard hitting homers in Dodger Stadium. S o I will go with the Dodgers in a six shocking games.


technorati tags:

Blogged with Flock

Monday, October 02, 2006

MLB '06 -- Awards and Postseason Picks

Today was a sad day. No baseball. The regular season ended yesterday, and the postseason starts tomorrow. This postseason is bitter sweet, as it is the first time in more than a decade that my favorite team, Atlanta, is not taking part. So time to look back at the regular season. Here are my picks for the various regular season awards.

MVP

First off, the National League. It is a clear race between Albert Pujols and Ryan Howard. Pujols was spectacular all season. He was the best overall hitter in the NL, as measured by OPS . However, he missed several weeks early in the season. This helped Howard put up greater cumulative numbers with 58 home runs to 49 and 149 RBIs to 137. Pujols still managed 119 runs to Howard's 104, despite Howard having nearly the same OBP as Pujols (.425 for Howard vs. .431 for Pujols) and actually getting on base 21 more times than Pujols. This just shows that Howard had weaker hitters behind him than Pujols. Overall, Howard also racked up 155.5 runs created vs. 141 for Pujols, and even had a slightly better RC/27 outs of 10.19 vs. 9.94. In my opinion RC/27 is just as good as OPS for measuring production. So with a wash on the "average" categories, you have to give the MVP to Ryan Howard with his overall better numbers. He certainly carried his team back into contention, and only a tremendous finish by the Dodgers kept the Phillies out of the playoffs.

Honorable Mention: Lance Berkman. Clearly overshadowed by the other two first basemen, Berkman had a huge season (.315-45-136.) He was definitely behind the other two guys in every category, but he was also easily above everybody else.

Now for the American League. It's kind of a similar story over there. Travis Hafner and Manny Ramirez had great average numbers (OPS and RC27,) but David Ortiz put up much better cumulative numbers, particulary total runs created. Like Howard, he lead the league in home runs and RBIs. In addition, Ortiz was probably the most feaured hitter, especially late in the game. This lead to him leading the league in walks as well. Ortiz is a clear choice over Hafner and Ramirez. The White Sox's 1-2 punch of Jim Thome and Jermaine also had huge numbers, but clearly below Ortiz as well.

No, the only hitter who could challenge Ortiz for MVP is Derek Jeter. Jeter had a great season, finishing second in batting to Joe Mauer. He had a great OBP (.417) which lead to him scoring 118 runs. Obviously his power numbers are nowhere near Ortiz's. In addition, Ortiz's OBP (.413) and runs scored (115) were nearly equal to Jeter's. It's hard to make a statistical argument for Jeter. Really Jeter was only the third best hitter on his team, behind Jason Giambi and Alex Rodriguez. Still, I wouldn't be surprised if there is a Jeter over Ortiz pick, kind of like Terry Pendleton beating out Barry Bonds back in the early 90's.

Cy Young

Let's do the easy one first, the AL. Johan Santana put togther a triple crown season, leading the league in ERA, wins, and strikeouts. Actually, he lead all of the majors in all three categories. Nobody is even close to Santana in the AL. In fact, you can make a strong case for him as an MVP candidate.

Honorable Mention -- Roy Halladay. He put together a great season (16-8, 3.19 ERA) for Toronto. Just nowhere near as good as Santana.

Now for the more contentious NL. Nobody had more than 16 wins in the NL, which is really unusual. Still, three pitchers had significantly better ERAs thant he rest of the league: Roy Oswalt, Chris Carpenter, and Brandon Webb. Oswalt and Carpenter won 15 games, trailing Webb's 16 games. Overall, Carpenter was harder to hit than the other two (.643 Opp. OPS, leading the league) and had more strikeouts. He also played on a playoff team, though Oswalt helped Houston make a run for the NL Central title. Seems like enough of an edge to hand him another Cy Young.

There are two NL relievers worth mentioning. Trevor Hoffman lead the league with 46 saves and had a 2.14 ERA. Billy Wagner was just behind with 40 saves and a 2.24 ERA. Both of these guys helped their teams win their divisions. Both guys also had 5 blown saves. Those are good percentages, but not good enough to pick them over a starting pitcher.

So to summarize:

NL MVP -- Ryan Howard

NL Cy Young -- Chris Carpenter

AL MVP -- David Ortiz

AL Cy Young -- Johan Santana

Next time, I'll put together some playoff analysis and picks.

technorati tags:

Blogged with Flock

Friday, September 29, 2006

Bye Bye Bonds?

I was reading this article from the San Jose Mercury suggesting that the San Francisco Giants should not re-sign Barry Bonds for next year. I was driving to San Francisco on Sunday morning, listening to talk radio, and many of the callers were saying the same thing. The crux of the arguments is that the Giants will have to pay Bonds a lot of money, and if they do so, then they will not be able to make the many upgrades they need to change the team into a contender. The pundits go on to say that if they spend the Bonds money on free agents, then the team will be back in the playoffs. However, the pundits fret that the Giants ownership will be afraid that ticket sales will fall if the Bonds is breaking the home run record for another team. Of course, these guys are all wrong.

First off, the Giants are not going to contend next year anymore than they contended this year. They are 11th in the NL in runs scored, 11th in OPS, 9th in runs allowed, and 11th in ERA. They are not good at anything. The Giants are not an Alfonso Soriano away from contending.

But it gets worse. If the Giants add Soriano, they are letting go of Bonds. Now Soriano ranks third in the NL in runs created, just behind Ryan Howard and Albert Pujols. However, if you look at runs created per 27 outs, then he falls to 13th. That's still pretty good. Bonds is 24th in the NL in runs created, but is 4th in runs created per 27 outs. So when Bonds plays, he is a much better offensive player than Alfonso Soriano. Obviously he doesn't play as much because of his age, thus Soriano winds up creating more runs over the course of a season.

Now will Soriano be a much cheaper player to sign than Bonds? That seems unlikely. Of course he will be around longer, so one could say the Giants will be better in 2008 with Soriano on the team. However, it's hard to argue that they would be better in 2007. They won't be able to improve in other areas if they had Soriano instead of Bonds, because they'll spend as much money on Soriano as they would Bonds. Soriano will play in more games, but will probably not be as productive as Bonds on a per game basis.

The fact is that Bonds is the best player on the Giants. Yes, he's (finally) starting to show his age and is not as good as he was a couple of years ago. But he's still an elite player when he plays. It takes a lot of money to replace an elite player.

Now of course the Giants could sign some other players instead of Soriano, I just picked on him because that's the guy that is being targeted by a lot of the anti-Bonds crowd. So maybe several other players together could more than compensate for Bonds. It's still not going to be cheap.

Once you realize that Bonds is still the best player on the Giants, then you realize that the decision to sign or not sign is not just about him breaking the home run record. The reason the Giants have struggled is they have not produced any quality players from their farm system in recent years. There is Matt Cain, who looks like he's on the brink of becoming an elite pitcher. That's it though. Their best everyday players are all free agent signings, thus they are mostly very old: Ray Durham, Moises Alou, Omar Vizquel.

You can't buy good young players, you must produce them. Look at the NL's top run producing teams: Philadelphia, Atlanta, and New York. Philly has Ryan Howard and Chase Utley, both home-grown. Atlanta's old vets of Chipper/Andruw Jones happen to also be homegrown, but they also have several young homegrown hitters: Brian McCann, Adam LaRoche, and Jeff Francouer. The Mets are in some ways the exception, with highly paid free agent pickups like Carlos Beltran and Carlos Delgado, but they also have homegrown talent David Wright.

Blogged with Flock

Thursday, September 28, 2006

Bill Clinton: Linux Enthusiast?

According to former president Bill Clinton: all you need is ubuntu. I actually installed the latest version of Ubuntu on my home PC this week. It was probably the least painful Linux install I've ever done on that computer. Only weird things I had to do was install a Nvidia driver (apt get nvidia-glx) and then reconfigure X. I only had to do that so I could my monitor's native 1280x1024 resolution instead of the 1024x768 Ubuntu came up with at first. Maybe I should try it on my laptop, since there appears to be a lot of other people installing on the same laptop I have. Of course the volume of info on this subject also suggests that there are a lot of problems with doing it!

Monday, September 25, 2006

Vista RC1

For about a week I've been running Windows Vista RC1 on my laptop. I had used the Beta 2 on my desktop machine. I was unable to use the Aero theme on it, because my graphics card (GeForce4 TI 4400) does not support DirectX 9. However, my laptop's modest Intel 945GM integrated graphics does support DirectX 9, thus my laptop can run Aero quite nicely.

Aero is some nice eye candy. I remember the first time I saw the XP graphics, and I thought "ok that's just silly." Aero is a more impressive evolution.

Overall RC1 is much, much faster than Beta 2. It has some bugs. For example, I can't seem to use my mouse to scroll through contextual menus in Explorer (arrow keys work fine though.) There still seems to be issues around long filenames/paths and with compressed folders. Also, Windows Defender keeps trying to tell me that it is blocking some startup program, but when I open the list of startup programs, all of them are active.

Now will an upgrade be worth it? Probably not really at first, but it will become necesarry eventually. XP was a bigger upgrade in terms of stability, at least when compared to Windows 98 or ME. A Windows 2000 user could get by without XP for a long time, at least until they needed some specialized hardware driver. Seems like Vista will be a tougher sell for XP users.

As for me, I have decided to finally upgrade my desktop's graphics card. The GeForce TI 4400 has been an awesome card. I bought it back when I played games (before I had kids basically.) It was great on games like Medal of Honor and Unreal Tournament. I don't play games anymore, so I will be happy with a cheap, Aero-capable card.


Blogged with Flock

Saturday, September 16, 2006

The Beast

I decided this week that it was time to buy new running shoes. Most folks say buy new shoes every six months or every 500 miles, which ever comes first. My six month mark was last month, but I had a couple of weeks where I could not run for health reasons. So I waited. This past week, I could really tell my shoes had lost their effectiveness. There were allowing me to pronate way too much, especially late in my run and on my right foot. So time for new shoes.

I went to my favorite running store, The Runner's Factory in Los Gatos. This is where I had bought my previous shoes. They had spent a lot of time with me trying on different shoes, running in them, and watching how my feet and ankles reacted to the shoes. My old shoes were Brooks Addiction 6. They had really worked well for me, and I thought I would probably get the same kind today. Not surprisingly, Brooks has replaced the Addiction 6 with (what else) the Addiction 7.

I was going to try out the new Addiction 7, but unfortunately The Runner's Factory did not have any in my size (11EE.) They offered to order them for me. I figured I would give some other ones a try, and if nothing else seemed good, then I would order the Addiction 7.

When I bought the Addiction 6, I had also tried Brooks top shoe for overpronators like me, The Beast. I didn't like how heavy it felt on my feet. Today I tried on the newer version of The Beast. It felt a lot lighter than the old Beast. Even better, it seemed to have a lot more cushioning than either the old Beast or the Addiction 6. So I decided to go with The Beast.

I gave them a good run on my usual route, later this afternoon. I was very pleased with them. They definitely prevent overpronation, and the extra cushioning made me feel like I had some extra spring in my step. They still feel a little heavier than the Addiction 6, but I think it's a good trade-off.

Wednesday, September 13, 2006

New Shiny Software

I've installed a couple of updates to widely used programs: Internet Explorer 7 RC1, and iTunes 7.0.

IE7 RC1

I don't use IE6 much, I mostly use Firefox and Flock. I'm not religious about it, though, so I've been trying out the various revisions of IE7. RC1 is definitely a huge improvement over beta 1 and 2. It is much faster and smoother. It's still slow on my favorite JavaScript test, mostly because it is very slow with opening new windows. The UI has continued to be tweaked, and I think it looks pretty nice. I would not be surprised to see open source competitors adopt some of the UI paradigms seen in IE7.

Now would I use it instead of Firefox/Flock? Probably not. The extensions offered by Firefox still make it a better browser for me. Plus there are still some issues with IE7. For example, it still seems to screw up CSS -- probably because of their incorrect box model. It is horribly slow on scrolling on Slashdot, and has rendering problems on it. Again this is probably because of poor CSS implementation by Microsoft.

iTunes 7.0

I could talk about the new menus, UI tweaks, etc. but it's the album artwork-flipping view that is the coolest. Of course this requires artwork, and Apple is kind enough to provide this for free. I tried to perform this operation on my entire library and had mixed results. iTunes requires an exact match on both artist name and album name. Many of my CDs were ripped using EAC+Lame or CDex, so these names don't always exactly match with iTunes. For example, I had "On and On" by Joe Johnson, and iTunes could not come up with any artwork for it. I changed the title fo the CD to "On And On" and then iTunes found the artwork.

So it's a little buggy with the find artwork. It also seems a little bit slower, maybe because of the extra amount of metadata it's dealing with. I like the menus re-org, and don't mind the other UI changes. I've seen some people comment that it looks more like a Java Swing application, which I find amusing.

Of course iTunes was only a small part of the big announcements from Apple. Yes, my Nano is now officially "old" as it has been replaced by smaller, metallic Nanos. It's nice that they have a 8GB option, and I think it is cool that it only comes in black -- a little extra icing on the iPod status symbol. I was most impressed with its extended battery life and quicker charge time. Those are actually compelling features to me, but definitely not enough for me to replace my nano. I was a little interested by the lower priced, better performing iPods.

The really big news was the widely anticipated iTunes movies for sale. Yeah, they only have Disney (and Disney subsidiary) movies, but you know that will change. They used to only have ABC and Disney TV shows, and look how that has evolved. The pricing seems pretty good, and it's good that they've gone to near DVD quality.

But the real kick is the so-called "iTV." It is unheard of Apple to show a product that is not finished yet. Which makes me assume that it actually is finished, and will be available for the holiday season. Forget the "Q1 2007" -- Jobs is just toying with us.

The idea is great by the way. Forget putting a whole computer in your living room. Nobody wants to surf the web and read email on their TV. They do want to listen to music on their home theater sound system, watch videos and look at their huge photo collection. This little box is going to do all that perfectly. And... with $10 movie downloads off iTunes, it could become a very popular way to buy movies. Pre-order your movie for $10 and it downloads while you're asleep one night. Wake up, and watch it on your home theater system, or copy it to your iPod to watch on the plane or whatever.

Monday, September 11, 2006

Using Annotations to Build Object Representations

One of my co-workers came to me with a familiar problem. He had class that was being rendered as XML. The class itself could have different renderings, so the XML creation was done using a classic builder pattern. This was good, but he still fretted about how his class would probably change (new features, imagine that) and he would have to change the XML builders so they would output the new properties.

It's a classic model-view coupling problem. I had suggested the builder architecture, in part because I remembered a classic article by Holub on this kind of problem. I started thinking and came up with a possible solution. This solution may have its own design flaws, but it was interesting.

My idea was to use Java's annotations to decide what parts of an object need to be present in its representation. Thus the annotation was a clue to the builder saying "show me." A reusable builder could this be built to simply obey the hints provided by the object it was building a representation for. In this case, everything was XML.

So I built a simple annotation class:


import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import java.lang.annotation.ElementType;
import java.lang.annotation.RetentionPolicy;

@Documented
@Target({ElementType.METHOD,ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface XmlView {
XmlViewType value();
}

I created this XmlViewType as an Enum. Basically there could be one value in the Enum for each representation needed. Actually value() should really return an array of XmlViewTypes, since you will often want to show the same data in different representations. Or for maximum reusability, just have it return an array of strings. You can pass in the value to match against later.

Now to create a reusable builder.




import java.lang.reflect.Array;
import java.lang.reflect.Method;
import java.lang.reflect.Type;

import org.apache.commons.lang.StringUtils;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;

public class AnnotationXmlBuilder{

public static Element buildXml(Object obj, XmlViewType type){
String objName = obj.getClass().getSimpleName();
return buildXml(obj, objName, type);
}
public static Element buildXml(Object object, String elementName, XmlViewType type){

if (isPrimitive(object.getClass())){
Element e = DocumentHelper.createElement(elementName);
e.addText(String.valueOf(object));
return e;
} else if (object instanceof Iterable){
Iterable iter = (Iterable) object;
String pluralName = "";
String singularName = "";
if (elementName.endsWith("s")){
pluralName = elementName;
singularName = elementName.substring(0, elementName.length()-1);
} else {
pluralName = elementName + 's';
singularName = elementName;
}
Element e = DocumentHelper.createElement(pluralName);
for (Object obj : iter){
e.add(buildXml(obj, singularName, type));
}
return e;
} else if (object.getClass().isArray()){
String pluralName = "";
String singularName = "";
if (elementName.endsWith("s")){
pluralName = elementName;
singularName = elementName.substring(0, elementName.length()-1);
} else {
pluralName = elementName + 's';
singularName = elementName;
}
Element e = DocumentHelper.createElement(pluralName);
int length = Array.getLength(object);
for (int i=0;i<length;i++){
Object obj = Array.get(object, i);
e.add(buildXml(obj, singularName, type));
}
return e;
} else {
// go through its methods
Element e = DocumentHelper.createElement(elementName);
e.addAttribute("kind", object.getClass().getSimpleName());
for (Method method : object.getClass().getMethods()){
XmlViewType xvt = getAnnotation(method);
boolean showMethod = ((type == null) ||
(xvt != null && xvt.equals(type))) &&
isProperty(method);
if (showMethod){
String propertyName = StringUtils.uncapitalize(method.getName().substring(3));
try {
Object val = method.invoke(object, (Object[])null);
e.add(buildXml(val, propertyName, null));
} catch (Exception exc) {
// eat it for now
}
}
}
return e;
}
}

private static boolean isPrimitive(Type type){
return (type.equals(String.class)) || (type.equals(Integer.class)) || (type.equals(Long.class))
|| (type.equals(Double.class)) || (type.equals(Float.class)) || (type.equals(Byte.class)) ||
(type.equals(Boolean.class)) || (type.equals(Short.class)) || (type.equals(Character.class))
|| (type.equals(Character[].class));
}

private static XmlViewType getAnnotation(Method method){
if (!method.isAnnotationPresent(XmlView.class)){
return null;
}
return method.getAnnotation(XmlView.class).value();
}

private static boolean isProperty(Method method){
return method.getName().startsWith("get") && !method.getName().startsWith("getClass");
}
}

This class returns a dom4j Element, but one could easily switch XML technologies for this. It would not be too hard to do it with just pure DOM. Anyways, what does this code do? It takes in a class and view type. It iterates over all methods in the class, looking for getters. If it finds a getter, then it looks to see if it has been annotated with the XmlView annotation. If so, it compares the value to the value passed into the method. If they match, then it uses the name of the property and invokes the getter. If the return type is a primitive or a String, then it crates a corresponding node for it. If it is a list or array, it creates a surrounding element, then creates a child element for each item in the array or list. If the return type is some other kind of object, then it descends the object graph using recursion. So if your class had a getFirstName method and an instance of this class happened to return "Michael" for this, then you would get something like <FirstName>Michael</FirstName> in your XML. If you object had a getCar() method that returned a Vehicel object, and Vehicle had a getMake() method you might get something like: <car><make>Volkswagen</make></car> Pretty straightforward.


Vista in the End

I read this interesting article about Windows Vista. Vista may well be more significant than the author realizes. It may well be the greatest piece of shrink wrapped software ever produced, and perhaps the final hurrah for shrink wrapped software.

For years people have talked about moving applications online. Proponents of on-demand applications tried to argue that they would win out for a variety of reasons, such as portability, ease of maintenance, lower cost, etc. The truth is that maybe they will win out just because it will become too hard to do things any other way.

It still probably seems absurd to suggest that it is easier to write something like MS Word or Adobe Photoshop as a web application than as a desktop application, but the initial creation of the software is only part of the cost. The history of Windows may prove prophetic for other desktop applications. They grow and grow, and have all kinds of "baggage" (working with other apps, backwards compatibility, OS compatibility, etc.) Perhaps this weight is even worse for an OS, especially one that offers so many integrated applications with it. But maybe it will prove to be true for lots of other software too.

So why are web applications any different? For one, there is no such thing as backwards compatibility. There is no such thing as "upgrade" for a web application. Thus you never have to support multiple versions and worry about upgrade rates. The use of web standards also makes many of the other issues easier to deal with. Releases can be much smaller, and incremental for a web application, and thus also more frequent.

All of these things may make desktop applications, especially complex ones, just too expensive to build and maintain. It may only make sense to do them online. Desktops may become the realm of small, simpler applications that don't change much (think notepad.)

Sunday, September 10, 2006

Better Late Than Never? NFL Predictions

So I guess I should've posted this before the start of the regular season... but today's action did not change any of my predictions.

  • AFC East -- Miami
  • AFC South -- Indianapolis
  • AFC Central -- Pittsburgh
  • AFC West -- San Diego
  • AFC Wildcard -- New England
  • AFC Wildcard -- Cincinnati
  • NFC East -- Philadelphia
  • NFC South -- Carolina
  • NFC Central -- Chicago
  • NFC West -- St. Louis
  • NFC Wildcard -- Atlanta
  • NFC WIldcard -- Dallas
  • AFC Champ -- Indianapolis
  • NFC Champ -- Chicago
  • Superbowl -- Indianapolis

I would love to pick Miami, but I think they will need one more year. I almost picked Arizona to make the playoffs, and I think Cincinnati will barely make it in.

technorati tags:

Blogged with Flock

Thursday, September 07, 2006

All In The Family

My wife started her own blog today. Apparently I wasn't doing a good enough job of blogging pictures of our kids, so she's going to do it herself! Add it to your favorite personal homepage today!

Blogged with Flock

SMS

I've been doing some research lately on SMS. At PocoPay, we had technology for sending SMS to our customers. For example, if you signed up online you werre sent a pin to verify your cell phone via SMS.

For sending SMS, we paid for a service from Clickatell. We would send them an email and they would then generate an SMS based on the contents of the email. Kind of primitive, but very cheap. PocoPay never made any money so cheap was important!

My latest research has been on receiving SMS. If you're a cell phone user, it is free to receive an SMS, though you must pay to send them. However, for an application provider, receiving SMS is a lot trickier.

SMS is very fragmented, especially in the United States. In the U.S., people like to use short codes for sending SMS. Thus if you want to receive SMS, you need a short code. Only problem is that short codes belong to service providers. So you must pay for the short code from each provider.

Next you still need to receive the SMS. Various service providers will relay the SMS to you either by email or by HTTP POST. Other providers give acess to SMPP networks where you can poll for your messages.

A more primtive route is to do things like cell phone users. This involves hooking your application directly to either a cell phone or a cell modem. Then you can simply receive the SMS on your phone, like an end user would, and then download the SMS to your server. This seems like a good "getting started" option. It's not as expensive, but it does not scale (that's ok for getting started.) Of course you have to connect your phone to a server and need code for interfacing with it, but there are lots of options for this, including some open source ones.


technorati tags:,

Blogged with Flock

Friday, September 01, 2006

XSD

My last post reminded me of a comment a former colleague of mine once made. He accused me of being "anti-XSD." I found this an unusual statement since I have written dozens of XML schemas, maybe more than a hundred. I have made good use of JAXB for generating parsing/binding code based on an XSD from when it was still a proposal up until the present annontation-based versions. So I don't think it's that I'm anti-XSD. It's that I'm anti-XSD proponents, or at least some of them.

You see when I meet somebody who is a huge XSD fan and want to use it to describe the world, I think to myself "I know who you are." These are the same people who used to want to describe the world using relational database schemas. They used to say "build all the data validation into the database, it is faster and better and it has to be right anyways." When they realized that SQL schema definitions were unable to properly describe all real-world data, they turned to stored procedures.

I see the same thing happening with XSD. It was obvious that DTDs were insufficient to describe everything, so XSD was born. It is several orders of magnitude more complex than DTDs, but it still cannot describe everything. It does not allow for dependencies between data. Thus the datatype of one element or attribute cannot depend on the value of another element or attribute (or on the values of four elements and two attributes, etc.)

I've long mused that the existence of the "xs:any" data type was partially because of this shortcoming. I've just picked on of XSD's shortcomings, but that's enough to see that at the end of the day neither XSD and SQL can actually describe the whole world.

So how oh how can we write software for real-world problems when these data modeling languages cannot describe all real-world data? Ahh, that's why we have programming languages. That's why the database guys started pushing stored procedures with their own languages like PL/SQL. Heck, Oracle eventually even put a JVM inside their database so you could write Java for your stored procedures. I wouldn't be shocked to see some kind of language added to XSD.

The truth is you don't need it. There are plenty of programming languages already out there. They can even be used to allow for a declarative approach to data definition. Maybe one of these declarative approaches could become "standardized" or somehow baked into XSD. Maybe one day web browsers (and databases, etc.) will become smart enough to understand "super-XSD" and "middleware", and the programming languages used to build it, will shrink away. I have my doubts though. Those database guys never really pulled it off, and they've been trying since the 80's.