Archive for April, 2005

Tiger for Tiger

This puts to rest all my doubts about the availability of Java 5 for OS X 10.4 “Tiger”.

An interesting tidbit of info is that: “This release does not replace the existing installation of J2SE 1.4.2.” Good news for those developers who have to ensure compatibility of their apps with Java 1.4.

ApacheCon deadlines postponed

From: Rodent of Unusual Size
Subject: ApacheCon 2005/EU speaking agreements

[...]

Also note that the deadlines for notes and handouts have been
extended at least 3 weeks.

I was almost done and planning to spend some time this weekend to finish off my slides, but now that I have three more weeks I will try to make them more polished.

They also informed me that Software & Support Verlag, the producer of ApacheCon will anticipate travel and lodging expenses for us speakers. Nice!

Straw sucks

This morning I noticed that the server where this site is hosted was responding very slowly for some minutes. I barely managed to log on and noticed that the load average for the machine was around 80! All the runnable processes were Apache server processes, so I suspected some kind of DoS attack.

Fortunately, the load returned to normal levels after a couple of minutes and, looking at the server logs, I saw a long string of requests from a user-agent that identifies itself as “Straw/0.25.1″. The problem is that there were about fifty consecutive requests in less than three minutes’ time!

Googling around I found Straw’s home page and learned that it’s a desktop news aggregator for Gnome. I don’t think I am exaggerating by affirming that an aggregator that manages to send fifty requests in three minutes is an incredibly sucky piece of code.

Some technical details follow:

The aggregator was evidently programmed to fetch the "/?flavor=rdf" URL. That was the URL of my RSS 1.0 feed when I was still running blojsom. Now that I’m using WordPress, the query parameter is ignored, so the request fetches my home page — in HTML, 18853 bytes served per request — is probably confused by it and happily retries immediately, fifty times in a row, without even pausing to think!

The requests came from the 84.191.68.245 IP address, which resolves to p54BF44F5.dip.t-dialin.net. This is probably a dynamic IP address for a dialup connection to Deutsche Telekom. If you are reading this and recognize yourself, please program your aggregator to use this URL instead: http://agylen.com/feed/.

In order to avoid this happening again, I’ll try to install an appropriate mod_rewrite rule. Failing this, I’ll have no other option than blocking an entire D-Telekom subnet, since the IP address is clearly dynamic.

Technorati hates me

I’m glad to hear that Technorati doesn’t hate Bru but it seems to hate me with a vengeance. Ever since I moved my blog to its new home, TechnoratiBot has stopped visiting me no matter how much I ping it. I’ll have to get in touch with their technical support if I ever decide to lift my lazy butt.

On related news, I discovered that my old blog, under the beblogging.com domain name that I sold, is still listed in the Open Directory and this has the unpleasant side effect of making it come up first when searching for my full name on Google :(.

Actually, the problem is worse. The site is not listed on dmoz but you can find it by searching. And when you try to use the “updateURL” function to update it, dmoz says that the URL you just found via searching is unknown! Looks like a bit of Catch-22, grrr… I had to email the editor for the category, but no reply so far. On the other hand, the Google Directory still lists it.

On top of alll this, visits to this site are unusually rare today, a couple of very interesting postings made yesterday notwithstanding. I’m feeling ostracized by the blogosphere ;).

Currently listening to James Taylor, “You’ve got a friend” … Where? … OK, just joking.

Google Adsense coming to RSS

It had already been foreseen, now it’s happening for real:

Jason Calacanis: “In case you didn’t notice, some of your favorite Weblogs, Inc. blogs now have Google Adsense in the RSS feeds.”

However, if you’re clicking an AdSense ad appearing in an RSS feed, like TUAW’s, in NetNewsWire, you get the following error message (assuming you have it configured to open pages in its embedded browser):

One reason you may not be able to access this advertiser’s website is because your web browser or email application is not configured to accept cookies. Cookies are small bits of text that websites place on visitors’ computers to identify that they have visited a site previously. To access the site, you’ll need to follow the steps below to set your browser or email application to accept cookies.

