Free Software Is Forever
Will Java endure?
It must be that time of the year again when everybody starts to talk about Sun open sourcing Java: [1], [2], [3], [4], [5].
However, there is something different this year. I don't know if you have noticed, but the main players seems to have changed their stances a little bit. The free software guys are resigned to the fact that Sun won't open source Java any time soon and are starting the post-game analysis:
Dalibor Topic (Kaffe, Harmony): So, here is a my take, why Sun will not, any time soon, release their Java implementation under an open source license,...
Chris Blizzard (Mozilla, Red Hat): So instead of just giving reasons of why they should do it, let’s instead talk about the cost of them not doing it...
The Sun guys, on the other hand, have softened from the "it's a bad idea and here's why" to something more neutral:
Tim Bray (Sun, via Dan Farber): So, I am definitely of two minds, and I'm not convinced that it will produce practical upside or developer benefit. But, we are not deaf. Legions of voices are crying out for it. At some point, you decide it's more important to make [the cries] go away.
David Herron (Sun): I absolutely cannot comment on the call for open sourcing Sun's Java implementation, so I won't.
Why the change? I don't know. But if I have to guess, I would venture to guess that it's because the free Java stack (GNU Classpath, Eclipse, gcj, kaffe, IKVM, etc., etc.) is working now, including generics and Swing. They are packaged with the freely downloadable Linux distributions such as Fedora Core 5, and Ubuntu.
The free Java stack may not be as performant and as compatible as Sun's JDK today. But if history is any guide, free software tend to out last their proprietary competitors and gain parity with the competition over time. How many of you remember what the top rated commercial editor/IDE was when GNU Emacs was first released? How many of you remember what the top rated commercial C compiler was when GNU C was first released? How many of you remember what the big three relational databases were when MySQL was first released?
Free software is forever.
WikiWordLooksStupidAndAreNotNormal
A better Wiki is coming.
(Oh boy, this live blog thing is catching on.)
In today's episode, I'm covering Eric Burke talking about his latest project—The (as of yet) Unnamed Wiki at the OCI internal Java lunch.
(An aside, my last blog entry was an marketing experiment. I've promised Fabian not to use the numerics trick in the future. However I have to make an exception for today.)
Three Quotes From Eric Burke
- WikiWordLooksStupidAndAreNotNormal
- You can't believe how easy it is to code up a custom tag. I use the Sun provided frameworks: Servlets and JSP. I don't need the bolt-on frameworks.
- I've used Spring in the past. Spring taught me how to write better code to the point that now I don't have to use Spring any more.
On with the talk (First person is Eric now.).
The Itch
- For every project I worked on, I have to manage documentations (requirements, etc.) On some projects I created web pages for that purpose. However I soon found out that people don't like to edit HTML pages. They just don't do it. They revert back to Word documents and email.
- Existing requirement management tools such as Doors or Caliber are proprietary and Windows only, and not easy to use. They produce Word documents.
- A Wiki is a good way of capturing project documentations. But the open source ones are all too hard to use, especially for non-geeks. The commercial ones, Confluence (really good) and JotSpot (the best wiki ever), are excellent but expensive.
The Goals
My goal is not to compete with some of the crappy open source Wikis, but to compete with the commercial Wikis.
- Easy for non-geeks
- WYSIWYG editing
- Image handling
- Email integration, even Word integration
- Make information findable, Google-quality search
- Open and extensible (Web services APIs)
- Tagging
- Customizable syndication everywhere
- Super easy to rename and arrange content
- Linking API
Mine is Better
- It will have integration built in
- It will be an application platform for building things like discussion forums
- It will have WYSIWYG editing
- It will have very easy page renaming
- It will have tags and feeds
- It will have Google like searches.
The Plan
- Data model is the key. I want to be able to rename pages and have the links automatically updated. And I want a solid data model from day one.
- Focus on usability.
- Web services integration API
- Open Source
The Technologies
- EJB 3
- Servlets
- JSP
- JSTL
- HSQLDB
- FCKEditor
- XFire
The Demo
I think people are going to like this.
(First person is Weiqi now.) I hope Eric can pull this off because I really really liked the demo.
My 10 Favorite Scripting Languages
What are yours?
Scripting languages are a hot topic these days. "What's your favorite scripting language?" is a question that will surely provoke a heated debate anywhere programmers gather.
And surprisingly, people's answers to this question are usually not based on reality. In my conversations with other programmers, when they say "my favorite scripting language is <X>" they really mean "I just heard of this cool language called <X> and I'm learning it right now and I wish I can use it instead of the one I learned last year, which is not cool any more."
You will get a better picture if you ask these questions "What scripting languages have you used during the last week in your day-to-day programming work when you had an occasion to use such a thing? How about last month? Year? Decade?"
Well, I asked myself the questions. And here are my answers, in the order in which each item came into my mind:
- bash: The default command shell for Linux and Mac OS X. Available on Windows through Cygwin. Learned it by reading the bash man pages. I use it every day.
- gawk: Usually available where bash is. Learned it by reading the gawk man pages. It's a rule-based text processor. It's more powerful than you think. I use it every day.
- regex: Not strictly a scripting language, but very scripting-languagy. I usually use it in conjunction with grep or awk. Learned it by reading the O'Reilly Mastering Regular Expression book. For some reason, this is a language that everybody assumes that everybody else don't know, or don't know enough and insists on teaching it again. I use it everyday mostly in vi doing searching and replacing.
- Jython: The Java implementation of the popular Python language. I fire it up when I want to learn a new Java API. I like its regularity of syntax and Java integration.
- Bean Shell: Similar to Jython but with a more familiar Java-like syntax. I use it less often than Jython.
- Kawa: It's a Java based Scheme/XQuery implementation. Also not strictly a scripting language. I learned Scheme by reading SICP. I learned XQuery by studying the W3C specs. Fun. One of these days I'll be a master of call/cc.
- JavaScript: Can you say AJaX? I also liked E4X. I learned it by reading the spec and the O'Reilly book JavaScript the Definitive Guide. I haven't done enough Web programming to hate it yet.
- DOS batch files: I wrote my fair share of DOS batch files way back when. I learned it through the DOS Help facility.
- Visual Basic: When all your nails are COM objects, your hammer has to be Visual Basic. I learned BASIC in DOS/QBasic and VB3, used it up to VB5. I know how to call into the Windows API. So don't mess with me!
- bc -l: An arbitrary precision calculator. The GNU version is everywhere. I learned the language when I was five. I use it in my daysago calculations. Very handy. When I have a calculation to make, I reach for bc -l, not the GUI calculator.
(I did not put in any hyperlink today. If you are using Firefox, just highlight a word or phrase and choose Search Web for "..." from the right click menu.)
What are some of your favorite scripting languages?
Boost Multi-index Container
One solution to the data problem.
This is my second attempt at live blogging. I'm at the OCI internal C++ lunch presentation. Today's speaker is Jonathan Pollack and he's talking about the Boost multi-index container, a C++ library that solves the "data" problem in certain situations:
You have a set of data, and you would like to find them by different sets of attributes. Find Customer by SSN, by name, etc.
I'll try something different this time. I'll try to write some code as I follow the presentation.
struct Customer {
std::string ssn_;
std::string name_;
};
struct SSN { /* tag for an index */ };
struct Name { /* tag for an index */ };
typedef boost::multi_index_container<
Customer,
boost::multi_index::indexed_by<
boost::multi_index::ordered_unique<
boost::multi_index::tag<SSN>,
boost::multi_index::member<Customer, std::string, &Customer::ssn_>
>,
boost::multi_index::ordered_non_unique<
boost::multi_index::tag<Name>,
boost::multi_index::member<Customer, std::string, &Customer::name_>
>
MyCustomerDB;
typedef MyCustomerDB::index<SSN>::type SSNIndex;
typedef MyCustomerDB::index<Name>::type NameIndex;
typedef SSNIndex::iterator SSNIterator;
typedef NameIndex::iterator NameIterator;
MyCustomerDB db;
SSNIndex& ssnIndex = db.index<SSN>();
NameIndex& nameIndex = db.index<Name>();
Customer c1("333-44-5555", "John Smith");
Customer c2("666-77-8888", "Robert Brown");
db.insert(c1);
db.insert(c2);
SSNIterator ssnIter = ssnIndex.find("333-44-5555");
c1.ssn = "999-00-1111";
indexBy.replace(ssnIter, c1);
Fedora Core 5 Desktop: Moving Backwards
Red Hat went a little bit too far.
A fuller experience report will come in a week or two (if I don't end up zapping Fedora Core 5 for another distribution) but I have to voice my disappointment at the disappearance of two tiny little features from this release right now:
- The first of is the new trash can behavior—As items are dragged into the trash can, the "there are things in the trash can now" indicator is never turned on. And if you double click on the trash can icon to open it, it will be empty. Where did the trash go? Into the ~/.Trash directory. And how do you empty trash? You don't. The trash can is always empty. Want to restore one of the files? Use the command shell. Want to really get rid of the files for good? Use rm.
- The second is the "Save session" checkbox on the logout screen. It's gone. I have used this feature in the past to open up the applications I always run, place them in the right workspace at the right location, save the session on logout. The next time I log in, my applications would be already opened and ready for me to use. Granted, I do this (saving the session) once in a long while. But now I can't do it.
On the possitive side, my DVD playing capability is intact. This has never happened before. MP3s, DVDs, Flash, Java, Adobe Reader have always required extra setup work every time I upgraded.
Ruby Thought Leader Retracts Attack on Father Of Java
It always helps to listen to the full context.
(A few days ago, the blogosphere is abuzz with attacks on James Gosling for a comment he made at a conference. The Ruby people was particularly vicious.)
Curt Hibbs: UPDATE: It turns out that’s not precisely what he said… close, but enough of a difference for me to retract what I’ve said. Jump to the end for more…
UPDATE: Bill Venners just posted a transcript, which was not available before. Reading the actual transcript shows a much more reasonable point of view than was implied by the slightly inaccurate “soundbite”.
Fedora Core 5: Smooth Upgrade, Refreshing New Theme, Faster Responses
I even read the release notes during installation.
I've heard praises for the new release of Fedora Core—Fedora Core 5—released 4 days ago. So I decided to be an early adopter of this release. I backed up everything and started with my usual routine of trying to do an upgrade first, if that fails, a fresh install.
Well, the upgrade worked. I just rebooted to the Fedora Core 5 DVD and answered a few questions to kick off the installation process. The screen said it will take 70 minutes. I waited for 5 minutes to see if it the prediction was accurate. It was. So I went to bed. When I got up this morning, the installation is complete. Reboot. Fixed X configuration (I was using the nVidia driver, which never upgraded well.) And I'm here, Firefox 1.5, Native Eclipse, even my hand installed Qemu. Printing worked. The internet worked. Everything. So I'm really happy.
I'll fill you in more with my experiences in a week or two.
Here's a couple of screenshots:
This one is for Kevin's amusement:

Interesting tidbits from the release notes:
- Geronimo, the Apache J2EE server, is included in FC5
- .NET support through Mono
- LinuxThreads is gone. NPTL has completely taken over
- Everything is compiled with -fstack-protector to thwart buffer overflow attacks
- Screencast with istanbul
Use Firefox, Break Up With Fiancé
That ought to teach them.
(Via Ranjit Mathew)
Steps to Reproduce: 1. Create 2 unique user accounts (for steps sake, let's call the two accounts Joe and Mary) in Windows XP Home. 2. Logout and sign-in under Joe. 3. Open Firefox and go to an e-mail site or to jdate.com or wherever. 4. Attempt to log-in to the site so that Firefox will ask whether or not you want your password saved. 5. Choose not to save the password. 6. After successfully logging in and having selected the "never save password" option, logout. 7. Log-in as Mary and open Firefox. 8. Browse, browse, browse... but you don't really have to. Just go to "View Saved Passwords," click on the tab that will show you sites to never save passwords for, and you'll see whatever painful site Joe denied to save a password for. 9. Break-up with fiancé.
Herb Sutter Talks About Concurrency
A concurrency revolution is under way.
Herb Sutter's PARC Forum talk, Software and the Concurrency Revolution, is online.
(1:50) For the first time in history of computing since the 1950's mainstream hardware is going to be parallel. That means for the first time in 50 years we are not going to be programming von Neumann machines.
(28:00) Programming concurrency by fiddling with naked semaphores feels a lot and is a lot like programming with raw assembler. Programming with threads and locks is like programming in C—structured programming. What is missing on the top there is an OO for concurrency.
(41:00) How many of you are familiar with double checked locking? How many of you know that double checked locking is broken? How many of you know that double checked locking actually isn't broken anymore? I'm talking specifically about Java 5 and Visual Studio 2005 which has deliberately made DCL work if you say volatile. for example.
Watch or listen to the whole thing.
WordPress Experiment Finished
For me, it's no match for Pebble.
I started a WordPress experiment 199 days ago. A couple of days ago, I quietly shut it down. I apologize to the 7 people who have subscribed to its feeds. I do appreciate the comments people have made on the two blog entries I have over there, and I will summerize those and publish them on my Pebble blog some time soon.
The main reason I shut it down is that I haven't posted any new blog entries to it, and it has become a spam magnet. The day I shut it down I received 35 comment spams (all waiting moderation, of course.)
The main reason I hadn't blogged there is that the user interface of WordPress, compared to Pebble, is not as Weiqi-friendly.
To understand the last claim, you have to understand who Weiqi is. As far as blogging is concerned, Weiqi is what you programmers call a power user. Weiqi blogs once every couple of days, and would like to get it done with the minimal amount of fuss. Weiqi doesn't read the documentation unless confronted with less than clear user interface elements, at which time Weiqi demands ultra high quality documentation that leads him to the answer very quickly. Weiqi hates unnecessarily high number of clickings above all other user interface evils. Weiqi won't mess with the configuration stuff unless he knows exactly what he gets in return. Weiqi's philosophy of personal software evaluation is "Don't hyper-analyze. Just install both, wait for a few months, and see which one you reach for when you want to get something done. The choice doesn't have to be binary."
Well, after half a year, WordPress didn't become the tool I reach for when I want to blog. About the only interaction I have with it is to go in and manage spams. And in that regard the UI is very inconvenient. I have to check the "Spam" check box for each of the 35 spams and then click on "Manage" button. The one time I went for the documentation, when I attempted to customize the UI a bit very early on, the documentation is no help at all. It's a headless mess of wiki style linksoup.
Of course all these are very subjective. WordPress may very well be the most wonderful blogging software in the world. However it has succeeded in showing me only its inconvenient side over a six months period.
I'm sorry.
Happy PI Day
3.1415926535...
How could one miss this? It's PI day today. Here's a slow converging approximation of PI:
[weiqi@gao] $ cat PI.java
public class PI {
public static void main(String[] args) {
double sum = 0.0d;
for (int i = 1; i < 64000; i++) {
sum += 6.0/(i*i);
}
System.out.println(Math.sqrt(sum));
}
}
[weiqi@gao] $ javac PI.java
[weiqi@gao] $ java PI
3.1415525815597167
Update: Kyle Cordes, in a trackback, expresses the above algorithm in one line of Ruby:
ruby -e "print (1..64000).inject(0.0) { | sum, i | sum + 6.0 / (i*i) } ** 0.5"
3.141577732895
This is indeed shorter than the Java code but not necessarily easier to comprehend. For example, what does ".inject() {| | }" do?
The clearest expression I can think of is in Mathematica:
In[1] := N[Sqrt[Sum[6/n^2, {n, 1, Infinity}]]] Out[1] = 3.14159
The equivalent python code is almost as elegent:
python -c "print sum(6.0/(i*i) for i in range(1, 64000))**0.5" 3.14157773266
Slightly longer, but still shorter than the Ruby code is Common Lisp
clisp -x -q '(sqrt (loop for x from 1 to 64000 sum (/ 6.0 (* x x))))' 3.141363
And the shortest of them all, (drum roll...) belongs to Perl (of course)
perl -e '(∑n=1∞6/n2)½'
Just kidding. :)
Happy PI Day
3.1415926535...
How could one miss this? It's PI day today. Here's a slow converging approximation of PI:
[weiqi@gao] $ cat PI.java
public class PI {
public static void main(String[] args) {
double sum = 0.0d;
for (int i = 1; i < 64000; i++) {
sum += 6.0/(i*i);
}
System.out.println(Math.sqrt(sum));
}
}
[weiqi@gao] $ javac PI.java
[weiqi@gao] $ java PI
3.1415525815597167
Java3D Tonight At The JUG
Come.
Chris Gundlach will give a presentation about Java3D tonight at the St. Louis JUG.
Come.
Whatever Happened To Google Search?
MSN search has given me better results lately.
"Weiqi, try google 'IIOP.NET' and 'TAO'." Dan shouted at me as I entered OCI North one day last week. (Or was it this Monday? I don't remember exactly.)
I knew why. I did a live blog of one of Dan's talks about IIOP.NET and TAO a few days earlier.
So I sat down and did the search. As I expected, the blog showed up on the first screenful of results. It ranked the fifth or sixth. "It was number one when I did the search," said Dan, a little bit disappointed that I did not get to see my own blog as the "I'm Feeling Lucky" result.
I said to Dan, "Let's try MSN." I installed the CustomizeGoogle Firefox extension, which gives me the ability to search some of the other engines with a single click from Google's results page.
MSN did better. The blog is ranked number two there, right below the IIOP.NET home page. "That's fair." I said.
Well, it's another few days now. Being the curious kind, I kept an eye on the rankings of that blog entry on Google as well as MSN. And the result surprised me: my blog entry has dropped off Google's radar screen, while it has reached number one on MSN:
This is not the first time that I've noticed MSN Search seems to return more relevant results than Google Search. And I find myself clicking on the "MSN" link on the customized Google search screen more often lately.
What is your experience?
Upgraded To Pebble 2.0.0-M1
It's pretty painless.
I have upgraded my weblog software to Pebble version 2.0.0-M1.
I followed Simon Brown's blog entry to the letter. And the upgrade took less than two minutes. (This includes the time to open pebble.jar in Emacs to figure out the new package names for the various listeners.)
Great job Simon.
The biggest change, aside from the new theme, is that article titles are no longer hyperlinks. To view a single article, you have to click on the "#" sign near the end of the post.
Let me know of any problems you may encounter with reading this blog.
My tasks for the next few days:
- Bring back Google AdSense
- Re-integrate Glen Smith’s Maths Captcha patch for Pebble 1.9
- Bring back my blogroll (Are blogrolls still hip?)
China Blocks SourceForge.net
This is ridiculous.
David Duan: 近日,世界上最大的开源软件社区与服务提供网站www.sourceforge.net 不能被中国用户访问了。
Translation: The world's biggest open source community and services website, www.sourceforge.net, is inaccessible from within China now.
Abandoning My Custom Theme
Getting ready for Pebble 2.0
Simon Brown announced the availability of Pebble 2.0.0-M1 yesterday.
I started this blog more than two and half years ago with Pebble 1.1 and JBoss 3.0. Over the years, I've kept up with new releases of Pebble but kept my original customization of the Pebble 1.1 theme. However, as you can imagine, with every release, Pebble's default theme moves forward a little bit, yet my custom theme remained relatively static. I changed the background and foreground colors once, two years ago. I changed the default font family to Georgia recently, after visiting Loud Thinking and felt very comfortable with its layout and fonts.
However, every time I upgraded, making sure my old theme still works had become a bigger and bigger job. I did not move to 1.5 and 1.6 because of it.
With 2.0.0-M1, Simon is breaking all old custom themes. This will force me to abandon my old theme when I upgrade to 2.0.0-M1, which I fully intend to do. Now that I'm sure I'll abandon it, I'm motivated to abandon it now.
So I went to the configuration page and made the switch. One thing that you'll notice right away is the tag cloud link in the header area. I have been blogging with tags since I upgraded to Pebble 1.9 193 days ago. So I have plenty tags in there and the cloud doesn't look too bad.
Getting to 2.0.0-M1 will be a major undertaking because of the Java 5.0 and a JSP 2.0/Servlet 2.4 container infrastructure requirement. I've been using JPackage 1.6 on Fedora Core 3 for my Tomcat 5.0 container. And Tomcat 5.5 (which offers JSP 2.0/Servlet 2.4) doesn't seem to be available there.
I'll have to look around and figure out a solution somehow. I would appreciate hints and links to possible solutions.
And You Call That A Thin Client?
Do you know how much RAM your browser is hogging?
Here today's test:
Guess, without looking at the task manager or running top(1) or ps(1), how much memory your web browser is using. Write that number down.
Now look at the task manager and find out how much memory your browser is really using.
Did you guess right? Did you guess too low?
My Firefox 1.5 was taking up 136MB of RAM a moment ago. Ouch.
Windows Live Local - Virtual Earth Technology Preview
This seems to be fun.
Go to this link: Windows Live Local - Virtual Earth Technology Preview
