Sunday, October 14, 2012

Midnight In Paris

I just watched Midnight In Paris - a movie written and directed by Woody Allen. It just reinforces my respect for the guy's creative genius. I had seen his Annie Hall, and though that movie didn't have a 'story' per se, it had clicked big time because of the character detailing (including their eccentricities), dialogues, realism and goofyness of the protagonist. 

Midnight In Paris is like a second installment in many ways. The themes and details of both the films are totally different. But within first ten minutes of the film itself you start seeing glimpses of Annie Hall 'isque characters, eccentricities, subtle shades of each characters, and you immediately appreciate that it's not a usual movie with loud hints and mannerisms, but a classy one with subtle treatment and a Woody Allen stamp on it. And I don't mean it in a cliched way. 

The movie uses time-travel, but that's not the point of the movie. Real thing is the fantasy of what would happpen after such a time travel. It's not about time-travel, but it's about what happens when a wannabe author, who likes to engage in nostalgia, finds himself in the middle of the age in the past which he likes to think of as the golden age. 

Don't we all have the tendancy to indulge in the bouts of such nostalgia? Don't we think of the 50s and 60's and 70's when the world was a simple place to live, when there were not much vehicles on the street, when there were no overloaded communication devices to attend to, when there used to be gifted authors, gifted musicians, singers, when one could attend to those Maifils/Katha-kathans/Sabhas when legends like Atre, Savarkar, P L Deshpande were around? Don't we think the golden age was when the Indian Freedom Movement was gaining momentum? when you could intermingle and get inspired by the like of Chaphekar brothers, Savarkars, Bhagatsinghs, Sukhdevs, Bose, Azads, etc? 

The movie is not about time-travel, it's not about a love story between characters of different era either, though there is subtle one going on. It's actually and really about the craving desire that we all have about how the current era we are living in, sucks, in comparison with some era in the past. 

The crux of the movie comes when this girl from past (1920s), with whom our protagonist is in love with, goes to some era in her past (1850s), which she thinks of as a golden age, and the guys from that era think some other era in their past (rennaissance) was the actual golden age! An intriguing reminder to us all that the grass can be greener on our side as well, from the perspective of some other side. The strength of the movie is how subtly this very message is conveyed. No preachings, no pedantics, no in-your-face dialogues. Just a subtle transition and it makes one think. 

There was this one scene I really liked in the movie. Gil, the protagonists, asks a lady guide in a theme park, if it's possible for one person to love two women at the same time. He gives a reference to some artist in the 1920s, and she says "well, he loves both of those women differently!". He startles, gathers himself, and says - "well, yeah, I forgot you people (the french) are more evolved in this department." That was bang on! Exactly how I perceive them to be. Going by the French movies I have watched so far, or the French characters I have seen so far, I have come to have similar opinions about those people. 

The movie is a gem. I especially like the goofy yet intellectual treatment of the topic, which, probably because I have come to like Annie Hall so much, seems like having a Woody Allen signature on it. I somehow manage to relate to both these characters (Woody Allen's from Annie Hall, and Owen Wilson's from this Midnight In Paris) a lot. 

Aside from this, I feel, had Woody Allen been not as old as he is, he would have acted in it himself instead of Owel Wilson. Like he did in Annie Hall. And he would have done even more justice to the character, not because Owel Wilson was bad, oh no, but because I think he made that character for himself (or keeping his character from Annie Hall in mind)

This one will sit there along with Annie Hall as one of my all time favourites, for sure.

Thursday, August 23, 2012

A NewConfigParser Module for Python


Python standard library contains an excellent ConfigParser module. It allows one to directly read the configuration variables from an INI file, without much ado and overhead. Simple and beautiful. Here is Doug Hellman's PyMOTW blog about the module, for more info.

