Archive for the 'Uncategorized' Category

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

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.

Google ads on hoardings…

 google

In a patent filing Google has revealed that it is looking into entering the physical advertising industry. The patent filing itself alludes to placing adverts on billboards, with the primary innovation being that they’re interactive and connected to the internet — what, you didn’t really believe that Google would go in for static ads did you?
read more…

 I knew most people know of this feature in Oracle but yet i just wanted to refresh your mind on this little yet powerful statement.

I just got reminded of this today because frankly this is the first time i am using it in work. We had a table something resembling the following structure.

All records

CHILDID is the unique id of a person with name NAME. His manager or his parent is denoted by the value in the PARENTID. NULL values in the PARENTID indicate that he is the “BIGGEST PARENT”.

We had this requirement. Pick up a childid somewhere in the middle of the hierarchy, say 103 and find his “root” parent. Meaning the parent of the parent of the parent (or the parent where the hierarchy ends).

Of course we can put a series of subqueries if we know the depth of the hierarchy. But Oracle provides this wonderful pseudocolumn called LEVEL and a few notable clauses.

Here is the syntax of the statement (Never mind. Syntaxes are always headaches).

Syntax:

SELECT…
[START WITH initial_condition]
CONNECT BY PRIOR recurse_condition

Key:

START WITH : The row(s) to be used as the root of the hierarchy

CONNECT BY : Condition that identifies the relationship between
parent and child rows of the hierarchy

The PRIOR keyword can be on either side of the = operator.

Done with Syntax.

Here we go,

CONNECT BY PRIOR childid=parentid will return a TOP-DOWN hierarchical results wherein the resultset starts with your child being the top most person and displays all the children of your childid.

i.e.

SELECT LEVEL, NAME, CHILDID FROM RELATIONSHIP START WITH CHILDID=103 CONNECT BY PRIOR CHILDID=PARENTID;

will return

child id parent id

CONNECT BY PRIOR parentid=childid will give BOTTOM-UP results. So, this the query we wanted …

SELECT LEVEL, NAME, CHILDID FROM RELATIONSHIP START WITH CHILDID=103 CONNECT BY PRIOR PARENTID=CHILDID;

parent id child id

The LEVEL pseducolumn returns a number indicating the level in the heirarchy: 1 for a root row, 2 for a child of a root, and so on. As we already know what we put after the START WITH statement becomes the root of the hierarchy.

Now, that we want the root parent, i just put a small hack around (I really dont know whether the following query is the most optimal one but yet gave what i really needed)

SELECT * FROM
(SELECT LEVEL, NAME, CHILDID FROM RELATIONSHIP START WITH CHILDID=103 CONNECT BY PRIOR PARENTID=CHILDID
ORDER BY LEVEL DESC)
WHERE ROWNUM<2>

(I am just using our original derived query as a view and extracting the top most record — forgot to mention the ORDER BY clause). Here comes what was needed. 

derived

Here is the complete SQL i used

–Table creation
CREATE TABLE RELATIONSHIP (CHILDID NUMBER, NAME VARCHAR2(50), PARENTID NUMBER)

–Population
INSERT INTO RELATIONSHIP VALUES (100, ‘ARUN’, NULL);
INSERT INTO RELATIONSHIP VALUES (101, ‘CHILD OF ARUN’, 100);
INSERT INTO RELATIONSHIP VALUES (102, ‘GRAND CHILD OF ARUN’, 101);
INSERT INTO RELATIONSHIP VALUES (103, ‘GREAT GRAND CHILD OF ARUN’, 102);
INSERT INTO RELATIONSHIP VALUES (104, ‘GREAT GREAT GRAND CHILD OF ARUN’, 103);
INSERT INTO RELATIONSHIP VALUES (100123, ‘NEVER KNEW WHO THIS IS’, 143143);

– Verification
SELECT * FROM RELATIONSHIP

–Top down results
SELECT LEVEL, NAME, CHILDID FROM RELATIONSHIP START WITH CHILDID=103 CONNECT BY PRIOR CHILDID=PARENTID

–Bottom up results
SELECT LEVEL, NAME, CHILDID FROM RELATIONSHIP START WITH CHILDID=103 CONNECT BY PRIOR PARENTID=CHILDID

–Derived query

SELECT * FROM (SELECT LEVEL, NAME, CHILDID FROM RELATIONSHIP START WITH CHILDID=103 CONNECT BY PRIOR PARENTID=CHILDID ORDER BY LEVEL DESC)
WHERE ROWNUM<2

Oracle 10g XE goes free

If you are Oracle user at home, you should have really felt the pain of the database server eating most of your system resources. Added to it, in all possibilities, we are using an illegal copy of the Personal Edition or the Enterprise Edition.

You would never imagine running Java applications against Oracle just because of the simple reason we can never run our application servers and database server and, of course, our IDE in a single machine. So, we just move in for MySQL, Postgre or other open-source alternatives.

You would have already known that DB2, just a few months back, came up with a free edition of its Database. And Microsoft is also coming up with its free edition of SQL Server 2005 as ‘Express Edition’

Oracle now joins the bandwagon. And, as always, Oracle is our favourite database.

(Please go through the document (at least the faq) and the pdf attachment for more details). The twp_general_10gdb_product

_family.pdf has a wonderful “feature comparison” table at the end of it.

Please dont get alarmed when they say Java development is not possible in Oracle 10g XE. They just mean that we cannot write Oracle PL/SQL stored procedures in Java. And i’ve still not seen anybody writing

“CREATE PROCEDURE DEPT_PROCEDURE AS LANGUAGE JAVA”

