You are viewing [info]code_martial's journal

 

Wheelspin!

About Recent Entries

Paratha Consumption 101 Oct. 11th, 2011 @ 06:55 pm
Back in 1997, my friends and I headed to Nirula's at Connaught Place to have some pizza in celebration of our passing out of school. It was lunch time on a working day and a lot of people in suits had descended to have lunch. We noticed one particular gentleman wearing a suit, having stuffed parathas... with a knife and fork!

It was quite an amusing sight. And no, he didn't look like he was from some other country.

Jump ahead to one fine morning in 2001 and I was with [info]peeyush and a few other NCSTians, having breakfast at NCST canteen. They were serving stuffed parathas and I found almost everyone over there to be having parathas with knives and forks — even our bus driver!

So, I decided to try it out myself. Two stuffed parathas, one over the other with butter melted between them, folded once over. The knife neatly cut a corner off the paratha, the fork dug effortlessly into the layers, and it tastes yummm...

Trust me boys, as absurd as it may sound, the best way to have soft, stuffed parathas is to use a knife and fork. I still feel embarrassed as I recall that day in Nirula's while we made fun of the dude who knew what we knew not.
Feeling: okayokay

Writer's Block: Remembering Steve Jobs Oct. 6th, 2011 @ 07:42 pm

Steve Jobs once said, "Your time is limited, so don't waste it living someone else's life." He inspired a generation to Think Different. How has the legacy of Apple's co-founder influenced your life?

View 495 Answers



The biggest influence that Steve had on me was that a) I learned how to see through sales and marketing bullshit and b) I realised how important "packaging" and "experience' are, when you want to sell stuff.

I watched his famous Stanford lecture where the above quote is taken from. Apart from all the inspirational bullshit, no part of which is truly inspirational, the one thing that I really remembered was that he actually believed that if he hadn't done things like make a smaller computer or an animation studio or stuff like that, nobody else would have. Well, I can't really talk in reverence about someone who believes that they somehow saved mankind from some form of doom.

He managed to bring some new stuff to the market and sell it big time, but the personal computer or the pocket-size MP3 player or the touch-screen-only phone were done before he did them.

He was undoubtedly the most successful entrepreneur I can think of, but I don't think anyone would go far by drawing inspiration from his Stanford speech or any of his other wins. For that, you'll have to actually believe that you're doing stuff to put the whole world out of misery, and then have the skill to pull the marketing con. Tough ask.
Feeling: blahblah

Alter-Geeks Sep. 22nd, 2011 @ 01:53 pm
It's one thing to acknowledge the existence of non-software geeks — art geeks, CG geeks, gaming geeks, literature geeks — and a whole different thing to chat with them every day at lunch or over coffee or in meetings.

My work may get boring some times, but my workplace doesn't :-)
Feeling: gratefulgrateful

What's Changed? Sep. 16th, 2011 @ 11:59 pm
Just spent the last half an hour or so looking around LJ, trying to figure out what's changed. Well, it looks quite a bit different from what it did a couple of years ago, which is a good thing. It means that LJ is not abandonware.

On the other hand, the blogging part of it has remained fundamentally unchanged, except for minor conveniences like publishing notifications to Facebook or auto-uploading images to a few photo sharing service providers. That's good too, because — yeah, okay, Wordpress is nice and all and you can install it on your website and own the data, but — LiveJournal blogging interface is still pretty awesome, in my opinion.

Then there are the clients. I've got LogJam installed on my Linux laptop (Oh, yay! Linux on the laptop! It became viable, just about the time that I stopped posting non-tech kind of stuff on blogs) and I'm writing this post from Semagic for Windows (on the desktop, if you like to know). BTW, I also switched back from the dark, photography inspired Journal style to the old and super-awesome Digital Multiplex (OSWD) theme. I was pleasantly surprised to find that LJ remembered my theme customisations for it too! :-)

Okay, I'm sorry if this post comes across as lame and pointless but despite wanting to update this blog, I can't really think of stuff to write. Scratch that... I have a few things to write about — like the dinner we recently had at Sufi, or the movies that I watched in the last few weeks — but somehow it's difficult to get started on writing that stuff. It becomes a bit difficult when you're no longer doing this as the primary activity that creates your persona online. You know what I mean? Gosh! How did I manage to write those massive travelogues ca. 2004, 2005?
Feeling: sleepysleepy
Listening to: End of the Night - The Doors

Wh... where am I? What day is it? Sep. 8th, 2011 @ 03:29 pm
That's perhaps the reawakening-from-a-coma equivalent of a "Hello World!" post.

