Wednesday, November 12, 2008

Get Pootled!!

Pootle stands for PO-based Online Translation / Localization Engine.
It has few cool features which are listed below:-

1. Greater flexibility for translators and new translators, you don't have to worry about the programming.

2. Cool feature is experiencing the translation of Pootle itself in you language on the fly, When you log in, you can override this language by choosing something else than the default. If your browser is configured to request Kannada, Pootle should automatically use that as the interface language for new users (who are not logged in).

3. Has online review, merging facilities etc..

4. Cool quality check on the fly and Translators can do a online testing very quickly.

6. Obvious, QA testing for po files are also listed here.

5. It is an open source free software and any one can use or contribute to it. It just has couple of steps to get the login and people are so responsive that they will help you in getting started.

So folks keep up the spirit, time to get involved in translating your Mother tongue!

Get Started now!! Good Luck!!

To read more about this visit here

Tuesday, October 21, 2008

NetBeans and JavaFX

Tutorial Requirements

This tutorial requires the following technologies:

* Java SE 6 Development Kit (JDK) software must be installed on your system. You can download the required version of the JDK for your platform from one of the following sites:

o For Windows. Download Java SE 6 Update 7 or later. If you choose to use the Java SE 6 Update 10 Beta version, both the Java SE Development Kit (JDK) and Java SE Runtime Environment (JRE) must be downloaded and installed. Two separate Download buttons are on the download page for Java SE 6 Update 10 Beta.

Note: The Java SE 6 Update 10 Beta version provides additional features, such as the ability to drag applets. You must update your browser's plugins to use the updated version of the JRE if you want to use applets to run JavaFX applications. Plese refer to your browser's documentation for assistance.



In this tutorial, you created a simple JavaFX application and explored some of the features offered in the NetBeans 6.1 IDE to support the JavaFX programming language. The IDE with JavaFX support provides you the means to develop your rich internet applications using the JavaFX programming language.

Monday, October 20, 2008

Happy Birthday NetBeans!!!!!!

I just like to dedicate this video to Netbeans..

Vision 2020!!!

Pals,
NetBeans as I see in future looks more catastrophic and blasting.. Well with all whelm I'd love to see the psychic part of me here.. Netbeans- No wonder as the word suggests might be a virtual vegetable for all those geeks hangin around comp 24x7.
Who knows what possible wonders would NetBeans create as time moves on.. It might go up to virtual Reality. We might expect a Virtual Reality plugin for NetBeans which would allow us see what our mind can ever imagine. We might expect NetBeans to be used in the field of Medicine. In therapies, Operations, Transplantation. We can as well expect NetBeans to be used in extensive Space exploration, Who knows one day Space Shuttle would be programmed using NetBeans :). NetBeans would even find it's application in the field of Neural Networks to train Robotic Brains which could match Human skills. I wish NetBeans would run on all possible platforms including PSPs, Handheld devices, Mobiles...
Netbeans might be the most fantabulous Grand Unified IDE supporting all possible Programming Languages including Hardware simulation programs as well..
NetBeans everywhere.. It would be an era of NetBeans. It might become a concept and an idea in itself.
Oops I'm out of my dreamz..
INSANITY RULZ

Disclaimer:
The above published article is in no way relevant to the possibility of it being true to the most extent possible. The author doesn't guarantee the truthfulness or fallacy of the article in any conceivable way. Believe it at your own risk. <(B)

Happy Birthday NetBeans!!!

Folks,
10 years ago a hero was born to bring the behemoth to its knees. Today he is more than a hero. Wonder not who he is...

It is our great Human Friendly IDE NetBeans....
Yes frenz, join me to celebrate it's Tenth Birthday with great Pomp and Show... On this auspicious occasion I take this small step to bring laurels to our Dream come true IDE, the one and only Netbeans.

Come one and all join me and be a part of the Birthday Paartay of Netbeans. Gift Netbeans by submitting more and more plugins as well as Docs..
Three Cheerz to NetBeans..

Netbeans Rocks more than ever.....

Monday, June 30, 2008

Refactoring Improvements for i18n Module in Netbeans'

Refactoring is the process of making changes to an application's code without affecting the outward behavior of the application.Refactoring feature could be extended to i18n module of Netbeans too.

