As statistical evidence suggests, most Indian movies are cheap imitations. Some (moi) feel that they drain the energy and test the patience limits. Bollywood's definition of sensuality is not something 'original'. The industry where dreams are sold has a strange appeal, which I rarely understood. Watching Indian movies is like watching a magician's show, the caveat, you already know the tricks.
But once in a while, when you expect the least, the rabbit is out , a real one which you would watch with child like amusement. Now that is a rarity. What is so intriguing! you tell me.
The "Slumdog millionaire" is one of those rare gems, not a bollywood movie though, it is based on the popular book 'Q and A' by Vikas Swarup. If you haven't read the book, don't miss this one. An uncouth movie with an arcane and predictable ending, but captivating it is. A bunch of lies, but beautiful ones they all are. A story teller's story which I have missed since a long time is what helped me stick. Go find out what is in for you. As the credits started rolling, I was in for another shock, so will you be when you see the name AR Rahman.
==spoiler==
A street rag, goes out to be a winner. Not much help is it, but remember that I am not going to be the one shouting kajol's name on the way out of the movie, Gupt. Wiki would definitely help, but why bother! See what I found on wiki after watching the movie,
"Rotten Tomatoes reported that 93% of critics gave the film positive write-ups, based upon a sample of 135, with an average score of 8.1/10.[20] At Metacritic, which assigns a normalized rating out of 100 to reviews from mainstream critics, the film has received an average score of 86, based on 35 reviews."
Reality is a perception. Perceptions are not always based on facts, and are strongly influenced by illusions. Inquisitiveness is hence indispensable
Friday, December 26, 2008
Thursday, December 4, 2008
Kick starting with hibernate
ORM is no rocket science, it is a very useful tool though. The idea of a tool to help manage transactions and bean bindings is a developer's paradise. So how do we start off? Download hibernate from internet, along with it the not so obvious slf4j-simple-xxx.jar and slf4j-api-xxx.jar files are needed.
Place these in you project class path. The next step is writing the mapping files. The file hibernate.cfg.xml is the one which spells out the all encompassing details like those of the database, connection pool etc. The < entity >.hbm.xml files contain the object mapping information along any operation specific information.
Note that I have placed all my xmls in a different package called model.resources. What about the hibernate.cfg.xml location? We can move it as well.
See the following:
Hope this helps in giving you that well deserved push
Place these in you project class path. The next step is writing the mapping files. The file hibernate.cfg.xml is the one which spells out the all encompassing details like those of the database, connection pool etc. The < entity >.hbm.xml files contain the object mapping information along any operation specific information.
A sample hibernate config xml for MySQL
<?xml version="1.0" encoding="UTF-8"?> |
Note that I have placed all my xmls in a different package called model.resources. What about the hibernate.cfg.xml location? We can move it as well.
See the following:
public class HibernateUtil { |
Hope this helps in giving you that well deserved push
Dynamic proxy
Every one knows compiled code is type safe and is static. It is not possible to dynamically type the behaviour in such cases. C, C++, Java … they all fit the bill. Java has this interesting feature called Dynamic proxies which promises what it spells. Now how the hell can… well it is not exactly dynamic!. There is a provision for plugging functionality (not just behaviour) at run time without major code changes. So should we really be calling it Dynamic?
As life goes on, let’s see an example. Suppose I have come legacy code/tested code/production code/my own kitchen sink code/tutorial code…Tan(90). The purpose of the code can be as simple as that of a logger. Now I want to impart some extra functionality (not just behaviour), say an actionlistener, whoa!! On a logger!! (Bear with me for the sake of example). Now how would be do that:
Think of a utility that creates a wrapper for the interfaces you want and lets you inspect the calls being made. Armed with this knowledge the lone ninja developer can render a killer app, well that is the idea at least. This utility is part of java since jdk1.3 and is called the Proxy.
Starring…coming to your nearest desktop…
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;
What exactly are these? Proxy helps you by creating the implementing class alias proxy and InvocationHandler helps you with the inspection/introspection. Proxy needs a set of interfaces and InvocationHandler needs to be hand coded.
As the whims of the butterfly go, in a flap of wing the requirements change. We now have a new technique under our belt.
I have seen a generic logging example on net as part of my learning, thank you Google, once again!
As life goes on, let’s see an example. Suppose I have come legacy code/tested code/production code/my own kitchen sink code/tutorial code…Tan(90). The purpose of the code can be as simple as that of a logger. Now I want to impart some extra functionality (not just behaviour), say an actionlistener, whoa!! On a logger!! (Bear with me for the sake of example). Now how would be do that:
- Implement the interface
- Create a wrapper class which uses composition
Think of a utility that creates a wrapper for the interfaces you want and lets you inspect the calls being made. Armed with this knowledge the lone ninja developer can render a killer app, well that is the idea at least. This utility is part of java since jdk1.3 and is called the Proxy.
Starring…coming to your nearest desktop…
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;
What exactly are these? Proxy helps you by creating the implementing class alias proxy and InvocationHandler helps you with the inspection/introspection. Proxy needs a set of interfaces and InvocationHandler needs to be hand coded.
Some code snippets
public interface IAppLogger { |
As the whims of the butterfly go, in a flap of wing the requirements change. We now have a new technique under our belt.
I have seen a generic logging example on net as part of my learning, thank you Google, once again!
Subscribe to:
Posts (Atom)
Popular Posts
-
I recently had to come with this data-structure, later I found that google collections has a MapMaker which essentially does the same. Post...
-
This is the way I like to handle events. Note the ease with which the MessageSenders and MessageListeners can be "weaved" using ao...
-
There are times when we face the need to marshall and unmarshall java objects. What better than XML for this! Most programmers can write the...
-
Bananas for the code monkey It is always a good idea to prevent users from doing unwarranted things. Thats the whole idea of client side val...
-
Event bus is a rather simple notion, that is of great aid. Think of a telephone network; to communicate between two ends, one would require ...
Labels
- Programing (13)
- monologues (8)
- Java (7)
- experiences (7)
- ideas (2)
- java script (2)
- CSS (1)
- GXT (1)
- My First Post (1)
- Politics (1)
- movies (1)
About Me
- Swaroop
- Well for a start, I dont' want to!. Yes I am reclusive, no I am not secretive; Candid? Yes; Aspergers? No :). My friends call me an enthusiast, my boss calls me purist, I call myself an explorer, to summarise; just an inquisitive child who didnt'learn to take things for granted. For the sake of living, I work as a S/W engineer. If you dont' know what it means, turn back right now.