viernes nov 19, 2004

II Congreso JavaHispano: Ole

¡Qué tíos! ¡Olé! No dejes de observar el pedazo de programa que se está preparando para el II Congreso JavaHispano. Impresionante. Joshua Bloch al final: la guinda.


What a program these guys are getting ready for the II Congreso JavaHispano. Just impressive. So cool. Joshua Bloch is coming too!!

martes oct 19, 2004

NetBeans4.0B2 GC revisited: lots of fun

So I have been playing around with NetBeans 4.0B2. Quite impressive, effective, fast, right-to-the point IDE. I am just missing a VI key binding ;-)

I wanted to share with everybody my findings just in case you want to consider using them.

Garbage Collection Tuning

I didn't like the default [NETBEANS]/etc/netbeans.conf so I commented out the line starting with "netbeans_default_options" and I used another one:

netbeans_default_options = -J-XX:MaxGCPauseMillis=100 
  -J-XX:GCTimeRatio=99 -J-Xms48m -J-XX:PermSize=32m 
	-J-Dcom.sun.management.jmxremote

(Note that this is just a single line).

Garbage Collection Ergonomics: comfortable ;-)

The MaxGCPauseMillis and GCTimeRatio are new in JDK5.0. This is known as Garbage Collection Ergonomics and is used to avoid having to tune the GC yourself.

Quite comfortable. The fact is that I am surprised it does a very good job at tuning the GC. Little human intervention needed ;-)

PermSize

NetBeans 4.0B2 uses quite a bit of memory for class information. This memory is stored in the "Permanent Generation" space, so I just gave it around 32m. This avoids lots of full generations (specially at startup) and gives NetBeans some more life.

Management: Cooool

Now this is cool. If I set the "-Dcom.sun.management.jmxremote" on the command line I can monitor the JVM using the "jconsole" tool. I just write "jconsole" and the full thing starts playing.

Of course this is a time consunming thing: having to monitor the JVM all the time, but it is interesting because I can see how memory consumption evolves and what each thread is doing. Looking at this I've found that NetBeans guys are smart enough to use BlockingQueues for inter-threading communication. That's a best practice I'll be talking around soon, that avoids for instance having to use all those SwingWorkers all the time. Keep tuned for that. Have fun meanwhile.

martes oct 12, 2004

Collections Trick I: LRU Cache

Maybe it's just my job. Or maybe it's just fashion. The fact is that I meet little people understanding and/or taking advantage of Data Structures and Algorithms. People tend to use higher-level abstractions (EJBs, JSPs and the like) and usually forget about the low-level stuff.

I don't mean you have to be an expert on that, but I think it's indeed useful.

So the other day, talking to a customer, I noticed he was trying to build a LRU (least recently used) cache for whatever it was. And he was in trouble. He didn't know that's already done, and it's well done.

The fact is that he didn't pay attention to the LinkedHashMap. You do it as follows:


LinkedHashMap lruCache = new LinkedHashMap( 10, 0.75f, true )
 {
    protected boolean removeEldestEntry( java.util.Map.Entry entry )
      {
        return size() > 100;
      }
 };

So I think it's a good idea to post these tricks from time to time, so everybody can take advantage of them.

Have a good hacking!

jueves sep 30, 2004

JDK5.0 and NetBeans 4.0B2

Can't resist trying them out working together. I'm downloading them right now.

As we spaniards say, I'm as happy as a child with new shoes ;-)

viernes sep 17, 2004

Barra Libre en JavaHispano.net

Qué fieras. Resulta que ahora han puesto una especie de SourceForge para desarrolladores en habla hispana.

No dejes de echarle un vistazo

martes sep 14, 2004

No comments...

We are receiving spam from stupid people around the net. They post stuff in the comments sections on our blogs. We are working on fixing that, of course (hey, we have the blogger guy with us!). Until then I won't allow any comments to be posted. Sorry guys. Anyway you can contact me directly by sending me email.

lunes sep 06, 2004

Better NetBeans 4.0 GC Tuning

Of course this is excessive, but I have plenty of RAM:

/SOFTWARE/NETBEANS/NB40/bin/netbeans 
  -J-XX:NewSize=16m -J-XX:MaxPermSize=64m -J-XX:PermSize=64m

With these (excessive) settings the GC is virtually unnoticeable: just a single Full GC after startup and no one after 25 min working. I'll be posting my preferred GC settings for different Java products I see around. Let me know if you want me to tune any application of your liking. I don't promise it'll be a perfect match, but I'll do my best if time allows.

viernes sep 03, 2004

NetBeans 4.0 GC Tuning

