Wednesday, February 28, 2007

Seamless Spring

I saw this post on TSS this morning. I read it, mostly because I like Seam so I wanted to see what was new with it. I was particularly pleased to see that Seam 1.2 was supposed to have "out of the box integration with Spring." I had to find out about this, so I read the man page on it.

I have to say, wow. The integration is really nice. When I started to read it, I immediately started to think "how is this going to work, Seam is all about statefulness and Spring is rather stateless?" Then I noticed the syntax on injecting a Seam component into a Spring bean:

<seam:instance name="someComponent"/>

I knew that when Spring 2.0 went XSD that we'd see things like this, i.e. a complimentary system integrating by importing its own XSD into a Spring config file. Next I noticed the unqualified name of the element, "instance." That sounded very stateful to me! Indeed from the doc:

Seam was designed from the ground up to support a stateful component model with multiple contexts. Spring was not. Unlike Seam bijection, Spring injection does not occur at method invocation time. Instead, injection happens only when the Spring bean is instantiated. So the instance available when the bean is instantiated will be the same instance that the bean uses for the entire life of the bean. For example, if a Seam CONVERSATION-scoped component instance is directly injected into a singleton Spring bean, that singleton will hold a reference to the same instance long after the conversation is over! We call this problem scope impedance. Seam bijection ensures that scope impedance is maintained naturally as an invocation flows through the system. In Spring, we need to inject a proxy of the Seam component, and resolve the reference when the proxy is invoked.

The <seam:instance/> tag lets us automatically proxy the Seam component.

That's just beautiful. Using a proxy like that is very common in both Hibernate and Spring, so this solution to the scope impedance problem is exactly what you would expect.

The doc details even more cool features. I love the way that Spring beans are injected into Seam components using @In("#{someSpringBean}"). The combination of using the annotation and the expression language is really nice. I would assume that something like @In("#{someSpringBean.someProperty}") would also work. Of course there are definitely some drawbacks to using all this syntactical sugar, but you can't argue that it's not fun.

Of course another interesting angle on this to me is that Seam is part of JBoss, which in some ways competes with Spring. Spring is often viewed as a "lighter" weight alternative to full app servers like JBoss. Indeed, when I met some JBoss developers last year they were somewhat incredulous about why people liked Spring. They thought it didn't do anything new, it just made some things a little easier...


technorati tags:, ,

Tuesday, February 27, 2007

No More Gaim

I've been using Gaim to access both my Yahoo Messenger and Google Talk contacts. However, the Yahoo email notification have stopped working for me. So I think I will just switch to using Yahoo's client and Google's client. Maybe I'll get rid of GMail Notifier, since Google Talk handles that too.

technorati tags:, , , ,

Generics Puzzler

I just read this Java generics puzzler from Pure Danger Tech. I have felt exactly this pain many times before. The decision to erase types from compiled bytecode causes so much pain. I don't think .NET uses type erasure, so I figured this would be pretty easy in C#:


static T[] merge<T>(params T[][] arrays)
{
int len = 0;
foreach (T[] array in arrays)
{
len += array.Length;
}
T[] result = new T[len];
len = 0;
foreach (T[] array in arrays)
{
foreach (T elem in array)
{
result[len++] = elem;
}
}
return result;
}

Monday, February 26, 2007

Netflix Turbo

I don't know what's going on with Netflix lately, but they've become noticeably faster. Maybe it's because of the competition from Blockbuster. As an example, I mailed off Battlestar Galactica Season 2.5, Disc 3 on Saturday morning. I had an email this morning (Monday) timestamped at around 7 AM saying they had received the disc and the next movie in my queue was about to ship.

On a side note, now that I've finished Battlestar Galactica Season 2.5, I have to find a new TV show to watch on Netflix. I am considering The Wire, Arrested Development, and Sports Night, but none of these excite too much. If I could watch the current season of Galactica or Heroes, I would go with that. Maybe they'll be available as downloads on Netflix? I could cough up $35 and get them on iTunes, but I'd rather leverage my $15/month I already pay to Netflix.

Saturday, February 24, 2007

XCode

I've been doing some development on the Mac lately. The tool that I've been most interested in is Dashcode, but I've also been using the seminal Mac development app, XCode. I thought it would be interesting to compare it to a couple of other multi-purpose IDEs: Visual Studio and Eclipse.

In some ways it's kind of ironic, but probably the thing that jumps out the most in such a comparison is that VS and Eclipse both have a lot more eye candy. They are more visually appealing programs, at least in my opinion. XCode is a little more stripped down, and not just in the eye candy department.

A popular feature in IDEs is code completion, popularized by VS's IntelliSense. I don't know if VS was the first IDE to have this, I just know it made it popular. I actually think Eclipse does this better than VS these days. XCode has this feature, too, but it is turned off by default. There is something appealing about that to me. Code completion can make developers lazy, and some would argue that it decreases your programming skill. It's hard to argue that it doesn't make you more productive, though. XCode should make better use of it and turn it on by default.

XCode is very good for running and debugging. I was impressed that it gave me an error code in a program that didn't clean itself up properly. Of course that error message was very cryptic, and was just a warning. Only after I fixed the problem did I realize that the weird warning was because I had left some garbage on the heap in the program.