Following are the missing features related to Refactoring that can be successfully implemented on Netbeans if nurtured properly,

Scenario 1: *.properties file of every project must be synced effectively with the source. Say I have a file named Foo.java inside a project that contains a properties file named abc.properties. Assume that I have internationalized most of the Hard coded strings in Foo.java whose corresponding key-value pairs are placed in *.properties file. I deleted few of the Hard coded strings from Foo.java. But my abc.properties file doesn't reflect that change. It may soon lead me to confusion if I have several key-value pairs in properties file.

Suggested Solution: It'd be better if my abc.properties could dynamically reflect the changes I made to my Foo.java file. Life would have been much better for people like me. When few strings are deleted from the original Source file, User must right click inside the editor and he should see an option like "Sync" and when clicked on it properties file should change accordingly.

Scenario 2:Imagine I have several properties file in different directories but under a single project. I need all of them under same directory during runtime.

Suggested Solution: When user right clicks inside the editor he must be able to see an option like "Resolve Property file dependencies". When clicked all properties file must be dumped into a single folder and the respective paths must get updated in the original source file.

Another probably missing feature is the Auto Completion (intuitive String completion) feature.
Scenario:Say I have put a certain no. of key-value pairs in my properties file. Now when I try to use them in my original source file, when I write a code like this:
Nbbundle.getBundle().getString("SEVERAL_KEYZ");
code completion popupmenu should appear showing the available keys.

Thursday, May 29, 2008

GUI Internationalization in NetBeans

Internationalization is one of the popular project which is moving at faster pace now-a-dayz. Netbeans has its own internationalization module. Internationalization permits applications to be adapted to various languages and regions without requiring engineering changes or recompilation. Internationalized programs enable textual elements, such as status messages and GUI component labels, to be stored outside the source code and retrieved dynamically rather than hard-coded in the program.

Here is a use case of simple GUI being Internationalized.

Open a new project with JFrame form added. (you can do this by right clicking on the project node then New and selecting JFrame Form).
I created a simple GUI to demonstrate the steps.

Now right click on project node and go to New->Other->Other->Properties.
Name it Bundle. Add the following contents to that file.



Now you need to set the name of the respective component by right clicking and editing. Note that the name must be similar to what you have written in Bundles file.
Open the UI class in the design mode. Right click on Form node->Properties.
You should see a window like this.


Check Automatic Internationalization. Click on ellipsis(..) to select the desired locale. I have chosen French(fr_FR). Right click on Bundle.properties and open it. You should see something similar to this,


Save it.Go to Design mode window(Editor Window). Now in the navigator window right click on the Form option and Reload.
Right click on the project name node, Goto properties->Run then enter this
"-Duser.language=fr -Duser.country=FR" (Without Quotes)
in the Virtual Machine Argument TextField and run the project.You must see your GUI Internationalized.



Howz That now......

Thursday, May 22, 2008

Another war of Titans


Good news for all students worlwide,
Sun has officially launched Student reviews contest for students as well as Sun Campus Ambassadors. Loadsa prize to be won. Here are some details,
The contest will have two groups: one for students who are not Sun Campus Ambassadors, and another comprising Sun Campus Ambassadors. For each group, there will be a grand prize of $250 in Visa Debit Card, and 5 second prizes of $100 each in Visa Debit Card.
Hurry up guys as the last date for the entry is June 6, 2008.

All the best! Get going!....

Sunday, May 18, 2008

Checking out projects from Java.net through Netbeans

Hi folks,
Recently I got interest(not sure from where) in CVS and SubVersioning. The features(integration etc) provided by NetBeans is excellent to do check outs. Be it CVS or SVN.
Out of curiosity I decided to check out a special project hosted on java.net. It is Aerith.
It has many dependencies. It requires JDK 6.0 and later versions to run. You need to download JOGL . Be sure to download jogl.jar as well as the jogl native libraries for your platform.
Install JOGL by unjarring the jogl-natives[your platform].jar file. It should create several native libraries. Put the native libs in your library path(/usr/lib/ in my case) and the jogl.jar in your classpath. It also requires dependency jar files like JLayer 1.0 and TimingFramework .
Now you need to check out the source code for swingx . For this to happen you need to create an account on java.net.
Open NetBeans, go to Versioning->CVS->Checkout as shown,



