Saturday 29 November 2008

Cool Javascript for implementing a photo gallery ...

The other day, Sudeep gave me a url to a javascript library that can be used to implement a photo gallery on web pages. The script is - LightBox2. I liked the script and wanted to give a try, so I thought why not a photo gallery with the pictures of Bara Imambara ;-)

Here it is ... Click on an image to see the script in action. After you click on an image, roll over the mouse on the image (popup) to see next and previous buttons or use left/right arrow keys to navigate through the gallery.


Images courtesy: wikipedia.org :-)

Friday 28 November 2008

POP3 client in C# ...


The other day, I was trying to develop a C# application that can retrieve emails from Gmail via POP3. I searched through various sites for a library that I could use to fetch POP3 emails. I came across a bunch of libraries (along with source code) but unfortunately, none of them worked, 'coz they all don't seem to support SSL, while Gmail POP server requires communication over a secure connection (SSL) !!

After a lot of search in Google, I came across a post in which it is explained that there is an open source project named OpenPOP.Net and that there is a class named PopClient.cs that needs to be modified as explained (the code was put on the site there). I had downloaded the sources, tried compiling OpenPOP.Net with the new class, spent some time fixing the compile time issues since the modified PopClient.cs in turn relies on a third-party library !!

Atlast I have got the sample in OpenPOP.Net working with the modified PopClient.cs and now I am able to fetch messages from Gmail :-)

For the benefit of all those developers, breaking their head trying to read emails from Gmail in C# apps (or any other POP server that requires SSL), here is the library along with one sample Windows application that you can use to test the library.

I request you to please post a comment, if you find the sources helpful and thanks to all the posts on the web that helped me compile the zip that is ready for download

Wednesday 26 November 2008

Incredible India ...Understand, to appreciate ....

Last week, I had been to Lucknow (the capital city of Uttar Pradesh) to attend one of my close pal's marriage.It is interesting to explore places, traditions and customs in general, and in India, you find a variety of it. Each state,pretty much, has got it's own language (almost), culture, customs and traditions.

We got some time to explore the places in Lucknow and we were taken to a place named "Bara Imambara" - a shrine built by Shia Muslims (I didn't know what it means when I visited the place but got to know of it from wikipedia !).My first impression at the shrine (it looks more like a fort than a shrine, though) was that it's a big construction, just another archealogical piece left to us by Nawabs !! I realized that my knowledge is meagre, so is the information that is available over there about the monument !

Some of the highlights of "Bara Imambara" are :-

  • The Great Imambara or the Bada Imambara has a central hall, one of the largest vaulted galleries in the world, beneath which many underground passages are present. Any pillars or any other supports do not support the main hall, which is over 50 feet in height. The roof has been put together with interlocking bricks without using a beam or a girder.
  • The upper floor, Bhulbhulaiya, is also famous as a fantastic labyrinth. It is believed that a stranger cannot come out of this maze without any assistance from some expert guide. It is possibly the only existing maze in India and came about unintenionally to support the weight of the building, constructed on marshy land.
  • The design of the Imambara was obtained through a competitive process. The winner was an architect Kifayatullah, who also lies buried in the main hall of the Imambara. It is another unique aspect of the building where the sponsor and the architect lie buried besides each other.
Incredible India - It has got so many archealogical master-pieces but pity that there is not much information available to the visitors to appreciate the beauty of these monuments.

I wish the Archealogical Survey of India wakes up atleast now to get some literature available to the visitors of these historical pieces and let them appreciate their greatness !


Sunday 16 November 2008

Generating PDF files programmatically using .NET ...

Ever ran into a requirement where you had to generate a PDF file as an output from your .NET application (windows or web application) ? Well, it's not that tough to accomplish this and let me emphasize that "it's easy" :-)

I got a chance to work on a requirement like this where in I had to generate a big pdf file with lot of numbers presented in tables, colored text and a bunch of images - to be laid out neatly in the pdf.


I came across an open-source project (am a big fan of open source projects and I try my best to distribute my code too - SmartTimePicker) named - PDFSharp.

You can download the documentation and samples from this site, but for the benefit of all my readers, let me list down the highlights (as given on that site):
  • Creates PDF documents on the fly from any .Net language
  • Easy to understand object model to compose documents
  • One source code for drawing on a PDF page as well as in a window or on the printer
  • Modify, merge, and split existing PDF files
  • Images with transparency (color mask, monochrome mask, alpha mask)
  • Newly designed from scratch and written entirely in C#
  • The graphical classes go well with .Net

With PDFsharp, start producing pdfs that look professional, even without having to buy Acrobat writer ;-)