Sunday, December 30, 2007

lolcatshost

Some people clearly have too much time on their hands, witness lolcatshost!
(Via Little Gamers)

UPDATE: actually, it seems like the site was inspired by that Little Gamers webcomic.

Terminus

Via Boing Boing:

A silent concrete monster follows a nervous businessman through Montreal in Terminus, an eerie and darkly funny short film directed by Trevor Cawood

Go here to watch, it's only eight minutes, well worth your time.

Friday, December 28, 2007

Bedtime

So, just as Christmas passes on December 26, I suddenly fall sick. Perfect. I haven't logged a single sick day for more than over a year, maybe even two years, and now that I'd have few spare days to spend on things I'd like to do, I'm more-or-less tied to bed. Don't worry, nothing too serious, just stuffed nose, terrible coughs, and enough fever and chills to keep me not wanting (or, in fact, being too able) to move anywhere outside of the bed. The usual "season's greetings", you might say.

I'm reading though. I read some wicked good books in the past months, including Charlie Stross' Glasshouse, as well as an überweird Cory Doctorow piece (Somebody Comes To Town, Somebody Leaves Town) as well as few Karl Schroeder novels. I'm through most of them by now and am tasting some Vernon Vinge momentarily, which isn't as good as the more contemporary guys (Stross and Schroeder) are, but is still much better than Iain M. Banks is.

Or even better, I listen to wife reading Mr. Pratchett's The Bromeliad Trilogy to kids (and me!). I picked up Truckers in a book store about a month ago without knowing it is targeted for children, but after reading it I realized it'd be great fun to read it to kids in the evenings. Usually it is me doing the reading, but with sore throat... So, we finished Truckers today (second reading for me), and started on the Diggers (which, along with the closing volume of the trilogy, Wings, I picked up today at the same bookstore. I have a habit of buying only the first novel in a series and making subsequent purchases based on whether I'm still interested in it after the first book ends. For me, Iain M. Bank's first Culture novel didn't hit the bar, so I'm avoiding it for now).

Anyway, my Mom was over for holidays, and listened in to our reading of Truckers. As a result, I gave her one of Discworld novels (Mort) to read on her way home. I'm pleased to say that Mr. Pratchett has obtained yet another (in this case, 58 year old) fan :-)

Anyway, days are a bit bleak. I'm usually not well enough to hack or even to play much with kids, or anything of the sort. Getting to a store to shop for groceries to get us through New Year's Eve was quite an effort and I felt much worse afterwards.

