- my webspace

- my webspace

Latest Comment

Allama Iqbal - Selective verse...
Great Job
You have dont a great job of collecting these... Even I had ...
25/08/09 07:01 More...
By Sikandar

O ye who don't believe !
It's like Lehman Brothers :grin
11/10/08 16:31 More...
By anurag Chaturvedi

I Protest
@Sikku
Thanks Sikku for the feedback. I never intend to blame, a...
29/07/08 17:06 More...
By Aminur Rashid

I Protest
Great !!!
:zzz this is a wonderful story and very honest from the hea...
29/07/08 10:33 More...
By Jennifer Gallagher

I Protest
The blog is good, but the contents show that the serial blas...
29/07/08 10:26 More...
By Sikandar

Login






Lost Password?
No account yet? Register

Tell a Friend

Home arrow Java
Quick logger PDF Print E-mail
User Rating: / 0
Written by Aminur Rashid   
Saturday, 14 August 2010
.

Post JDK1.5 you can create a quick logger(if you are not using apache log4j for some reason)as below:

 public Logger {
    public static void log(String msg) {
        System.out.printf("%s : %s",Thread.currentThread().getStackTrace() [2],msg);
    }
}

.

Be first to comment this article | Add as favourites (2) | Quote this article on your site | Views: 77

Last Updated ( Saturday, 14 August 2010 )
 
When false is true PDF Print E-mail
User Rating: / 1
Written by Aminur Rashid   
Thursday, 12 August 2010
.

While trying to explain reflection to one my young friend, I finally ended up writing this code:

package aminur.test.mutate;

import java.lang.reflect.Field;

public class MutableString {

	public static void main(String[] argv) {
		mutate();
		System.out.println("TRUE".equals("FALSE"));
	}

	public static void mutate() {
		try {
			String t = "TRUE";
			String f = "FALSE";
			Field val = String.class.getDeclaredField("value");
			Field count = String.class.getDeclaredField("count");
			Field off = String.class.getDeclaredField("offset");
			val.setAccessible(true);
			count.setAccessible(true);
			off.setAccessible(true);
			

			count.set(t, f.length());
			val.set(t, f.toCharArray());
			off.set(f, off.getInt(f));
		} catch (Exception e) {
			e.printStackTrace();
		}

	}

}

This won't work in 1.3/.4 but will work in higher/lower version of JDK

The bug #5044412 fix(?) may disallow setting of value of fields.

Be first to comment this article | Add as favourites (6) | Quote this article on your site | Views: 103

Last Updated ( Thursday, 12 August 2010 )
 
Jdeveloper extension for JavaFX - II PDF Print E-mail
User Rating: / 0
Written by Aminur Rashid   
Friday, 26 February 2010


In the last JDeveloper extension for JFX I used the initial release of JavaFX. The support for compiling a javafx file was missing in the extension. Moreover, the extension didn't make use of the JavaFX SDK.

I have finally upgraded the extension, to use the JavaFX SDK. With this, we no longer need to add the ".fx" extension to the list of files to be copied to classpath during compilation.

The extension works on the assumption that an entry in environment PATH is set, which points to <JAVAFX_SDK_HOME>\bin folder.

There is no Drag and Drop support yet. And of course there will be bugs which you can point out or fix.

To use the new extension, please remove the old extension jar from jdev_home\jdev\extension folder and add the new jar oracle.jdeveloper.javafx2.jar to folder. Restart Jdeveloper. [Once more, please do not forget to add <JAVAFX_SDK_HOME>\bin to your system PATH variable].

You can download the JavaFX SDK from javafx website.

Be first to comment this article | Add as favourites (19) | Quote this article on your site | Views: 380

Last Updated ( Friday, 26 February 2010 )
Read more...
 
Jdeveloper extension for JavaFX PDF Print E-mail
User Rating: / 0
Written by Aminur Rashid   
Saturday, 20 February 2010


JavaFX is an expressive rich client platform for creating and delivering rich Internet experiences. More on JavaFX can be found at http://javafx.com/.

JavaFX was the Official Rich Client Technology for the 2010 Winter Games. [http://www.oracle.com/us/corporate/press/049166]. I forsee the technology getting a push from Oracle specially after the Sun-Oracle merger. Infact I have read somewhere that JavaFX will be same to java Swing, what JSF was to Struts.

And it was surprising to find there is no support in JDeveloper currently for JavaFX. (Offcourse now with Sun deal, Netbean with JavaFX support goes to Oracle but still for the lovers of Jdev its missing.)

 

Be first to comment this article | Add as favourites (27) | Quote this article on your site | Views: 448

Last Updated ( Saturday, 20 February 2010 )
Read more...
 
Using oracle graph/bi graph without datacontrol bindings PDF Print E-mail
User Rating: / 1
Written by Aminur Rashid   
Friday, 28 August 2009

Oracle had this excellent graph utility in the earlier releases of Jdeveloper. It was Bi-graph, which user can use to represent the data in graphical forms. This has been replaced in JDeveloper 11g by DVT component. However, the new Faces DVT component forces user to use Faces components, which may not be a requirement always. Neverthless, both the components (old BI graph and latest DVT components) are closely tied to the Datacontrols. What if user has Hibernate at the server side and want to use these components. The writeup, descibes one of the different ways, to show the data using BI Graph.

The IDE used was : Oracle Jdeveloper

Idea is to create an oracle.dss.thin.beans.graph.ThinGraph object in the background, set the data from any datasource (dummy data in this example), export the graph as image, and show in the JSP

Be first to comment this article | Add as favourites (47) | Quote this article on your site | Views: 441

Last Updated ( Saturday, 29 August 2009 )
Read more...
 
<< Start < Prev 1 2 Next > End >>

Results 1 - 9 of 10
Aminur Rashid