Viva LiveJournal!
Feeling: curiouscurious
Other entries
» Rewriting, and Rewriting From Scratch
vlangber writes:

Joel Spolsky wrote a famous blog post back in 2000 called 'Things You Should Never Do, Part I,' where he wrote the following: '[T]he single worst strategic mistake that any software company can make: They decided to rewrite the code from scratch.'


Sometimes readers take this to mean that rewriting software is a mistake, ignoring the key phrase, "from scratch".

The implications of "from scratch" are that you have a forked code-base and the new and old code are developed in isolation. When that's the case, I tend to agree with him.

I read Joel's article shortly after writing my own KISS blog post and referenced to it in the "Write Disposable Code" section. My premise was that if you write code that you can throw away, you can just re-write the problematic bits of your application without having to rework the whole of it. Even rewriting the whole of it could be a phased approach.

Early in my career I was doing a lot less code writing than I was studying how code was written. One of the advanced diploma classes that I took on Software Engineering [Discipline] had a discussion about various levels of software coupling.

Unfortunately, I don't remember the whole order of the list, nor its source, but I do remember that the loosest coupling was achieved by sharing nothing except data. (Edit: Found the list and its source, see footnotes).

Anyhow, back to the point. Since the day I found that list and I internalized the fact (or empirical observation, if you please) that data is the loosest means of coupling, I've been designing my systems as collections of components that only exchange data with each other. Even while designing interfaces to be used within the same programming language, I prefer using pure data objects instead of UDTs/Class instances.

I don't use IDEs to help me with refactoring because I've never felt the need to have this support. That, in turn, is because I've never had so much code in one component that I can't analyse it using more easily accessible black-box and white-box testing/debugging tools. When a component implementation gets out-of-hand, I prefer to throw it out of the window and start over with a new understanding of the software at large and the realities of the environment it operates in.

Meilir-Page Jones has done a lot of work on analysing the technicalities of code "cohesion" and "coupling". His book, Fundamentals of Object Oriented Design in UML has an amazingly brilliant discussion of these concepts. What's really strange, for me at least, is how all of that discussion is applied to the creation of really large OO Taxonomies without actually suggesting that it might make sense to build many of those pieces as separate components or entities.

Object Oriented Programming discourses, besides the basic premise of co-locating data and behaviour, have almost universally focused on building massive applications within the same environment, under the same project. Obviously, when you *can* operate at a very high level of coupling (same program and source code scope), you need a lot of discipline to keep you from falling into the tight coupling trap.

That's also where my differences with some OOP implementations (e.g. as done in Java) stem from.

One of the side effects of poor implementations of the OOP paradigm was that data sharing and creating objects were made mutually exclusive. It is, for example, the difference between being able to recursively break down an associative array using standard interfaces, vs. accessing data inside objects using class-specific accessors (getters/setters). What's worse is that this is actually promoted as a good practice (never have public data members). It's not a bad OOP practice if you're exchanging objects. The problem is, you end up exchanging objects where you just ought to be exchanging data.

It's somewhat telling that the one time I was most clueless about why a problem was occurring and how I could proceed to solve it was when trying to debug slow operation of the Shuffle phase in Hadoop's MapReduce engine. Thankfully, I was the junior-most clueless bloke in that case and it took the seniors quite a long time to figure out things they could fix. Oh, and you also know that Hadoop is a big hunking piece of Java code ;-)

Please do remember, though, that Hadoop is system level software and very sensitive to performance issues. It would make trade-offs in favour of performance at the cost of maintainability more often than a non-core technology company would for stuff that it builds in-house.

Footnotes


The coupling levels were defined by G Myers in 1974 and were further formalised by Fenton and Melton in 1990. See Table 1 in this paper for the levels and their implications:
http://ajse.kfupm.edu.sa/articles/331B_P.9.pdf
» Switching from a 4:3 CRT to 16:9 LCD TV? ˑ
With a combination of impulse, cost-sharing and pent-up demand, my parents ended up buying a 32" LCD TV. They've got it up on their wall and are very happy with the way it looks, not to mention the big step up in screen size from the old 21" CRT.