Oh, I also picked up Half Life 2 retail box three weeks ago on an impulse while shopping for Christmas presents. Tried to install it this morning (lacking better pastime since I couldn't sleep from my cough rush), and it claims the CD key is invalid. Swell. Valve support didn't answer within a workday. Knowing me, if I don't get to try playing it during the holidays, I probably won't find time for it anytime soon, so it's as good as money thrown out of the window if they don't resolve this quickly. Way to go, selling people unusable DVDs.

I also managed to drop my photo camera from a waist height on a hard stone floor during Christmas - I was trying to take pictures of kids while they were having fun with Sparklers. In response to the drop, the camera's objective developed a very ugly skew. Not entirely surprisingly, it doesn't work anymore... Closest Canon service (and the only one in the country) is of course, where else, in Budapest, 200km away. Buying a new one might be a more viable option.

Oh well. I guess I'm going back to bed. Sorry everyone for a bad-mood rant...

Thursday, December 27, 2007

www.opensource.org hacked?

Does anyone know what happened to http://www.opensource.org? It's supposed to be the website of Open Source Initiative, but it looks like right now it serves the same content as http://hyperreal.org, whatever that might be... It is either hacked, or maybe the two sites are collocated on the same physical HTTP server and there was a config glitch. Anyway, quite annoying...

Rhino in Spring 1.2

So, I've used some free time around the holidays to put the finishing touches on a new release of Rhino in Spring. The new release is 1.2, and it has one major new feature (as well as few featurettes). The major big thing: it is now fully clusterable with Terracotta!

Actually, that's pretty much it. There's few other featurettes as well, but the real big leap forward was restructuring of the internals so that it plays nicely in Terracotta distributed clusters. Configuration for clustering is dead easy: it comes with a Terracotta "configuration module", a special JAR file hosting an XML file with clustering declarations for the code. You just reference it in your tc-config.xml and that's it. The rest is Terracotta magic :-)

Friday, December 07, 2007

FreeMarker 2.3.11 released

We released FreeMarker 2.3.11 on Wednesday. There are few new feature goodies as well as some significant performance improvements (both speed and memory) in there, not to mention bugfixes, so you might consider upgrading from earlier 2.3.x version. Head over to the project website for more info and download.

Wednesday, November 28, 2007

13949712720901ForOSX

13949712720901ForOSX

Tuesday, November 27, 2007

Working Java 6 on Mac OS X - but not from Apple

Turns out there's a working Java 6 for both Mac OS X Tiger and Leopard. It is a port of the Java Research License licensed codebase for BSD, so to use it legally, you need to agree to JRL first. It's developed by a person named Landon Fuller, and he says on the page:

The Mac OS X work is based heavily on the BSD Java port, which is licensed under the JRL. The BSDs develop Java under the JRL; FreeBSD has negotiated a license with Sun to distribute FreeBSD Java binaries based on the JRL sources.

As the Mac port stabilizes, I am merging my work upstream into the BSD port, and in turn, it is a goal of the FreeBSD Java project to merge their work into OpenJDK. I've signed a Sun Contributor Agreement in preparation for this...

There are some minor features lacking (minor if you're like me, using Java for server side): sound doesn't work yet, nor is there a native Aqua Swing UI.

Via Charlie Nutter (who also perftested it with JRuby and sounds quite impressed).

Sunday, November 18, 2007

New MacBooks finally have 3D graphics in hardware

I just noticed that new MacBook models ship with Intel GMA X3100 graphics chipset instead of GMA 950 in previous models. Notable difference is that X3100 has 3D rendering hardware - a shader processor with 8 execution units fully supporting transform & lighting, with support for DirectX 10.

That's quite a big news for people who previously dismissed MacBook as an option because of weak graphics chipset (i.e. people who'd dual boot into Windows for gaming).

On the downside, GMA X3100 still doesn't have dedicated RAM, and it'll actually take away 144MB of system RAM (160 if you use an external display), compared to 80MB that GMA 950 used, so YMMV.

Saturday, November 17, 2007

"Some thoughts on security after ten years of qmail 1.0"

There's a paper "Some thoughts on security after ten years of qmail 1.0" written by qmail's author, Daniel J. Bernstein. (I found it though Bruce Schneier's weblog). The paper is well worth reading because Daniel is extremely security-conscious. As he says:

In March 1997, I took the unusual step of publicly offering $500 to the first person to publish a verifiable security hole in the latest version of qmail: for example, a way for a user to exploit qmail to take over another account. My offer still stands. Nobody has found any security holes in qmail. I hereby increase the offer to $1000.
He actually gives lots of practical advice on how to make your code more secure: security holes are bugs, so you should strive to eliminate bugs in general. Also, you should strive to eliminate code (as number of bugs is usually proportional to number of bugs). Finally, you should minimize the amount of trusted code and have all untrusted code run in a sandbox (using his words, a "prison").

Now, to reflect a bit on sandboxing myself from a Java point of view, Java is fortunately quite well suited for minimizing trusted code. When you run a Java program under a security manager, code gains privileges based on where it came from, and the privileges of the current stack frame are the intersection of privileges of its code and all of its callers down the call stack.
There's a facility for privileged execution, SecurityController.doPrivileged(), where the code within the privileged block will run with full set of its own privileges, and not get narrowed down further with security restrictions placed on its callers. It can be a dangerous feature, and must be used judiciously lest you create an exploit vector through it. I.e. if your code accepts a file path from its callers, reads the file in a privileged block, and returns the file content to the caller, then a caller can potentially exploit this to gain access to contents of files it would otherwise not be able to see.
I'm actually quite conscious to enable easy integration with Java security manager in software I write - you will find a PolicySecurityController class in Rhino, as well as a SecureTemplateLoader in FreeMarker, both allowing running JavaScript code or FreeMarker templates, respectively, with their own set of privileges defined in the effective JVM-wide security policy based on where they're loaded from or whether they're digitally signed (same aspects are used to assign privileges to Java code). FreeMarker also uses SecurityController.doPrivileged() in few places judiciously.

Anyway, back to Daneil's paper: there's a wealth of food-for-thought for any practicing software developer: how we often sacrifice security for speed, how hidden data flow (global variables and singletons, people!) leads to security issues, and how this can be fixed by further decoupling of components with explicit narrow communication (i.e. message passing across processes), and so on.
A section entitled "Avoiding parsing" also speaks very closely to my heart.
So, recommended reading.

Friday, November 16, 2007

Wired profiles Randall Munroe

Wired has a profile article on Randall Munroe. Munroe is the Xkcd guy. If you didn't know Xkcd before, you can thank me later for pointing it out for you.

Wednesday, November 14, 2007

"JVM Dynamic Languages Metaobject Protocol" now released

I finally got around to packaging up the current state-of-art of my metaobject protocol library as a downloadable release (source + binaries + documentation), plus putting up a very basic website (hosting an information page + JavaDoc) for it.

I haven't got around to setting up dynalang.org yet, so the website is for now hosted at http://dynalang.sourceforge.net.

The fact there is now a release does not intend to confer either a sense of completeness or rigidity. It is versioned at humble 0.3. It is pretty much open to modifications and is also probably not complete yet (i.e. I fully expect people to need further features for integrating with their particular language runtime). The release just strives to make it easier for people to get started with it, as it's now available as a HTTP download instead of only through SVN. Also, having a release means there's now a baseline for purposes of tracking changes in a changelog file etc. Unit tests cover about 75% of the code right now, so it's fairly safe to say it does what it is intended to do, but of course, bugs are always to be expected.

In completely unrelated news, today's my birthday too :-)

Monday, November 12, 2007

Leopard firewall breaks Skype

Apparently, Skype.app on Mac self-modifies its application package. Leopard OTOH digitally signs application packages after you download them from the net and allow them to run, and also when you allow them to accept connections through firewall. Skype's self-modification causes the signatures to get invalidated. After this, Skype will completely fail to launch. It'll bounce twice in the dock, and that's it.

Options: (a) don't use Skype (b) disable firewall. Damn. I'm going with (a) until Skype fixes this. Actually, I tried disabling the firewall, and for me even that didn't help. Double damn.

New Language Features for JDK7 - from the Java Community

A newsletter from Belgian Java User Group (BeJUG) landed in my Inbox yesterday, and boy, am I glad to see it. You can read it here. Basically, BeJUG is submitting the JSR for closures in Java, based on Neal Gafter's proposal. This is huge news for several reasons. Reason one, we need closures in Java NOW. Reason two, this is the first JSR filed by a Java Users Group, and also the first Java language JSR led outside of Sun Microsystems.

The second jolly good news in the same newsletter is that Google also submitted a JSR for a "collection of smaller language features". Smaller? They're proposing type inference, extension methods, catch for multiple exception types (Brian Goetz will be glad. Hell, me too!), and improved syntax for easing the catch-rethrow pattern. These ain't small in my book.

We need to realize that C# has had type inference, extension methods, object initializers, anonymous types, and lambda expressions for two years now. It'd be about time for Java to catch up with the times, and I'm really glad to see community finally taking initiative to make it happen and not waiting for Sun.

Thursday, November 08, 2007

Network traffic prioritization by specific cost

I've been following with some interest the recent Comcast scandal where the ISP started inserting TCP reset packets into BitTorrent traffic of its clients, thus disrupting it.

Comcast claims they do it to protect the ability of "normal" users to use the bandwidth from "excessively using" users that hog it.

(I personally believe Comcast tries to minimize the overall amount of traffic that flows out of its network to other ISPs as it costs them money in the fiscal clearing of cross-ISP traffic.)

But let's entertain the idea for a moment that Comcast would really like to protect their "normal" (read: low-traffic) users from their "excessively using" users. How would I go about implementing a fair system that achieves this goal?

Well, certainly not by disrupting the traffic.

Below is an idea that I believe would result in fair allocation of bandwidth within the network of a single ISP with paying customers. I must forewarn you that while I design software systems for living and often need to deal with management of limited resources, I'm just a layman when it comes to the narrow field of packet-switched network traffic management, so what's written below might not make sense at all because of some arcane aspect or the other that I know nothing of :-)

Anyway, here it goes:

The ISPs already measure the amount of traffic generated by every user within a billing period, that's how they are able to detect "excessively using" users today. However, instead of handicapping a user that "excessively" uses the bandwidth, the metrics would be used only to select which user's packet to drop when there is insufficient bandwidth on the routers' outbound lines, but only then.

The strategy would be to always drop the packet coming from the IP address of the user who had the highest traffic in the billing period so far. Or, in case of differently priced packages, or even different billing periods, the user with highest traffic/fee ratio for his current billing period, expressed nominally in byte/dollar.

This way, the proverbial "only checking his mail" user would always experience a fast connection, followed by a user who listens to online radios and watches some amount of online videos, while the "excessive" p2p users would be only competing for leftover bandwidth among themselves.

It'd be easy to suitably extend the idea to a nondeterministic scheme where a packet to be dropped is picked randomly, but the probabilities are weighted by their user's dollar/byte ratio. That'd give a user who heavily used p2p at the start of the month a standing chance to still be able to check his e-mail even when another user comes along who floods the network with p2p traffic near the end of the month.

Feel free to point out why this wouldn't work, doesn't make sense, or is already invented in this or similar form and used somewhere :-) I've tried uncovering this technique using Google, but have found only port/service/application based QoS prioritizing, and didn't find anything specifically describing this -- namely, prioritizing based on user's specific monetary cost of traffic, amortized over a billing period.

