2009-08-11
Using license with NetBeans project
When you're using GPL or LGPL with your project - you should add license statement to every source file of your project. Using NetBeans it's not that simple - you have to use PROJECT/nbproject/project.properties file to add project.license=default_2 for example, using file name of your license template (but not template name itself). To make your life even harder - GPL and LGPL statements are using name of your project three times. Because of this I created separate templates for each of my (L)GPL projects to include project name. Because of this is took a time to set a complete new project. Now I found solution how to make NetBeans use single GPL template for all projects:
1. use ${project.name} for name of your project. For example: "This file is part of ${project.name}.".
2. in file PROJECT/nbproject/project.properties add project.license=default_1 (or any other file name for your license).
3. in same file (PROJECT/nbproject/project.properties) add project.name=MyNewProject
Now create new Class file and check license header of your file. Hope you'll enjoy!
2009-07-23
KDE 4.3 RC3
You may already know that KDE 4.3 RC3 released, and release delayed for a week. I can't stand that news, I thought that is will be released this Monday, but another 2 weeks... And of course I want to try it without harming my every day system with KDE 4.2.4 and only stable packages. In that moment I remembered about kde4live CDs, that I used some time before SUSE 11.1 released. And of course I found it fast enought using Google. And there are good news - on top of the page there is message that KDE 4.3 RC3 already packed to LiveCD and can be downloaded from SUSE's repositories. Well, Kubuntu users, don't you feel betrayed that your favourite "KDE-oriented" distro is far behind great and green OpenSUSE?
2009-07-09
Kompare - the only valuable diff for M$Windows
I used KDE and Linux for many years, and of course I was shocked when I had to switch to Windows in new office and I didn't found all those little but important tools KDE guys made for us all. Today I will tell you about Kompare.
My history as Kompare user
While being developer from time to time you need to diff between two files. Of course almost any IDE and other development-oriented tool have own diff UI. Of course I used many of them, some are more useful than others. For example older Eclipse diffs were so ugly that it was hard to look at, IDEA had horizontal 3-way comparison, older NetBeans versions - vertical 3-was comparison, KDiff3 showed too much of not required data and also was ugly enought. Only SmartSVN and Kompare used two-way clean and informative diff, but while SmartSVN was written in Swing - Kompare used all possible KDE features including font antialiasing, user's colouring and icon theme and of course smooth comparison blocks. While being feature-rich it was only comparison tool with great UI, so I stuck with it.
Switching to Windows
Of course after I got used with pretty tool like this - it's hard to move to something ugly and not so usable. When on the new job I had use Windows - I went to wikipedia to search for another file comparison tool. And what do you think, I downloaded every free-to-download tool and tried it - and it failed. Some of them took 3-4 steps before show you actual diff, others were overloaded with features, others had ugly UIs. I couldn't make myself use them. I've been lucky and by that time NetBeans team swithed to 2-way diff, and I used NetBeans for even smallest comparison operations.
kde4win salvation
I was lucky enought not to die before kde4win project released with Kompare ported to Windows. Of course few first releases didn't helped me also, but starting with 4.2.0 release Kompare was fully functional. And not with kde4win you can use this great tool if file comparison operations is critical for you.
installing
It's not hard. You don't even have to compile something. Only few steps:
- Go to gnuwin32 diffutils, download and install.
- Download kdewin installer and launch it.
- After installing kde4win - start kompare and in "Diff" section show him where your diff.exe (from gnuwin32 diffutils) is located.
- Restart Kompare and it's ready to use!
Now you can enjoy your life without feeling the pain of uncompared files on your system.
PS: Kompare can be used even for folders comparison - and it's much more powerfull than you can expect from simple file manager!