Apart from the form factor, though, the pros don't go too far. This is a short note of issues or things to keep in mind before switching from a 4:3 CRT to a 1080p wide-screen TV. I don't know about you, but I'm going to use it for reference.
  1. Content Quality: If you spend most of your time watching the regular cable/DTH TV content, you're in for distress. When you switch from a small TV to a large one, you'll suddenly notice how pathetic the recording and transmission quality of TV content in India really is. The difference you notice would depend on the specific content supplier, channel and even the programme. The best I've seen is Airtel's pay-per-view movies, which are "DVD Quality", as advertised. The worst are among the most frequently viewed channels -- stupid saas-bahu soaps and music channels.
  2. Content Aspect: This is partly tied to the first one but I'm putting it as a separate item, mostly because #1 is about differences in screen size (vertical size, actually; see #6) and wouldn't be a big issue if that doesn't change appreciably. This point is about showing 4:3 content on 16:9 screens. None of the DTH/Cable operators in India are offering HD content as of today. Scaling the 4:3 stuff is mostly a PITA, but these days having a 4:3 set isn't all fun either. I wonder if you've noticed, but you often get unboxed 16:9 content on cable, making it look vertically stretched. Then there are those junky Moser Baer Bolly-movie DVDs that letterbox a wide-format movie into a 4:3 signal. How I hate those bastards for doing this. You can't play those DVDs on your 16:9 TVs without losing resolution and/or watching a shrunk 16:9 video boxed in a 4:3 boxed in a 16:9. You wanna know what it looks like? This, minus the outer-most 4:3 boxing. I thank the dedicated aspect switch button on my Sony HD-CRT's remote because I can't tolerate screwed up aspect ratios anywhere, ever.
  3. Cabling: How many LCD TV ads have you seen where they show the TV hung on a wall? Almost all of them, yeah? How many of them show the cabling? With just two external components -- cable/DTH TV and a DVD player, you get a messy tangle to handle. Most cables are also not long enough to have all the hardware placed in a corner. The result is that you invariably need some sort of trolley under your TV, even if it's up on a wall. My plan is to get a 5.1/7.1 Amp with HDMI multiplexing so that I can connect my peripherals (game console, DVD Hi-fi, Blu-Ray, DTH, PC) to the amp and have just one cable going into the wall-mounted TV -- a 5 meter HDMI. Oh shoot, I forgot about the power supply cable :-| Why didn't they build a power line into the HDMI spec itself?
  4. Sound Format: Talking about amps, I realised that playing DVDs or other media with 5.1 channel sound on a stereo system is bad juju. This may be specific to Sony DVD players, but the voice channel gets severely choked during the conversion from 5.1 to stereo. If you have a movie DVD that gives you the option to choose between 5.1 and 2.1 channel outputs, you should try them both and see the difference in voice loudness between the two. It's dramatic.
  5. Peripherals: This note is about integration with the rest of your A/V components. Once you've got an HD panel, you'd want to view everything on it -- youtube videos, DVDs, photo slide-shows, and clips from the new-fangled HD video capable DSLRs and AVHCD capable digicams. Heck, if I get sufficient colour fidelity, I'd even edit my photos on that panel! IMO, not having a PC connected to your HD panel would make you miss out on a huge potential. If I have to choose between hooking up a PC with an HD LCD vs. hooking up DTH/cable with it, I'd choose the former. The good ol' 4:3 CRT is is as good as the more expensive LCDs for watching "TV".
  6. Sizing: Sizing is another issue when moving from a 4:3 TV to a 16:9 TV. If the aspect ratio wasn't changed, you could just compare the diagonals and say that, e.g. a 28" TV has twice as long edges and 4x as much area as a 14" TV (remember those li'l bachelor-pad fillers?). This doesn't apply when comparing a 21" 4:3 TV with a 25" 16:9 TV. The latter is actually smaller, at least where "TV" content is concerned. Since content resolution is measured in number of lines in the vertical (e.g. 480p, 720p, 1080p, etc.) irrespective of aspect ratio, I find it more instructive to compare the vertical edges. By that measure, a 21" 4:3 screen is as tall as a 26" wide screen. The ratio you need is 1.224. If you are a movie buff, you might want to consider the anamorphic wide-screen ratio of 2.35:1 The height equivalence for that will be at 1.53x. If I want to upgrade my 29" TV and watch DVD/Blu-Ray movies at essentially the same vertical size as the ones I watch on HBO, I'd have to get a 46" LCD TV.
Ah, now to work out a savings and acquisition plan for this set up. Till then, my trusty CRT-HDTV and its 720p capabilities will keep me happy. Hope this helps you make a more informed purchase for your LCD TV and its integration with the rest of the entertainment gear.
» The UV Filter FUD
When I bought my first lens (18-200mm VR) I asked for a UV filter to go with it. It was the Right Thing™ to do. I had to "protect" my lens, right?

The second I bought was on a bit of a tight budget. Lots of planning and saving went into it. Then came the incidental expense. $40 for a 52mm multi-coated filter. Wham! That's what Mumbaikars call a fatka.

Why do we really buy these pieces of glass, really? Let's see... they keep the lens protected in case of a crash and they prevent the lens from getting dirty. What do they take for this service? Image quality (IQ) and money. Are they worth the price in both terms?

