Tuesday, September 25, 2007

Sabeer Bhatia back with Apnacircle.com

With growing number of community list like Orkut, Facebook, Simpler version of e-learning community@Englishtown now Sabeer is venturing in to same arena. He has come up with his version of online social utility - ApnaCircle. He has different kind of marketing strategy though - like accumulating points as you spend time on his website and you redeem your points in exchange of some gift.

But on the whole, web seem to driven to unify bunch of users around the world .. good or bad... but really has shrunken the world and broadened the human mind.

Sunday, September 16, 2007

Photography - Rule of Thirds

I have lot of interest on photography. I love taking picture and watching others picture. At one point, when I did not have a digital camera, it was quite an expensive interest to hold upon. Now that I have a digital camera, now that I can shoot anything I feel like and play around the picture with some photo enhancing software. I got a pretty decent camera in my mobile as well. I have published my pictures at http://www.flickr.com/photos/beautifulminds/

I love my Camera too. Canon S1 IS with 10x optical zoom. Pretty nice camera for amateur which I bought some 3 years back. It is a well designed camera and fits nicely in my hand and give nice balance. Very effective IS (Image stabilization) as well is very handy when you start using 10x zoom. Only thing it lacks is, now it is 3 MP (Megapixel). It would have been better if I had a 6MP+

However, getting back to the topic. I thought I will take my photography more serious that before and wanted to learn about photography. I did some googling and read some blogs in flickr. Many people talk about one concept a lot. It was “composition” of the picture. It is nothing but identifying your subject and draw the attention of the audience towards the subject. It could be by placing the subject at different location of the photo or blurring the background and appropriately focusing the subject. There is guidance available for us and it is called “rule of thirds” handy. It has been followed for centuries now.

By this rule, if we divide the picture in to 3 vertical and horizontal portion, just like tic-tac-toe -2 lines drawn at equal spacing between them horizontal and vertical – these drawn lines form intersections. They form 4 intersections on your picture. The rule says the subject should lie on the intersections of these lines. Very interesting and gives an easy rule to follow for beginners.

Sunday, September 09, 2007

Proof of concept - Be careful with Environment!

At work, one of my colleague was suggesting using URLMapping available in .net 2.0. So thought will try something and play around with that. It is pretty simple implementation available ready made though we can think of building something to support wildcard or regular expression. Many out there have already built and kept in place - available as free and commercial version.

First, I was trying to build a POC for a URL Mapping feature in .net 2.0.

So, I had the below config in the web.config.

<urlmappings enabled="true">
<add url="~/application/action/view/test" mappedurl="~/app/navigate.ashx?action=view&module=test">
<add url="~/application/enroll" mappedurl="~/default.aspx?action=enroll">
<add url="~/application/register" mappedurl="~/app/navigate.ashx?action=register">

The above stuff worked beautifully when I ran from the VS.Net 2005 editor. The application was running in the Web Dev server. For "http://localhost:2401/application/enroll" it mapped the request to default.aspx. I moved the application to IIS 6.0. Booomm!!! I get 404 error with the http://localhost/urlmapping/application/enroll. Makes sense, because when I try http://localhost:2401/application/enroll, IIS tries to find the default document - ah now IIS could not find any default document, it throws 404 exception.

<urlmappings enabled="true">
<add url="~/application/enroll/<anything>.aspx" mappedurl="~/default.aspx?action=enroll">

When above change was made, it worked fine because, IIS has no roll to play except to hand over the request to ASP.Net engine. Once it comes to asp.net environment we have complete control. So it was important to keep proper environment for POC. As you all know Web Dev server runs with a higher privilege that IIS might actually run and this would also cause problem.

In my case it was not that costly but otherwise we should give due respect to the POC environment.

HTTPHandler Vs HTTPModule

Other day,at work, we were discussing about building a Business Interceptor. Idea is to build centralized component to intercept all web request and associate them to a Business component and pass it on to handler to do the further request processing. Approach something we inherited from Struts approach and FrontController kind of approach. Nice FrontController Article

So we had a discussion when to choose between Handler vs Module. This is my opinion, might be wrong. Before that, a quick briefing about module and handler.

Handler as it say handles request - which would mean take a request and return a response. Handler is the end point of the request chain. Module pipes the request - it can read the request, modify the request, but ultimately is not responsible for handling request but pipe that to another module or finally hand it over to handler. And importantly, the module is for every request whereas handler has other attributes affect like the extension, the verb we are looking.

Some of the decision we made is that we don't want any custom extension or different extension like ".ashx" though it is practice is java world. They for e.g. attach ".do" for struts environment.

With above understanding, the interceptor we are building is clearly a module.
Every request will be intercepted and first will be validate to see if they have any special business logic mapped and will be handle appropriately and will be piped through other module and finally handed over to custom handler or asp default handler. And in case no business logic, just follows the standard pipeline and finally handed over to the handler.

In another scenario, we wrote an HTTPHandler to read image from db and write to response as binary. So in this case, it takes the parameters reads the BLOB from DB and write to response stream and request ends with a response back to the user.