November 29, 2007

My NetBeans: my.netbeans.org

NB Community Docs: Branding Updater Splash

Hi all!

Tony Kohar is back with "Another series of Netbeans Platform branding, but this time is branding the updater.jar. Updater.jar is used by Netbeans Platform during modules updates and update tracking and work in conjunction with Auto Update Services. .."

Check his tip & tricks entry here


The NB Community Docs is growing. Are you playing a role?

See you!

November 27, 2007

NB Community Docs: Article: Import an Eclipse WTP project into NetBeans

Hi all,

Kristian has contributed the 2nd article in the "EclipseToNetBeans" series. In his article he shows you can work with simple web applications created with Eclipse in NetBeans.

Here is the article: http://wiki.netbeans.org/wiki/view/EclipseWebToNetBeans


I found it a good read especially in the face of the plugin not being
to handle properly web projects (as reported earlier).

November 24, 2007

NB Enhancement Request: Support for Importing Eclipse Europa features

I tried to import a Eclipse Europa 'Dynamic Web Application' project with the facets enabled - Java, Visual Web Module on NetBeans 6 Beta 1.

The plugin complains that there might be some external plugins being used. And then proceeds to import the project, but only succeeds in importing the servlets under the 'src' folder (which is a generic approach for any Eclipse Java Project). The JSP files are not imported.

Hence, I filed an "Enhancement Request" to the Eclipse project Importer plugin for NetBeans.

November 23, 2007

Meet Amit Kumar Saha

Meet me here at http://www.sercononline.com/promos/nov/s_a_k/002.html

See you!

November 22, 2007

Spotlight on James: Q n A with the NetBeans Community Docs Manager

Read what James has to say about the NetBeans Community Docs Project in this interview: "The NetBeans Community Docs Program Wants You!"


Related:

Research Publication: Towards a User Friendly Framework for Parallel Image Processing

My paper submission titled "Towards a User Friendly Framework for Parallel Image Processing" to the "International Conference on Information Systems and Technology 2007" has been approved/accepted.

Unfortunately, I won't be able to attend the conference due to my exams.

November 20, 2007

Article: Introducing Mercurial, a distributed version control system

My article "Introducing Mercurial, a distributed version control system" is now live on Linux.com.

Read it here at http://www.linux.com/feature/121157

Here is an excerpt:

"According to its developers, "Mercurial is a fast, lightweight Source Control Management system designed for efficient handling of very large distributed projects." Dozens of projects already use the software. Here's how you can get started with some basic version control tasks using Mercurial.."

Read it here at http://www.linux.com/feature/121157

November 18, 2007

Web Applications for Dummies: Using JSP and Servlets

Improving on the post JSP for Absolute Dummies: Simple User Validation Demo
I shall simulate the same User Validation scenario using Servlets and JSP.

The only change from the previous post is that instead of using 'validate.jsp' to perform the validation, the validation is now performed by the Servlet 'Validate.java'. The flow of control remains the same. Please refer to the earlier post: JSP for Absolute Dummies: Simple User Validation Demo

Source Code:


Servlet generated from a JSP Page

For someone, who is just trying to get a feel of Web Application Development using Java on NetBeans 6, this is a cool discovery.

A JSP is compiled into a Servlet before it is excuted by the container. Now, can you see the Servlet generated?

  1. Run the JSP page
  2. Go to the project explorer and Right-Click on the JSP page
  3. Choose 'View Servlet'


Try reading the NetBeans IDE Help sometimes, before you start Search-Fu!

November 17, 2007

JSP for Absolute Dummies: JDBC connectivity in JSP

Using Java Server Pages, simulate a simple User Validation scenario in which the user name, password is stored in a database

Login Page



Successful Login


Design of the Application:

The whole application consists of 3-JSP pages and a database created in Java DB - 'user-validate' :
  1. index.jsp - login page
  2. validate.jsp - validating the credentials
  3. user.jsp - User's page after succesfull login
  4. user-validate
    • Contains the table USERDATA which consists of the fields:
      • name
      • pass

Flow of control / Application Flow:
  1. User enters credentials in the login page, hits the 'Submit' button
  2. 'validate.jsp' is invoked via FORM action, GET method
  3. The Username/Password is compared with values obtained from the database in 'validate.jsp'
  4. On success, the 'user.jsp' page is invoked using tag else control returns back to 'index.jsp'
Software Used:
  1. Sun JDK 1.6
  2. Apache Tomcat 6.0.13
  3. Java DB (shipped with NetBeans 6 Beta 1)
  4. IDE
    1. NetBeans 6 Beta 1
Source Code:
Running the code:
  1. Open the project in NetBeans 6 Beta 1 (or M10 onwards)
  2. Add the 'Java DB libraries' (By choosing 'Add Library')
  3. Start Java DB
  4. Create a Database 'user-validate'
  5. Connect to it (Right-click and..)
  6. Create a table 'USERDATA', in the schema 'APP' with 2-columns - NAME, PASS, both VARCHAR
  7. Insert into the table values - 'Amit', 'amit' using a simple SQL script
  8. Observe the Database specific address, port and adjust the code in 'validate.jsp'
  9. Build the project
  10. Run it