then enter the name of the module.


Click finish. You will see the source code being downloaded to the above mentioned directory.


Now you need to download the code for Aerith project from SVN. To check whether svn is installed or not on linux type svn in console. You need to download the rpm package or the source code to install it otherwise. You will get further information about SVN on linux here. Download and instaalation instructions are here. I just did apt-get install svn (I use kububtu Hardy Heron).
Check out the version of svn by issuing svn --version command. NetBeans needs another svn client to be installed on your system. NetBeans 6.1 supports versions > 1.3. The clients which I know are kdesvn and rapidsvn.

After you install a svn client you need to provide the installation path of these clients to NetBeans. By default it is /usr/lib/ on linux. Go to Versioning->Subversion->Checkout. It'll ask you to enter the path. If it is proper you should see a window similar to this.

Input the proper repository URL and click Next,

If you are not sure about the repository folder click browse button. Browse the repository for folder containing the proper source code and click finish.

Now that the checking out is over , you need to resolve certain dependencies. Open the project you checked out. Right click on the project and go to Resolve Reference Problems. Click on resolve to locate the required jar libraries on your system. Now you need to tell Netbeans where your Jogl.jar is. Right click on Libraries under your project tree. Then click on Add JAR/Folders and locate the relevant jar file. Now build the project.
Note: I got the following errors:
init:
deps-jar:
Created dir: /home/rajath/NetBeansProjects/trunk/build/classes
Compiling 99 source files to /home/rajath/NetBeansProjects/trunk/build/classes
/home/rajath/NetBeansProjects/trunk/src/com/sun/javaone/aerith/g2d/AnimationUtil.java:20: package com.sun.xml.internal.messaging.saaj.soap does not exist
import com.sun.xml.internal.messaging.saaj.soap.Envelope;
/home/rajath/NetBeansProjects/trunk/src/com/sun/javaone/aerith/ui/ActionButton.java:35: package com.sun.xml.internal.messaging.saaj.soap does not exist
import com.sun.xml.internal.messaging.saaj.soap.Envelope;
/home/rajath/NetBeansProjects/trunk/src/com/sun/javaone/aerith/ui/WaitOverlay.java:31: package com.sun.xml.internal.messaging.saaj.soap does not exist
import com.sun.xml.internal.messaging.saaj.soap.Envelope;
/home/rajath/NetBeansProjects/trunk/src/com/sun/javaone/aerith/ui/fullscreen/IndyFullScreenRenderer.java:49: package com.sun.xml.internal.messaging.saaj.soap does not exist
import com.sun.xml.internal.messaging.saaj.soap.Envelope;
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
4 errors
BUILD FAILED (total time: 6 seconds)


Click on the errors to navigate to the respective location of the source code and try to resolve unused imports. Save it and rerun the project.
Ah.. Now you must be able to see the gorgeous Aerith window. Enter your Flickr username and enjoy. If your username is invalid you may end up in getting Exceptions.
Few ScreenShots of Aerith:

You can browse photos. You can prepare a trip report and do lots more.

It is a Filthy Rich Client Application.

Tuesday, April 15, 2008

I'm back with NetBeans Profiler

I had been playing around with NetBeans profiler for past few days. All I can tell is that NetBeans Profiler is one of its kind and the most gorgeous tool in NetBeans.


Getting Started
Prior to using Profiler with any project we need to set the profiler to get accurate results later and to integrate the tool with your project. To achieve accurate results profiler must be calibrated in the beginning. To do this go to Profiler-->Advanced Commands -->Run Profiler Calibration. A dialog box appears where you need to select your JDK.



The calibration needs to be run only once. However if any significant changes are made to your machines, you need to run it again. A dialog box appears after the calibration where you can check the info about calibration and it also saves the calibration information in .nbprofile in your home directory. The profiler tool profiles the main project by default, However you can select the project you want by right clicking on the required project and selecting Profile option in the pop-up menu.

The profiler tool window appears wherein you can select the required action.