This is my preferred command line at the moment for NetBeans 4.0:

/SOFTWARE/NETBEANS/NB40/bin/netbeans -J-XX:NewSize=16m

You know, NB 4.0 is much less memory hungry than previous versions (that's my first feeling), but comes bundled with no GC tuning at all. With a young generation size of 16m (not tuned, this is just my first hack, I'll post definitive settings later) things are much more responsive. Otherwise it GCs too frequently. Now it takes longer to GC and each GC is a minor one taking around 30ms. That's much better.

NetBeans 4.0 Beta is cool!

I agree with Mukesh Garg: NetBeans 4.0 Beta is cool.

I confess I am a convinced user of NetBeans, and that I have always been. I am a convinced user of the command line interface too, and I have always been and, more importantly, I will ever be.

Command line interface is all I usually need. It's flexible. I can script things for automatic build/test, and I can make my Linux/Solaris environments to do those using cron. That's cool too.

While using NetBeans 3.6 (and previous versions) I had to keep the Ant file myself. I could integrate that into the IDE, but that was too complex/elaborate for me. I prefer editing the Ant script with VIM and not with the IDE. Much cleaner.

But NetBeans 4.0 (Beta, is this Beta? Wow, what a Beta!) is what I have always been looking for. I can use both a GUI and a Command Line Interface. The best of both. NetBeans 4.0 keeps source code and tests in separate directories, and builds on another directory. That's what I wanted. It uses Ant internally. That's what I wanted. Allows me to use the Command Line Interface. That's what I wanted.

As a conclussion: NetBeans 4.0 is all I need.

And, by the way, it's much better looking that NetBeans 3.6, uses less memory and, of course, is cool.

Thanks, guys, for giving me NetBeans 4.0 (Beta, Beta?).

lunes ago 23, 2004

Why Java is Cool

Lots of people asking Why Java isn't cool

I disagree. I think Java is Cool. Let me explain why.

Java has considerably fewer surprises

No operator overloading. No multiple inheritance. No pointers. No invisible memory leaks. No need for 35 New Ways to Improve Your Programs and Designs. There's no need for exceptional tricks. No surprises.

It's such a language-for-the-masses that, yet again, passes the average programmer test. So an average programmer can do really Cool stuff. And that is Cool.

Java is not slow

Java is, indeed, quite fast. Fast in execution and fast while developing. You can concentrate on using an HTML editor to build a JSP that produces XML, or WML, or HTML, or CSV content, or text content. And then deploy and run.

And you cannot do that so fast in C++ nor C. In Windows and Solaris and Linux and whatever.

And that is fast. So it's Cool.

Swing is improving a lot

Swing has nice look and feel. Both native-looking (although not to the pixel, possibly) and fancy looking commercial and open-source look and feels.

And then you have lots of libraries out there. For everything. For lots of components and beans and graphics and graphs and maps and whatever.

So isn't it cool?

Java's libraries...

Are so vast that you have lots of tools out there for you to use. You can move a rover on Mars and then play a game on your phone or listen some speech or do some 3D graphics or whatever.

So lots of Java developers can concentrate on the task. And have the job done easily. No long hours of memory-leak hunting. Pizza and Java. Nice fit. Cool.

Java has lots of good IDEs

Netbeans and Sun Java Studio and Eclipse and BEA and IBM and Borland and IDEA. For free and commercial. And lots of UML tools out there. And whatever. Cool.

Java is a programming platform

So you can program USB and desktop applications and services and games and real-time stuff.

So basically Java is cool because Java is for everybody. Not just a geek-only thing.

Java is cool. I hope you enjoy it as much as I do!

miércoles ago 18, 2004

Windows SP3 is out!

I have been using Windows at a customer's the whole day.

I am stressed. I need some relax.

I need Windows SP3.

Since the site is in spanish you may want just to click somewhere on the desktop after the blue screen of death appears.

Enjoy!

domingo ago 08, 2004

II Congreso JavaHispano

De vuelta de vacaciones, qué mejor que ir pensando ya en enviar algo al II Congreso JavaHispano

II JavaHispano Conference

It's somewhat weird to publish this in english, because this is a spanish congress. Anyway I assume english speakers are welcome as well. If you happen to be to Spain by December 2004 then consider visiting them, or even better, submitting something. More info at II Congreso JavaHispano (spanish only site, at the moment ;-) )

UPDATE: I am just publiciting the conference. I don't know if they accept english speakers or not, or if this is just a spanish-only conference or not. Please contact them directly for further information!

viernes jul 09, 2004

Open-Sourcing Java: because...

