Monday, January 28, 2008

Nokia Acquires Trolltech & Qt

Trolltech, maker of my favorite development platform Qt 4, just announced they're being purchased by Nokia. Damn.

History has pretty much shown that the independent, open-source shops being purchased by mega-corps have largely resulted in a slovenly product. Novell's purchase of SuSE has resulted in a distro that kernel dumps... kernel dumps occasionally on bootup. I don't hold fantastic hopes for Qt 4 unfortunately.

It appears that others share my scepticism. A good deal of comments to LWN - which still boasts a pretty coherent readership - seems to also have the sort of timidity stemming from being burned before. The Register, which prints an overall positive article, still feels it needs to assert Nokia has made claims of continuing Qt development.

It feels at the same time like the OSS world is shrinking and expanding. While awareness and adoption is at an all-time high, the high-profile projects are starting to be absorbed into the same machine they raged against.

Saturday, January 19, 2008

Keyboard and Mouse Synergy

I've been using Synergy for... what... like three years now? It's one of those integral pieces of software that I can't do without anymore. If you ever have craved a dual-screen setup for your laptop, but still want to use your desktop at the same time, Synergy is the perfect thing for you.

Synergy works like a KVM in reverse. You give it two or more machines, each with its own display. Pick the machine with the nicest keyboard and mouse - that will become the "host." You tell Synergy where the other machines' monitors are located (i.e. the laptop is to the left of the desktop's monitor) and Synergy will transmit all keyboard and mouse events to the other machines. You basically have connected your mouse and keyboard to your remote machines via TCP/IP.

For example, let's say you have a desktop at home and a laptop at work. Pretty typical setup. And you have a nice dual-monitor setup at work: you have your laptop's monitor on the left side of your desk, and a nice DVI monitor on the right side of your desk to use. When you get home, you'd like to have the same sort of setup... except you don't want to detach your desktop's monitor at home and re-attach it to your laptop every day.

Synergy will connect your laptop and your desktop together at home so one keyboard/mouse can control the contents of both screens. Copy and paste, lock screens, whatever you like. You can't drag-and-drop files from one desktop to another mind you - they're still physically separate machines. But you can verily easily browse the Web on one monitor and code in the other, all using the same keyboard.


The above image is translated from http://synergy2.sourceforge.net/about.html - but unlike the source image it isn't animated (thanks blogspot). It gives you a sense of how the desktops can sit side by side and Synergy allows the mouse cursor to "hop" over to the other screen. Do take a look at the animated version on Synergy's site to get a better sense of it.

It's cross platform, so Linux desktops and Windows desktops can still work well together. Even works with OS X. So your PowerBook can share a screen with your WinXP desktop alongside your Linux server. Nifty!

Tuesday, January 15, 2008

Jini in the Skull

Now that I have my uber-huge project out the door, I'm trying to think smarter about development in general. I kept thinking that being smarter about development meant thinking bigger - so I initially tried to get more involved in the infrastructure of things. But it wasn't a good fit in my brain - you can't lose yourself in a PowerEdge like you can lose yourself in a stream of bytecode.

This hit home when I was talking to a previously C++ programmer at work. Because I'm a) lazy and b) often muddle explanations, I often tell new Java developers... whilst stammering and mealy-mouthed... that Java passes objects by reference. This quickly helps people understand(ish) why setting a value on an Object inside a method doesn't necessitate a return value. However, when I say that I'm perpetuating a distinctly wrong concept. One I should be ashamed about.

I try to avoid the long conversation that ensues, but I should tell developers the truth. Java always passes by value, never by reference. In fact, it passes references by value. Most people look at me like a Buick is growing out of my head when I say "passes references by value." But the fact is that variables only hold primitives and references, and are always passed by value.

Take a look at Java is Pass-By-Value, Dammit! It all boils down to this fact: C and Java always pass by value... that's why you can't do the standard "swap" function. For example, in C++ you might do:

Object hello = new("hello");
Object world = new("world");

swap(hello, world);

printf("%s", hello);
printf("%s", world);

void swap(Object obj1, Object obj2) {
Object swap = obj1;
obj1 = obj2;
obj2 = swap;
}

This transposes the value in obj1 with the one in obj2. You should see "world hello" from running this craptastic pseudocode. Try this same code in Java and nothing happens - you've locally overwritten some values, but you didn't swap your references:

Object hello = new Object("hello");
Object world = new Object("world");

swap(hello, world);

System.out.println(hello);
System.out.println(world);

void swap(Object obj1, Object obj2) {
Object swap = obj1;
obj1 = obj2;
obj2 = swap;
}

Here you'll just get "hello world" out - your references remained intact, because you passed by value.

This is ultimately a cleaner way to develop... so it's a major plus for both C and Java. And my New Year's resolution is to stop telling people that Java passes by reference just so I can end the conversation sooner.

On the flip side of the complexity coin, I've been reading the the Jini specification by the Jini community as well as Jini and JavaSpaces Application Development by Robert Flenner. Jini has evidently been around forever, but I've only recently become interested in it. Remember the old pre-turn-of-the-century adage that Java would be running on everything in your house, from your kitchen toaster to the fridge? Evidently around 2000 or so Jini was sold as becoming the premier way Jini could allow your toaster to auto-discover your refrigerator and... er... do... heating and cooling... stuff. Who the hell knows. The idea of automagically connected and integrated micro-device clusters communicating across a mesh network is cool, but practical consumer applications are pretty much nil. Then once EJB's started incorporating RMI, Jini came back to the forefront as an easy way to do the heavy lifting of RMI without the thick refried JavaBean layer.

Once you get Jini up and running, it is wicked cool. Start up your Jini registrar and then poof, services get published across a network. Look for a remote service and poof you can discover it and invoke it - no need for stubs or manual marshalling. Once you get the Jini infrastructure up, you don't have to teach developers how to use it... they just implement an interface and the rest is done for them. You can have a mesh network of peer-to-peer nodes up and running within seconds, and the actual node developers don't even know they've done it.

No crappy WSDL's. No UDDI. No thick & slow SOAP XML transport over HTTP. Bytecode and serialized objects all the way. We're not just talking a faster mode of transport, we're talking about delving down two entire network layers.

The application for such technology is mind-boggling... which maybe is why people aren't using it as much as they could. Damn shame, too.

Thursday, January 03, 2008

Now Maybe We Can Talk

Well... it's out. The press releases were finally sent out, the media embargo was lifted, and my big no-sleep-'till-prod project has finally been announced to the public. It was almost four months ago I last prepped the exit music, and hopefully I'm back for a little while now.

Project Apricot is in full swing, the NDS widely available homebrew cart, I'm still filing bugs for openSUSE 10.3, accelerated MPEG2 playback isn't working on my Mythbox, I finally got a copy of The Orange Box along with a copy of Orcs and Elves for the NDS. There's plenty to do.

In my five-minutes-here-five-minutes there I've been enjoying Carmack's mobile-turned-DS title, although it took me a while to adjust my frame of reference. Don't expect more than a turn-based DooM mod... it's a sprite-based engine that is first person but completely turn based. But after you adjust your expectations you realize it's a return to form of sorts. Carmack was a pencil-and-paper AD&D player, and such roots definitely go deep in this title. You can see where his experience as a DM sparked a lot of good ingenuity and design into a rather primitive (but imminently playable) title.