The moment this feature is available to all the publishers, I will probably revert to publishing a full RSS feed, with ads. Frankly, if I can make a little money with ads, after I have covered hosting fees, I won’t complain. One problem with this is that my feed is aggregated in places like Planet Apache, which is not too picky with HTML code it digests and regurgitates.

Indeed, if you happen too publish a truncated RSS feed and by chance an entry gets truncated after an opening tag (<em> for example), but before the corresponding closing tag, everything that follows will be italicized, in the example.

This probably means that it will happily display all the ads included in the RSS feeds it syndicates. Some people have already indicated that they wouldn’t accept this, and I fully understand this sentiment. It wouldn’t be fair for my ads to be carried by a community site like Planet Apache.

While it could be argued that this is a bug of Planet Apache (other aggregators, like javablogs.com for instance, sanitize all HTML code before republishing it), I’d better investigate if WordPress can be configured to produce both an ad-free, summarized feed and an ad-carrying full feed at the same time. Besides being nice to Planet Apache, this solution would give more choice to all of my readers who use an aggregator. What do you think?

Designing from the outside in

Great post by Tim on the O’Reilly Radar about the importance of starting a design from usability and function rather than from frameworks:

I was talking with Jason Fried of web design firm 37Signals recently. He believes that contrary to the normal expectation that applications are built on top of frameworks, applications should always be designed ‘from the outside in.’ That is, at 37signals, they try to design the usability and function of the application first, and that drives the implementation. And if they can then extract a re-usable framework, all the better. For example, basecamp wasn’t built on top of Ruby on Rails. Rather, Ruby on Rails was extracted from basecamp. This approach seems obvious and commonsense — but hardly common in this era of heavy web services standards-ware designed by technical committees far in advance of actual implementation.

All very true, in theory, however there’s something to be said in favor of consistency. When you use the same framework over and over, you start getting familiar with it, you learn its pitfalls and hacks and you become proficient. Sometimes it’s better to stay with what you know, even if it’s sub-optimal, than risk taking a new road, however promising it looks.

Most of all, you want to avoid falling into “Classic mistake 34: Overestimated savings from new tools or methods.” from Steve McConnel’s classic “Rapid Development”:

Benefits of new practices are partially offset by the learning curves associated with them, and learning to use new practices to their maximum advantage takes time.

That’s why, even if Ruby on Rails looks cute, for my next project I’ll probably stick to my usual bag of tools: Java, Cocoon, Spring, Hibernate, etc. (Note that this bag was not designed by a technical committee, but grew out of many years of experience in developing software projects.) This probably means that while designing the application, I will unavoidably try, at least in part, to fit it into the context of a predefined framework.

I guess this approach fits better the “from the outside in” moniker, after all. We start from the outside (function and framework) and move towards the center (implementation), whereas I would say that starting from the functionality and deriving a framework from it can be better described as “top-down” design.

Of course, it’s entirely possible that once in a while you’re faced with the task of developing a system of a kind you’ve never seen before and find out that your usual framework is not good at all, but I’m sure this seldom happens very seldom, at least in my experience.

Spring is ripe for bashing Microsoft

BSOD T-shirtI usually refrain from bashing Microsoft unnecessarily, but these days bad news about our Redmond friends seem to crop up with a disturbing frequency, so I’ll summarize most of them in a single article to avoid going on for days on end.

Stop that monopoly!

Latest EU threatens Microsoft over Windows: “BRUSSELS (Reuters) - The EU’s executive told Microsoft CEO Steve Ballmer his company must comply urgently with its decision to stop abusing its virtual monopoly position of its Windows operating system or face action.

‘All I can say for the moment we are still not satisfied,’ European Commission spokesman Jonathan Todd told a news briefing, referring to Microsoft’s action to meet the Commission’s demands.”

Tricks with search engin rankings

Google and MSN search comparison: “On the whole is seems that the MSN search engine is indeed placing IIS hosted sites higher in the results more frequently than other webservers. Frequently the MSN search is placing more IIS servers in the important top 10 results than Google even where result sets from a query have actually returned fewer IIS servers overall on MSN.”

Should I switch from Apache in order to get more hist from MSN? At least, they don’t have a monopoly on search engines. Whew!

Longhorn a train wreck?