First of all I would like to thank everybody that posted some comments to my previous questions about open-sourcing Java. Now that I have different points of view I can comment on them. Of course these are my comments, not Sun's ;-) There we go:

Fast, fast, fast

Some comments state that Sun is slow solving issues ("you have to wait Sun to take your submission", "Sun react too slow to big issues", etc.)

Well, I don't know what slow is. I mean, that's quite a subjective question. Lots of people think Debian is slow, for instance. I disagree: Debian is released whenever Debian is ready. Nor sooner nor later. Of course if you want to deliver good quality software you need some time. I don't mean that Good Software Takes Ten Years. Get Used To it, but you need some time.

Mono, for instance, has taken some years to build 1.0. And it seems they're not up yet with Microsoft .NOT stuff (well, that's a moving target, so it's difficult).

Lots of open-source people get used to the "release-often" approach. I don't mean it's a bad method, it's just a way to do things. That's ok whenever your users are beta testers: you can detect bugs easily. Furthermore, most users get used to have to keep track manually of dependencies, I mean: lots of open-source projects depend on other open-source projects which are in turn released often, so whenever you want to upgrade one you have to upgrade different others, and this is a nightmare of upgrades.

I wouldn't like that to happen with Java. It's a pain in the neck. I just prefer to have a new Java version whenever the version is ready. And if it has any bugs in it I'd like them to be publicly available, say in a web page or something, so I can go and see if there's a problem there. And I'd like them to be solved in the next Java release. In such a big thing as Java is (with lots of libraries there) is difficult to solve all bugs. There's no software without bugs. All I want is to be able to vote for bugs so the more important to me are solved. So people can concentrate in those bugs annoying me.

And that's exactly what's happening with Java. So I don't see a reason to change it.

JCP is open to open source

Some other comments state that you have to belong to a Big Company to participate in the Java Community Process. I know that the Apache Foundation and JBoss, Inc. are big companies, but they are part of the Open Source Movement, so I assume the Open Source Movement is participating in the JCP.

So JCP is open to open source.

But it's open as well to individuals. To experts.

All that is required is to do some work at the JCP. I mean, if you become an expert I assume you are supposed to do some real work, not just be there hanging around at your spare time. (And this is just my opinion: I'm not an expert at the moment, mainly because I cannot do any more real work at all ;-) ).

Saving Sun's money

Some of the comments state that open sourcing Java is a money-saving technique for Sun ("this will cost Sun a lot").

Now I understand the reason why IBM is pushing to open-source Java !! ( ;-) )

Now, seriously, I think Sun people is smart enough to decide on how to save money by themselves. No help from IBM needed at the moment. They could start by reducing the funds for R&D to a minimum, to the same level as other companies. But then we wouldn't have HotSpot, those nice featured, high-technology garbage collectors, not even a Real Time Java, nor a sound, secure, operating system.

And that wouldn't be good for customers, nor for Java users, so it's a Bad Idea: I still want Sun to deliver free hardware and free StarOffice licenses to the Open Source and Academic Communities. I still want Sun to invest huge amounts of money to build the Best Of The World garbage collection technology I can use in my laptop. Making Sun save money is, indeed, a Bad Idea.

Open-Sourcing Java will reduce the bugs in J2EE

"They did a lot of work on the J2EE standard, and EJB's ended up being a big pain in everyone's butt." Well, J2EE and EJBs have nothing to do with open-sourcing Java. Both J2EE and EJBs are being worked on at the Java Community Process, which is (as far as I know) already open to everybody.

Distributing the JDK with Linux

Someone mentions that the JDK cannot be installed by default in a Linux distribution. Well, this is a major problem to me too. I would like it to be installed everywhere. For free. With no licensing restrictions. I also think Sun should fix that.

Kaffe and GnuClasspath

I have to agree that Sun should make things easiers for these groups to verify their implementations. In fact it would be great if someone at Sun could collaborate with them in their implementations. That's something Sun should consider, I think.

Conclusion

I still cannot see a real reason why Java should be open-sourced. In fact I think there's no real reason to open-source Java. Even reading Eric S. Raymond's Open Letter I can see no real reason at all.

"But Sun has done other things that make us wonder if the vision and courage to choose the open-source path are really there.", Eric says. Well, I do think Sun has vision and courage to go through the open-source path, mainly because it is already in the open-source path. And this vision has been Sun's vision for quite a long time now. We're not new to Open Source. We've open-sourced lots of things. We're open-sourcing Solaris. We're open-sourcing Java3D. We're open-sourcing Looking Glass. We're not new to Open Source.

