Blogging Year In Review: 2005
Another year draws to a close. Rather than going through the year's events month by month like I did last year, I thought I'll just do some work with the log files and come up with the years top blogs.
I used this awk script extract URLs from log files:
{
if (match($0, /.*\[(.*)\] *"GET ([^ ]*2005[^ ]*)" .*/, a) > 0) {
print a[2];
}
}
And I used a simple Java program to do the counting and sorting.
Here's the top 15 postings this year.
- Native XML Comes To Firefox 1.5's JavaScript (2665 hits)
- Native Eclipse Comes To Linux (2631 hits)
- GCC 4.0.0 Released, Supports Free Software Java (1978 hits)
- Questioning AJAX (1950 hits)
- LimeWire: The Killer Java Desktop App? (1754 hits)
- NetBeans vs. Eclipse---Why Not Both? (1727 hits)
- NetBeans Is Not Open Source! (1494 hits)
- There Is No Such Thing As A "Java Architect"... (1321 hits)
- Re: Who Are These People (was: Re: Open Source JVM Proposal On The Table At Apache Software Foundation) (1208 hits)
- Java People, Stop Worrying and Start Coding! (1063 hits)
- Guys, TurboGears Is Every Bit As Compelling As Rails (995 hits)
- Seven Reasons To Go With OpenOffice.org 2.0 (956 hits)
- Spring Framework Has A Competitor Now (949 hits)
- C++, Boost, Template Meta-Programming, ... (800 hits)
- Does It Work? (798 hits)
Thank you for reading this blog. I wish you a Happy New Year!
See you next year.
Stumbled Upon StumbleUpon(.com)
Escape the familiar web.
The web should be a place where you can wander off to unexpected places. However that's not what my browser gives me. Everything about the browser pulls me back into the part of the web that I'm already familiar: the history pane, the bookmarks menu, the address bar combo box all do this.
Even blog aggregators, Google and del.icio.us give me sites based on my own input. They are more dynamic and provides more variety. But after a while, I find myself reading the same set of bloggers, subscribed to the same set of tags, and searching for the same set of topics.
Then, a few days ago, I stumbled upon a blog entry, I forgot who's, that mentioned StumbleUpon. It's one of those "we'll give you some fresh sites" kind of deal. It gives you a web toolbar with a "Stumble" button. One click and you are on a totally unfamiliar page. There are also "I like it!" and "No more like this" buttons.
I haven't tried doing anything fancy yet. I just selected my interest areas (away from the usual computer stuff) and started to stumble.
So far, the sites suggested have all been refreshing, unfamiliar, surprising, and of high quality.
Try it. It's a novel way to waste your time.
Hours of fun™.
Does Your Firefox Do This?
Now I can print HTML pages with headers and footers.
First of all, Merry Christmas.
I have observed, but not investigated why, Firefox (and Netscape and Mozilla before it) wouldn't print page headers and footers on my Linux machine. I have always thought the browser will print headers and footers on Windows but not on Linux. It's been that way for ever.
Then last week, I did a print preview and saw page headers and footers. I realized that my printer margin settings must be wrong. Sure enough, in my printer properties dialog, the Gap from edge of paper to margin was set to 0.04 inch:
That puts the headers and footers into the printer's non-printing area. Changing the gaps to 0.2 inch at the top and the bottom, and 0.25 inch on the left and the right, fixed my problem:
I've been copying my ~/.mozilla directory from computer to computer every time I upgraded I don't know for sure if the wrong gaps were the default settings for modern day Firefox on UNIX machines or if it was just my personal configuration from a long time ago that endured all the upgrades. What does your Firefox do?
At any rate, I'm glad I fixed it.
Java People, Stop Worrying and Start Coding!
Ruby is being hyped pertty hard right now, just like Java was ten years ago.
I classify myself as one of those developers who don't get Ruby, just like I don't get Perl. Both are too hard for me. And there seems to be something in my brain that prevents me from learning both. It's strange I never had the problem with C or C++ or Python or Lisp or awk.
So, the hyper-enthusiasts have left the building. They went for another programming language. They claim that the other language is five to ten times more productive than the current languages, even though the other language does not have very good stories in terms of IDEs, GUI toolkits, multi-processor/multi-thread support, or distributed transaction management. They claim that the other language supports object-orientation far better than the current languages. They claim that the other language handles a big chunk of the tedious work we do in the current languages automatically. And they have a fifteen minute demo that anybody can download from the internet and fire up and be in awe.
Am I talking about Ruby? No!
I'm talking about Java—ten years ago. Yes we did all these when we were young. We downloaded HotJava, the world's first Java-enabled browser, fired it up and saw the animated website and liked it. We wrote our first Java applet in AWT 1.0 and it felt just so right! We were hooked. We left C++/COBOL/Fortran behind without ever looking back, proclaiming them "bad memory that is mercifully fading away."
Yep. That was us. Now ten years later, it's our turn to be on the other side of the flood gate. And it can be a scary time. What are we to do?
Well, you can follow the hyper-enthusiasts to the new pasture where the grass seems greener, if you believe them and you can stomach the new language. It will be fun. It will be exciting. For a while. But you won't be more productive than you are now. All the new things take time to learn. All the new missing features will need to be added into the mix. You will also constrain yourself into the narrower domain—Rails based webapps. If this is what you choose to do, I wish you luck.
Actually that's what I did when Java came around. And it has worked out great for me. But I was looking for another language anyway. My old language, a proprietary 4GL for developing client/server applications on Windows that everyone in the team loved, died, edged out by a language that's inferior but cheaper.
Or, you can stay with Java. That's what I would like to do this time. Let me explain why.
One, I just don't like Ruby. This has more to do with how I think and work than with the true quality of the Ruby language. I'm sure Ruby is a fine programming language offering good OO features. But there is something in it that rubs me the wrong way. I tried to learn it when the first edition of the PickAx book came out. But somehow I can't get past the "we are so OO, we write 3.abs instead of abs(3)" noise. I'm sorry. It's not for me. There. I said it.
I used to be afraid of saying such things publicly. Fearing other people would say "this guy is an idiot, can't even learn Ruby." I've been doing this line of work long enough to know that I'm not an idiot. Just like there are people who like Java and people who don't like Java, I think it's only natural that there will be people who like Ruby and people who don't like Ruby.
Two, I'm a slow person. It took me years and years to become really fluent and comfortable with the whole Java environment. My experience tells me learning the syntax is the easiest part, and learning the standard library and third party libraries takes a long long time. Even if I liked Ruby, it will be years before I can be as efficient in it as I am in Java. The at least ten times increased productivity that's cited last year, has been reduced to 10%-50% this year. My fear is that even the 10% number is for hyper-enthusiasts only. For the rank and file, it will more likely be no productivity for the first six months, reduced productivity for the next year and a half, and on par productivity for the next two years. By that time, the Ruby hype should have already died down. There will be a new media darling on the horizon making outlandish claims. What do you do then? Abandon Ruby for this other new thing?
Three, I think Java has a very bright future. Not as glorious as in the past ten years, but bright nonetheless. Java's fundamental strengths in OO, multi-threading, security, networking, dynamic remote class loading, distributed computing, GUI development and advanced and relatively performant runtime make it a strong contender as the language of choice for a wide variety of computing tasks.
The recent raft of proclaims—such as this one: Java is so Nineties—should be read under some critical light. They sound very much like press hits to me. The press has an internal need to hype something. Something new and exciting. They also has a tendency to get tired of them fairly quickly. When something goes off the radar screen of the press, it's not the end. It's just a new beginning. The beginning of the next phase in maturity.
With the hyper-enthusiasts gone, Java enters into a new age. The age of calmness, clarity, and confidence.
How Did They Do That?
Amazon makes the connection. But is it valid?
I've always liked Amazon's personalized spams. Here's one that came in yeaterday:
They used to provide a little bit of logic in the good old days. Now they've gone stream of consciousness.
Today's game: reconstruct the link between Simon Brown and Dave Johnson. (Simon Browns and Dave Johnsons need not play.)
AJaX Lipstick On Browser-Based UI Pig
A little out of context, but a good quote.
Eric Burke: The new Yahoo mail offers drag and drop, loads the message pane in a thread, and looks more like a desktop app than any web app I’ve ever seen. But compared to a native app like Outlook, there is simply no comparison. Lipstick on a Pig seems an apt metaphor. (AJAX is the lipstick, browser-based UIs are the pig).
Printers That Just Worked, And Other Stories
Fedora Core 4 makes my life easier.
Last week was computer music chair week. I installed Fedora Core 4 on gao-2006, moved all my stuff from gao-2004 to gao-2006, installed Windows 2000 Pro in gao-2004 and moved all of my daughter's stuff from hal-2001 to gao-2004.
I already told you about my one day encounter with Ubuntu 5.10. I switched back to my old friend Fedora Core 4 after that. I finally turned gao-2004 over to my daughter yesterday evening.
Here's a few stories that I want to tell.
No printer configuration needed for FC4
Usually one would expect that some network printer configuration is needed after installing a new OS. Not for Fedora Core 4. It recognized the two printers I have on the home network and configured them appropriately. Immediately after the OS install, I can just open up Firefox and print to both the HP LaserJet 1100 on an Fedora Core 3 box and the HP Photosmart 7350 on the Mac mini.
Moving a Subversion repository
I hosted my Subversion repository on gao-2004, and needed to move it to gao-2006. With the default backend storage system change (from Berkeley db based to file system based) for Subversion that happen between FC3 and FC4, I expected that I need to at least read a lot of documentation and perform a fair amount of experimentation.
It turn out that that is not the case, for two reasons. One, the backend storage system is an implementation detail of Subversion and is mostly hidden behind the Subversion user interface. The detail leaked through only in terms file permission problems. BTW, Pragmatic Version Control Using Subversion helped a lot in the process, even though one of its recipes no longer applies in the fsfs world.
Here's my migration steps:
[root@gao-2004] $ svnadmin dump /var/svnroot > /mnt1/svn-repo.svndump [root@gao-2006] # svnadmin create /var/svnroot [root@gao-2006] # chown -R weiqi.svn /var/svnroot [root@gao-2006] # svnadmin load /var/svnroot < /mnt1/svn-repo.svndump
The Pragmatic Subversion book contains a recipe that contains some "group sticky bit" trickery (p.151) that is no longer needed because svnadmin create already does it for you.
Here weiqi is the user who will access the repo through the svn+ssh protocol, and svn is a group that contains all Subversion users.
Moving a WordPress weblog
I haven't done too much with the WordPress blog I created 122 days ago. But instead of throwing it away, I thought it a good opportunity to test how easy it is to move the blog over.
It indeed it easy. All I have to do is to move the MySQL database and the /var/www/html/wordpress directory from one computer to another:
[root@gao-2004] # mysqladmin -p --add-drop-tables wordpress > /mnt1/wordpress.mysqldump [root@gao-2004] # cd /var/www/html [root@gao-2004] # tar cf /mnt1/wordpress-files.tar wordpress [root@gao-2006] # mysqladmin -p create wordpress [root@gao-2006] # mysql -p wordpress < /mnt1/wordpress.mysqldump [root@gao-2006] # mysql -p Enter password: [...] > grant usage on *.* to weiqi identified by password > grant delete, select, insert, update on wordpress.* to weiqi [root@gao-2006] # cd /var/www/html [root@gao-2006] # tar xf /mnt1/wordpress-files.tar
where weiqi/password is the username/password pair I gave to WordPress when I did the five minutes install back then.
Here it is.
Evolution did not migrate cleanly
I never thought the migration of email client data could be this hard. I use Evolution, the default email client for Fedora Core (and Red Hat Linux before it). There is a ~/.evolution directory and it seems to contain my emails.
Just copy the ~/.evolution directory to the new machine and everything will be taken care of, right? After all, Mozilla, Firefox, Thunderbird all work that way.
Wrong! It turns out Evolution also saves some of its settings elsewhere that is not obvious to the casual user.
When I started Evolution on gao-2006, the first-use dialog popped up. I recreated all of my email accounts. Fortunately for me, once I'm in Evolution proper, all of my old email messages showed up.
Windows installation remains to be a pain
Compared to how smoothly the Fedora Core installation went, Windows installation remains to be a major pain. Nothing is improved since I last performed this magic 704 days ago.
My main complaints:
- The trickling in of updates. Windows Update first told me I have to get IE6. Only after the reboot did it tell me that I also need IE6 SP1. And only after another reboot did I learn that I also need IE6 SPI security update KB45423, or whatever.
- Everything is a separate download. Red Hat need to do a Windows distribution—"Here's 20 DVDs for your Red Hat Windows distribution. It includes all the cool programs that you can download from the internet. Just install it, and turn on the Red Hat update agent."
- There are too many reboots that I have to perform to get everything installed.
- Microsoft Office installation is down right ridiculous! I've done the installation several times too many to render the online activation not working. So I have to call an 888 telephone number and speak with a voice response program:
- Very pleasant synthetic female voice: Now read the first set of numbers
- Me: six-three-five-nine-zero-eight
- Voice: Do you want to repeat it? If you don't want to repeat it, simply say "move on."
- Me: Move on.
- Voice: All right. read the next set of numbers
- Me: nine-zero-five-three-seven-six
- [...]
- Voice: We are almost done. Now read the last set of numbers
- [...]
Why Do They Want My Email Address Twice?
I can understand typing passwords twice, but...
I've seen a lot of website registration forms that requires me to type my email address twice:
| Email Address (required): | |
| Retype Email Address (required): |
Why is this? Who invented this practice? Does it work (for whatever reason it is invented for)?
Are you annoyed by this practice? I am.
Have you designed such a registration form yourself? Why did you decide to do it? (Not counting "Everybody was doing it?")
Java News Brief (JNB): The Framework for Integrated Tests (Fit)
If you have heard about Fit for some time, but never had the time to investigate it, then this month's JNB article is for you.
The idea is very simple.
Your write your test scripts in HTML:
<table border="1" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="vertical-align: top;" colspan="2" rowspan="1">ValidateCustomerName</td>
</tr>
<tr>
<td rowspan="1" colspan="1">
<span style="font-style: italic;">customer name</span>
</td>
<td rowspan="1" colspan="1">
<span style="font-style: italic;">valid()</span>
</td>
</tr>
<tr>
<td rowspan="1" colspan="1">
</td>
<td rowspan="1" colspan="1">error</td>
</tr>
<tr>
<td rowspan="1" colspan="1">Mario</td>
<td rowspan="1" colspan="1">true</td>
</tr>
</tbody>
</table>
which looks like this in a browser:
| ValidateCustomerName | |
| customer name | valid() |
| error | |
| Mario | true |
You run the thing:
[prompt] $ java fit.FileRunner tests.html report.html
And depending on if your code is right or wrong, you get either an all green report card:
| ValidateCustomerName | |
| customer name | valid() |
| null | error |
| Mario | true |
or worse (from a different test):
| check | customer total balance |
$135.00 expected $35.00 actual |
You have to write a few Java classes along the way. But those are trivial, right? :)
Tuesday Quiz
I bet you don't know this.
Without using Google or the internet or referring to any books or magazines, answer the following questions:
- Is JavaScript a registered trademark(™)?
- If yes, who is the owner?
- Are you sure?
Ubuntu 5.10, First Impression...
...and last, at least for a while.
My old desktop computer gao-2001, which I passed on to my daughter who renamed it hal-2001, developed a problem (spontaneous reboot) recently. So I ordered a new box from a trusty local store (whose radio ad featured "Dad, I spilled milk into my keyboard. Is that bad?")
So here's what gao-2006, your basic developer desktop computer circa December 2005 (compare with one circa 1993), looks like (gao-2004 will be passed on):
- AMD Athlon 64 3500+ CPU (at 2.2GHz)
- MSI K8N Neo4 Platinum MB
- 1GB DDR400 RAM
- 250GB STAT 7200RPM hard drive
- ASUS Extreme N6200TC PCI-x16 (GeForce 6200, 64MB) video card
- 16X DVD±R/±RW drive
For the operating system, I decided that I'm going to experiment a little. On good recommendations from Jonathan and a whole lot of other people who blogged about it, I downloaded Ubuntu 5.10 (Breezy Badger.) It's a Debian based Linux distribution with a recent kernel and GNOME desktop.
The system arrived Friday. I played with Ubuntu 5.10 on it whole day Saturday. Here's my first impressions:
- The first thing I noticed is that the Ubuntu 5.10 download is only one CD, instead of the six CDs for the latest Fedora Core 4. This make sense because for most of the Fedora Core installations, and I've done lots of them, the first thing I do after the CD install is to hook up with the updates repository and usually most packages are out of date.
- Ubuntu 5.10 has a character based installation system. The installation process is streamlined and easy to follow except for the part where I have to partition the drive. The options there are confusing.
- All the hardware are recognized and worked. I only have to enter a username and password during the installation process. The network is automatically configured using DHCP.
- Once the basic install is completed, I went to the Synaptic Package Manager to install some of the things that I know I will need but was not installed (such as gcc, emacs, etc., boring stuff.) The package manager has a basic mode and an advanced mode. The basic mode is designed for the occasional addition of a package from a specific category. The advanced mode is, well, more advanced. Of course, I didn't know about this. So I did the elementary thing, opening each tree node, and check the packages I wanted to install one by one. I didn't see any gcc package there. However when I applied the changes, after much downloading, I ended up with gcc installed. To this day I don't know how that happened. It must be the dependency of one of the things that I checked.
- I did find emacs in the advanced mode of the package manager. However when I applied that change, the post installation script threw and error of some sort, (cedet and speedbar had some unsatisfied dependencies.) This error would persist. Every time I ran an install, at the end it would report to me "Your installation has errors, blah blah blah." even though whatever I was installing did indeed get installed.
- Then something bad happened. My display was all garbled up as I was browsing the web. When you use Linux, you can expect to have bad video hardware support for new chips. So I googled and found the binary driver from nVidia. Downloaded it it. Tried to install it. It complained "You can't do this while running X." So I tried to get out of X by issuing the "sudo init 3" command. It didn't work. I googled again, and found out that I can use the package manager to install the driver, as long as I enable the Universe and Multiverse repositories. It turns out that they are already enabled out of the box. So I installed the driver and the problem went away.
- In Ubuntu 5.10, at least after the default install, I can't simply do an "su -" and work as root. Everything rootish has to be done with "sudo" command.
- At this time, I recognized that Ubuntu 5.10, in its effort to make the Debian distribution more accessible to the general users, has hidden certain details from me. This made me uncomfortable because whatever I may want to do, such as setting up the network configuration my way, will require me to learn a new set of things, things that I already know how to do in my old Fedora Core environment.
At that point, I decided to go back to my old distribution, Fedora Core 4, where I already know how things work.
So what's my impression of Ubuntu? I'm very impressed. It's easy. It looked slick. And it presents Linux in a form that I'm comfortable with. However, It's not meant for me, a ten-year Red Hat user who are not about to learn some new ways of doing old things.
I guess my feeling is not unlike that of a Windows user who were told "you should use Linux," or the Microsoft Outlook user who were told "you should use Thunderbird," or the Java programmer who were told "you should program in Ruby," or the C++ programmer who were told "you should program in Java."
"Why," we ask, "should we throw away the knowledge we have accumulated over the last ten years and go with the new trend?"
"It is easier," we were told.
"But it's not hard if I already know how to do it," is my reply, high cool factor of the shiny new thing notwithstandings.
Rsstroom Reader
A novel new idea that should take off.
(via Solidot.org, formerly Slashdot.org.cn) This is a real product. I'm not making this up. :)
Piling On
Here's another one of those
JT Morée, on SLUUG mailing list: since all of the journalists are SO EAGER to publish firefox 'exploits' EVEN if they are really just regular bugs I thought I find one too. It's not a bug but hopefully everyone will look past that fact with all the hype that will be created over another 'firefox exploit'. ;)
Native XML Comes To Firefox 1.5's JavaScript
E4X (ECMAScript for XML) is here!
I first blogged about E4X 425 days ago. At the time it was only available in Rhino. I'm happy to note that E4X support is part of JavaScript 1.6, which is delivered with Firefox 1.5.
As a simple illustration, the following line (in a red box, which you won't see unless you use Firefox 1.5) is written from JavaScript with E4X:
Here's the JavaScript that outputs the line:
<script type="application/x-javascript; version=1.5; e4x=1">
var x = <div/>;
x.@style = "margin-left:3em";
x.span = "JavaScript for XML in Firefox 1.5";
x.span.@style = "border: solid red 1pt";
document.write(x);
</script>
Now guess what this will do (you will see the result if you are in Firefox 1.5):
<script type="text/javascript;e4x=1">
function makeRow(item) {
var date = item.pubDate.text();
var url = item.link.text();
var title = item.title.text();
var row = <tr/>;
row.td += <td><a href={url}>{title}</a></td>;
row.td += <td>{date}</td>;
return row;
}
function makeTable(feed) {
var table = <table/>;
var items = feed..item;
for each (var item in items) {
table.tr += makeRow(item);
}
table.@style = "margin-left:3em";
table.@border = "1";
return table;
}
function getFeed()
{
var xhr = new XMLHttpRequest();
xhr.open("GET", "http://www.weiqigao.com/blog/rss.xml", false);
xhr.send(null);
return new XML(xhr.responseText.substring(21));
}
var feed = getFeed();
var table = makeTable(feed);
document.write(table);
</script>
I have highlighted some of the interesting features of E4X. It's reading syntax is very silimar to XPath 1.0 (the dot and dot-dot operators take the place of the slash and slash-slash operators, the at-sign syntax for attributes, predicates are JavaScript expressions (you can use real regular expressions!) surrounded by .( and ) rather than /[ and ].) It's constructor syntax is very similar to XQuery (element name, attribute name, element content, attribute value can all be JavaScript expressions— you just put them between curly braces. Firefox escapes them properly!). It's updating syntax is unique to E4X but very intuitive once you get used to the concept of XMLList. (It took me a while to figure out all the code in this post, after reading the E4X spec, which is pretty easy to read as language specs goes.)
One thing that's not in Firefox 1.5 is the live update of the document DOM as the AJaX programs usually do. But it is promised for a future release. (See Brendan Eich's presentation at XTech 05.)
Firefox 1.5 Is Here
It's better than Firefox 1.0.7
Just installed Firefox 1.5, released a couple of days ago.
I've been looking forward to this release ever since Kevin, who's been using the betas for a while, showed me a feature that'll make my life a little better.
In Firefox 1.0, if I'm in the middle of reading a web page and an email arrives, I would go to Thunderbird to read my email. If that new email happens to contain a link and I click on it, the link would be displayed in Firefox, replacing the page I was reading. If I was reading a plain old web page (POWP), I would go "Oops, didn't mean to do that," and click on the "Back" button. Trouble arises, however, if I was in some sort of a Weird Web Page (WWP, aka Web Application), click on the "Back" button would engender a dialog box that warns me about how the previous page contains POST data and would I like to repost the data to the website, etc., etc. Being the cautious person that I am, I would be too chicken to repost the data back! And guess what, I would be stuck. Even worse is if I have done any data entry since the last post, I would lose work. I have lost a couple of blog entries that way. (Oh, those were my best blog entries that the world would never see.)
Firefox 1.5 fixes this problem. When I click a link in Thunderbird, the link will be displayed in a new tab, preserving whatever it is that I was browsing.
Some other observations:
- It did not try to hijack my home pages as Firefox 1.0 did.
- The installation process checked all my installed extensions for compatibility. Everything except two are compatible, one is SlashFix, the other is JavaScript Debugger. The former is no longer necessary, the later will be missed.
- Some of the AJAX stuff seems to be broken.