Thursday, June 24, 2010

A Puneri patya showcasing different rules - well, for dumb humans and smart dogs?

Today is my 4th consecutive day at the jogging track in our society. And something grabbed my attention yesterday, that is a Puneri istyle message to Dog owners, who come for a stroll at the track with their dogs.
There is a temple, around which the track is built, and hence some folks do not like dogs in the vicinity for obvious reasons. But then, the same jogging track is the place, where chaps from the society throw wafer packets in the evenings, burst crackers and even gossip about the the deepest secrets of other families.

Certainly, religious 'rules' are twisted for humans and animals at will...!

(Photo Courtesy: My Nokia 3110c, not bad for the image quality right?)

Wednesday, June 23, 2010

'More' is No More!!

In times when departmental stores are coming up like mushrooms do in monsoon, there is one chain of stores in particular, which has caught my eye, well not so much for the good reasons though.

'More' the Aditya-Birla retail venture, which has stores all over Pune are now probably seeing a downward trend. In the last 18 months, I have seen 2 of their outlets in my locality shut shop. The reasons (by them), "Sir, the rent has been increased for that place", "Sir, I do not know why that outlet is closed".

For one of the outlets that got shut, in its merrier days, I had caught up on a 'friendly' discussion with one of the fellows, handling their fruits/vegetables section. Here is a snippet of the conversation (from whatever I remember)...

    Me  - "Hello my friend, Please help me find something in the vegetable section"

    Him - "Sure sir"

I wait for next 5 mins and still no trace of him. I get what I want and move to the billing counter. There I see him opening another billing counter (other than the one active then), to give some 'preferential' treatment to probably his 'favourite' male customer.

    Me  - "How can you do this? There is one counter already open, and I had asked you for something"

    Him - "Sir, sorry but..."

    Me  - "This way, just like your other store, even this would get closed"

    Him - "Could be sir, but I have my own store in Balaji Nagar, I am there in the mornings, do visit me if you want fresh vegetables"

    Me  - "Would you sell it to me at better prices there?" (just to see his reaction)

    Him - "Why not Sir, please do come!"


It would not take too long for anyone to make out the actual reason, once you visit any of their outlets.
  • Try to pick up a vegetable or a fruit and get it weighed, chances are that the prices you see on display are different than the prices in their bills. If you try asking the reason about the older prices on display, the answer would be "Sir, those prices are older, the system has the latest" (GDIT* - I also know that man, but at least apologize for the same!).
  • Try going to their freezer and you would see only 1 brand of milk, which is not available anywhere (and probably would not be bought by anyone) in Pune. One look at the pouch, and you realize that the milk is due for expiry in a day. I have never come across a pouch there, which had a 'Use before date' of more than the next day. The reason? See the pouch again, and you would realize (once more!). The milk is from some XYZ dairy in Thane, and just marketed by the Aditya-Birla group. So how on earth it is supposed to have a greater shelf life, when it needs transportation (after packaging) all the way from Thane (160 Kms from here + the distance traveled distributing the pouches all over the city)
  • Try taking a glance at the biscuits area, and you see 'promotional' offers like "Buy 6 packs and get Rs. 10 off" on a pack of biscuits that cost Rs. 20 per pack. How is that promotional, and that too on biscuits? I am taking the biscuits for me and my wife, and not to my shop that I would buy 6 packs at one go, just to get less than 2 bucks off per pack. I would instead prefer even if you give me 1 buck off for a packet of biscuit purchased.
Hmm.. so going by all this, 'More' would soon be 'No More', and I fear would be soon forgotten by people too, that there existed 'More' in the city of Pune.


*GDIT = God Damn IT :)

Sunday, June 20, 2010

Cheap tricks...