" if you're serious about preparing Sun for the future we can all see coming in which code secrecy and proprietary lock-in will no longer be viable strategies ", Eric says. Lock-in you say? Does JDBC lock you in in any proprietary database? Does J2EE lock you in any proprietary application server? Does Java lock you in any proprietary operating system? There's a misunderstanding here somewhere. We're about open systems and open source, not the other way round. And we have always been, and, for sure, we will ever be.

Jean-Christophe Collet's blog expresses it quite well: Sun is all about open-source and open-systems, Sun is an open-source ally. It's \*the\* open-source ally. Sun will always be an open-source friend.

And that's one of the reasons why I like this company!!

lunes jul 05, 2004

Open Sourcing Java, why?

Open Sourcing Java seems to be a hot topic nowadays. Everybody wants Java to be Open Source.

Although I am not an expert on the area I would like to express my opinion. After all that's the reason why I'm blogging.

One Java to rule them all

Go take a look at how many different SmallTalk implementations are out there. Quite a few, right?

Go take a look at how many different Scheme implementations are out there. Quite a few, right?

I like Scheme a lot. It's my favourite functional programming language. Simple, efficient, straight to the point. There're lots of implementation dependencies though. Mainly with libraries (although SLIB helps a lot). Open source people have built different implementations of libraries and there're no standards for those. Building a GUI with Scheme, for instance, is different for each implementation. That's a pain in the neck for Scheme. (If you wonder, my preferred Scheme implementation is SISC, a Java based one that can be found here.).

I wouldn't like to have Gnu-Java, IBM-Java, Microsoft-Java (they tried it hard, though) and the like around. It would be frustrating to generate Java code that is not portable between implementations. Filling in code with "if"'s for each implementation, going around implementation specific bugs. I don't like that. I don't think Java users want that either. Nor Sun customers. Nor IBM customers.

Java should be controlled by someone. Sun has done it fairly well during this years. I can't think of a reason why they shouldn't keep on doing that.

Being controlled does not mean people can't build implementations of it. It just means that implementations are controlled whenever they claim to be Java. IBM-Java JDK, for instance, is a perfectly valid Java implementation. So is Blackdown's. Kaffe has little gotchas, so I think (just think) it's not fully Java compliant.

To summarize: I think it's better to have a controlled Java standard. That's good for everyone.

Open Source

I am not an expert on Software Licenses. I know a little bit about GPL and LGPL, and a little bit about Sun Community Source License (SCSL). With SCSL I think you can:

- Download Java sources and modify them.
- Send enhancements and error corrections back to Sun, so they can be taken into account in future releases

Were you using GPL you'd be on the same situation, I think.

With the Java Community Process you can:

- Ask for new features in the Java language.
- Agree with the Java community and discuss with them about these features and enhancements.

So, what is the problem? Is it that the name is "Sun Community Source License" and not "Apache License"? Is it that it's Sun controlling that there're no different implementations instead of any other entity? Which entity should that be, and why? Is it that different companies have to agree with features and standards with the JCP? Who is that bad for?

I try to keep being open-minded, but I just can't understand why anybody else other than Sun should keep Java implementations compatible. Sun has been fair with the open source community for quite a long time. I can export my filesystems through the network thanks to Sun, for free; I can make presentations easily in Linux with Open Office, for free; I can build Java applications on Linux easily with NetBeans, for free; I am safe using Java because it's compatible between Windows, Linux and many other OSes.

I will try keeping to understand why an open source license other than SCSL is better for Java. At the moment I just can't understand it. Too limited I am, I acknowledge.

lunes jun 14, 2004

Open-minded

I have been travelling a lot these last years. I have spent two, very nice, years in Portugal, some months in the UK, some others in USA, and several weeks all around Spain.

Travelling is a great learning opportunity if you have a chance to stay longer. On long stays you have time enough to learn the idiosincrasies, learn what people think and why, and how they react to things.

The fact is the more you stay abroad the more open-minded you become.

And the more open-minded you become the better the solutions you give to problems. Both professionally and personally.

And then, as a consequence, the better the solutions you give to problems the longer the customers want you to stay!

It happens to me as well that the more open-minded I get the more radical and fanatical some solutions appear to me. There's lot of open-source, closed-minded people. And as well some closed-source, closed-minded people. Lots. On the following days I'll be posting on this, giving my opinion on why some well-known topics seem to be closed-minded to me. Stay tuned.

Being open-minded is most important to have a good health. Here at Sun there's lots of open-minded people. That's great!. Lots of open-minded, enthusiastic people. Few closed-minded, radical or fanatical people.

About

swinger

Search

Archives
« abril 2014
lunmarmiéjueviesábdom
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Hoy