If you are not aquainted with Java DB, refer this link.



Major Shortcomings:
  • No Session management

Creating Ordinal Columns in Table Component

"Creating Ordinal Columns in Table Component" is the latest contribution to the NetBeans Community Docs. Go ahead and check it out!

Fun with Android

I was dying for having some fun with Android, and results are very very encouraging


Demo


More videos from Android Developers:

Surfing the Web using Android Device Emulator


November 16, 2007

JSP for Absolute Dummies: Simple User Validation Demo

Using Java Server Pages, simulate a simple User Validation scenario

Login Page


Successful Login


Design of the Application:

The whole application consists of 3-JSP pages -
  1. index.jsp - login page
  2. validate.jsp - validating the credentials
  3. user.jsp - User's page after succesfull login
Flow of control / Application Flow:
  1. User enters credentials in the login page, hits the 'Submit' button
  2. 'validate.jsp' is invoked via FORM action, GET method
  3. The Username/Password is compared with 'hard-coded' values in 'validate.jsp'
  4. On success, the 'user.jsp' page is invoked using tag else control returns back to 'index.jsp'
Software Used:
  1. Sun JDK 1.6
  2. Apache Tomcat 6.0.13
  3. JSP Editors:
    1. gEdit, or
    2. NetBeans 6 Beta 2 (makes life lot easier)
Source Code:

Major Shortcomings:
  • No Session management
  • Login credentials hard-coded

NetBeans 6, Subversion, Cygwin

The NB Community Docs has got a new entry "Challenges with Netbeans 6.0 Beta 2, Subversion, and Cygwin on Windows " - a utility tip which is surely going to be useful for developers working with NetBeans, SVN, Cygwin.

Do you have such a trick you would like to share? Go ahead and contribute to the NetBeans Community Docs.

See you there!

November 14, 2007

Automating XAM Model Generation: Agenda

The XAM usage page states that "There is no automate generation of XAM model at this time."

UPDATED:

I asked Nam for suggestions regarding the possible approaches and he suggested me a faster approach than using JAXB.

Nam writes:


Certainly there could be different approaches to generate the model.
From my experience, this is what I would do:
- Create a NBM project, add dependencies on xml/xam, xml/schema/api, xml/axi
- Use the SchemaModelFactory to create the schema model and then create
AXIModel from the schema model
- For java code generation use DataObject.createFromTemplate method.
- For java source manipulation (adding method...) use Retouche java
model facility:
http://wiki.netbeans.org/wiki/view/Java_DevelopersGuide
You can see websvc/rest classes: GenericResourceGenerator,
JavaSourceHelper for example usage of template and Retouche. For java
template files, I would start with the sample xml/xam/kitmodel.

EARLIER:

My CFF mentor Rohan brought this fact to my notice when he suggested me a possible project I could work on as part of my participation in CFF besides my NB Community Docs effort. So after a couple of telephonic conversations and exchanging e-mails it appears that I am ready to start off.

So, here is the informal objectives-cum-agenda of the project:

The outcome will be a tool (a NetBeans plugin probably) whose:

Input -> a XML schema (.xsd)
Output -> XAM model of the XML document

Now, to design such a tool I will investigate writing a 'XJC' plugin
to take advantage of what is already there in JAXB. This 'XJC' plugin
will export a XAM API instead of the JAXB API tha JAXB normally
exports.

Now, as a first step I will try out some simple unmarshalling tasks with JAXB.

Watch out this space for updates!

November 12, 2007

Double Delight: Android SDK, $10M Bounty

Official Google Blog: Calling all developers: $10M Android challenge

The Android SDK is now available at http://code.google.com/android/

Google also announced Android Developer Challenge

I just had a brief glance at "What is Android?" and my fingers are just itching to lay my hands on the SDK (Linux)

It has a Linux kernel and applications will have to be written in Java. Now, Linux and Java- they are hot favorites for me. Too bad, they do not have a NetBeans plugin (they have an eclipse plugin) for this, but I might as well write one, with some time and effort.

Watch out for the Android!

November 10, 2007

Building NetBeans 6 Beta 2 from Sources

The latest contribution to the NetBeans Community Docs is a short article titled "Building NetBeans 6 Beta 2 from Sources"


It basically shows you how you can build NetBeans 6 Beta 2 from sources. It has been contributed by yours truly!

November 8, 2007

CodeForFreedom: Tech Talks now Live

The CFF Tech Talks are now Live, available here.


 What is code for freedom? PDF | TechTalk
 How to contibute to OpenSolaris? PDF | TechTalk
 How to contibute to NetBeans? PDF | TechTalk

Good work Rohan!

Featured on Sun Developer Network- South Asia

SDN South Asia has featured me here based on my active participation in Code For Freedom.