As far as I can tell, this method preserves network neutrality, as it does not discriminate based on either the type of traffic or the destination of the data. It also doesn't degrade the throughput for anyone in any way as long as there is sufficient free bandwidth.

Monday, November 05, 2007

Leopard so far

This Thursday, I upgraded my MacBook Pro to Mac OS X 10.5 Leopard. It was a holiday over here, so I had four days (Thursday to Sunday) to work out the wrinkles in case something didn't work. I did the usual precautions: mirror the boot drive to an external drive, boot from the mirror to make sure it works, then shut down the computer, physically disconnect the external drive, and only after all this start the OS install.

I decided to give myself a chance to avoid reinstalling everything, and thus chose the "Upgrade" option instead of a clean install. After an hour of DVD consistency check and an hour of copying files, the machine rebooted and I was greeted by a working Leopard. It went incredibly smoothly.

I proceeded checking whether everything works. First on the list was Cisco VPN Client which I need for work. I was sceptical, as the Cisco VPN client integrates tightly into the system, installing kernel extensions for networking. To my very pleasant surprise - it worked! Next was ssh, which also worked. VMWare also works, no problems there.

Then there's some more arcane stuff:

An unsupported printer driver for my Xerox Windows-GDI printer, cross compiled to a PowerPC binary from a Linux CUPS driver - works!