Got the following as a forward in my email from a very close friend...
~~
Find the error, its impossible:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Did you know that 80% of UCDS students could not find the error above?
Forward this to at least 5 people with the title
'Find the error, it's impossible',
and when you click 'Send',
the answer will be right in front of your eyes!
~~
This is something new, have seen earlier emails supposedly originating from Microsoft, HCL, Nokia and types, claiming to give freebies(and even money!) to all who forward the same to more than 'n' people...

I really don't know when would netizens get more mature and stop initiating such really cheap email chains, which I am sure will do more rounds than my hard disk does per minute!

At least now, someone who comes across this blog would not forward email having similar content to this, and I'd have saved some network traffic, doing my bit to contribute to faster internet :-)

Thursday, June 17, 2010

"Mann ka Radio" please!!



The only time I tune in to the FM radio channels is when I drive to office, and that too just because I am too lazy to burn more than a couple CDs of my favorite songs :-)

The RJs are more often than not decent too, they speak well in all the 3 languages. However, of late I have noticed that they also advertise a particular brand of car, cement, blood sugar monitor device etc. How good is that?

I would not want to (and so would most of the population) listen to all such advertisements from the RJs themselves. For ads, there are the ad slots in between the good numbers. The job of an RJ (I believe)is to praise a good number, remind us of some good old numbers, play some apt songs at that time of the day, give us some useful information about happenings around, talk to the listeners and the list goes on..
But, please do not make me hear your banter praising some brand, which you might not have used yourself. I know where to go and search, when I need to know about which car, apartment, apparel and underwear is really good!

So, please "Mann ka radio, bajjne do jara..."

(Photo courtesy : arm.net.in)

It's not about your brakes...

This happened about a couple of weeks back, while I was driving one of the arterial roads of Pune. The sedan in front of me braked suddenly, so did I with the 'power assisted Vacuum front disc brakes' on my Wagon-R. However the six-seater behind me, couldn't brake in time (probably he was never educated about keeping safe distance) and THUD! I got a nice jerk on my back, and my car got a nice dent on its back.


Claimed insurance, Maruti Sai-Service, Pune did a neat job of getting the repair done in just 2 days. The Fix? The boot door was replaced, so was the rear bumper.


Now the costs incurred ..
To the insurance company - Rs.19.3K
To the car owner - Rs. 3.7K

Now you know, it's not about YOUR brakes, it's about the brakes of the vehicle behind you!

(Photo courtesy: My Nokia-3110c :-) )

Wednesday, June 16, 2010

Push Button Start - Really neat?

Happened to come across the feature that's come on a couple of new cars here in India viz. the Chevy Cruze and the Nissan Micra. Yes, The push button start/stop feature.

Does it really sound exciting? I remember my cousin's Diesel powered, 1976 modeled HM Amby which had a similar feature to crank the engine. And now, I see it again on atleast these 2 cars in the Indian market.

I could not make any sense - neither aesthetic nor from a usability perspective, as to why would a manufacturer incorporate such a feature and also boast about it?

Tuesday, March 23, 2010

The Indian Train lingo...

As a kid, I remembered asking a lot of questions from around the world to my dad, and I must say he answered most of them with a lot of patience especially with the amount of "whys" and "hows" I used to bombard him with :)

However, there was one question I always asked but never got a concrete answer, for the obvious reason. That was, why the trains (mainly the local EMUs) in Mumbai hoot in a certain rhythm at times? Was that done to indicate an accident? A faulty engine? A boorish railway line crosser mowed down?
The answer to this age-old question of mine was published in the Times Of India(TOI) Mumbai edition one fine Sunday!


Supposedly, every driver who undergoes the training is taught the lingo amongst many other things before he gets behind the wheel.


So, the next time you hear the engine driver honk in one of those tones, you know what's happening, thanks TOI! :)

Tuesday, January 12, 2010

What's in the name?


As I start re-posting to this blog, many who read might want to know why the name - GrowWithJava, when I'd be blogging just about anything.