SDN Feature

The interview is available at http://developers.sun.com/asiasouth/news/amitsaha.html

Reproduced below:





  1. Why did you participate in the Code for Freedom (CFF) Contest?

    My involvement with Open Source started 5 years ago when I started using GNU/Linux. Gradually, the involvement is becoming stronger and I am now an active contributor to some Open Source projects in the form of Code and Documentation. CFF was announced at a time when I had just started contributing to NetBeans Community Docs project. I saw a chance to play a greater role in the NetBeans Community by signing up for CFF (to provide the motivation- a sense of responsibility, and get some recognition too! Hence, I signed up for CFF, also let me mention that since it was by Sun that attracted me more.

  2. Please give us details of your project for the Code for Freedom Contest

    As of now, my contributions have been as a coordinator and contributor to NetBeans Community Docs. I am also the creator-cum-onlooker of a NetBeans Community Docs sub-project.

    Soon, i plan to start on either/both of the following:

    1. Python support for NetBeans
    2. XAM related utility for NetBeans


  3. What in your opinion do such contests help in?

    Any Open Source project helps in making a better programmer. Further such contests help in motivating you further with cool prizes and goodies.

    It also helps in learning the dynamics of Open Source, which is getting to know the functioning of a distributed development scenario. IT biggies like Sun are playing an active role in Open Source, so you are making yourself future-ready.

  4. Give us your thoughts on Sun Microsystems as a propagator of Open Source technologies

    I am absolutely in love with the Open Source efforts at Sun. I currently work on ODF Toolkit for Java, NetBeans projects - both of which are Sun backed projects. The engineers involved are great mentors, friendly, and quick to help you. I look forward to be a part of the Open Source team at Sun.

  5. How important is open source technology for students?

    It is very important. Some of the benefits are:

    • Makes you a better programmer
    • It makes you think, since you are your own guide
    • Makes you future ready

Thank you Sun!

November 7, 2007

NetBeans + XGL

Check this cool blog post entry here:

http://linux.maxblog.eu/?p=5337

November 4, 2007

No Monopoly Please

Google, for most people, including me is all good. Rarely, if at all do we found that Google and/or its policies, services are criticized or even a bad word said. But, as Google grows, which it is - as shown by its rising share prices, swords are being sharpened to start looking for loopholes, malicious intent in things that Google do. When, a company grows - rocketing share prices, large scale acquisitions of medium-to-small firms, more services - one word starts following the company- Monopoly.

Some days ago, in a casual conversion I had carelessly remarked to my friend that once people identifying the word Monopoly with Google, then a Google-bashing will start and soon Google will be evil, in a way Microsoft is today.

And then going through the Slashdot headlines, I was just surprised to see the heading of an article : "Google As The Next Microsoft?" and I knew it for sure, that it was related to my earlier mentioned careless remark. This was only confirmed by reading this article :"Google is starting to look a bit like Microsoft"

Just as in real life, we often disapprove of the monopoly of a person and do our best to criticize/bring down that person, so is in IT. None wants monopoly- MS or Google - spare NONE

November 2, 2007

Search Google from your Perl Script

This article here at http://linuxgazette.net/115/okopnik.html contains a Perl script by the author via which you can search Google from the shell. The script uses 'w3m'. If you are interested to use Mozilla Firefox, just modify it as follows:

#!/usr/bin/perl -w
# Created by Ben Okopnik on Tue Feb 12 07:03:34 CST 2002
$browser = "/usr/bin/mozilla-firefox";

exec $browser, "http://www.google.com/advanced_search" unless @ARGV;

for ( @ARGV ){ s/.*/%22$&%22/ if y/ /+/; $s .= $s?"+$_":"$_"; }

# $ENV{LANG} = "en_US.UTF8";
exec $browser, "http://www.google.com/search?num=30&hl=en&as_qdr=all&q=$s&btnG=Google+Search"

LinuxGazette: November-2007 Issue #144

The LinuxGazette November issue is out.

Here is the TOC:

Article:NetBeans Community Docs

NetBeans Community Docs has got print media coverage in India via Linux For You's November 2007 issue which has this article titled "NetBeans Community Docs" (by me), also featuring an interview with James Branam, the NB Community Docs Manager.




Since it is a print publication, it is not available online now. A copy may be obtained though by pinging me back.

Open JDK extends Sun JDK

"Open JDK extends Sun JDK" out in the November 2007 issue of Linux For You looks at Open JDK- motivation, current status, future and finally winds up with showing how you can start working with the open source version of 'javac' using NetBeans.

The Article

Since, this is print publication, it is not available online. Those, interested can however ping me back for a personal copy.

NB Community Docs: NetBeans Platform ClassLoader Trick

The NB Community Docs has got a new contribution- a short tip titled "NetBeans Platform ClassLoader Trick".

Do check it out!


The NB Community Docs is growing and we are having more contributions each passing day. Looking forward to a "Sweet November" for the NB Community Docs.