My heavily customized, start-on-boot MySQL setup - works!

There's of course no Java 6 yet, as discussed earlier, but the good news is Java 5 is at least upgraded from 1.5.0_07 (found in Tiger) to currently latest 1.5.0_13 in Leopard.

Eclipse 3.2.2 works overall. There are keyboard issues though. I.e. if I press Command+Shift+U ("Occurrences in File"), it brings up a context menu (to choose among "Identifier", "Implementing Methods", and "Throwing Exceptions"). However, both the menu and editor window receive the keyboard events for arrows, and when I hit Return, the context menu disappears altogether (without performing the selected operation), and the key is interpreted by the editor (i.e. inserts a new line...). That's one minor annoyance.

One of my pet peeves is also fixed finally: I can finally use the Return key to activate the "Allow" button in Keychain Access' "Copy to Clipboard" dialog. Oh, progress! Previously, if I didn't want mousing, I had to do Tab-Tab-Tab-Return. Still no keyboard equivalent to invoke the said dialog though... Also, the "new password assistant" palette now syncs with the password field, so I needn't copy/paste a generated password back to the main editor window of Keychain Access anymore. Yeah, small things, but they do matter.

Also, there was something amiss in my user account in Tiger - lots of programs forgot their license number when I logged off (Delicious Library and Disco most prominently), and it also lost my keyboard shortcuts whenever I logged off, so after a while I lost the habit of using custom shortcuts, as you can imagine... Upgrading to Leopard fixed both issues.