Well, for starters, I'm a Java Developer (now a team/tech lead though by designation) and that is rooted in my fascination and love for the programming language. And also, the fact that I have actually Grown (technically, socially, professionally, personally etc etc) with Java is the reason. Apart from giving me my bread and butter, it has also seen me through some tough times, helping me digress away from a few nasty twists of life...

Java apart, to know me better, you should also know that I love long drives in my small Wagon, spending time with my family, watching NatGeo, humorous movies, cracking "sweet" jokes and recently developed some love for photography - thanks to a new DSLR gifted by my bro :)


That's it I guess before I start praising myself on where I started and to what(and how) I've grown with Java :)

Monday, April 6, 2009

Don't let Java final Strings trick you...

Imagine working on some production issue, where a UI message has to be changed (for it not being as per specifications ofcourse). So, here you are, faced with a very simple 'defect' (if you term it one ;) ).

All that needs to be done is to change the value of a final String variable somewhere in your Interface or concrete class that contains the same (example below), followed by shipping out the class file as a patch. A 2 mins job - and actually, does not even need a 'programmer' to make the change. So, you happily make the change, ship the file (without even bothering to test - due to sheer confidence or may be over-confidence as we find out why further...)




    public interface ConstStrings{

      String CONST_1 = "Java";
      String CONST_2 = "Blogger";

      Integer i1 = 9;
      Integer i2 = 20;

    }




What happens when it reaches QA? Or worst still, the client? Boom, they still end up seeing the old incorrect message. What went wrong? Certainly, the message is changed in the class file and the patch is applied as expected!

Well, the problem turns out that, the UI class(example below) which refers to this class for getting the final constant variable has not been compiled! Now, try re-compiling the class that refers to the constant, and everything works as expected.


    public class ClassUsingConstants {
    private String str;
    private String str2;
    private Integer i1;
    private Integer i2;

    ClassUsingConstants() { // Constructor

      str = ConstStrings.CONST_1;
      str2 = ConstStrings.CONST_2;
      i1 = ConstStrings.i1;
      i2 = ConstStrings.i2;

    }

    // Getters for the variables are here...

    }


Behind the scenes, whenever you compile a class that refers to a String Constant (in another class or interface), the compiler creates the .class file with the constants embedded in it, instead of having a reference to the actual class that contains it. Hence, changing and re-compiling the referred class only is not sufficient, but what is actually required is re-compilation of all the classes that refer to the same.
However, a point to note here is that, this behaviour is exhibited only for Constant 'final' Strings and not for any other type of 'final' objects.



Hope this helps you, if it does, leave a comment :)

Friday, April 3, 2009

Beware - It could be the Java integer pool!

Most of the java-developers are aware of the String pool* that Java provides. However, not many are aware of the Integer pool that java provides - which is what I have observed from my interviewing over the last 1.5 years of candiates carrying experiences ranging from 1-3 years.

Integer pool is maintained by the JVM for Integers ranging from -128 to +127. So, when a line of code like:

    Integer i1 = 10;

is executed, the JVM checks for the same in the pool of Integers it maintains and pulls one from the same. Execution of such statements (or assignments) can be done safely without having to bother (which most of us don't anyway) about any side-effects. However, the problem surfaces when you execute the following lines of code...


    Integer i1 = 100;
    Integer i2 = 100;
    if(i1 == i2) {

      System.out.println("Wow Integer pool exists !!");

    }


The above code, when executed results in printing out the assertion that the Integer pool does indeed exist.
I leave upto you, to check what happens when the the values for i1, i2 are changed to 129.

And now a catch about it (for a good number of freshers out there :) ), the above code when changed to the following, results in nothing getting printed.


    Integer i1 = new Integer(100); // New Integer object is created and the pool is not queried.
    Integer i2 = new Integer(100); // ---- Same as Above ----
    if(i1 == i2) {

      System.out.println("Wow Integer pool exists !!");

    }


When the code above is executed, since we explicitly ask for a 'new' object, JVM does not bother to save memory for us :) and instead, gives us new objects.

Hope this is useful...