Protection Against Damage
A UV filter is just glass in a plastic or metal ring. It can't, by design, absorb any impact. Glass is brittle so it'll neither deform nor flex. The ring around it itself is too thin to absorb any shock at all. What the filter can do is make things worse by shattering and spilling shards of thin glass that could cut you or scratch the lens element really hard and bad.

In a lot of cases the impact on the lens, when you drop it, isn't enough to shatter the lens elements. The UV filter on the other hand is too easy to break. When you see a shattered filter on an unbroken lens, the impression you get is of a sacrifice. This works wonders for the placebo psychology and you don't stop to question whether the lens would've survived without the filter.

You'd also not realise that such accidents commonly leave the filter jammed into the lens threading, making it tough to remove and replace without damaging the lens that you so dearly wanted to protect.

Guess what works better than a filter and comes for free with many lenses -- a hood. It's flexible so it has real shock absorption abilities unlike the UV filter placebo. It also protects the lens from scratches as effectively.

Keeping the Lens Clean
The other most common use of a filter is to avoid having to clean the lens. The idea is that it's easier -- risk free, rather -- to clean the filter instead of the lens. In my experience of using UV filters over 3 years, I've found the front element of the lens to be amazingly more resilient to dirt than the UV filter.

I took my new 16-85mm VR lens to a recent trip to Kerala through dusty mountain trails and to salty sea-fronts. The hood gathered quite a bit of dust and in those conditions I'd be wiping the UV filter after nearly every shot but not so with the lens directly exposed. The only time I smudged the lens was when I tried to pinch off the lens cap and left my fingerprints since the cap was already removed!

Again, put on a lens hood to avoid having things touching the lens and your lens would take good care of keeping itself clean.

The Price

So what's the price you pay for a little psychological comfort? It's a trade-off between money and IQ. You could get a cheap filter and have it erode all the contrast and flare resistance that your lens maker worked hard to put in. That, let me tell you, really sucks because what makes or breaks a good lens is not just its MTF figures but also its contrast characteristics that, unfortunately, most reviewers only comment on but don't measure.

You could otherwise pay up more to get all the coatings that are already on your lens's front element to minimise IQ impact but then your filter becomes as precious as the lens. Of course it will be cheaper than your lens but you'd still hate replacing it. Since the filter is really not capable of preventing lens damage, it's just another asset... er... liability to take care of.

Given the 1:5-10 ratio of filter to lens cost, not buying UV filters is like getting a free lens when you buy 10! If it's the nifty-50 that you want for free, you just need to buy 3 other lenses without filters ;-)

See Thom Hogan's opinion about filters as well.


Post from mobile portal m.livejournal.com
» Photography Updates
Last week, my entire photography setup went through an upgrade and that means a lot of exploration and experimentation to get up to speed with things. While I'm looking forward to an extended shooting opportunity to get into the flow, sporadic shooting through the week got me started. Here are some notes from the experience.

The Camera: Nikon D90

What's New?



[info]nadircruise and I were heading to MG Road on February's last Sunday for him to buy a Nikon D5000 to replace the Sony Alpha 200 that he wasn't too happy with. A long set of permutations later we figured that he could take my D80 and 18-200mm VR and buy me a D90 with 16-85mm VR instead. I couldn't believe this plan actually happened but after much verification it seemed to indeed work with him, so we did it.

I wasn't too excited with the D90 because I didn't need two of its most advertised features -- movie mode and Live View. I tried a bit of both and I still hold my opinion of them. The high ISO benefit also looks a bit hyped to me. There's definitely 1-stop of difference but it's not enough to force a switch. So far I've not dropped below ISO 800 and the output doesn't encourage me to push it either. The larger LCD is good too but it's more useful for impressing others than for critical review.

So what does D90 have going for it? I think it's the AF -- 3D tracking and low-light AF performance, in particular. 3D tracking allows you to use one of the AF points to lock focus with and then recompose the shot. The active focus point will switch to the one that's closest to the subject you locked on. I can only imagine how good this would be with 51 points in D300 and higher class bodies!

Metering on the D90 also seems to be better. I've reverted to shooting in A mode with centre-weighted metering for casual shots. I try Matrix occasionally but I prefer using the spot meter when CW doesn't cut it. The reworked menu system is now way too elaborate so they've given the option of creating a custom menu where you can put your most accessed menu items for quick access.

The Lens: AF-S 16-85mm f/3.5-5.6 G ED IF SWM VR Nikkor

16mm DX View