The system is noticeably snappier. Tiger had the tendency to stall under heavy load. "Heavy" is when I run a Terracotta server and two clustered Tomcat instance on the MacBook Pro, talking to a special Linux appliance running in VMWare, occasionally recompiling the code or interactively debugging from Eclipse. Oh, and running a BitTorrent client in the background to boot it. Now, Tiger did have issues with this even with 2GB of RAM, to the point of UI freezing up for 20-30 seconds whenever I switched applications with Command-Tab. Leopard tolerates such loads much better. I guess virtual memory management got smarter with regard to handling applications' working sets, and there are probably lots of minor kernel optimizations and reentrancy improvements. Overall, noticeably better. Lot less beachball sightings.

As for games: Diablo II works nicely even on an Intel mac (it's a PowerPC binary). Of course, only when you install it using the "carbonized" installer, the version on the CD requires Classic subsystem, which is gone from Leopard.

Age of Empires III has issues though. In single player, all is dandy, but playing in network is completely borked by network sync issues. Few seconds into a multiplayer session it'll say "Out of sync. Exit and try again". Truth be told, the other machine still had Tiger on it when my son and me tried it; I installed Leopard on it since.

After two days when I was sufficiently convinced that it works okay, I installed it on my wife's iMac G5 as well, and faced an interesting limitation. You know those custom iChat backgrounds Apple showcases as new iChat features? The ones where you can have the room behind your back replaced with a moving Niagara falls scenery? Well, you won't get them on a PowerPC Mac. I wanted to try it out for fun between our two machines, but the iMac's 2.1GHz G5 CPU is apparently not strong enough for them. Intel Macs only. Now, come on, Apple, I don't buy it. You probably just had a nice hand-optimized assembly with MMX and SSE instructions in there somewhere, and couldn't be bothered to port it over to PowerPC AltiVec. You know, the one you touted as being the superior vector unit. I think we're experiencing the first signs of PowerPC users falling out of grace. I don't want to sound dramatic, but I mean, I can maybe, just maybe understand a G4 not being strong enough for this task, but a 2.1 GHz G5? What about people with dual or quad G5s? This is a minor, but sad letdown.

Also, my MacBook Pro took on the habit of waking up at precisely 1:00:00 AM every night after the Leopard upgrade, without anything being set in the com.apple.AutoWake.plist file. Since 1 AM in my timezone (GMT+1) is actually midnight GMT, I suspected this to be some stray zero making its way into EFI or something. Pretty much, after I overwrote it by setting "Start or wake up every day" in Energy Saver to 9 AM, the phenomenon went away.

Well, that's it so far. I'm also fooling around with XCode 3. It's a very polished development environment, and I'm toying with the idea of creating some native Mac OS app. Y'know, just to unbox myself a bit from my "server side Java" box and try the "desktop app in Objective-C" world for change.

Tuesday, October 30, 2007

Scapegoating for Java crisis on Mac OS X

So, pretty much all Java developers working on Mac OS X are filling up the blogosphere (sorry for using the cheesy term) screaming how Apple left them behind not releasing Java 6 for Leopard. This article (via DF) summarizes the overall sentiment (and somewhat hysterical atmosphere). Apple's own java-dev list is another place where people are raising concerned voices.

It's understandable where this outcry comes from. Go to any major Java conference. The Mac laptops are totally over-represented in the audience.

I could well be among them. I'm guilty of amplifying the "Macs are everywhere" effect at conferences myself with my MacBook Pro. I too am a Java developer working on Mac OS X.

I just see a different perspective to things. First off, it always struck me as actually very unnatural that Sun ships Java for Windows, Linux, and Solaris, but does not ship it for Mac OS X. I don't feel let down by Apple here.

I feel let down by Sun.

Sun already publishes a JDK and JRE for three different OS platforms. How hard would it be for them to publish it for Mac OS X as well?

It appeared to me that Sun just recently started natively supporting OpenOffice on Mac OS X. The concept is not completely alien to them, then.

Looking realistically, what is the supposed rationale behind having Apple ship Java for Mac OS X? My educated guess is that the reasons are twofold:

One, OS X was originally so small marketshare-wise that Sun simply couldn't be bothered. They probably had they doubts about the success of the OS. So Apple undertook porting Java to increase the potential software base of the OS and its overall utility. Remember, Mac OS X at the time was still quite young. Hopefully this has changed by now, especially seeing how lots of Sun employees also use Mac OS X. So there's me hoping that in 2007, Sun could actually be bothered.

Two, Apple provided some Apple-specific functionality, like Swing that looks almost like native Mac UI, plus a Cocoa bridge (which is not updated to keep up with Cocoa improvements for quite some time, and is declared by Apple to not be updated ever again).

Don't get me wrong, but the vast majority of Java developers on Mac doesn't give a shit about either Swing or Java-Cocoa bridge, or anything else there might be. Java isn't doing particularly well on desktops; strong Java market is on the server side. As a consequence, vast majority of Java developers don't deploy their software on Mac OS X. They deploy it on enterprise irons that typically run Linux or Solaris. I'm in this crowd.

Let me repeat: I don't give a flying shit about Mac OS X specific Java functionality. If I wanted to write a Mac desktop app, I'd use Objective-C. If I wanted to write a cross-platform desktop app (ha!), I'd probably first talk myself out of it, and if I really couldn't, I'd go for SWT. I'd be more than happy with Java on Mac that allows me to do my command line and server side stuff. I wouldn't care that it has us an ugly looking UI with Swing (as it does on all other platforms, anyway).

And I firmly believe it is Sun's job to give us one, not Apple's.

If you're following what Apple is doing with its developer strategy, it'd be clear to you Apple doesn't have any interest in Java on Mac OS X, and I can't actually blame them for that. Apple is slowly abandoning lots of technologies. It is slowly abandoning Carbon (Carbon will have no 64 bit support, ever). Apple is slowly abandoning non-Cocoa QuickTime bindings (they too will have no 64 bit support). Apple's developer strategy is unification: everything is Cocoa and Objective-C.

In an interesting twist that seemingly (but only seemingly) contradicts what I wrote above about unification, Apple ships Ruby and Python bundled with the OS. However, please observe that both of these are (a) open source and (b) support compiling on Mac OS X in their mainline source code. That is to say, the original developers of the code provide OS X support by sprinkling required #ifdef blocks around the code. Apple just needs to take it and bundle it, without further tailoring. That's what they do. To Apple, Python and Ruby are just Darwin-level tools. And even if they didn't bundle it, it'd be trivial for anyone to compile them from the source and install. Fink and DarwinPorts can give you newer versions of either if you need them. Neither (a) nor (b) can be said of Java. OpenJDK is not Java. Not yet. Sun is definitely heading in the right direction with open sourcing Java, but they started too late to avoid this particular crisis.

Relying on Apple to deliver the Mac part of the WORA promise was a mistake, one that could be easily seen by anyone for years, as Mac users were getting their JDK updates with six months or longer delays compared to platforms serviced by Sun. Sun would've had plenty of time to act upon this mistake.

Again, is it Apple's fault that we don't have an industry-grade open-source Java implementation that supports Mac OS X in its mainline source code? I don't think so. If you want to be angry at someone, or better yet, you want to petition someone about the situation, please direct your energies at Sun.

UPDATES:

  • OS X Java Definitive Timeline shows the problem of letting Apple - a party for who Java is low-priority business - take care of delivering it on its platform: worst lag in release schedule was 21 months for Java 1.4 to show up in Mac OS X.

  • Also there, Comic: Apple’s Pathetic Java Support? Oh Really? saying
    Dear Steve,

    Writing your own JDK is really hard. Maybe you should follow Microsoft’s lead and let Sun do the dirty work?
    Well, yeah, if only Sun wanted to do it.

  • In Shipping means prioritizing Gruber also reinforces my point:
    Perl, Python, and Ruby pretty much compile out of the box on Mac OS X. Apple doesn’t have to do much at all — at least relative to Java — to include them on Mac OS X. Why? Because that’s how these tools are designed and engineered — they’re made to “just build” on any Unix-like OS. It’s not Apple’s responsibility that Java isn’t like that — it’s Sun’s.
    He's also quite confident we'll see Java 6 in Mac OS shipped soon, if the timeline above is any indication.


Fastest Vista laptop is MacBook Pro

According to PC World's "The Most Notable Notebooks of 2007" article, of all laptops they tested this year, the one that runs Windows Vista fastest is - MacBook Pro! They conclude with:

... MacBook's score is far more impressive simply because Apple couldn't care less whether you run Windows.

(Via Daring Fireball)

Thursday, October 18, 2007

Linux preinstalled on Acer laptops - a scam?

Here's a bit of a firsthand bitter experience with laptops and Linux from last week. (It's also another hard reminder why I run Apple computer gear exclusively for myself for two years now.)

