Thanks a ton !!!

Thanks a lot for your continuous support to this blog. Your every visit to this blog motivated me to spend more time learning new things and sharing them with you.

For all your support, i owe you so much. But i do realise that what best i could do to repay you is to do better things and, of course, the same thing better.

As a first step, this blog has been now moved to the newly launched http://www.arunma.com. More and more things are to come to this site and I will be very happy if you offer the same support you gave for this blog.

I promise that I will continue to do my personal best.

Thanks.
Arun

Sub domain, Parked domain and Add on domain

Sub domain

  • Lets say your domain is mysite.com.
  • You install a Message Board and put in in a directory called mysite.com/board/.
  • You can turn the directory board into a sub-domain by adding it as a sub-domain from your Control Panel.
  • Now you can access your Message board as either mysite.com/board OR board.mysite.com
  • This costs you nothing and is free.

Parked Domain

  • You have two domains mysite.com and my-other-site.com.
  • mysite.com is the domain of your website and you want to add my-other-site.com.
  • You want them both to go to the same place. In other words, when someone types either www.mysite.com or www.my-other-site.com they will go to the same page(s) on your website.
  • In order to have additional parked domains you need to purchase the additional domain(s).

Add-On Domains

  • You have two domains mysite.com and my-other-site.com.
  • You want the two domains to be totally separate/independent websites.
  • In order to have additional parked domains you need to purchase the additional domain(s).

source : http://webnet77.com

Open Document gives Office a new look


We know that Open Document Format or simply ODF is a widely used XML based document representation format to which Sun is the key contributor. OpenOffice, KOffice and a lot other office suites stores its documents in any one of the following OpenDocument formats by default

  • .odt for word processing (text) documents

  • .ods for spreadsheets

  • .odp for presentations

  • .odg for graphics

  • .odf for formula, mathematical equations

Though, these suites support the proprietory and popular .doc, .xls, .ppt formats, Microsoft had, for a long time gave a deaf ear to what happened on the “other” side. It never even cared to support these formats for a long time.


But after a biiiiiiigggggggggggggg annoucement by the State of Massachusetts that “we cannot have our public documents locked up in some kind of proprietary format, perhaps unreadable in the future, or subject to a proprietary system license that restricts access”, Microsoft started financing the ODF plugin for Word last year (under BSD license, of course). A lot of third parties, even before Microsoft, announced that they are developing plugins for ODF in Office environment.


All this happened last year. So, why this blog now? The popular open document format has just been approved as an ISO standard. And the Open Document Foundation Inc has annouced complete development of ODF plugins for Office suite. With it, every 32-bit Windows user can use ODF. They are planning to distribute the plugin bundled with the Google Pack. Oops !!! (Google always gives me that heart attack)


Now that we see a huge migration of windows users to Linux flavours, this plugin surely gives an extended life to MS Office. But then this should really have given Gates a taste of his bitter future.


Edwards, co-founder and president of Open Document Foundation Inc, says that he’s now waiting for the “Microsoft ODF plugin to show up. Microsoft has said that if the demand is out there, they will produce it. If Bill Gates holds up a finger to judge the wind for ODF demand today, he’ll get his arm ripped off.” :-)

 

WebRowSet — Playing XML with Database


We already know that ResultSet gets closed once we close our Statement object. So, prior Java 5.0 we were just “migrating” the ResultSet values to a Collection of Value objects.. But, bundled with Java 5.0, the “disconnected” RowSet came up. Although there is a rowset.jar that could be used with Java 1.4, most people still follow the conventional “migration” process.

We know that there are three kinds of RowSet implementations, the CachedRowSet (one which stores the data in memory. best suitable for less quantity of data), the JDBC Rowset (I really havent used it yet. They say ResultSet could be used as a Java bean.) and my personal favourite, the WebRowSet.

WebRowSet typically fetches your ResultSet in an XML format. You could just use a plain Javascript DOM parser or an XPath language and just show the data on your HTML page.

I just wrote this small program so you could feel what i felt.

So, I have my getConnection() method to link my app to the database.

public Connection getConnection() throws ClassNotFoundException, SQLException {
Class.forName(“com.mysql.jdbc.Driver”);

Connection con = DriverManager.getConnection( “jdbc:mysql://localhost:3306/ukc”, “root”, “orange”);

if (!con.isClosed())
System.out.println(“Connection created”); return con;
}

Then i am just using the connection to fetch some data

public WebRowSet getWebRowSet(Connection conn) throws SQLException {
Statement statement = conn.createStatement();
ResultSet rs = statement.executeQuery(“select * from Products”);
WebRowSetImpl webRowSet = new WebRowSetImpl();
webRowSet.populate(rs);

return webRowSet;
}

And finally a main program to link these two methods and write the XML to the Console

public static void main(String[] args) {

WebRowSetSample rowSetSample = new WebRowSetSample();

try {
Connection conn = rowSetSample.getConnection();
WebRowSet rowSet = rowSetSample.getWebRowSet(conn);
//I am writing output to Console. Just pass an OutputStream to the writeXml method
rowSet.writeXml(System.out);

} catch (Exception e) {
e.printStackTrace();
}

}

tabledata

output

Debugging Javascript errors in Firefox

errorconsole


You know very well that Mozilla Firefox is a much much better browser than the IE. But one thing i missed during development testing with Firefox is the debugging of Javascript error messages. IE would just pop us a very useful ‘Object expected’ message. ;-)

