V4forums Weblog

Stay Hungry, Stay Foolish

Flower Pic(k)s!

leave a comment »

This weekend I got a chance to go for a field trip and as a result I could come back with some flower pic(k)s. Thought would share them with you all.

You can check out my complete album at:  http://picasaweb.google.com/v4forums/Flowers#

flower-picks

Written by v4forums

March 22, 2009 at 7:08 am

Posted in Photography

Tagged with

My first post processed image

with 2 comments

copy-of-img_1271_pp

Yesterday, I got some time to get my hands dirty by trying out some post processing on one of the pictures that I had shot recently.

I used Gimp 2.4 for processing my image.

Nothing much I did expect that I played with some of the tools like rescale image, crop, change brightness-contrast using level settings and finally use the un-sharpen filter for some enhancement of sharpness in the image.

I was pretty much satisfied with the outcome and gave me confidence to try more enhancements during post processing and eventually get the best of out of my pictures.

Written by v4forums

March 19, 2009 at 9:37 am

Posted in Photography

Tagged with

Platonic Form URIs

leave a comment »

I knew about URI but I never encountered a term “Platonic Form URI” until yesterday. I found the term floating around the net especially on couple of blog posts that I usually read. As usual, curiosity caught me again to know more about it. So after getting my hands bit dirty, here are some details/of my understanding about Platonic Form URIs in the most high level or simplistic form.

Lets brushen up some details that we already knew before we get into the details as that would even help for a better flow of the post.

URI

So we all know what’s an URI is. Simply put, it is a string that identifies a resource. For example, the following is an URI.

http://www.myblog.com

The above URI helps me to identify the Google’s search page which is ofcourse in this case is a resource. Please note, identifying the resource may not necessarily mean that we can retrieve it.

URI with Application State

To understand “URI with Application State”, lets take a simple example. Say I am trying to access the first page of my blog and assume that the URI for reaching there is,

http://www.myblog.com/V4forums?page=1

and my retrieved first page on a web browser not only contains the resource, but, in the footer, has also got a link to navigate to my second page. The URI for the second page is presumably,

http://www.myblog.com/V4forums?page=2

Now I would say, both the above URI’s were not just identifiers but also were holding the application state. For instance, If I forward the URI of my second page to a friend of mine, on clicking, he would directly taken to my second page instead of landing him on my first page and force him to click on some link in my footer. Its because the URI has got an application state with it. In this case, the portion of URI that preserves the application state is ‘?page=2’.

URIs behaving Platonic

Now I’ve got a problem with representation part of my blog page which was reported by one of friends to whom I forwarded the link. My friend knows only French but I have configured the blog to represent my resource in english, by default. Neither the URI that I sent to my friend has got any information on what type of language he prefers.

At this juncture I can call my URI having a Platonic Form ie., devoid of any language specifics. One of the synonyms form Platonic in WordWeb displayed, “free from physical desire“.

Hope we understood what Platonic Form URI’s are.

But I am yet to find a solution for my friends problem. So here’s what I’ve got. I changed the configuration of my blog to check the header content of every request that is coming in to identify the browser preference language and sent back the appropriate response/resource for my second page.

Ideally, there are much better ways of handling this problem than using the header content to identify more details which goes beyond the scope of this blog post. So I leave you on your own to go and figure out the other solutions.

Written by v4forums

February 19, 2009 at 6:48 pm

Posted in Java

Download “Ubuntu Pocket Guide” Free of Cost

leave a comment »

Ubuntu Pocket Guide and Reference

Keri Thomas’s Ubuntu Pocket Guide is now available for free in PDF format.

The original paper edition cost $9.94 in amazon.

The free pdf version can be downloaded from:

http://www.ubuntupocketguide.com/index2.html

So what are you waiting for, download a copy and become a Ubuntu master in double-quick time.

Written by v4forums

February 11, 2009 at 10:05 pm

Posted in Books

Tagged with

Photography: Sunset in my native place

leave a comment »

sunset

It was late in the evening and I was actually driving back home from a my friend’s place. It was a road with lots of bends and curves and at one turn, I saw this beautiful sunset and immediately captured it on my camera.

Written by v4forums

January 9, 2009 at 3:33 am

Posted in Photography

Tagged with

Caught on Camera – Chennakesava Temple, Belur, India

with 2 comments

This is another incredible sculpture that I captured using my camera.

BelurSculpture

Visit the following site for more details on Chennakesava Temple, Belur, India.

http://en.wikipedia.org/wiki/Belur
http://www.karnatakatourism.org/

Written by v4forums

December 31, 2008 at 3:58 am

Posted in Photography

Tagged with

Photography: Chennakesava Temple, Belur, India

leave a comment »

Chennakesava Temple, Belur

This is again one of my favorite pictures which I’d taken when I visited Chennakesava Temple, Belur.

Belur is in Karnataka and one such great place to visit when you are in India. For more details on Belur and near by places to visit, checkout the following links:

http://en.wikipedia.org/wiki/Belur
http://www.karnatakatourism.org/

Written by v4forums