My wife's aunt wanted to buy herself a computer. She wanted the "usual" functionality, y'know, browse the web, e-mail, listen to music, watch movies, online chat. It also must have a hungarian UI. I suggested she gets a desktop computer, but she insisted on a laptop. Oh well, it's her money.

Her budget was half of what you'd need for a MacBook. Not wanting to enrich Microsoft's Windows division, I suggested we get a laptop that comes with Linux preinstalled. I had some successes installing Ubuntu Linux on some machines lately (one of them an oldie IBM ThinkPad where Ubuntu even recognized the PCMCIA wireless card without a hitch). Also, seeing how she lives 100 km from here, I didn't feel like doing tech support on it often, which is something I believe I would end up doing with Windows (if my wife's machine is any indication).

My argument was that for the same money, we'll get a stronger machine, since the manufacturer didn't have to scale back the hardware budget to accomodate a Windows license.

We ended up buying an Acer Aspire 5315 that's distributed locally in a Linux configuration for 120000 HUF (660 USD).

Now, the first thing is that it comes with a Linux distribution named "Linpus Linux". There's no install CD so I can't reinstall it if anything goes wrong. Also, I can't install any graphical interface. That's right. In 2007, a machine equipped with a 1280x800 screen, gigabit ethernet, wifi, DVD burner, and bluetooth comes with a preinstalled OS that dumps you to a shell prompt upon boot. No graphical environment whatsoever is preinstalled. I've tinkered with it a bit, and noticed it doesn't actually bring up the wireless network interface. We'll see later why.