Paul Thurrott: “I’m reflecting a bit on Longhorn 5048. My thoughts are not positive, not positive at all. This is a painful build to have to deal with after a year of waiting, a step back in some ways. I hope Microsoft has surprises up their sleeves. This has the makings of a train wreck. I’ll have more on that later.”

Firefox spreading

Firefox: Blazing a Trail to 50,000,000: “They said open source would never penetrate the mainstream. But you’ve never cared much for rules, have you? And now we’re blazing a trail to 50 million downloads worldwide. As we turn open source into a household word and reassert the supremacy of simplicity, we are making waves—and starting fires.”

Meanwhile, IE7 beta is yet to be seen.

The SWT vs. Swing Controversy

I haven’t been doing “rich client” applications for a long time and did just a little Swing development at the times of Java 1.2, preferring to concentrate myself on web applications instead. With all the new developments around the concept of “Rich Internet Applications”, Ajax and the like, I don’t think I’ll be doing GUI development in Java at least for the foreseeable future.

However, I read with the utmost interest the comparison between Swing and SWT that was published today on Hacknot. You never know when you you might find yourself in the kind of situation described in the article: being forced by the management to adopt a technically inferior solution for no apparent reason.

The article is, as usual for Hacknot pieces, quite long and well documented. I suggest you read it all by yourself, but if you’re lazy, I’ll quote the main conclusions:

My prediction is that SWT will continue to limp along in support of Eclipse; neophytes will continue to discover it and sing its praises until such times as they’ve used it enough to realize its limitations; the uninformed will continue to attach a significance to platform fidelity that their user base does not; and marketers will continue to talk of SWT ‘taking over’ from Swing - as they have for the last three years - despite the lack of evidence that such a takeover is actually occurring. I expect the enormous maintenance burden incurred by SWT’s multiple code bases to become the limiting factor in its ongoing development, and cross-platform stability and consistency to remain ever elusive as SWT rushes to keep apace of the progress and initiatives amongst the native widget sets of different platforms. Any claims to better performance will finally be abandoned in the face of increasing capabilities of the average PC, leaving SWT an anachronism without a raison d’etre.

Ten years of Java

logo_java.gifI didn’t notice, but looks like last Friday marked the 10th anniversary of the birth of the Java language. I should have really paid more attention, as for me Java was a very important part of my working life in the last ten years. Here is my personal timeline:

1995 - Java announced but not much more than a curiosity.

1996 - I start off with Java by reading David Flanagan’s Java in a Nutshell.

1997 - Java Servlet Developers Kit released. I realize that developing web apps with servlets is much easier than with CGI Perl scripts.

1998 - Java2 platform shipped. Now we’re getting serious! Also include Swing, which is much better than AWT.

1999 - I start doing some work with Apache Cocoon. Sure beats doing out.print(”“), but actually I had already discovered XSL-T and used it with a self-made framework.

2000 - I start reading about EJB, thinking that sooner or later I’ll be using this very cool technology. Five years later, EJB is out of fashion and I still haven’t developed a single application using it.

2001 - Cocoon 2.0 released. Big improvement over Cocoon 1.

2002 - Not much happening this year.

2003 - Cocoon 2.1 released. I start using Hibernate to develop database applications. Bye bye, straight JDBC!

2004 - Dependency Injection-based containers are all the rage and I start using Spring together with Cocoon and Hibernate. A very powerful combination.

ApacheCon Europe 2005 drawing near

Actually, ApacheCon Europe 2005 starts on the 18th of July, but I just got this email:

From: Rodent of Unusual Size

[...]

1. Session slides/handouts are due by 1 MAY 2005.

Gosh! I have less than a week to finish the slides and the handouts. I don’t even know how handouts are supposed to look like.

Fortunately, Monday is a national holiday here and I had already decided to take a day off on Tuesday anyhow, so I have plenty of free time before Sunday. I was thinking of devoting some of that time to doing development for Source.zone, but it’s priority will have to be lowered.

Out of the Sandbox - new Google PageRank

Out of the Sandbox - new Google PageRank: “We are waiting now to see what the effect will be on traffic. However, we’re glad to have this obstacle out of the way. It is a frustrating situation; it is completely not within the control of any well-planned SEO strategy to combat the sandbox. Unfortunately, the data on the sandbox phenomenon is not documented. It may not happen to everyone. And its length is really independent of the blog age, as we’ve found. All of our blogs, started at different times, came out with PageRank with the new index.”

