The NetBeans 6.0 Story Continued: Using The Profiler
Weiqi Gao's Observation has made quite a few posts about NetBeans. Here's a list of the more interesting ones:
- 2004/04/15: NetBeans 3.6: Still Annoying
- 2005/05/03: NetBeans vs. Eclipse---Why Not Both?
- 2006/02/03: NetBeans Still Thinks It Competes With Eclipse
- 2007/12/11: NetBeans 6.0: A Week Later, And A Much Better Story
As you can see, my opinion on NetBeans has evolved quite a bit. And I believe it reflected the real progress that the NetBeans team has made in improving their product, which in turn reflects Sun's investment in this space.
As I mentioned in my earlier post, I am still an IntelliJ IDEA user. (I upgraded my personal license to 7.0 recently.) However, with NetBeans and Eclipse being open source and free, I also wanted to use features in these tools that are not freely available for IDEA.
Examples are: C++ development (both Eclispe and NetBeans), UML modeling (NetBeans 6.0), and Profiling (NetBeans 6.0).
I had an opportunity to use the NetBeans 6.0 Profiler recently. And I'm quite pleased with what it can do. Since my application is not very big, the actual time running the profiler, even with different sets of configuration parameters, are done very quickly. Most of my time were spent on "setting up the projects" in NetBeans 6.0, which isn't hard either, just time consuming. (This seems to be a good time to renew my call for a way to generate project files for IDEs from simple, easy to specify project dependency description files.)
Here's a few more of my observations after actually using NetBeans 6.0 for a short time:
- NetBeans 6.0 starts up fairly fast, and is pretty responsive during use
- NetBeans 6.0 has a familiar feel to long time IDEA users
- NetBeans 6.0 projects are like IDEA 7.0 modules
- NetBeans 6.0 project groups are like IDEA 7.0 projects
- NetBeans 6.0 does not have a "Built All" menu item. I have to build the projects one at a time
- NetBeans 6.0 does not have a "Run All Tests" menu item
- NetBeans 6.0 has global libraries but not project level libraries
- NetBeans 6.0 does not like it if project root is the same as the source path root
- NetBeans 6.0 projects are expressed as a build.xml file that uses subordinate Ant files in a nbproject/ subdirectory
- NetBeans 6.0 will built a jar for each project and put it in a dist/ subdirectory
- You better not touch the NetBeans 6.0 generated Ant build files
- When project B depends on project A, A/dist/A.jar is put into various classpaths for B
- The tests are not jarred and even if B depends on A, A's tests can't be seen by B's tests, this is different from IDEA
- NetBeans 6.0 disallows cyclic dependencies among projects (IDEA merely warns)
- NetBeans 6.0's profiler is easy to learn and use
- NetBeans 6.0 profiler output are very well organized and usefully presented
- NetBeans 6.0 says it supports profiling junit tests, but I can't make it to work
- When a project depends on a third party jar, there are two ways to specify that dependency: a Jar file dependency, which enables code completion but not debugging, ...
- ... and to debug into a third party Jar, a "Library" (a Netbeans 6.0 concept) needs to be created with the proper paths and a Library dependency be created
- And as far as I can tell, NetBeans 6.0 does not support certain IBM source control system
As you can see, as it stands, I can't use NetBeans 6.0 as the primary IDE for my project. However, I was able to setup NetBeans 6.0 projects to mirror my IDEA project/module structure in such a way that I can build and test everything, and run the profiler on test applications. I did gain valuable insight into the performance characteristics of my code. And for that I think my time playing with NetBeans 6.0 is well spent.
There is something magical about being able to profile your application. It's the same feeling I had when I first debugged into my Java application in the IDEA debugger.
Remember the time back then, when
System.out.println("x = " + x);
was considered a legitimate debugging technique?
A few years from now, we may view the pre NetBeans 6.0 time as the time when
long start = System.nanoTime(); doIt(); long end = System.nanoTime(); System.out.println(end - start);
was considered a legitimate profiling technique.
Nokia Acquired Trolltech
Trollteck Press Release: The acquisition of Trolltech will enable Nokia to accelerate its cross-platform software strategy for mobile devices and desktop applications, and develop its Internet services business. With Trolltech, Nokia and third party developers will be able to develop applications that work in the Internet, across Nokia’s device portfolio and on PCs. Nokia’s software strategy for devices is based on cross-platform development environments, layers of software that run across operating systems, enabling the development of applications across the Nokia device range. Examples of current cross-platform layers are Web runtime, Flash, Java and Open C.
As a long time GNU/Linux user, I know Trolltech mainly as the company that makes Qt, the fundation of KDE, a desktop environment for Linux.
As a reluctant cell phone user, I know Nokia as a cell phone maker. I have never owned a Nokia phone. I had a Qualcomm and then a Sanyo
So why is a cell phone company buying a Linux desktop environment company? It turns out, the Trolltech also has a mobile device line of product called Qtopia. It is that line of product that Nokia wants.
What does this acquisition mean for KDE? I don't know. I myself am not a KDE user, so this really doesn't affect me. However, with Qt owned by a cell phone company, I doubt they will care too much about the KDE users. So my prediction is that KDE evolution will slow down, which will also slow down the evolution of its competitor GNOME, which is the desktop environment I use.
I don't think I'll like that.
Now I have a question for all the cell phone companies: How many development platforms do you want? I mean, there are already plenty of them out there, why are you buying up PC desktop environment companies?
My guess is that they are making too much money.
Wait a minute! There are money to be made in the mobile devices space? I'll take a look there.
Ten Years Of Big Open Source
Mitchell Baker:January 22, 1998 -- the Beginning of Mozilla
Anyone remember this?
NETSCAPE ANNOUNCES PLANS TO MAKE NEXT-GENERATION COMMUNICATOR SOURCE CODE AVAILABLE FREE ON THE NET
BOLD MOVE TO HARNESS CREATIVE POWER OF THOUSANDS OF INTERNET DEVELOPERS; COMPANY MAKES NETSCAPE NAVIGATOR AND COMMUNICATOR 4.0 IMMEDIATELY FREE FOR ALL USERS, SEEDING MARKET FOR ENTERPRISE AND NETCENTER BUSINESSES
...
I remember.
And I remember what a shock this was at the time. Prior to this, the software world had been divided into the proprietary software world and the free software world. There was not a whole lot of intermingling between the two. The internet was not as ubiquitous as it is today. And the advertiser paid trade magazines were the main source of information for IT workers.
And Free Software, in the RMS sense, was not even talked about in the respectable magazines. The whole proprietary software world behaved as if Free Software did not exist. When an article on C++ compilers were published, it wouldn't mention GCC. When an article on editors were published, it wouldn't mention Emacs.
IT shops often were built completely on proprietary software systems that were expensive and restrictive. I remember having to put a dongle on the parallel port of my 66MHz Pentium server running NT 3.5 just to use a scanning software package that cost thousands of dollars to license.
Then the term Open Source was coined, and a PR campaign was launched with Eric Raymond and Tim O'Reilly as the leading figures. ESR's The Cathedral & The Bazaar was an eye-opener for a lot of people.
The Netscape announcement was one that made Free Software and Open Source mainstream. I believe prior to this, when a software company gets crashed by Microsoft or anybody else, they just roll over and die.
The ten years since the announcement has seen Free and Open Source Software being adopted in a lot more places, and a lot more bit vendor proprietary software being released as Open Source. And the world is better place.
Here's my prediction for the next ten years: By 2018, most business computers will be running an open source operating system.
When Good Math Meets Fresh Fish...
... you get a great dish.
Good Sunday morning. This blog entry is completely off topic. If you are looking for the usual Tech stuff, go read Eric's latest piece on MapReduce.
Still with me? Good. Where was I? Oh, yeah, Good Math and Good Food. Today, I'm thrilled to announce Weiqi Gao's Observation's endorsement for Friday Recipe: Cantonese Steam Fish.
I started following Good Math, Bad Math since I read its Abacus series (and put out my responses) 474 days ago.
I've noticed MarkCC's Friday Recipe series for quite some time now. But this Friday's recipe struck a chord because steamed fish is something I cook regularly and has always been something that my daughter liked the most, right up there with Jiaozi (or Chinese Dumplings as they are popularly known in the United States).
As I explained to Brian Gilstrap about Jiaozi, the Chinese are non-precise recipe writers. If we write our recipes down at all, it will be full of "a little bit" of this, "a dash" of that, "frying for a little while" or "cook until done".
So I'm really glad to see this recipe being written down to the point where a non-Chinese person can follow.
And on my way to pick up my daughter from the university to spend the long weekend at home, I went to the Olive Farmer's Market at 8041 Olive Blvd in University City and picked up a stripe bass. I steamed it for dinner.
As is the case with most recipes, I did not follow it completely. I used my big stainless steel steamer instead of a bamboo steamer. I substituted scallions by green onions. And I used regular cooking wine instead of Vodka.
It's delicious!
Friday Java Question: Debugging Into JNI Code
Rob asked about how to debug into JNI code yesterday. I haven't had the need to debug into JNI code for quite some time. But I know it is possible, at least on Solaris/x86 with jdb and dbx. But that was a long time ago when jdb was the only debugging option on the Java side and System.out.println() was still mentioned as an alternative to debugging for even the non-JNI Java code.
So I took my hello world JNI project and tried to debug it with jdb and gdb (on GNU/Linux/x86). It is pretty straightforward. You just start the Java process in jdb and let it run to a point where the native library is loaded. At that point you attach gdb to the running Java process and set breakpoints in the native code. About the only unusual thing you have to be careful about is to invoke jdb with the proper
-Djava.library.path=<... (paths to JNI .so files)>
option under the proper
LD_LIBRARY_PATH=<... (paths to C++ .so files)>
environment. And you have to compile your Java and C++ code with the debugging information turned on.
A little Googling turned up this IBM developerWorks article from 2269 days ago that describes this process in more detail.
Of course, nowadays we can use our favorite Java IDE to replace jdb.
My question today is: What is a good modern way of carrying out the native debugging in a GUI environment? Although I'm currently on GNU/Linux/x86, I would also like to know answers to this question on other platforms.
I realize this is a more general question about how to debug a library/dll/shared object. And I would imagine the following combinations will work:
| OS | IDE/GUI Debugger |
|---|---|
| Windows | Visual Studio |
| Mac OS X | XCode |
| GNU/Linux | Emacs gdb-mode |
Are there other tools that has been used successfully fo this task? I'm playing with NetBeans 6.0's C++ support, but I couldn't find a way to debug into a DLL on Windows or a shared object on GNU/Linux. What about Eclipse CDT? DDD? Or anything else I don't know yet?
Your help is appreciated.
Fwd: I'm not tired of Java yet
Forwarded message included.
Cedric Beust: Rick Hightower posted an interesting follow-up to Zed's rant against Ruby on Rails. There are a lot of insightful comments in this discussion, and one in particular caught my attention:People are tired of dealing with Java's many idiosyncrasiesI've been reading this a lot these past years but I've yet to see any evidence of it.
Come to think of it, this statement is mostly coming from bloggers, but...
- They don't speak for all Java developers (actually, they represent a very tiny fraction of them).
- They need to drive traffic to their blog, and nothing achieves this goal better than posts titled "Java is dying" or "Ruby has won".
I've been programming in Java for more than ten years. I have studied a lot of languages, and I keep learning new ones just out of curiosity. I even use some of these exotic languages here and there as the need warrants. Yes, some of these feel really good to program in (Ruby and Groovy for example), but at the end of the day, I still like Java. A lot.
Being a heavy blogger myself, I agree with Cedric's assessment that we tend to go with the provocative topics. People just wouldn't read anything else.
It is also true that bloggers are not representative of the wider Java programming community. This is similar to the situation with radio commercials. I once heard it on the radio that if a blind Martian arrives on Earth and landed in the United States, by listening to the radio ads alone, he would conclude that it is a country where everyone eats at McDonald's.
But mostly, I want to echo Cedric's sentiment:
> but at the end of the day, I still like Java. A lot.
Me too!
If It's Going To Be Full Closures Or Dead Java, I Choose...
... full closures, as in BGGA, because the prospect of Java dying will be a really hard pill to swallow.
I realize this is a switching of sides of some sort, as I was saying the opposite just 30 days ago.
And quite frankly, Mr. Gafter scared me into his side:
Neal Gafter: Personally, I believe rumors of Java's demise are greatly exaggerated. We should think of Java as a living language, and strive to eliminate much of the accidental complexity of Java programs. I believe it is worth adding support for closures and control abstraction, to reduce such complexity of both the sequential and concurrent aspects of our programs. At the same time, for completely new code bases, we should also consider (and continue to develop) newer languages such as Scala, which benefit from the lessons of Java.
The thinking behind my switching of sides is simple, and non-technical. While many evaluate the various proposals based solely on their technical merits, I base my decision on the roles people play in the Java ecosystem.
It's one thing for an outsider such as Bruce Tate, or even Bruce Eckel to run around saying Java is dead. It's something completely different for Mr. Javac (I still think of Neal Gafter as Mr. Javac) to say the same thing.
Have you seen the stream of people leaving the Java development team, be they program managers, lead developers, or evangelists? This happened after every major release of Java, starting with JDK 1.1. Sure you can always hire new people to fill the old roles, but it's not the same. They have different visions, styles, and agendas.
The bottom line, for me at least, is that we should not bite the hands that feed us. For the day when the last JDK developer leaves the room, Java is truly dead.
Please, Uncle Neal, give us closures. "And we shall like them!"
Brian Sletten: NetKernel: Software For The 21st Century
Oh, Boy!
Sparks flew at the St. Louis JUG yesterday evening.
More than forty people packed the auditorium at One City Place to hear Brian Sletten of the No Stuff Just Fluff tour talking about Resource-Oriented Computing w/ NetKernel: Software for the 21st Century.
(I have been calling the tour No Stuff Just Fluff on this blog for quite sometime now, just to see if people would notice it. Nobody did. That ought to teach bloggers a lesson about sending secret embedded messages in their blogs.)
For the first time in a long time, I went into a JUG meeting not knowing anything about the technology being presented. And judging from the audience questions, neither did anybody else.
But before I get into the fun stuff, let me just get the positives out of the way.
It was a somewhat pleasant day in January, a little bit rainy, not too cold. As I mentioned earlier, more people showed up than usual. I have seen a few faces that I haven't seen at the JUG meetings for a year or so.
Brian Sletten gave a well prepared, engaging, opinionated, and meaty presentation. For a complete stranger to the technology and its way of thinking, I think Brian got the message out succinctly and clearly.
We have some enhanced bunch of giveaways: in addition to the IntelliJ IDEA 7 License that JetBrains has provided us, we also gave away three books, two on GWT and one on Integration Patterns.
Jay Zimmermann, the man behind the NFJS conferences, was on hand to promote the 2008 NFJS tour, which will be in St. Louis the weekend of March 7–9. Jay also gave away a free pass to the event to a lucky audience member (the aforementioned member whom I haven't seen for a year.) Jay also gave up another free pass to be given away at next month's JUG meeting, which will be held on not the second but the third Thursday, February 21, to not interfere with Valentine's Day celebrations.
I sparked a long discussion on closures in Java during the Q&A before the main presentation by simply asking "Have you read Bruce Eckel's latest blog?"
Not every member is aware of the controversy, and of those who are clued in and are willing to share their feelings on this matter, I see people on Neal Gafter's side and people on Josh Bloch's side. One new argument for the full fledged closure implementation is that that will "move the curve" towards the more advanced direction, and in doing so make Java the language and platform more valuable (and therefore our Java skills more valuable) to the current enterprise users of Java technology.
The wider audience members were not comfortable with the "Java is the new COBOL" claim and would like to see the Java language evolve further.
OK. Enough of the side stuff.
"What is it?" began Brian. "It's software that changed my life."
With an opening like that, I know the evening is going to be, uh, interesting.
Some more choice quotes (not exact quotes) from the evening:
"There was a three-year project that wouldn't scale. We went in, and solved their problem with NetKernel in six weeks. The customer was very happy."
"The computer industry is moving away from writing code and towards using formatted data over the past decades."
"Service orchestration is clearly the sweet spot of NetKernel. I have seen no better orchestration environment."
"NetKernel based projects needs surprisingly small amount of maintenance."
"You need to step away from objects, which are tightly coupled and brittle."
"Let me seed you with the ideas of NetKernel. You will have your epiphany sometime after you start using it."
"NetKernel applications are scalable and have no problems with heavy load because it uses a microkernel architecture that handles caching intelligently."
"Enterprises that adopt NetKernel technology see it as a competitive advantage."
With assertions like that, you bet the audiences are skeptical.
Here are some of their questions:
"How is this different from CGI?" I asked after the first demo, in which we saw a BeanShell script saved as a file on the server side, and a browser accessing the result of its calculations through an URL. The answer is that NetKernel does its magic on the server side after it intercepts the request.
"You can do that in Java too, with the Java 5 and Java 6 concurrency and executor framework." Kyle Cordes asked on seeing the NetKernel's
<throttle> <concurrency>4</concurrency> <queue>50</queue> </concurrency>element.
"Object orientation is a great way for me as a developer to organize my work. You are advocating that I give up object-orientation. What aspects of the new style of development with provide benefits that will compensate for the ones that I lose by giving up object-orientation?" asked Brian Gilstrap.
"With Web Services, the WSDL defines the contract. With the REST style architecture, where is the contract?" was Dean Farwell's question. Dean also asked for the potential future tools support: "With Java, I type foo dot, and my IDE tells me exactly what I can do. I don't want to go back to where developers will have to open multiple terminals and multiple vim session looking around for answers."
I just realized that this post is already too long.
If I keep on writing, I would have to go back to the beginning and change all "yesterday"'s into "the day before yesterday"'s.
Fortunately, Brian has promised to send the presentation slides to be posted onto the JUG website. I'll post the like here when it arrives.
Talking about the day before yesterday, Brian also mentioned after the presentation that he was at the Denver JUG on the prior day talking about REST. Matt Raible has a detailed report from that event.
And, coincidentally, the second speaker at that meeting, Norman Richards, will be our speaker for February. His topic? Seam.
Stay tuned.
Gmail Gives Me Choices: Ajax, POP3, and IMAP
Continuing with the "Give me the choice!" theme from 6 days ago, I am happy to discover that Gmail can be used with regular email clients like Mozilla Thunderbird or Windows Live Mail.
That Gmail supports POP3 and IMAP may be old news for some of you. But it's new news to me. I might have heard of the original announcement of Gmail's POP3 and IMAP support along with other computer news items, but it scrolled off my mind pretty quickly.
I most recently rediscovered it a three days ago, when I was setting up my old IBM Thinkpad (you've seen it here 1643 days ago) as my wife's computer. Being able to play CDs, DVDs and online videos, and being able to use email and some websites were the only requirements.
So I removed the Grub bootloader (login with discuss/freely) and the Linux partition, rebuilt Windows XP Pro, applied all patches, installed iTunes, RealPlayer and Windows Media Player, Firefox. and Thunderbird. My plan is to setup the regular email with Thunderbird, and save a couple of bookmarks for Hotmail and Gmail.
When I opened the Thunderbird account setup wizard, it gave me four options:
- feeds
- Gmail
- newsgroups
That "Gmail" option grabbed my attention. So I chose it, entered the username and password. At that point, I was informed that I had to turn on POP support in Gmail. When I went to Gmail to turn on POP support, I was informed that what I really want to do is to turn on IMAP. So I did that. And come back and configured a regualr IMAP account for Gmail.
That got me to thinking: can Hotmail be accessed from a regular email client? I vaguely remember that Outlook Express supported Hotmail. So I did a Live search, which lead me to this Microsoft page. It essentially said that I need to upgrade the Hotmail account into a Windows Live account, and that Windows Live Mail is what I want. I downloaded Windows Live Mail and setup the account there.
Just for simplicity, I also set up the other two email accounts in Windows Live Mail. So now my wife can access all three email accounts from the same Windows Live Mail client.
I don't know what she'll think about the new email client. But I've heard enough complaints in the past about both Gmail and Hotmail that I believe Windows Live Mail will provide a better experience than both Hotmail and Gmail's web interfaces.
If you've followed this post to this point, I might as well waste a couple more minutes of your time to address an assertion that I heard uttered by Web fanatics, for example:
Tim Bray: This notion, that the Web GUI is insufficiently interactive and we need something richer, is widely held among developers and almost never among actual users of computers, and it’s entirely wrong.
This seems completely backwards. If by "actual users of computers" he means the non-programmer users of computers, then my experience is completely opposite. They don't usually care whether an application is Ajax or RIA. But they can tell which one is better. At least in the email clients arena, the RIA is always better than their Ajax counterpart.
As far as I can tell, the only people who are touting the merits of Ajax Web UIs are web fanatic developers and vendors who has a big stake in the continued dominance of the inferior Web UI.
Once again: Give us the choices!
Friday Java Quiz: Know Your java.lang.Object Class
Warm Up Q: Without the help of your IDE or looking at the Javadoc, list all methods of the java.lang.Object class.
Q: Will the following program compile? Run? Print anything? If so, what?
public class Foo implements Cloneable {
private int i;
public Foo(int i) {
this.i = i;
}
public int getI() {
return i;
}
public static void main(String[] args) throws Throwable {
Foo foo1 = new Foo(1024);
Foo foo2 = (Foo) foo1.clone();
System.out.println(foo2.getI());
}
}
Follow Up Q 1: How would things change if the following method is added:
public Object clone() throws CloneNotSupportedException {
return super.clone();
}
Follow Up Q 2: How about this?
public Object clone() throws CloneNotSupportedException {
Foo clone = (Foo) super.clone();
clone.i = this.i;
}
Again, no actually running the compiler, etc., etc., ...
Given A Choice Between A Web UI And A RIA UI, ...
... I would always choose (as a user) the RIA!
Up until a couple of days ago, that was a theoretical assumption. Then something happened that validated my assumption.
It's not from Google or Amazon or eBay. It's from my ISP, the one that was bought by BestBuy some time ago. I have an email account with them that I use everyday from Thunderbird (or Icedove on Debian). They do spam blocking on the server side, and once in a month or so, I would check the spam folder on the server side to examine if there were any false positives.
I do that through a browser based interface. And on my most recent visit, there was a note saying something like "if you use Firefox, you might like our new RIA version of the webmail."
And I clicked on the link, which lead me to a XUL based version of their mail client. And guess what? It's better than the HTML interface. As far as I'm concerned, the XUL interface offers one feature that beats the HTML interface: I can now drag the table column divider to see more of the Subject lines. In the HTML version, here's what I see:
*** [Spam score 20.6] ***: Get...
and I can't make it show more of the subject. With the XUL version, I see:
*** [Spam score 20.6] ***: Get meds from Canada
and I can always make it show more of the subject line if it is longer.
You can't believe how big a usability win it is for XUL.
I would choose a RIA application over HTML any day.
The key to the argument is "given a choice."
Give me the choice!