2009-07-06
Yet another opinion in Mono case
There were many Mono debates on Tuxmachines for last few weeks. Of course I have my own opinion on this topic. I will not blame Mono right now, just my thoughts about distributing it with Linuxes.
Default distribution
As far as I know, all those debates started when Debian guys thought about including Mono into default installation. But what it default installation? Isn't it related to target users? It's obvious that when you installing Ubuntu - you target home desktops, SLED or Mandrake - office, SLES or Slackware - servers. Depending on that choice "defaults" are very subjective. But is there any distribution problem? I don't see it. Being SUSE user I have my distribution on DVD media, lots of stuff could be fitted there, why not include Mono? If you're single CD distribution - you should think twice and count all Mono-based software you'd like to install. If it's just single application - it will be funny to install mono because of it.
Next, most of Mono apps are made for GNOME. I see no reasons to install it with KDE-based distribution, or console installations.
Thinking about users
In perfect world user should never bother with technology used in his favourite apps. Application should just do it's job, not promote or blame something. To mono or not to mono should depend on those user apps, but should not be some politics or religion choice. As for me I hate beagle, banshee and f-spot. Mono should not be installed for me. And vice-versa. If user will notice any Mono application he will run - it will look like there is some problem with Mono, don't you think so?
System core
While it's completely OK to depend some desktop apps on Mono or other interpreted stuff - it's totally wrong to use it for system parts. Every next level of abstraction and interpretation adds additional level of possible problems, removes some part of integration and requires more resources to work. Can you imagine our world if HAL will be written in ruby or python or something like that? System must not be related on interpretator vendor or on subjective solutions. You may already see some bad examples like ZEN in SUSE 10.0, pulseaudio in current distributions, gcj instead of Sun JRE in fedoras and many more.
From my perspective
It's strange to see, but all mono-based apps I know makes me sick. Beagle that starts and scans event without any GUI installed. ZEN that made me think about switching away from SUSE. Banshee with it's crippled playlists. F-spot with it's lack of features. MonoDevelop with it's lame possibilities totally unexpected in any IDE. I think that the day I will not be able to set "taboo" on Mono in my SUSE installation will be the last day of me as SUSE user.
Java things that make you go "hmm"
I am preparing myself to SCJP exam, and while reading preparation book I found "feature" I didn't knew about. Take a look at the following code:
public class Main {
public static void main(String[] args) {
new B();
}
static class A {
public A() {
System.out.println("A constructor");
}
}
static class B extends A {
{
System.out.println("B init");
}
public B() {
System.out.println("B constructor");
}
}
}
How do you think, what output will it generate?
2009-07-02
Java single inheritance questions
There are few structures in Java that are not so intuitive as others. Take a look:
public class InnerInvocation {
String getValue() {
return "Outer Value";
}
private class InnerClass {
String getValue() {
return "Inner Value";
}
void work() {
// insert code here
}
}
}
What code do you need to invoke getValue() method from outer class?
Here is the answer:
void work() {
InnerInvocation.this.getValue();
}
And now the question of the day: there is syntax that possibly can allow multiple inheritance in Java, so why is it forbidden? Because you as developer can make lots of mistakes? Why then they allowed reflections?
2009-06-30
Eclipse and NetBeans compared
Eclipse 3.5 released few days ago, and NetBeans 6.7 just released. Of course I am using NetBeans 6.7 starting from beta versions and I know how it works, so I wanted to test eclipse. After using it for few hours came this comparison.
Both IDEs have clean install and run.
About
Two about dialogs to show used versions


Memory usage at the beginning
Memory usage just after startup. It's pretty comparable to say "there is no winner".

Step 1: project creation
Eclipse
New project dialog:

Eclipse gives lots of options on project creation page, and defaults are quite ugly. May be that is the reason why eclipse users are never writing small projects just to test some API?...

NetBeans
New project dialog:

NetBeans gives option to create Main class for project at once, but we will ignore this suggesion for comparison purposes.

Step 2: main class
Eclipse
Eclipse shows another overloaded window. Of course first bug in package input, Ctrl+Space just does not work there. As for me to save user's time it would be better to create just empty class as soon as possible, and editor will give possibilities to modify that options.

NetBeans
Quite better options than Eclipse gives, you see all possible templates for your Java project organised in tree.

But there is next window to complete Main class creation. It's a bit more usable than Eclipse's version because of good focusing system, but still it's step 2.

Step 3: autocomplete
Eclipse 1
Basic autocomplete is just ass-ugly. No text coloration, small and not monospaced fonts just suitable to print errors, but not information for developer.

NetBeans 1
Text coloration helps more than icons, but icons differs each other if compare to Eclipse's round icons with just letter changed. And of course monospaced font.

Eclipse 2
One point to Eclipse - after autocomplete focus is given to set type of list.

NetBeans 2
Not much to look at.