I discovered yesterday that the PageRank for this blog went finally from 0 to 5. Nice, but it doesn’t seem like it’s making a lot of a difference in terms of hits from Google searches. I think we can conclude, once and for all, that the Google Toolbar’s PageRank indicator is almost completely useless as a predictor of search results positioning.

The Firefox ad that never was

041905firefox_400x490.jpgI can’t understand how this ad can possibly offend someone. Even with Pope Ratzi sitting right here in the center of Italy, it wouldn’t even raise an eyebrow. We’ve had a TV ad for a chewing gum, featuring a guy who couldn’t open a condom’s envelope with his — presumably rotten for lack of hygiene — teeth, running for months on national television. So much for being a traditional catholic country.

NevOn: Firefox blush at browser protection ad: “Anyway, I bet we do see that poster run. If not, at least the image repeated in blog posts like mine. Now that’s a an idea for some viral advertising…”

I’ll pick up the suggestion. Click on the ad to see the larger image.

Still on the subject of controversial ads that never did get shown, here’s a sexy video that was made for Microsoft but, so they say, Bill G. didn’t appreciate.

Re: What the bleep do we know?

It’s interesting to see how normally smart people can be easily duped:

techno.blog(”Dion”): What the bleep do we know?: “I got to see a film that I have wanted to see for awhile now: What the bleep do we know?!.

This is part documentary, part story, part exploration.

It is my kind of movie. One where you are actually encouraged to THINK while you suck it all in. Imagine that.”

Sorry, Dion, you’re a very competent guy when it comes to Java and server-side programming in general, but you’ve been had. What the bleep do we know is not a documentary, it’s not a story and it’s not an exploration. It’s simply a very long infomercial for a cult:

Skeptico: What the (Bleep) Were They Thinking?: “I can answer that now. They were thinking that if they made a film using the word “quantum” a lot, plus plenty of feel-good drivel they would (a) make a ton of money (not that they are short of the stuff), and (b) gain more recruits to their loony-tunes cult. This is probably one of the few things they got right.”

Dion, I hope you’re a bit more skeptical when evaluating application servers or databases than you’ve been evaluating that film. Cheers.

Pope Ratzi on evolution

Yesterday we chided Pope Ratzi for being a homophobic reactionary. Now it’s time, thanks to PZ Myers, to see how he stands on matters of science, especially in fields where science seems to be perfectly able to explain things like the evolution of living beings, without needing to resort to a lot of hand-waving about a “creator” or some kind of “intelligent design”:

It is the affair of the natural sciences to explain how the tree of life in particular continues to grow and how new branches shoot out from it. This is not a matter for faith. But we must have the audacity to say that the great projects of the living creation are not the products of chance and error…(They) point to a creating Reason and show us a creating Intelligence, and they do so more luminously and radiantly today than ever before. Thus we can say today with a new certitude and joyousness that the human being is indeed a divine project, which only the creating Intelligence was strong and great and audacious enough to conceive of. Human beings are not a mistake but something willed.

This is the same old pro-design argument that was first brought forward by William Paley more than two centuries ago and that has since been utterly refuted numerous times (see Richard Dawkins, The Blind Watchmaker, for instance). You’d think Ratzi would know better than that.

Indeed, his predecessor JPII sounded a bit more informed than him:

Today, more than a half-century after the appearance of that encyclical, some new findings lead us toward the recognition of evolution as more than an hypothesis. In fact it is remarkable that this theory has had progressively greater influence on the spirit of researchers, following a series of discoveries in different scholarly disciplines. The convergence in the results of these independent studies—which was neither planned nor sought—constitutes in itself a significant argument in favor of the theory.

Character encoding is a PITA

I don’t know if it’s just us, but we seem to periodically run into the same troubles concerning character sets in Java web apps. This time I got bitten once again by the bug that causes international characters entered into an HTML form field to come out as an unintelligible string of random symbols when displayed on another page.