Now so far as you have a simple requirement of independent configuration variables, you are good to go right away. But if you are used to shell scripting, and are spoilt by variable resolution there (one variable resolving from another previously defined variable, like this - $URL=$PROTOCOL://$DOMAIN:$PORT/), you sure are not satisfied. And if you are spoilt by python's opulence, you sure cannot just let it go and do with whatever is available.

I couldn't either. I had a complex configuration file, and I just couldn't think doing without variable resolution. Here is a subset of what I wanted. I had a common configuration section about a server and different set of URLs which I wanted to fire HTTP requests at (get/post/any such), on the server. Now these domains would be listed in a different 'urls' section, while server details will be listed in the 'server' section. Something like this -
[server]
domain = www.pyarabola.in
port = 80

[request-config]
protocol = http
type = get

[urls]
konkan = ${request-config.protocol}://${sever.domain}:${server.port}/coastal-konkan-day01.html
apple = ${request-config.protocol}://${sever.domain}:${server.port}/applyhypepotatopoteto.html

[requests]
get_konkan = GET ${urls.konkan}
get_apple = GET ${urls.apple}

Note: I know there will be other (better) ways to get the URLs constructed, but this is a made-up example just to make the use-case clear.

The requirement is quite straight-forward - if I want to change the server or port number or the type of request I am making, I dont want to end up changing all [requests].

As you can see, the parameters are constructed by back-referencing other parameters. And the back-referencing is multi-level - one parameter referencing another, which in turn is referencing yet another, and so on, as can be seen for the get_konkan parameter in [requests] section.

As far as I know, the current ConfigParser module (or its ConfigParser.SafeConfigParser class) doesn't allow such referencing in the INI file it parses. Enter NewConfigParser.


NewConfigParser

So I ended up extending the ConfigParser.SafeConfigParser class and overriding its get(...) method to make space for such back-referencing.

Features -
  1. Define-anywhere-use-anywhere freedom, while defining dependent options
  2. This means even if the [requests] section in the above example, is defined at the top of the INI file, before any other parameter definition, it will not complain. This is contrary to the way linux shell variables are resolved. There the used variable must have been defined apriori.

  3. Caching of resolved parameters
  4. A small optimization. It caches any resolved parameters. As a result, if get_konkan request, from above example, is resolved before get_apple request, the NewSafeConfigParser.get("requests", "get_apple") call wont again resolve the same protocol, domain or port. It would directly use it from cache.

  5. Any amount of depth in dependancies (*only limited by global recursion limit)
  6. The parameters' dependancies are resolved recursively. So the depth of dependancies is only limited by python's global recursion limit.

  7. Detection of circular dependancies
  8. All circular dependancies are detected and they result into a CircularDependancyException. It also prints the dependancy graph for you to make hay. Take a look at the circular dependacy example in the Examples section below.

  9. Same usage semantics as SafeConfigParser, i.e. variable resolution is transparant to the user
  10. Since NewSafeConfigParser is extended from SafeConfigParser, the usage semantics are same as SafeConfigParser. You would call a NewSafeConfigParser.get(...) method in the same way you would call a SafeConfigParser.get(...) method. All the referencing and parameter resolution and caching and circular dependancy detection happens behind the closed curtains. User No Bother.

  11. No section means current section
  12. Back-references are to be specified in ${section.parameter} manner for resolution. If no section is specified, e.g. new_param = ${param}, then current section (same as the new_param) is assumed, and the back referenced parameter - param - is resolved in the same section as that of new_param.


Check the Examples section below for more details.


Limitations
  1. Works only for strings as of now
  2. Only SafeConfigParser class extended as of now. Not implemented for ConfigParser.


Code: Where and How

The code is available on GitHub - https://github.com/shreyas/NewConfigParser
I was too lazy to pack it into a legitimate module and post it on PyPI for pip install (it's only a smal tweak really). So it's just a single file (as of now). You might want to copy it into you tools folder and import it as a module to start using it.


License

This was done quite long back, only to realise that I need it quite often. So thought it might be useful to someone else as well. One shouldn't just consume open-source, but contribute to it too. So am releasing it in the public domain under Apache Software License version 2.0.

Do what you want with it, just maintain that copyright notice at the top, despite the (obvious) disclaimer that I wont be responsible if your rocket hits someone's ass instead of the moon just because you resolved its controller config using this parser.


Examples
shreyas@tochukasui:~/devel/python$ python
Python 2.7.3 (default, Aug 1 2012, 05:16:07)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from NewConfigParser import SafeConfigParser as NewSafeConfigParser
>>> from ConfigParser import SafeConfigParser
>>> newparser = NewSafeConfigParser()
>>> origparser = SafeConfigParser()
>>> newparser.read("config.ini")
['config.ini']
>>> origparser.read("config.ini")
['config.ini']

>>> newparser.get("request", "request_type")
'get'
>>> origparser.get("request", "request_type")
'get'

>>> newparser.get("request", "request");
'get http://pyarabola.blogspot.in'
>>> origparser.get("request", "request");
'${request_type} ${server.url}'

>>> newparser.get("server", "url");
'http://pyarabola.blogspot.in'
>>> origparser.get("server", "url");
'${protocol}://${website}'

>>> origparser.get("server", "protocol");
'http'

>>> origparser.get("server", "website");
'${subdomain}.${host}.${tld}'
>>> newparser.get("server", "website");
'pyarabola.blogspot.in'
>>>


Circular Dependancy Detection
shreyas@tochukasui:~/devel/python$ cat circdep.ini
[humans]
drinking_water = ${govt.pipeline}

[animals]
drinking_water = ${natural.reservoire}

[govt]
pipeline = ${natural.reservoire}

[natural]
reservoire = ${river}
river = ${heavens.rains}

[heavens]
rains = ${clouds}
clouds = ${vapor}
vapor = ${natural.reservoire}

shreyas@tochukasui:~/devel/python$ cat cdep.py
#!/usr/bin/python

import NewConfigParser

p = NewConfigParser.SafeConfigParser()
p.read("circdep.ini")

try:
p.get("humans", "drinking_water")
except Exception as e:
print e

shreyas@tochukasui:~/devel/python$ ./cdep.py
Cicrular dependancy detected while resolving parameter 'natural.reservoire': natural.reservoire -> natural.river -> heavens.rains -> heavens.clouds -> heavens.vapor -> natural.reservoire
shreyas@tochukasui:~/devel/python$

Tuesday, July 24, 2012

CKRT Day 05 - Ganapatipule to Vijaydurga


Continued from: CKRT Day 04 - Guhagar to Ganapatipule

Route: Ganapatipule -> Pracheen Konkan -> Ratnagiri -> Pawas -> Purnagad -> Jaitapur -> Padel -> Vijaydurga -> Devgad

Today was the day when the possibility of being forced to tent in the middle of nowhere, was looming large on us. Given the amount of locations to visit, the distance to travel, lack of clarity about connections between few places enroute, a plan B of tenting and camping, was prepared for this day.

गणपतीपुळ्याचं मंदिर (Ganapatipule Temple)

Early in the morning, we had been to the Temple campus and the adjoining beach. It pained to see its current status. Quite a few years back (back in 2003/04 if I remember correctly), when we were in T.E., the temple had only the hill in the rear and the sea in the front. It was a serene and beautiful sight. Now the temple is mobbed by many ugly buildings and fences. It has lost its charm. Simple was immensely beautiful. This is what happens when you have a large population which doesn't mind mobbing and littering beautiful places in the name of god.


प्राचीन कोकण (Pracheen Konkan)

We checked out from the room, and went to Pracheen Konkan. The project is conceptualized by a group of college going public. It depicts how Konkan was, back in the time of ancient civilization. The social structure, the geology, the people, their fashion, animals, birds, fishes, reptiles, their varieties etc. It's an informative project, definitely worth a visit. Only their guides need to let go of that disinterested, monotonous, news-anchor like accent, and speak with a normal tone.


Pracheen Konkan Guide Map

Small Scale Model of Jaigad

White Hibiscus

Impressive Arrangement

Black Headed Golden Oriole

पावस (Pawas)

Soon after Pracheen Konkan, we took our breakfast and started towards Ratnagiri. The route to some extent is a coastal sea-side drive, and views of the rocky coast, crystal clear white-sand beaches, deep blue sea and an occassional fishing trawler take one's breath away.

Our next stop was the स्वामी स्वरुपानंद आश्रम (Swami-Swaroopanand Ashram) at Pawas. I did a tankful at a petrol bunk near Ratnagiri, just in case petrol became scarce later on.

The Swaroopanand Ashram was a very silent and serene place. The atmosphere was indeed strangely different and calming. It was my first time there (or maybe second, I have a very hazy memory of Pawas from my early childhood). The आरती (aarati) there, was a different experience, though I haven't remained the आस्तिक (believer) of olden times anymore. कर्मकांडावर माझा बिलकुल विश्वास नाही. पण माणसाच्या जीवनात देव असण्यानं जर माणसं सरळमार्गी आणि इतरांचं चांगलं चिंतणारी होत असतील तर माणसाच्या जीवनात देव जरुर असावा. असो.

While looking around during the aarati, I observed quite a lot of different profiles of people. Some of them looked almost out of place. A lot of old people - quite expected. But quite a few young women, some young guys (like us) in half pants and commando T-shirts. The most striking sight was a young guy with Devanand-style long hair, half-moon glasses, a goatee, white(!) 3/4th and a black T-shirt with a red star and Che Guevara imprint(!) on it. Talk about being out of place!

We had our lunch at the Ashram itself, and after gulping down a few hefty doses of कैरीचं पन्हं, we set out towards पूर्णगड (Purnagad).


पूर्णगड (Purnagad)

It was comparatively closeby from the Ashram. Quite a small fort - or rather an observation point. The fortifications are intact, but that's about it. Nothing much there. Except - except for the untouched, directly accessible, beautiful beach in its rear.




It was a striking sight. A route from the rear entry/exit door of the fort, was dropping straight onto the pristine beach. It was an ideal site for an overnight camping. Sitting there in the shade of big trees, and watching the tides wash the beach, is a soothing experience.


Finding विजयदुर्ग (Vijaydurga)

Next destination was the विजयदुर्ग (Vijaydurga). Now this was the start of the uncertain part. The sources that I had referred to, suggested that there will be ferries to Vijaydurga from Madban beach (माडबन किनारा). Otherwise, the land-route was quite distant.

To top that, the map I had, suggested no bridge going from Purnagad to Jaitapur, over the Jaiapur creek. No mention of ferry service from Madban to Vijaydurga either.

We started towards Jaitapur and decided to alter the plan on the go as per the circumstances. It was already 2-3pm in the afternoon and we still hadn't a trace of Vijaydurga. Checking out Vijaydurga was going to take couple of hours and thence we were to move to Devgad in search of accommodation. It looked like a doomed plan already. Unless we rushed ...

I stuffed my hat back in the rucksack, and got the helmet out. It was very windy and the hat wouldnt have allowed me to pickup speed without distractions. Helmet would allow me to let lose on the bike and make the best effort to attain these tight timelines.

Our stars were shining bright. After rushing through the plains for sometime, we came across a brand new bridge that would take us acoss the Jaitapur creek, and would grant us direct access to the Madban beach. The bridge was commissioned only recently.

Finding Madban beach, turned out to be a very confusing affaire due to misleading and mis-reading boards. And then after finally finding it, we learned that ferries dont ply between Madban and Vijaydurga anymore since a new bridge has been commissioned over the Vaghotane creek (वाघोटणे खाडी) - the very creek that seperates Vijaydurga from Madban beach. Viola! So it was all road route now.

It was 40kms from Madban though, and the evening was approaching very quickly. I started feeding in even more throttle. The road, again thanks to our lucky star, was impeccable - smooth, wide, desserted, recently laid, tar surface - also known as: a biker's paradise.

By 5pm, we were in Vijaydurga. Parked the bike, had a few doses of Karvanda juice (करवंद सरबत), and started a guided tour of Vijaydurga, along with one other group.

विजयदुर्ग (Vijaydurga)

The guide we met, and had the pleasure of learning from, at Vijaydurga, was, without a single doubt in my mind, the best guide I had ever met. He was highly knowledgible, self learning, a seemingly history-buff himself and was well researched with his knowledge nuggets. The minute details that he explained of small things, which usually slip from our attention, were astounding. Those details not only introduced us to the foresight of Shivaji Maharaj and the people he chose, but also made us appreciate how well researched this guy was. Undoubtedly one of the best guided-tours I ever had a pleasure of attending.

At the end, we decided to double the amount we were to pay to the guide. It was just a token of gratitude for doing such a great job of making historical nugggests interesting for people like us. Guides like him need to stay in that profession so that people get to learn the history from a knowledgible person.


Reclaimation on the right

Arms Depot (दारुगोळा कोठार) iirc
Now a bit about Vijaydurga. The fort was surrounded by water from all sides. But recently one side has been reclaimed and the fort is now connected to the land. The reclaimation also hosts MTDC resort, at a vantage point, like all MTDC resorts. The fort overlooks the Vaghotane creek, which Shivaji maharaj wanted to keep under control so that nuisance from the English and Portugese navies would be kept at bay. The creek cuts very deep in the land, and it posed a danger to the स्वराज्य (the self-ruled empire) from the foreign navies. That's why this old fort, which was originally built by King Bhoj (भोज राजा), was enlarged and strengthened. The old fortification is still standing inside Vijaydurga, though in a dilapidated condition.


We came to know various steathy ways in and out of the fort. Attention to details in minutest of defenses, used to stop the enemy if an attack were to be carried out, was plain amazing. We couldn't help but appreciate the strategic thinking during that period of time.

We were told about an underwater wall that Shivaji maharaj got built and kept under wraps all the time. Nobody knew about the wall until recent time. It's said that at least 2 British ships were wrecked by that wall. The interesting part was how the hulls of British/western ships were built in V-shape, while those of Indian ships were built in a U-shape. This U-shaping of the hull enabled Indian ships to pass over that underwater wall safely, while it broke the V-hulled western ships into pieces. That - Indian shipbuilding was indigeneous and not derived from western technology - came as a pleasant surprise - a breath of fresh air, if you will, in a world where all we do is mimic the westerners. And that this very difference was noticed and exploited in that era, was a cherry on the top - leaving us wondering where all that shrewdness has gone since.


देवगड (Devgad)

By the time Vijaydurga fort tour ended, it was 6:45pm and the sun had just set. It was slowly getting dark around. I was not sure whether we will get to Devgad before nightfall. Devgad was still 20-25kms from there and I wanted to avoid driving in the night due to the inconsiderate manner in which people drive - headlights set to upper beam - blinding the incoming drivers.

I again let the bike lose on the silky smooth road. But then things don't always go your way. However hard I tried, it was stark dark by the time we reached Devgad, and I had hurled quite a few choice words towards the high-beamers.

Thankfully we didn't have to struggle much for the room. And what a room we got for mere 500 bucks a night at the 11th hour! Posh interiors, LCD TV, double bed, air cooler, huge balcony, utter clean and posh bathroom with a napkin, towel and toiletries placed where they should be ... boy! Compared to the kind of rooms we have had so far, for a similar cost, it was a gem! A jackpot! It was so unbelievable that we went to the extent of confirming with the reception that it was not 500 bucks per head, but 500 all inclusive. :)

It was a hectic hectic day with some serious driving and running around done throughout. The intermixture of exertion of the day, satisfaction at the end that we didnt have to resort to plan-B, and a delightful room, was too much to handle, and I didn't realise when I fell asleep after we came back from the dinner.


Next: CKRT Day 06 - Devgad to Malvan (Tarkarli)

Sunday, July 22, 2012

CKRT Day 04 - Guhagar to Ganapatipule


Continued from CKRT Day 03 - Anjarle to Guhagar

Route: Guhagar -> Velaneshwar -> Hedvi -> Tavsal -> ferry -> Jaigad -> Malgund -> Ganapatipule

Who let the what out?
We got up quite early in the morning. It was a fresh, cold morning. There was no trace of any ghosts around, nor did we remember hearing anything. I almost rolled on the floor laughing when Pravya told me his predicament in the middle of the night when he wanted to take a leak, and he didn't have anyone to watch his back because I was fast asleep. Alone in that setup, in the middle of the night, was just too much.

After strolling on the Guhagar beach, and again gorging on the home-made Thaleepeeths, we left for Velneshwar. Velneshwar has a colourful temple and a white-sand beach. Nothing outstanding as such. We had another round of breakfast there, and moved on towards Hedvi.


वेळणेश्वर मंदिर (Velneshvar Temmple)



Beach behind the temple


हेदवीची ब्राम्हणघळ (Bramhanghal of Hedvi)

The road to Hedvi, is typical Konkani, and passes through dense jungle. Hedvi is a very small town with a small beach and a rocky coast. The beach is backed up by a dense सुरुचं बन. Nice relaxing location. Hedvi is known for a strange geological setup called ब्राम्हणघळ (bramhanghal). A small crack in the rocks comes in almost 15-20feet from the sea and creates a very narrow 10-feet deep and 20-feel long gorge. During high tides, the tidal water comes rushing inside the crack and breaks at the end of the crack with a loud bang. All the way making a loud roaring sound. I am told, during the high tides of monsoon, the tidal fury is so powerful, that it creates a 25-feet high water-coloumn when the tide breaks at the back of the crack. We moved around in the area for sometime, and then started towards Tavsal.


ब्राम्हणघळ (Bramhanghal) Top Viw


ब्राम्हणघळ (Bramhanghal) Front view

तवसाळ आणि जयगड (Tavsal and Jaigad)

Tavsal is quite closeby from Hedvi. This time we had to wait for about 10-15mins for the ferry boat. That rest was much needed, and nobody complained.


Enroute Tavsaal

We got down at Jaigad after boarding the ferry. A road takes you first to a Jindal factory and then bifurcates into two - one towards Jaigad and one towards Ganapatipule.

Jaigad, like all other forts we had seen so far, is a fort in ruins. When you check out the views, it's quite clear the kind of hold the fort would have had over the creek. It's a strong hold and whoever controlled Jaigad, quite naturally controlled the naval movements in the creek. Vantage point.






Now, though, children use this fort as a cricket playground! There is hardly anything left there to see, apart from, of course, the views - probably because it's difficult to ruin the views with apathy.




After taking photos, and roaming around on the fortifications, we moved on towards our destination for the day - Ganapatipule.


गणपतीपुळे (Ganapatipule)

The road to Ganapatipule is smooth and well laid, but through a barren land for most of the time. Sometimes a coastal sea-side drive pops up and recharges one for the next bout of barren land. But otherwise, it's quite a boring ride. We passed through Malgund, which is closeby Ganapatipule, and has a nice beach. Malgund is the birth-place of well-known Marathi poet - Keshavsoot (केशवसुत - कृष्णाजी केशव दामले)

We got to Ganapatipule, found a room, checked into it, threw in our luggage, and rushed to the beach hoping to catch the sunset on the horizon.

It was a demoralizing sight - the beach. We couldn't decide whether the human sea was more potent or the natural one. It was a huge crowd, and all types of lame beach activities were going on. We trudged along the beach for a long time, in search of a comparatively less populated area, which eventually we found and perched there to observe and click the sunset as and when we desire.

The sky was a bit cloudy, and the hide and seek of a setting sun behind those clouds, was quite an interesting sight, especially with some fishing trawlers in the foreground.





Small Day

Eventually, after the sunset, we got back to our room, and got busy with the daily chores. I had carried couple of 6mm ropes, around 12-feet long, with me, just in case, and they had turned out to be immensely useful for drying out our clothes. Some knots that I had learned during usual preparations for climbing, were turning out to be highly practical and useful.

All in all, it was quite a slow day in comparison with the previous ones. In stark contrast, the next day, with Vijaydurga-Devgad as the destination, was going to be the most hectic and anxious day of the whole trip. Adding to the anxiety was the confusion about the connectivity from Jaitapur and Madban.

After dinner, we went to sleep wondering about the plan for next day.


Next: CKRT Day 05 - Ganapatipule to Vijaydurga

Monday, July 9, 2012

Why People Choose Java over Python



I love Python for the freedom it gives to a developer, and for the way it allows one to concentrate purely on the business logic part of the solution, rather than on the nitty-gritties of the language. Coming over from C/C++ world, it's a breath of fresh air, no matter how much you love C/C++.

Despite all this coolness, this awesomeness of Python, and this black-magic-like problem solving ability that it offers, it's heart-breaking to see the adaptability of this superb language staying much lower than it deserves to be. The industry is still banking on Java for addressing its requirements.

Over some time recently, I have been trying to understand what makes people prefer Java over Python for new development, despite Python being such an excellent choice.

So from whatever little I have understood about the technological landscape so far, here are some points (without any priority as such) that I could put together, as to why java might still be a go-to rather than Python -
  • Java is compiled while Python is interpreted. When you want to deploy a webapp on a third-party web host, with Python you have to deploy all your source on the server, while in case of Java, you deploy compiled bytecode (classes and jars). And though bytecode reverse engineering may not be impossible or uncommon, it just makes access to source-code much more difficult, as compared to Python where you have to deploy production source-code as it is. People are paranoid about exposing their source code.

    CPython / Jython / IronPython might offset this shortcoming to a certain extent, but then this is an added layer, and it might come with its own set of drawbacks, limitations and bugs.

  • A Java webapp, when deployed under an app server like Tomcat, allows request pooling and hence will possibly be more responsive. For a WSGI/mod-python/FCGI hosted Python web-app on the other hand, all requests result in a new fresh invocation of the interpreter and it will be, I suspect, much slower in comparison with a request-pooled instance which can maintain its state.

  • The biggest thing, in my opinion, that goes in favor of java, is the huge ecosystem, of proven tools (development, debugging, profiling, build-management, documentation etc) and frameworks, that has been developed around it over the last decade or so. And 'proven' is really the keyword here.

  • When it comes to language constructs, Python doesnt enfoce anything. It's a come-all-do-all language where even following OOP paradigm is *voluntary*. for exmaple, encapsulation, which is a very important OOP building block, is not enforced. It's voluntary. You can use _underscores_ and __double_underscores__ if you will to specify class variable accesses, but then there is no restriction on their being accessed from outside the class definition - private/protected/public notwithstanding. So chances of a developer making a subtle but critical mistake are much more than say in java.

    Managers, product owners, and anybody for that matter, want to have the peace of mind that the software development process they are overlooking, will have stringent checks in place at the grass root level itself, so that a subtle mistake from an inexperienced developer wont go on wreaking havoc on production.

    Java to a large extent has those checks.Pointers, or rather lack of it, was one of the reasons why it gained acceptance above C++ after all. Java enforces OOP paradigms. It has static typing as opposed to duck-typing or dynamic-typing in Python. Due to enforcement of OOP, it opens up large possibilities for development methodologies, like interfaces and contracts, which, though possible in Python, will be bypass-able, due to its weak OOP support.

Again, to reiterate, I have jotted this down as per my understanding of the technological landscape. I am nowhere near being an expert in either Java or Python, and I do not claim to be one either. So there might be some errors in the way I perceive these things, and if you spot one, please point it out.

With that, I open it up to you guys. I am sure there will be lots of viewpoints as to why Java clicks, since we have such a large experienced Java population here. And there will be counter-points as to why Python clicks despite these points or why some of these points I mentioned aren't valid anymore. So let those viewpoints flow.

Thursday, June 28, 2012

CKRT Day 03 - Anjarle to Guhagar


Continued from - CKRT: Day 02 - Shrivardhan to Anjarle


Route: Anjarle -> Harne -> Suvarnadurga -> Anjarle -> Dapoli -> Burondi -> Ladghar -> Kolthare -> Dabhol -> Dhopave -> Anjanvel -> Guhagar

After getting up early in the morning, we quickly set out towards Harne. Quite a few locations were on the mind - the Light-house, the fish market, the citadel of Harne and most importantly the Suvarnadurga fort.

After we left Anjarle, sun had risen, and standing on the hill which overlooks Anjarle beach, the scene around can be described by only one apt word - नजारा! Starting from the Kadyavaracha Ganapati (कड्यावरचा गणपती) on the right, to the dense coconut backyards, to the clean Anjarle beach, to the sea to the creek that separates Anjarle from Harne, to the small Konkani houses doting the coast, to the Suvarnadurga fort ... and all of this goldenified by the rising sun. It was a beautiful sight. One which makes you forget whys and whats and wheres.


Exact opposite was the route that we took to Harne. It was a short coastal route, but very dirty and it was stinking bad. We still found couple of moments to try and capture Suvarnadurga apart from a large group of egrets feasting on dead fish (again!).


Harne

The citadel of Harne was in ruins. Crossed.

Citadel of Harne
After getting at Harne jetty, we were told that boats for Suvarnadurga fort leave at around 9am. As for charges, if there are enough people, Rs.100/head, else a dedicated boat would cost Rs.400/- for to and from Suvarnadurga. Fair enough.


Suvarnadurga सुवर्णदुर्ग 

Light house of Harne in the far left corner
Hoping to see a few more people, we started walking towards the light-house. It was in absolute ruins and had become a roosting place for crows. We went towards its backside, towards the sea, and view was quite eye-pleasing. Heavy waves breaking loudly on the rocks, while a few fishing boats were plying here and there - their boats-men busy with the fishing nets. A large extent of sea was visible, apart from couple of very small uninhabited islands close by.

While I was sitting there taking in the views, suddenly I noticed something big flying towards me. It was much bigger than a kite. While I kept staring at it in awe, it came at perched right in front of me - around 20-30 feet. Such a grandios pose and mannerisms. It was an eagle, goddamnit. It looked like a juvenile of a Greater Spotted Eagle! Lifer!

Life is never fare. And you know that in black-and-white clarity, if you are into photography. I had a magnifiscent eagle sitting merely 20-30 feet in front of me, bathing in sunlight, with sun behind me, on a perch which was dramatically separated from the background ... in short all things favourable ... and my camera had a wide-angle lens on it! And to add to the misery, my monstrous tripod was hanging by my shoulder.


Juvenile of Greater Spotted Eagle (?)


Indian Pond Heron (breeding)
I started scrambling in my camera bag for switching from wide-angle to telephoto, while still keeping that tripod on the shoulder, and while keeping the movements to the minimum. But these मनमौजी birds don't wait. The eagle took to its wings before I could focus my camera on him! A golden opportunity lost.

I tried to make most of what I could get of that eagle, and them came back down towards the jetty. By that time, a large crowd had assembled on the Harne beach. Turned out, that was the fish-market we were after.


The Fish-Market of Harne




It was still more than an hour to 9am, so we rushed to the beach. A lot of different types and sizes of fish were being auctioned. People were hyperactive auctioning and bidding. At the same time, some fellows, even some old ones, were stealthily lifting some small fish while the seller looked the other way even for a fraction of second. The sellers, if they discovered, would get irritated, would snatch the fish and put it back into the basket. Some ladies who had bought their fish from the market, had setup their 'retailing' shop right around the market itself - mostly for the tourists. They had  quite a bit of variety - cut and cleaned fish, spiced, salted etc. While all this was happening, more and more fishing boats were docking at the beach, their catches were being loaded into bullock-carts and fresh goods were arriving at the market. Hyper activity and a spectacle no less.











After having enough of the market, we got back on the road to get our breakfast. It was 8:45am and we didn't have much time to feed ourselves.

By the time we retured back to the jetty, another group of 3 guys from Pune itself, had had arrived and was looking for ferry to Suvarnadurga. In next 5-10mins, we had boarded a motorboat together, and were on our way to the fort.



Suvarnadurga (सुवर्णदुर्ग)

The beach on which the motorboat docked after traveling for about 15-20mins, was a fantastic small white-sand beach. It was a swimming paradise, since the beach was gaining depth very quickly. Unfortunately, however intense the urge was, we neither had time, nor spare clothes to go swimming right then and there. Something has got to give sometimes.



Suvarnadurga was a fort in absolute ruins. Crows and bats had made it their home. Almost every bare tree on the fort had lots of crow-nests. And one peepal tree was hosting infinity-squared number of inverted creepy bats at the same time.

There are some water cisterns, some store rooms, a small secret passage-way and a still standing massive and impressive fortification. That's about it. Nothing much.




In about an hour, after roaming along the fortification, we came back to the beach, boarded our boat, and came back to Harne. The fish-market crowd was thinning by then.


Dabhol

We checked out after returning to Anjarle, and left towards Dabhol via Dapoli->Burondi->Kolthare. Had lunch mid-way in Dapoli. The road from Anjarle to Dapoli is excellent. That from Dapoli onwards towards Dabhol is not that good though. A new road is being laid out and it might get much much better in next few months.

En route Dabhol, we saw some of the finest typical Konkani villages, which one would immediately fall in love with. There was one called Panchnadi was which settled along a descending hill before the jetty, and the style of those houses, their scarcity, the shallow flowing river with crystal-clear water - enough for its bottom to glitter with falling sun-rays, and the dense jungle around made it a serene and surreal place which I would only dread of in my dreams.

When we got to Dabhol jetty, a ferry boat had already docked and my bike got accomodated immediately. We were lucky once again.


Gopalgad of Anjanvel   अंजनवेलचा गोपाळगड 

After alighting at Dhopave, we started towards Anjanvel to visit Gopalgad. We passed the Enron of Dabhol on our way, and it seemed like it was in working condition - contrary to what we believed. To add to our surprise, after we took the turn for Anjanvel, we noticed Enron's gigantic cooling towers were humming, with water streams dripping. So it was indeed producing electricity.

The Enron of Dabhol
Anjanvel is a small village situated in the valley formed by two close and gigantic walls of Sahyadri. On three sides, it's surrounded by those massively steep walls and on one side it has got a cute beach tucked in as an outlet to the sea. It's one heck of a beautiful Konkani town.

For getting into Anjanvel, one has to climb down the steep, very steep wall on one side of the town, and controlling the speed on those steep slopes calls for circus. Had those sloped been any steeper, we would have to reach Anjanvel head-first on gravitational assistance.

You get down into Anjanvel and then you realize that Gopalgad is situated on the steep mountain wall on the other side of the town. If getting down was hard, going up is even harder, with the front wheel barely staying grounded. Any small hint of throttle, and it lifts off. With a pillion and around 30-40kg of luggage on the bike, sensing the front-wheel lifting off of the ground, and much scarier than it sounds.

Gopalgad was a surprise. We were greeted with a board saying - that historical place was actually "a private property and is open for tourists"! That was a first. So far we were under impression that anything, that had anything which seemed even remotely like fortification, is a government property, which the government is entitled to sit over and watch getting slowly destroyed over time. Here a private party was one step ahead, and had already converted the interiors of the fort, into a mango farm! Later I came to know that there was a court-case going on between the Govt of India and the "owner" of Gopalgad, who, as I was told, wouldn't allow hoisting Indian flag on the fort on even national days like 15-Aug and 26-Jan. What a crazy-ass banana-republic we are living in!



White Bellied Sea Eagle circling over a kill
There was nothing on the fort, apart from flowering mango trees of all sorts. Sitting on the fortification, facing the huge Dabhol creek, and watching an occassional streamer  or some rare raptor circling above a kill, is all that's Gopalgad is about.

We sat there on the fence, clicking this and that, and eventually having a chat with the watchman of the mango farm. The guy was surprisingly knowedgible for his post of a watchman. We talked about various things ranging from the mango produce, profit and loss, to Enron to Jaitapur to local issues there. He told us how supporting Enron would have been beneficial for the villagers, about how the politicians and the "angrez" finally got their way while it was the villagers who lost the offered good life, about where the massive gas pipeline comes from and where it goes, and about how Enron was a gas company rather than an energy company. This last one about Enron being a gas company, jolted me to the core. This kind of an observation needs a keen mind and a shrewd analytically thinking mindset. Definitely not something expected of a mango-farm-watchman in some sleepy village. What we had in him was a shrewed, very well learned guy with balanced and fair opinions which even educated people hardly have these days. His opinions didn't suit his humble job.


The Light-house

We moved on towards the light house. This was the first time I was seeing one. It being a govt. property, and we being hardened terrorists, on our mission to recce and blow-up a small-time harmless light house, we were not allowed to carry our cameras inside. The place was impeccably well maintained, despite being 50-60 years old. The prisms and lighting system was mounted on a revolving setup and we were told it starts automatically at predefined times, and I could notice it was connected to some external network, possibly for remote command and control operations.

It was absolutely windy on top of the lighthouse. Had we not have any support, we would have got blown away smoothly into Guhagar. That's how maniacally wind was blowing up there.


Guhagar

After getting down, we left towards Guhagar. Again the climb, after leaving Anjanvel towards Enron, was marauding. Somehow managed it, and in about half an hour, we reached Guhagar.

I had already called and arranged for the stay, while wandering on Gopalgad. The Jog family turned out to be very sweet, homely, talkative and welcoming one. We kept discussing this and that, eventually landing on different connections in Sangli, while gorging on a fantastic set of थालीपीठ, before we set out to the place where we were going to stay.


The Guest House ... or was it a Ghost House!?


It was a huge Konkani house, it turned out, that we had rented at mere Rs.200/- per head. A 200 year old at that! And there were only two of us - me and Pravya - who were going to stay in that huge and lonely  house, that night. And boy did the place have a feel! All the doors and their hinges were squeaking. A portable wooden ladder was leading to a dark attic, which we dared not look at. There was a full-size wooden swing in the porch, which was half-broken on one side yet in movable condition, and it would make a very apt sound while moving - custom-made for announcing arrival of ghosts in a starry new-moon night.
And then to complete the treatment, when we are placing our luggage in thr biiig hall, suddenly out of nowhere, came an army of big black ants (मुंगळे), which reminded me of The Mummy, and made me wonder if a cockroach-eating muscular guy would enter the room next, from that mysteriously dark attic and wring our necks like hapless chickens. But before anything of that could become a reality, we left the place under the pretext of checking out the new Durga-devi temple in the city. That goddess specialized in handling such cockroach-eating-muscular-maniac kinds afterall.

It turned out to be a very beautiful temple; and as part of the महापूजा, प्रसाद-वाटप was under way, by the time we reached there. There was शिरा in the प्रसाद and no-one says no to शिरा. We made them ask more than once, and we didn't say no on either occassion. It was a damn well made one.


That day when we returned and made our beds, we were half-expecting some payals and/or a satanic-laughter jolting us anytime out of our sleep in the middle of the night. It was a freaking 200 years old house after all.

Owing to the exertion of the day, though, I fell asleep even before my mind could render and race behind the legs wearing those payals or the face behind that satanic-laughter.


Next: CKRT Day 04 - Guhagar to Ganapatipule