Eclipse 3
Another ugly autocomplete window.

NetBeans 3
Only imported types shown. Once this was IDEA's feature and it makes good job.

Eclipse 4
It's very strange to see icons and other information here, just can't understand who needs it.

NetBeans 4
Quite lot of variants.

Eclipse 5
Cool. 5 items in list and none will work for us.

NetBeans 5
Same problem, just showed everything it knew.

Eclipse 6
Nothing interesting.

NetBeans 6
The same.

Eclipse 7
Were there any worse possibilities?

NetBeans 7
Pretty good, all found List implementations will help us. Just why to show classes from com.sun.* packages?...

Eclipse 8
Still no help from IDE! I can do the same in plain text editor, why do I need IDE like this?

NetBeans 8
Perfect. The most suitable class and full javadoc for it.

Eclipse 9
One more point to Eclipse. It's good to write type and brackets when class is already known.

NetBeans 9
No brackets... I have to press another autocomplete to see available constructors. Even no autopopup of autocomplete here.

Eclipse 10
Another ass-ugly autocomplete. No text coloration, no text alignment, some strange info about class of object, and that stupig "arg0" labels... I don't know, did Eclipse guys ever saw what they developed?

NetBeans 10
Just perfect. Bold marks methods implemented in class and plain - inherited methods, text aligned to let you browse return types with ease.

Eclipse 11
arg0?...

NetBeans 11
Well, it's really the best found option around.

Eclipse 12
Hm... no text autoquoting?...

It even can't put semicolon to the right place!...

NetBeans 12
Oh, here is text autoquoting, autoputting of semicolons... But it's NetBeans who helped me to save my time.

Eclipse 13
Wait... but there is src.zip with my JDK installation, it's full of javadocs! Why can't it just show me javadoc from there? Do I really need to go and download javadoc.zip in 21st century?

NetBeans 13
Here we go, it's not hard, is it?

Memory usage now
Memory usage after comparison above. And you will be next to say me that "native SWT is faster than interpreted Swing"? I'll write separate article about that myth.

Conclusion
"IDE" stands for integrated, but as naturally I expect my IDE to help me in my every day job. Help in this case stands for autoquoting, autosemicolons, simple and fast dialogs, and of course pretty and usable interface, that saves your time searching required items. Currently NetBeans is only IDE that really tries to help me as much as it can, though there are things to work on. And that makes me NetBeans user, not just big user base or Sun trademark.
2009-05-27
Problem Silverlight: Micro$oft owns your computer
Intro
I am using official version of M$ Windows XP at work, and all the day yesterday I fought with it's updates. Yes, I am talking about Silverlight. I do not care about other possible updates as long as they have no impact on my work. But this one... "Why not?" you will ask... Well, I have few reasons.
1. This computer is MINE!
It installed without my approve. Just downloaded and made ready to install. And more, when I am checking box "Don't notify me about this updates again" it waits about 5 minutes, than downloads it again and installs it again. I can't cancel or forbid installation of this package. Just can't. I have no control over own operation system! I can put TABOO on any package on my SUSE Linux box, but I can't make Windows ignore this peace of "optional" crap.

2. User-agent of browsers
When silverlight is installed - it changes user-agent string of web browser to include itself. M$ already changed user-agent of my Firefox to this one:
Mozilla/5.0 (Windows; U; Windows NT 5.1; uk; rv:1.9) Gecko/2008052906 Firefox/3.0 (.NET CLR 3.5.30729)
What for? Someone is using those dirty techniques to determine silverlight or .NET installed on my machine? And why M$ hacks my browsers without my permission to do it? I can't agree with such politics.
3. Politics
Development of Silverlight looks like politics solution from my point of view. If you can remember history of Netscape - you will see that M$ always releases own products of same kind after they're losing market. Market is totally occupied by Adobe with it's products and experience with graphical applications. M$ will easily take market back with such "optional" features as Silverlight.
4. Religion
I am Java developer. And being Java developer I can see that no one believes in desktop java apps because of JRE on client's computer. Do you really think that JRE is harder to install than Flash Player? No it's not. But "everyone has a flash player, but no one has JRE installed" is already mature religion in most countries. So that will be my own religion - if something is written in silverlight - I don't need it with it's crappy silverlights.
Subscribe to:
Posts (Atom)