Some time ago, I came to the conclusion that if we used UTF-8 everywhere, we’d have had less problems. And, indeed, by encoding all files in UTF-8, setting container and form encoding to UTF-8 in web.xml, ensuring all pipelines are serving UTF-8 streams, putting relevant <meta> tags in the HTML output, specifying UTF-8 as the charset in JDBC connection properties and having an UTF-8 encoded database, when a problem comes up it is a safe bet that someone, somewhere forgot one of these precautions and fixing it is usually just a matter of finding where.

Until today, at least. Today I spent a few hours fighting with this kind of bug and painstakingly reviewing everything in order to make sure that UTF-8 was specified everywhere, to no avail. At last, I gave up and set page encoding to ISO-8859-1 and everything is now hunky dory again.

Sometimes I wish all the world stopped using national character sets and everything was encoded as 7-bit ASCII once again. 127 characters should be enough!

Italian catholics don’t get the new pope

ratzinger.jpgI’m watching TV right now and what I’m seeing is an endless string of debates amongst and interviews by and to catholics. It would have been interesting if they had invited an atheist, for a change.

Anyway, all those catholics seem to be very happy about the choice of Joseph Ratzinger as the new pope. I wonder what do they have to be glad of. Most of them are much more “liberal” than even John Paul II was, especially regarding sexual morals. I’ll bet that when their daughters are going out with their boyfriends, they will certainly teach them about the proper usage of condoms and contraceptives.

They do not seem to realize how brutally reactionary the new pope is. One who seems to get it very well is Andrew Sullivan:

His views on the subordinate role of women in the Church and society, the marginalization of homosexuals (he once argued that violence against them was predictable if they kept pushing for rights), the impermissibility of any sexual act that does not involve the depositing of semen in a fertile uterus, and the inadmissability of any open discourse with other faiths reveal him as even more hardline than the previous pope.

One of the few smart observations I heard tonight was expressed by journalist Antonio Socci. Ratzinger chose Benedict XVI as his name in memory of St. Benedict, who kept alive Christianity in the Middle Age, against barbarians. The new barbarians, in Ratzinger’s view, are liberals and relativists, and a new St. Benedict is probably needed to fend them off.

Oh well, why do I care? It’s those catholics who will have to come to terms with the clash between their doctrine and their true beliefs and behavior, not me.

Ratzinger-Z

After Mazinga-Z, a new robot will save the Earth: Ratzinger-Z!

Ratzinger-Z

Here’s the soundtrack (MP3, 1.92MB).

Nutch Page Ranking

Nutch logoI’m presently doing some experiments with Nutch, the Open Source search engine that has recently been moved to the Apache Incubator.

I’ve been reading about how Nutch’s Open Source ranking algorithm is supposed to be better being open, but I couldn’t find — either googling around or nutching around ;) — a complete description of how it ranks pages. Does it take into consideration inbound links like Google’s or not? I’d really like to know.

LazyWeb: How to create an Image from a byte array using JAI

Dear Web,

I have the following problem: I need to adapt some code that reads an image from a file using JAI to read it from an array of bytes having exactly the same content as the file. The code for reading from a file is quite simple:

RenderedOp img = JAI.create("fileload", "filename.jpg");

My problem is that I don’t have the JPEG file on disk, but it’s in memory inside a byte[] and I guess that I should do something along the lines of:

RenderedOp img = JAI.create("WHOKNOWS", data);

Or:

RenderedOp img = JAI.create("WHOKNOWS", new ByteArrayInputStream(data));

I couldn’t find anything googling around, the JAI documentation is a mess and the FAQ is of no help.

Please help! What operation name should I use instead of “WHOKNOWS”, assuming what I’m trying to do is even possible?

Please note that the byte array does not contain a raster, but a JPEG-encoded image.

Security update makes Java unusable on OS X

If this is for real, I will hold off upgrading to 10.3.9, which I planned to do later today. On the other hand, I’ running the stock JDK and not a developer release, so maybe this doesn’t apply.

Mark Watson: “This morning when applying the latest software update zapped Java, I just went ahead and did an OS X re-install followed by re-applying security patches, etc. About 90 minutes wall clock and about 20 minutes of my time wasted.. eerrrrrr….”

By the way, there is no evident comment or trackback link on Mark’s site, so I hope he’s checking his referrer logs.