6th
DEC

Erlang and Java (and Scala too)

Posted by Keith under Development Tools, Erlang, Java

People on the net did many performance testing on Erlang, and it shows that Erlang clearly wins over other environments.  And I see that more people are experimenting with it and there are real systems built on it, and performs incredibly.  The language is not easy to learn for someone (like myself) who worked in C++ and Java for many years and only touched Prolog (and Lisp) very lightly.  I concluded years ago that Prolog and Lisp are dead, but with this monstrous language/system, it intrigued me to learn the damn thing.  It’s very fun to play around with it, but it’ll take a while for me to be proficient enough to write a big application in Erlang.  I was a bit bored with Java and was looking for something new, so it’s alright.

I started wondering why this (Erlang way of concurrency) can’t be done in Java, and found something: Kilim. (and Scala’s concurrency.)  It is too early for me to say anything about them as I don’t know enough, but it’s worth reading a few pages.  This page shows Java+Kilim out performs Erlang: http://stephan.reposita.org/archives/2008/06/22/erlang-vs-java-benchmarking-update/

Kilim: http://www.malhar.net/sriram/kilim/index.html

Here is a posting about Erlang and Scala: http://yarivsblog.com/articles/2008/05/18/erlang-vs-scala/ I only read and played around basics with Scala and thought it’s just a way to add FP to Java.  After reading above posting, I looked at Scala site and found this article: http://www.scala-lang.org/node/242.  Take a look at the example code.  It’s very similar to Erlang how concurrency is done.

To Do:

17th
AUG

Glassfish init script

Posted by Keith under J2EE, Java

Here’s the init script for Glassfish. Change JAVA_HOME, GLASSFISH_HOME, USER variables for your environment.

[sourcecode language=’css’]
#!/bin/sh
# This is for: Sun’s J2EE sdk v5.05 (Glassfish)

JAVA_HOME=/usr/java6
GLASSFISH_HOME=/opt/glassfish
export JAVA_HOME

USER=glassfish
glassfish_stop() {
su $USER -c “$GLASSFISH_HOME/bin/asadmin stop-domain domain1″
}
glassfish_start() {
su $USER -c “$GLASSFISH_HOME/bin/asadmin start-domain domain1″
}

case $1 in
start)
echo “Starting Glassfish server:”
glassfish_start
echo “.”
;;
stop)
echo “Stopping Glassfish server:”
glassfish_stop
echo “.”
;;
restart)
echo “Restarting Glassfish server:”
glassfish_stop
glassfish_start
echo “.”
;;
*)
echo “Usage: /etc/init.d/glassfish start|stop|restart”
;;
esac
[/sourcecode]

7th
JUN

Foolish attempt - Trying to compile Java’s src.zip

Posted by Keith under Java

It helps to add that as a rt.jar’s source in IDE to debug/trace, but src.zip itself won’t compile.  Many classes’ sources aren’t available in that zip file.  I was able to get some source codes using JAD decompiler, however.

I’ve downloaded entire source code of Java from java.net which is now community open source — it has JVM, JDK source codes and Java source code for class files as well.  I haven’t had a time to look at it yet, but it must be interesting to look at.

19th
MAY

Eclipse Plug-ins

Posted by Keith under Development Tools, Java, Tips

Here is list of Ecplise Plug-ins I use:

  • CDT (C++)
    http://www.eclipse.org/cdt/
  • Azzurri (DB)
    http://www.azzurri.jp/eclipse/plugins/
  • Perl
    http://e-p-i-c.sf.net/updates
  • Maven
    http://m2eclipse.sonatype.org/update/
  • PHP
    http://download.eclipse.org/tools/pdt/updates/
  • PHP Debugger, Zend Debugger
    http://downloads.zend.com/pdt
  • JavaScript Debugger, JSecplise
    http://download.macromedia.com/pub/labs/jseclipse/autoinstall
  • Python
    http://pydev.sourceforge.net/updates/
  • Scala
    http://www.scala-lang.org/downloads/scala-plugin/
  • Subversion (Subclipse)
    http://subclipse.tigris.org/update_1.4.x
  • Android (ADT)
    https://dl-ssl.google.com/android/eclipse/

References:

  • PHP and eclipse
    http://2tbsp.com/content/getting_started_eclipse_php_development_tools_(pdt)
    http://mprobst.de/SherlockWeb/?postid=2
  • Scala plug-in, demo video
    http://www.scala-lang.org/docu/movies/plugin_win.html
  • Getting Started with Scala
    http://www.scala-lang.org/docu/started.html
  • First Steps to Scala
    http://www.artima.com/scalazine/articles/steps.html
  • php.ini in WAMP
    http://www.en.wampserver.com/faq.php#q3

16th
MAY

Realtime Java

Posted by Keith under Java

Interesting article:

http://www.javaworld.com/javaworld/jw-04-2008/jw-04-realtime.html

http://www.javolution.org/

Whenever I work on such project or reading on it, garbage collection is one of many problems that developers will face.  Some times I hope that Java give more control (dynamically, programmatically) of memory management to developers.