December 29, 2008 at 3:05 am

Posted in Photography

Tagged with

Photography: Old Temple Dome

leave a comment »

SaravanaBellagula

This is one of the pictures that I had taken some time ago. The growing old tree in front of the temple was really giving a feel that how old the temple is.

Written by v4forums

December 28, 2008 at 3:42 am

Posted in Photography

Tagged with

Hibernate: Implicit & Explicit Polymorphism

leave a comment »

As I was going through the various inheritance strategies in Hibernate, I came across the ‘class’ element’s attribute, polymorphism=”implicit|explicit”.

From the Hibernate’s reference manual, this is what I found as definitions for implicit and explicit polymorphism.

Implicit Polymorphism:

Implicit polymorphism means that instances of the class will be returned by a query that names any superclass or implemented interface or the class and that instances of any subclass of the class will be returned by a query that names the class itself. For most purposes the default, polymorphism=”implicit”, is appropriate.

In simple terms, for getting a better idea about Implicit polymorphism, here is a scenario. Consider a program that manipulates lists of several different types of elements. One approach is to define a separate composite class hierarchy for each kind of list. But this approach requires replicating essentially the same code in the definition of each class. To avoid this code replication, we can define a single composite class hierarchy for lists of type Object. Since all Java object types are subtypes of Object, such a list type can be used in place of any specific list type. However, when we extract an element from such a list, we will generally have to cast it to the specific type required by the context in which it is used.

Explicit Polymorphism:

Explicit polymorphism means that class instances will be returned only by queries that explicitly name that class and that queries that name the class will return only instances of subclasses mapped inside this <class> declaration as a <subclass> or <joined-subclass>.

Explicit polymorphism is useful when two different classes are mapped to the same table (this allows a “lightweight” class that contains a subset of the table columns).

Further beyond all the findings and explanations, I was still in need of a clear living example for understand the concept, especially about explicit polymorphism and its usage. Eventually I landed up in a much better place than expected which gave me a right picture of how polymorphism strategies work in Hibernate.

Light weight Class: http://www.hibernate.org/41.html

I hope the article in the above link have given you a better understanding too.

Extreme Power of Implicit Polymorphism:

BTW, I came across a snippet in one such article, which showed me the extreme power of implicit polymorphism in Hibernate. (Please note that all classes have got the polymorphism set to ‘implicit’ by default.)

Here is a code snippet (HQL query) that I came across using which you can retrieve the whole database.

public List all() {

List objects = session.find(“from Object”);

}

Pretty powerful Huh!

Written by v4forums

December 27, 2008 at 5:28 pm

Posted in Java

Tagged with

SLF4J Vs JCL / Dynamic Binding Vs Static Binding

leave a comment »

This morning I downloaded latest version of Hibernate and was trying to use it for one of my web application that I was working on.
As I configured all the mapping details of the relevent entities and pointed hibernate to MySQL to create the schema, I ended up with the following error:

java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder
at org.slf4j.LoggerFactory.<clinit>(LoggerFactory.java:60)
at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:128)
… 46 more

What I understood was Hibernate recently introduced the use of the Simple Logging Facade for Java (slf4j) whose jar files are actually missing from my classpath. It was easy to fix the problem by adding the respective jars on my classpath and get going.

But on the other side I was bit curious to know more about SLF4J. So without much hesitation I started digging into the details with http://www.sl4j.org as the primary point of my dwelling. The following are some of the interesting facts that I learnt. As you would see I would be mostly refering to the external links on the facts, my goal is to make this blog complete.

Simply put, SLF4J is a simple facade for logging systems allowing the end-user to plug-in the desired logging system at deployment time.You can consider it as  a counter part of Jakarta Commons Logging (JCL).With so much complains regarding the dynamic binding approach taken by JCL, SLF4J has taken the simple approach of static binding which would eventually solve all the dynamic class loading problems while using JCL.

Dyanamic Binding Vs Static Binding

* So what exactly is this Dyanamic and Static binding in Java all about?

The answer is very clearly explained in the following link. Thanks for the at most simplicity approach taken to explain the differences between Dynamic and Static binding.

http://geekexplains.blogspot.com/2008/06/dynamic-binding-vs-static-binding-in.html

Problems with JCL

* So what kind of problems does the JCL pose on developers because of dynamic binding/class loading?

The answer can be found much more in detail through the following blog.

http://wrschneider.blogspot.com/2005/06/commons-logging-classloader-pain_18.html

SLF4J using static binding approach (LESS IS MORE!)

How does SLF4J help us to get rid of the problems using static binding approach? I think the following snap-shot taken from SL4J manual says a thousand words than any further explanation (same picture can be found in the SL4J Manual).

slf4j

Just a final information. Looks like not only Hibernate, but all the JBosses are making a move towards SLF4J.

More useful information on SLF4J can be found here:

http://www.slf4j.org/faq.html
http://www.slf4j.org/manual.html
http://www.slf4j.org/docs.html

Written by v4forums

December 27, 2008 at 8:41 am

Posted in Java

Tagged with

Design a site like this with WordPress.com
Get started