Ignorance had the best in us. Actually, Mozilla gives a wonderful Javascript AND CSS console to play with. To view the console Click TOOLS — > Error Console.

ANTlr – The Mountain problem

Recently, I was trying to integrate Struts with Hibernate 3.2 under Weblogic. And i had this big pestering exception…

javax.servlet.ServletException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken [from com.g2h.biz.vo.Category category]
at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:909)
at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:873)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:812)
at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:3281)
at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppServletContext.java:3226)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:3207)
at weblogic.servlet.internal.HttpServer.preloadResources(HttpServer.java:694)
at weblogic.servlet.internal.WebService.preloadResources(WebService.java:483)
at weblogic.servlet.internal.ServletInitService.resume(ServletInitService.java:30)
at weblogic.t3.srvr.SubsystemManager.resume(SubsystemManager.java:131)
at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:966)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:361)
at weblogic.Server.main(Server.java:32)

The reason for this problem is this. Both Weblogic and Hibernate was using “antrl.jar”. Weblogic 8.1, that i was using, had an “antlr” jar bundled inside its weblogic.jar. Since server libraries had preference over the jars in our application, hibernate wasnt using the latest antlr jar in my web application’s lib folder.

Solution that i used :

Put the following lines in your “.cfg.xml” inside your session-factory tag

classicquery
There is a biggggg discussion in the hibernate forum on this issue. It also had another solution for weblogic. To add the following tag inside weblogic.xml

weblogic.xml

Autoboxing Kickboxing ;-)


Sorry for not posting last week. Had a tight work schedule.

Here is an interesting feature of auto-boxing, which you know, was introduced with Java 5.0 where you could directly assign a primitive to a Wrapper (eg. int value to a Integer wrapper.)

Meaning….something like

Integer a = 10;

Here goes the interesting part of this feature.

Integer a = 10, b = 10 ;
Integer c = 128, d = 128 ;

System.out.println( a == 10 ) ;
System.out.println( a == b ) ;
System.out.println( c == 128 ) ;
System.out.println( c == d ) ;

This is the output for the above snippet

true
true
true
false

Strange Isnt it? ‘a’ and ‘b’ holds the same value. And they are the same. Good. But “c” and “d” also holds the same value but they arent equal !!!

Sun has something as an interesting explanation for this…

“If an int or short number between -128 and 127, let r1 and r2 be the results of any two boxing conversions. It is always the case that r1 == r2.”

It seems that -128 through 127 are cached. God knows why they did this.

Solution :

Use intValue() during unboxed comparisons. The following code would return true.

System.out.println( c.intValue() == d.intValue() ) ;

source: http://java.sun.com

Minimo and Opera Mini

Opera has released its latest version of its browser for mobile phones. The Opera Mini. For a download point your mobile browser to http://mini.opera.com/tv2/.
Or just download the installable to your computer and transfer to your mobile.

opera mini

“Mini doesn’t pull pages directly, but is kind of like a browser-front end, so you can be assured that Opera’s speed and screen-crunching powers will work their magic without you having to download a 4MB JAVA app every time you want to get on the Internet.”

If you are a fanatic Mozilla user, you just need to point your browser to http://www.mozilla.org/projects/minimo/ for the Mozilla Minimo.
minimo

Tired of .net


Sick of your .net applications and would love to have a button that just converts your .net applications to Java? Here is it.

Started in May last year, NET2Java translates any .NET source code to Java source code. It currently supports VisualBasic and C#.

The good news from NET2Java is that it got open-sourced under GPLv2 this month and is currently in the incubator of java.net. There are however, previous stable versions of the project.

“And if you have a friend struggling with .NET, do let them know there is an exit strategy.” ;-)

No Java on Apple iPhone


“Java’s not worth building in. Nobody uses Java anymore. It’s this big heavyweight ball and chain.” This is what Steve Jobs quotes. Are they planned to run a Enterprise Server on iPhone. I guess Java ME was created just to enable Java to run on lightweight JVMs, especially Mobile phones. Millions and millions of people are downloading Java games everyday. I dont really know which planet Steve Jobs is in.

Ironically, Steve also quotes “iPhone is not meant to be a Smartphone series of phones”. Without Java, it surely wouldn’t be.

Check out the hot comments in http://www.theserverside.com/news/thread.tss?thread_id=43850#225422

Next Page »


 

February 2010
M T W T F S S
« Feb    
1234567
891011121314
15161718192021
22232425262728

Top Clicks

  • None

Archives

a