More than the camera body, I'm impressed with this lens. It's the bees knees when it comes to resolution -- high enough to let the D90 flex its 12MP muscle without making the 100% crop look smudgy or soft. Flare resistance seems to be good though I've mostly been shooting with the hood on. AF is super-silent and super-fast. Colour rendition is amazing (though I'm wondering if some of it is just Capture NX 2's magic). The zoom ring is much tighter than 18-200mm VR, which will take some time getting used to. Focal length accuracy isn't a critical factor so I prefer the faster action of the super-zoom. I also don't feel like the VR on this lens is strong enough. Anyhow, my 35mm f/2 has gone hiding ever since this lens came on board.


The Lighting: Nikon SB-600 Speedlight with LumiQuest Accessories

Nikon SB-600 with LumiQuest 80-20



More than the $800 body or the $650 lens, this $225 accessory has impacted my shooting for good! Guys, I'm telling ya. If you don't have a speedlight that you can also use off-camera, you must get one NOW. And when you've got one of these and played around with it for some time, you're only gonna want MORE of them to play with.

I've had so much fun with the SB-600 that I can only keep wanting more of it. The Nikon D90 shot above was taken with the SB-600 wearing different coloured gels and pointed in different directions to give multi-coloured background illumination and a different colour for subject highlights. Oh, fun! You should also read the illumination notes for the following photo (in one of my comments on the details page).

The Blackberry Prayer



The ProMax system is going a bit under-utilised as of now, mostly because my S/O is floored by the difference that ceiling bounce makes to the photos and is yet to be convinced with the 80-20 difference. Bouncing the flash is the easiest way to make your photos look way better. You don't have to do anything except attaching the speedlight to your cam and making it point to the ceiling (not the sky, of course). That's the reason why I've still not dropped below ISO 800 or used the 35mm f/2 much. Indoor casual shooting is p0wned by the SB-600.

Development: Nikon Capture NX 2

Last piece in the equation is how you turn those NEFs into final images. After seeing several online reviews and tests, it's an undeniable conclusion that no other converter can work the NEFs better than CNX2. Nikon embeds so much more shooting data into the NEFs that is only decoded by CNX2. But don't worry just yet. All that data only makes some of the post-processing happen in a less manual way. The real killer is that CNX2's treatment of highlights and shadows is miles ahead of what Lightroom or Aperture or what-have-you does. The U-point technology that they've used is another thing that allows easy execution of changes that are practically impossible to achieve with The Gimp. The Auto-retouch tool is magic!

CNX2 on Windows Vista seems much slower (2-3x so) than UFRaw + Gimp on GNU/Linux but the overall time you spend on it could easily be less because making tweaks that do what you mean is much easier and faster with CNX2.

Goodbye F/OSS. Where photo development is concerned, my soul is sold to the devil. I doubt if there's any F/OSS advocate from the millennium cross-over era among my acquaintances that's not using proprietary software (mostly the evil Mac OS) full-time for something or the other.
» Remote Model Designs for Web Apps
I've been involved with writing back-ends and (limited) front-ends for multiple web-apps over the course of my career and one pattern that I observed at the last 3 of my 4 workplaces was that the application started as a single unit running on a webserver but the model sooner or later got ripped out and deployed in a separate layer over the network.

There were different reasons for the model to be broken out. In one case, our team was the provider of some data (ratings and reviews) and all the data management logic. It soon stopped making sense and being feasible to package our code and get it deployed on rapidly growing client base. So we started offering it as a webservice. In the second instance, we had a website to display our data as part of the end-user experience but soon realised that there was demand for the data itself via the b2b channel, so we again created a webservice. In the third case, it was driven by a need to scale up and modularise a pretty large and complex web application that we had, and the first step was to decouple the data management from the application UI.

wsloader was a product of this observation. Having done this thrice over, I wanted to make the process as painless as possible -- even have it as the starting point in fresh application development.

This blog post is essentially just to discuss whether the repetition of this pattern has been a coincidence with me or is it a recurring pattern in the larger development ecosystem.

If it is a larger pattern, does it make sense to recognise an end-to-end development pattern wherein some toolkits or frameworks establish and automate the conventions in providing data services and some other toolkits establish the convention in usage of these services to build the UI -- whether it be for direct end-user interaction via different platforms (web, mobile web, etc.) or for integration into other applications or systems.

How many web applications have you built where you have (or wish you had) stuck a UI on top of decoupled data services? Do you think that the thick-server pattern as promoted by frameworks like Django, Rails, etc. is inherently not scalable? If it were a project specification to have remote data services and a decoupled UI layer, what tools would you use to work on that project?
Top of Page Powered by LiveJournal.com