Ok, so let's install a proper Linux on it. I started with Freespire - it's an Ubuntu derivative, but comes with non-free media codecs. Just what I need, so auntie doesn't nag me later that she can't play back MP3 and WMA files. It went up without a hitch, but I hit exactly three problems with it:


  • Sound drivers claim to work, but no sound comes out.

  • The Atheros wifi chipset is too new, so it's not yet supported by pci_ath

  • An attempt to install hungarian language ends up with error message saying qt_language_selector is not found


Trust me, I've spent fair ammount of time browsing all sorts of support forums to solve these, but had to throw in the towel in the end.

Next, I tried a mainline Ubuntu distro (Feisty Fawn). This ended rather quickly - I got dumped into a BusyBox command prompt by the installer. Turns out FF doesn't recognize the chipset, and thus can't detect the hard disk drive properly, and as a last ditch measure gives me a command prompt. Geez...

At this point, I decided to give Windows XP a try. I had a copy of WXP SP 2 at hand, so I tried installing that if only to see whether the sound might be defective in hardware (if WXP drives the sound chip, then it's apparently not). To my utter surprise and disbelief, WXP installer also failed to recognize there is a HDD in the machine. Ouch. Friends are telling me that I'd need to provide the installer with SATA drivers externally. Yeah. Provided I can find them. And then there's the minor issue that Windows XP installer only accepts external drivers through a - you guessed it - floppy drive! Yes, there are USB FDDs. I've also heard some newer BIOSes can present a USB pen drive as a floppy. Still, what would've it taken to write the damn thing so that it can accept external drivers from a CD?

Back to Linux - there's another Ubuntu derivative named Kiwi. I chose it because, similar to Freespire, it comes with nonfree codecs preinstalled, and can be installed in Hungarian language by default, so Freespire's language selector problems at least won't trouble me. It was also based on next Ubuntu release - Gutsy Gibbon.

Well, what can I say. It did boot and install, but the sound still didn't work, and I still couldn't get wifi to work. Yes, I did try ndiswrapper with Windows drivers, but even after I blacklisted pci_ath and rebooted, some part of the OS still pulled pci_ath, which took precedence, but was unable to drive the new chipset.

So, I had to admit defeat. I wasted sunday evening, monday evening, and part of tuesday evening on this. My time is worth more to me than this.

So I phoned an IT shop in the city and asked them for a quotation on Windows Vista Home Basic. (Seeing how XP doesn't install, how Acer itself suggests Vista, and how the driver CD only contains Vista drivers.) With Vista, sound works (not a hardware problem then), wireless works. All hardware works.

But here's my question: why does a company sell a computer with Linux preinstalled if there's no Linux distribution currently on planet that can, installed out of the box, correctly drive all of its hardware? What can be said of such a marketing practice? In case of Acer Aspire 5315, at least the wireless and audio didn't work (and I haven't tested either the Bluetooth or the DVD burner, so I can't say they either work or don't).

If they aren't aware of the hardware support limitations, shame on them for being unprofessional. If they are aware of it, shame on them for enticing us on purchasing the machine by representing that it has an OS installed appropriate for it. Duh.

Vista install is running as I'm writing this. I'm cheering myself up thinking of how next time I'll be installing an OS it'll be Leopard on my two Macs.

Thursday, October 04, 2007

Language trendspotting at JAOO

Surveying the talks this year at JAOO, it is hard not to notice that nobody is getting too excited about either Java or C# anymore.

Ruby of course had a full track to itself on monday, and a track named "Enterprise Application Frameworks" on Wednesday was also pretty much Ruby/Rails dominated.

On the other hand, other languages were in the limelight too. We had a great introductory presentation on Erlang by Joe Armstrong, one of the principal inventors of the language. Erlang is the old-new contestant for the title of "right answer to concurrency challenge", and it really looks like it solves the challenge correctly for a fair ammount of use cases I can think of. Basically, whenever you can afford a share-nothing message passing architecture.

We also had a presentation of Scala. Scala must be my favorite language for about two years now even if I didn't write anything in it yet :-). You just got to love all the modern amenities in it that are missing from Java: type inference, very good syntax for map and list literals, closures, a really polished generics implementation (it allows contravariance, by golly!), plus assorted functional programming goodies, not the least of them being Haskell-style datatypes. Oh, and it is static and compiles to a plain Java .class, creating a very low (virtually nonexistent) entry barrier for gradual introduction into your existing Java code.

Oh, and people are talking about JavaScript as well :-)