All of this made me think, I wonder if there is an Eclipse plugin that's designed to enable Mac development? The answer is no, and for a good reason. Eclipse is a little clunky on the Mac because SWT is implemented in Carbon, not Cocoa. Most of those super-slick Mac apps out there use Cocoa. SWT binds the native UI elements on whatever system it is running on, so it could use Cocoa or Carbon on the Mac. The SWT developers chose Carbon. They had some very good reasons for doing so, but the end result is Eclipse is a little clunky. It's hard to convince somebody who wants to build a slick looking Cocoa app to use Eclipse.

Anyways, XCode holds up pretty good, though it definitely seems like a notch below VS and Eclipse. Let's face it, appealing to developers has never been Apple's strong suit. Dashcode is kind of promising, though widget development is definitely a niche at this point.

Meetings make us dumber

I have to enter the echo chamber and write about this article that was also mentioned on Slashdot. I had to write about this because it really resonated with me. I hate "brainstorming" meetings, unless they are very small (as in me plus one other person.) Whenever I need to participate in such meetings, I do a lot of homework before the meeting, i.e. I do all my brainstorming ahead of time and then just present my ideas in the meeting. I've always thought that was a product of my personality type (intj.) Sometimes I've wondered if it indicated a weakness in me, i.e. that I'm not good at "thinking on my feet." I decided a long time ago that I didn't care if that was the case or not. I knew that I was much better at thinking things through on my own ahead of time rather than in a group. Now I wonder if this wasn't just my personality, but something that is true for most people.

Further, when somebody else brings up significantly different ideas than me, I am very reluctant to agree with them in the meeting. Again I've thought that maybe that was product of my personality. I think my education made me skeptical by default. Of course that kind seem obnoxious -- the only ideas I support in a meeting are the ones I brought to it. But this article again makes me think that I've probably adopted this approach through experience. Jumping on a bandwagon has few advantages besides being easy to do.

Thursday, February 22, 2007

Safari

I found myself using Safari for the first time in ... a long time. I have to say that it has some definite speed advantages over Firefox on OSX. Firefox on OSX compares pretty well I think to Firefox on Windows and Linux. Blogger gives me a dumbed down interface on Safari though. I guess some of its rich editor features don't work on Safari. I'm guessing that's probably a common problem I'll encounter with Safari. Like Opera, it really embraces standards.

Sunday, February 18, 2007

Dwight Horward

Being from Florida, I am an Orlando Magic fan. I haven't been too interested in basketball the last few years, but I am very glad that Orlando has Dwight Howard, because this is just ridiculous:

Monday, February 12, 2007

Blogging from Word 2007

I pressed the "new" menu on Word 2007, and saw "blog post" as an option. So I had to give it a try. Authenticating with Blogger was easy. There is "picture options" menu item. Apparently this allows you to drop pictures into your blog post in Word and have the picture automatically uploaded by Word. My only choices for Blogger were "none" or "My own server." That's disappointing since Blogger can allow for uploads, but more importantly, there are so many picture hosting sites out there. Where's Flickr or Photobucket? Oh well. Also, there is an "Insert Category" button on the ribbon, that sounds like something for adding tags (err labels heh heh) to the blog post. This was disabled for Blogger. Maybe for Microsoft's blogging service (Windows Live Spaces?) this is enabled. Still pretty cool to be able to use Word so easily to blog.

Friday, February 09, 2007

Outlook 2007 Breaks Funambol Sync

For some reason, Outlook 2007 breaks Funambol sync. The plugin (which just gives you a little button in Outlook to launch the sync program) won't load. I thought that was OK, I had Funambol set to sync automatically anyways, I didn't need to launch it from Outlook. Unfortunately, that stopped working too. It seemed to read all the events from my calendar in Outlook, but then would fail when sync'ing to ScheduleWorld (which in turn sync'ed to my Google Calendar.) Maybe the data coming from Outlook was causing a problem, who knows. I updated my Funambol plugin, but to no avail.

Outlook 2007 does allow export to a "Office Online" calendar. That works very nicely. There is even an iCal for the calendar. I tried to then add that calendar to Google Calendar, using it's iCal, but it did not work. Google Calendar would accept it at first, then a little while later would complain about not being able to open some URL.

So my wonderful utopia of having auto-sync of my work calendar to Google Calendar so that it was easily viewable by me or my wife is over for now. With Outlook 2007 I can subscribe to my own calendar, which works great. I can't subscribe to my wife's, probably because of security. At least I can see upcoming personal appointments on my Outlook calendar at work.

Python

I decided to go ahead and do Python versions of the programming assignments. I updated the ATM and Text Manipulation assignments to include Python versions. This is my first programming with Python. It seems pretty clean so far. Obviously it is similar to Ruby. It seems a little more procedural (lots of standard functions like ord(), len(), str()) whereas Ruby tries very hard to be object oriented. I think it is possible to be more OO with Python and more procedural with Ruby, but I'm not good enough at either to do so!

Python includes it's own IDE, IDLE. It seems pretty nice. I'm not sure how well it would work on a large project with many Python scripts/classes. I've been using Eclipse for Java and Ruby, and using Visual Studio for C# and C++. For easy things like these assignments, Eclipse is definitely the biggest pain to use...

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.