That because Oracle XE doesnt come with an inbuilt JVM. (You know Oracle 9i came up with JRE 1.4 bundled inside). Regular SQL, (ALL) PL/SQL, JDBC calls will just work fine.

Best part, Oracle 10g XE comes just as a 250MB iso image.

Linux users, who were denied of the privilege of using Oracle, just because we dont get a pirated version of the full database, can now download their RPM installers direct from the oracle site. Debian users (Ubuntu, Kubuntu, MEPIS, Mandriva, CentOS) can download their .deb installers. All installers are around the same size.

Good luck.

Eclipse.. the forgotten path

Ever tried opening up the plugins folder of Eclipse 3.1 or greater? What is the difference between the previous versions and the current ones? Just look at the screenshots.

Equinox bundles
Equinox is an Eclipse project to structure Eclipse software not just as a collection of plugins, but as a collection of OSGi bundles. OSGi bundles is an approach to break an application into components (jar files), large collections of classes with a unified interface that is well-encapsulated and easily reusable amongst multiple applications.

Most important part : OSGi also enables applications to dynamically load (and better yet, unload as well) these components at runtime as optional functionality is needed (and no longer needed). Meaning your SQL Plugins or XML Plugins actually do not get loaded during startup. They are runtime loads. God… my head rolls.

This helps the application manage its footprint, e.g. the memory that it consumes in order to run. Rather than using memory to load every option that any user may ever need, it only loads the kernel functionality and then loads optional functionality when the user asks for it by loading OSGi bundles.
Equinox helps formalize an approach to developing Eclipse applications as these OSGi bundles.

A particularly interesting part of Equinox is the Server Side OSGi (sub?) project. OSGi has mostly been used to create desktop applications. This enables you to start the application quickly with a small footprint and then load options as needed. What if you could do the same in a server application? The application starts quickly, then as client apps invoke optional functionality, the app dynamically loads components to provide the functionality. Interesting idea, so check it out at http://www.eclipse.org/equinox/server/ (project under development)

War of the worlds — Ripples from OpenJDK

Part 1

As we all know, Sun, after two years of meditation, broke its silence last November crowning itself as the torchbearer for the open source initiatives.
It announced that Java SE, ME and the Glassfish projects (Glassfish is the open source effort for an JEE 5 compatible application server – incubated and developed in the java.net community) is open sourced under the GPL v2 (GNU’s General Public License).

This has brought huge applause from the open source communities, more especially, from the linux circles which, till recently, were upset with the Sun’s distribution of Java through the CDDL (Common Development and Distribution License). CDDL states that Java could not be bundled with the Linux distros. Redhat, Suse and a few other distros, however, bundled JRockit (Bea’s proprietory JVM), whose license allowed redistribution.

What does the GPL say? Modify the open code howmuchever you want. Keep it private in your own system. But if you want to redistribute, share your modification to everybody else. Meaning, redistribute under GPL again. (Nice. isn’t it). And GPL is also known as the Grand Daddy of the Open Source licenses with about 70-80% of the open source projects under it.

Why did Sun release Java under GPL? It had its own reasons. And Microsoft was one big reason when they created a buggy JVM based on JDK 1.1. They called it the MSJVM (Microsoft Java Virtual machine) with Microsoft extensions which made applets run faster on windows machines, and eventually forgetting the “Write Once Run Anywhere” concept of Java. Sun sued and won $ 20 million. Microsoft is never to use ‘Java’ or any of its trademarks for its newly cooked up JVM. What do you think “Microsoft VM” that is installed in our Internet Explorer is?

Naturally, Sun was afraid that there will surely be forks for Java implementation and which might be incompatible with each other. GPL promised prevention of forks to some extent.

Part 2

IBM, which was the leading “pressurizer” that wanted Sun to open source java, is now upset over the announcement. Last year, there were open letters and hues and cries by IBM all over the open source community asking Java to be open sourced. In fact IBM made an open challenge to Sun that IBM would open source its proprietory JVM if Sun open sourced its version. Then why is IBM upset over this announcement. Reason.. Lot many reasons — all with business intend.

1) Apache Harmony, as you understand, is an Apache project started around May last year. What are they doing? They are writing open source Java SE. An equavalent (lets not say competitor) to Sun’s Java implementation. Recent visit says that 1.25 million lines of code is already contributed to it. IBM is one of the lead players here other than Intel. IBM joined this project soon after its start just to show itself as a serious open-source player and to bring down Sun’s reputation among the already disgruntled OS community.

2) The GPL v2 licensing for OpenJDK. IBM wants Sun to contribute to Apache Harmony or at least bring OpenJDK under Apache License. Whats so special in Apache license? — it allows use of the distribution of the source code in both open source and “closed source” (proprietory) software. Meaning IBM can go ahead and wrap the OpenJDK and market it. The same way it produced Websphere Community Edition wrapping Apache Geronimo, Websphere commercial version wrapping Apache Web server and its Rational products wrapping Eclipse.

While IBM was saying that Opensourcing Solaris as OpenSolaris was not a big deal for Sun (Solaris is well known as the most secure Unix based operating systems), and that Sun’s interest in the community could only be seen when it outsources Java, questions came up with the OS community that if open-sourcing Solaris, a home grown product of Sun, was not a big deal, what is stopping IBM open source its AIX which uses a lot of open source code in it. In fact, IBM has been advertising that AIX is a superior Unix. Why not share it with the Linux community?

Sure there exists a cold war situation between the giants. And IBM is on the losing side.


IBM opens Windows of suspicion.


 

November 2009
M T W T F S S
« Feb    
 1
2345678
9101112131415
16171819202122
23242526272829
30  

Top Clicks

  • None

Archives

a