Glenn Vanderburg gave a talk titled "The Overlooked Power of JavaScript", which was exactly what it said. The language had quite an injustice done to it because of its unfortunate name choosing -- as we know and as Glenn pointed it out correctly, it is not related to Java at all, its ancestry comes from Scheme and NewtonScript (useless trivia: I actually wrote a commercial application for Newton in NewtonScript back in 1996).

JavaScript is an incredibly powerful language if you can get rid of the preconception that you need to handle it as you'd handle Java. Once you get past that and actually understand how things work in it, you can develop some mightily beautiful code in JavaScript, as the extreme dynamism of the language allows you refactorings simply not possible in more constrained languages. You can end up with some very tight internal DSLs. And I'm not talking only about code to run in a web browser -- I'm talking about applications running on desktop or on a web server.

To demonstrate the power of the language even further, there was a presentation of Flapjax on JAOO this year. Flapjax feels like a language, but in reality it is "just" a JavaScript library, but one that allows you to program your browser-run client applications in an event driven manner, plus supporting reactive evaluation (think self-recalculating cells in Excel) when events change values. "Event" in Flapjax can be almost anything -- a tick of a timer, a click of a mouse, asynchronous completion of a HTTP request, and so on. You can concisely express your program in terms of reactions to such events, and also always preserve consistent internal state of all variables thanks to its self-recalculations, all with fairly intuitive syntax. That's quite a something from "just a library" in JavaScript :-) Flapjax was covered on LtU as well about a year ago.

So, all-in-all, language diversity is again in fashion. Developers seem to finally recognize that a language is just a part of their toolbox, and that you need to choose the right tool for the right job. Of course, I know that the same developers usually need to also convince their managers about this point of view, but fortunately this seems like it'll become easier with language diversity now being an accepted trend at respected conferences.