To integrate with the project, the IDE modifies the build script of your project to import an additional build script for the required profiling libraries. Before modifying the build scipt, the IDE creates a backup of the original build script. You can restore the original build script by choosing Profiler > Advanced Commands > Unintegrate from the main menu.

IDE provides you different profiling tasks which you can select according to your needs. The following table describes the profiling tasks and the profiling results obtained from running the task.
Profiling Task Results
Memory Application
Choose this to obtain high-level information about properties of the target JVM, including thread activity and memory allocations.
Analyze CPU Performance
Choose this to obtain detailed data on application performance, including the time to execute methods and the number of times the method is invoked.
Analyze Memory Usage Choose this to obtain detailed data on object allocation and garbage collection.


Monitoring an Application
The target application is starts soon after you click on the above option. Note that the overhead is low in this case.



To get the Telmetric view, under the view option (in the profiler window) select VM Telemetry, It must be something like this,

The Profiler window contains the controls that enable you to do the following:
  • Control the profiling task
  • See the status of the current profiling task
  • Display profiling results
  • Manage profiling results snapshots
  • See basic telemetry statistics
Analyzing CPU Performance
This part is quite interesting! CPU task allows you to profile the entire application or a particular code fragment (Of course you can select this!). It allows method by method execution.
You can select one of the options in the window,
  • Entire Application : The IDE instruments the entire code that you have written. It highlights the thread entry and exit points as well as calculates the time spent in each method.
  • Part of type Application : In this mode you can profile a particular code snippet of your interest. This significantly reduces the profiling overhead. You need to select the root methods in order to give profiler an entry point. Profiling data is collected when one of the application's threads enters and leaves the instrumentation root. No profiling data is collected until one of the application's threads enters the root method.


After defining the required root methods the same thread window pops up showing the thread execution status as well as the time taken by the entire method to run. You can view the Signal Dispatcher (it shows the status of selected threads) in the thread window by selecting the appropriate threads in the main window of the threads. Screen Shot of my app is shown below:



Analyzing Memory Usage
This mode gives you information regarding allocation to memory to objects, type if objects etc etc.
You can select one among these :
  • Record object creation only : When this option is selected, all classes currently loaded by the target JVM (and each new class as it is loaded) are instrumented to produce information about object allocations.
  • Record both object creation and garbage collection : When selected, profiling the application gives you information on object liveness such as about how many objects of each type are still alive, their size and average age, as well as allocation data.


You can also view the live results by selecting live results under the profiler menu in profiler window.



Taking SnapShots
You can obtain the memory snapshots of your application and also see the allocation stack trace for any object you want.
To do this,
  • Make sure that the profiler is still running, otherwise go back to your project, right click on it and open profiler tool again as mentioned before.
  • Open up the Live Results from the Profiler window, right click on an object whose stack trace you want and click on take snapshot.

The IDE takes the memory snapshot and opens the snapshot to the Allocation Stack Traces tab where you can explore the reverse call tree for methods that instantiated this object.

Sunday, April 6, 2008

New Language Support in NetBeans 6x

Few days ago I happened to come across Project Schliemann , I already had interest for providing VHDL Language support in NetBeans. Prior to Project Schliemann I was struggling to set up syntax highlighting support, code Folding & parser. Again I had to go thru lots of Netbeans APIs like Nodes APIs, File System APIs etc. It was a heck for me atleast! Days went on and I kept wondering when I'll kickstart my work. Then suddenly as though god had answered my prayers Project Schliemann came to my rescue. Thanks to the team of Project Schliemann.

I think I needn't explain what project Schliemann is about.
Schliemann project implements Generic Language Framework for NetBeans IDE. Schliemann engine allows one to describe some programming language and define how to integrate it to the NetBeans. Each programming language is defined in one nbs (NetBeans Schliemann) file. New declarative language has been created for that purpose.

As normal, In the first step you should describe the language - lexical part (define tokens using regular expressions) and syntax (grammar rules). In the second step you can define how to visualize this language in NetBeans. You can define colors for tokens (syntax coloring) or folding (based on grammar rules). You can define what parts of this language should be displayed in the navigator, and how to indent this language plus many other features.

Here I go with my findings,
- NetBeans is bundled with GLF support and shipped. It must not be difficult for users to extend the IDE to support their favorite language. Start with a new Netbeans module project:



Define the code name base and Display name on the next page:




New project is created when the finish button is pressed.

Now a new language support is to be added so right click on the project root node, then choose Language support (or Other-->Module Development-->Language Support)



Select the mime type as shown below:



After this you should see a language.nbs file in the editor window. It creates syntax definitons, grammars, color highlighting etc etc for an artificial language. It can be modified according to the
need of language description. This module can be directly built and installed now.


However if one wishes to see the changes made to his nbs file in the output file ( Example.vhd in my case) immediately, the following steps must be followed.

1. Open Advanced Options Dialog first (Tools--> Options action and Advanced Options button).

2. Select IDE Configuration/System / Object Types / Generic Languages Framework Objects node in Advanced Options Dialog.

3. Open "GLF Files" property for editing & press "..." button. A dialog box appears where the corresponding mime type can be selected for editing.

4. Select the mimeType ("text/vhd" in my case) there and press "Edit" button.






Now onwards, all the changes made in the nbs file will be reflected on the actual file type opened!
Lexical Structure of the Language can be defined in the way one wants! Here are few regular expression constructs-
'a' character a
"abc" string abc - syntax is the same like in Java (\t, \n, ...)
"ab"i case-insensitive string, i.e. ab, Ab, aB or AB
['a' 'b' 'c'] charater a, b, or c (simple class)
[^'a' 'b' 'c'] any character except a, b, or c (negation)
['a'-'z' 'A'-'Z'] a through z or A through Z, inclusive (range)
. any character
'a'? character a once or not at all
'a'+ character a one or more time
'a'* character a zero or more time
XY X followed by Y
X/Y Either X or Y
(X) X, as a capturing group

Example:
TOKEN:identifier: ( ['a'-'z' 'A'-'Z'] ['a'-'z' 'A'-'Z' '0'-'9']*)
Here is the list of Tokens( To be modified later) I declared:



A statement can be skipped by using the SKIP keyword as shown,
Example
SKIP: comment

Note that the comment has to be declared as a token prior to the usage of it with this keyword.

Grammar has to be defined for the language, here is a pic of my grammar definition



Coloring can be done in an easy fashion:
Supported properties:

  • color_name: Name of color. elementName is used for name of color if its not specified.
  • default_coloring: Defines parent coloring (operator, keyword, identifier, whitespace, number, char, string, comment).
  • foreground_color: Foreground color (for example "white", "FF00FF").
  • background_color: Background color.
  • underline_color: Underlined color.
  • wave_underline_color: Wave underlined color.
  • strike_through_color: Strike through color.
  • font_name: Name of font.
  • font_type: Font type (like "bold" or "italics-bold").

Code Folding is also made easy. Any grammar rule can be code folded.

Syntax:

foldDefinition = "FOLD" ":" identifier [ ":" parameters ( "\"" text "\"" ) | methodCall ]

Where identifier is name of some grammar rule.

Examples:

FOLD:additiveExpression
FOLD:additiveExpression:"$multiplicativeExpression$ + $additiveExpression$"
FOLD:additiveExpression:org.foo.Foo.method

If some part of code is folded, there is some text written in place of it. There are three ways how to specify this text.

  1. If you do not specify the text, default text ("...") is used.
  2. You can specify text directly. And you can use some expressions inside this text.
  3. Text can be obtained from some method call.
Here is my code which is an example for it.


Here is a screen shot of sample vhdl file in Netbeans. It looks very cool for me!!



I'm exploring more and more. There are many more things included in this brilliant project. I wish to come up with it in future. It has made life so easy for coders like me :)

Saturday, April 5, 2008

My First Post

Hi folks,
Finally I'm set to blog! I must say that this is the brilliant way of communicating with the world. Thanks to blogger.com. Well it's a fun IMO to blog. Its a kinda brain draining. Whateva it is, I will try to put up everything in a decent manner.

Thursday, April 3, 2008

NetBeans Blog Contest


Hi Folks,
My blog will be mainly Netbeans centric! I'm set to submit this blog for the NetBeans Blogging contest. Its a wonderful opportunity to discover plethora of things in NetBeans the only IDE you need. I'm set for it now. Wish me all the best frenz!