Make the most of IRCTC

Make the most of IRCTC

Although it lacks the friendliness of world-class e-Commerce websites, IRCTC.co.in (Indian Railway Catering and Tourism Corporation), the train ticket booking website of Indian Railways is possibly the most trafficked e-Commerce website in India due to the monopoly it enjoys in online ticket reservation & the sheer volume of transactions that it processes. There is news of IRCTC offering APIs for external parties to carry out reservations from their websites.

(Update: 27-May-10) If you wish you did not have to use IRCTC at all but still book tickets online, you can consider using alternative websites  

Till the time there are more such user-friendly options, here are some tips to make the most of IRCTC -
  1. Checking for accommodation availability, status of wait-listed tickets etc is much faster on IRCTC than the official Indian Railways website that has umpteen ads & a clumsy interface.
  2. You can book tickets online up to 90 days ahead of your planned traveling date. Even if you change your plans, the cancellation charges are low when compared to the premium price you would otherwise have to pay closer to the date of travel.
  3. Note however that e-tickets can only be canceled online (if submitted before 24 hours) and the electronic refund to your bank can take more than 3 days.
  4. You can now book wait-listed e-tickets and during the reservation process opt to be considered for allotment against 50% of Tatkal quota if you feel your chances of getting a confirmed ticket are low.
  5. If you are well acquainted with the site's interface, the QuickBook option available from the left navigation menu lets you book your ticket in fewer than normal steps
  6. If you are a frequent traveller, you can maintain the names of passengers in a Master List and auto-populate these details during the reservation process.
  7. Understand the transaction charges of the bank through which you are transacting so that you can save some money. While some banks charge a flat rate of Rs.10 per transaction some banks deduct 1.65% to 1.8% of the transacted amount. If you have multiple bank accounts, choose the percentage deduction option for low value (less than Rs.500) transactions and the flat rate charge for high value transactions. Purchasing with a credit card attracts higher surcharge
  8. Do not choose the "Book my ticket only if alteast two lower berths are alloted" or "Book my ticket only if alteast one lower berth is alloted" if fewer seats are available while choosing your Berth Preference. Although money will be recovered from your bank the transaction will not succeed. The entire deducted amount including transaction charges is returned back only after roughly 3 days.

If you have any tips using the website, please leave a comment.

Also see:
Travel Planning & Reservation Tips using Online Tools
Read More
5 free SQL Server tools

5 free SQL Server tools

In the 10th Anniversary edition of SQL Server Magazine, there are recommendations to 5 free tools for SQL Server. Two of them are for load testing and the others for preventing SQL Injection -
  1. SQLQueryStress - query load testing tool written by SQL Server MVP Adam Machanic.
  2. SQL Load Generator - run multiple concurrent queries against SQL Server
  3. HP Scrawlr — This free scanner utility can detect and identify whether your website is susceptible to an SQL injection attack.
  4. URLScan — This security tool actively restricts the kind of HTTP requests that Microsoft IIS will process.
  5. Microsoft Source Code Analyzer for SQL Injection — Static code analysis tool for finding SQL Injection vulnerabilities in ASP code
The following are Kalen Delaney's recommendations for testing before deployment:
1. Test with real data.
2. Test with real data volumes.
3. Test with a real number of concurrent users.

Also see:
SQL Server Performance Audit Checklist
Tips on ASP.NET Hosting & Deployment
Read More

Pay It Forward with Wikipedia

Wikipedia Missing ManualOne of the best free learning resources on the Web is Wikipedia. It has been built by thousands of altruistic volunteers from across the world. Despite some controversies, it is favored by millions and it runs on donations. If you have benefited from it, you can donate to the cause or pay it forward by contributing your knowledge and time to it.

Editing existing articles or adding new ones though is not for the technically faint of heart. Luckily there is now help at hand. The how-to book Wikipedia: The Missing Manual is now available online for free on Wikipedia. (Thanks Amit)

Update(27-Apr-09): You can create a book out of any content on Wikipedia and download the finished book as a PDF.

Talking of donations, Philip Greenspun gifted $20,000 for creation of illustrations for Wikimedia Foundation projects.
"It occurred to me that when the dust settled on the Wikipedia versus Britannica question, the likely conclusion would be 'Wikipedia is more up to date; Britannica has better illustrations.'"

By the way, the popularity of Wikipedia has been a cause of serious concern for Encyclopedia Britannica which is now inviting the hoi polloi to edit, enhance and contribute to its online version. It's CEO is displeased that Google ignores it in favor of Wikipedia. I feel it is because the Britannica website is not optimized for search engines. Healthy competition is good though and Britannica does not appear to be sparing any efforts to catch up.

Related: HOW TO use Wikipedia content in your application
Read More
Technorati's Blogosphere Report

Technorati's Blogosphere Report

Did you know, Mort Reichek, a World War II army veteran & former editor of Business Week, began blogging when he achieved octogenarian status in 2005?

If you are a blogger, you may find useful tips & interesting stats about bloggers & blogging in Technorati's Annual Blogosphere Report.

Key findings from the detailed State of the Blogosphere 2008 report -
  • Blogging is a global phenomenon
  • Self expression and sharing expertise are the top reasons for blogging
  • Personal satisfaction is the key success metric for three out of four bloggers
  • Most Professional and Corporate Bloggers have benefited professionally
  • One in three bloggers are concerned about blog readers learning their identity
  • The vast majority of bloggers are tracking their site visitors and monthly pageviews
  • Bloggers are enjoying CPMs on parity with large publishers
  • Bloggers are active Web 2.0 participants
Read More
PDFZilla overrides PDF's copy protection

PDFZilla overrides PDF's copy protection

Giveaway Of The Day recently offered a FREE licensed copy of PDFZilla. PDFZilla has a option to convert a PDF to Word, RTF or text file format.

I was a little surprised to discover that it can even convert PDFs with copy protection and as a result text can be copied from the converted file. I (naively?) believed that the a PDFs copy protection property was unbreakable. In fact there seem to be other tools as well that can bypass a PDF's copy protection.

I wanted to share this finding so that others wanting to protect their PDFs are not under the mistaken belief that the protection mechanism is reliable.

Also see:
HOW TO convert authenticated / protected pages to PDF
Set PDF security settings with OpenOffice
Read More
Learning Resources for Algorithms & Data Structures

Learning Resources for Algorithms & Data Structures

For Computer Science students & developers, a good knowledge of Algorithms & Data Structures is essential. Not all reading material you find may be easily digestible & put to practical use. Here is a list of useful articles, audio & video presentations that are freely available online -

  1. Skiena's Algorithms Lectures
  2. MIT's Introduction to Algorithms
  3. Data Structures and Algorithms: Annotated Reference with Examples (free eBook)
  4. A 6 part series by Scott Mitchell - An Extensive Examination of Data Structures Using C# 2.0
Read More
HOW TO read cookie placed by ASP.NET using JavaScript

HOW TO read cookie placed by ASP.NET using JavaScript

You can retrieve the cookies with JavaScript if you set the HttpOnly property of HttpCookie class to false.

The HttpOnly property gets or sets a true/false value if cookie is accesible by client side javascript. If value is true, cookie will be accessible only by server side ASP.NET code. The default is false. This property is new in the .NET Framework version 2.0. Check the MSDN documentation for a code sample.

If HttpOnly can help mitigate cross-site scripting threats that result in stolen cookies, I wonder why the default value of the property is false.

As per this OWASP article, Opera & Safari do not support HTTPOnly while only some browsers prevent writing to a cookie or reading HttpOnly cookies using XMLHTTPRequest.

Also see: A Web App Is As Secure As You Make It & the Browser It Runs On
Read More

Digital Photography Tips & Tricks

It's difficult not to get fascinated by a digital camera once you lay hands on it. It's also not easy not be intrigued by all the features and settings of the camera. The convenience of not having to buy film rolls & wait for them to be developed in order to view your photos as in older times means you can experiment a lot with your digicam. With digital cameras getting more sophisticated and their prices coming down (at least the point and shoot variety), photography is turning out to be an inexpensive hobby for many.

I have been compiling articles on Photography by experts. These are some of the links I have so far:
Read More

Book Review: A People's History of the United States

On my sixteenth birthday, a cousin gifted me a copy of MAD magazine ("Number one in a field of one"). The magazine or comic book as some would call, satirizes various aspects of American life & generally takes the side of the underdog. It had a perspective that was unique and it's irreverent (but never below-the-belt) humor kept me hooked for years. Last year an American friend presented me the book A People's History of the United States as a parting gift. I found this to be a serious version of MAD magazine in the way it chronicles American life. When I sat to read both books, I did not have any idea what I was getting into. Both turned out to be very thought provoking.

Prior to reading the book, I had scant knowledge of American History. To relate to it better, I started reading the chapters from the back. Covering the history of America through five centuries, the prolific author Howard Zinn empathetically tells the untold stories through the voices of oppressed and marginalized people. The book is filled with disturbing facts and inconvenient truths. Zinn picks on the flaws of American Presidents, powerful people and institutions to reveal a not-so-shiny side of USA. I got to learn about the diversity of America and the challenges a democractic country has to face. Despite the dissenting tone, the book helped me know a little more about the United States & what goes into the making of a country.
Read More
Giveaways

Giveaways

The site Giveaway Of The Day offers free licensed software with full functionality for download for a time-limited period, generally 24 hours. You can subscribe to their RSS Feed to track goodies that may be of your interest.

Their current giveaway is TextAloud, a text to speech tool that also let's you save specified text as MP3 or WMA files.

Talking of MP3, Project Gutenberg, the first producer of free electronic books (ebooks) also offers Audio Books that are both human-read and computer-generated.

To find out-of-copyright books that you can download, you can select the "Full view only" option from the dropdown while searching on books.google.com. Some magazines are also available with the "Full view" option.

Also see: Voice of Opera
Read More
A Web App Is As Secure As You Make It & the Browser It Runs On

A Web App Is As Secure As You Make It & the Browser It Runs On

Did you know about these security issues...

An IP addresses such as 74.125.19.99 can be written in ambiguous ways such as 74.0x7d.023.99 (mixing decimal, octal, and hexadecimal notation) or 74.8196963. This is a trick used in phishing exploits.

SVG natively permits embedded scripts and event handlers. Firefox, Safari, Opera, Chrome support SVG image format.

xssed.com, a site dedicated to tracking publicly reported issues about HTML injection flaws, amassed over 50,000 entries in under two years.

The recently released Browser Security Handbook has revelations like these and a thorough review of browser quirks that can affect security.
This 60-page document provides a comprehensive comparison of a broad set of security features and characteristics in commonly used browsers, along with (hopefully) useful commentary and implementation tips for application developers who need to rely on these mechanisms, as well as engineering teams working on future browser-side security enhancements.

This is a great resource for web developers keen on building secure cross-browser applications. Remember your web application is as secure as you make it and the browser that it runs on.

In the security interest of users and for better standards compliance, developers should encourage users to upgrade to newer browsers.

The Handbook is currently a kind of beta and I hope the final version of this handbook has numbers for the Browser Comparison Tables for better readability & reference and a way to download it as a PDF for offline use.

The Microsoft ACE (Application Consulting & Engineering) Team's blog is another good resource on security for ASP.NET developers.
Read More
HOW TO get date N working days ahead in Excel

HOW TO get date N working days ahead in Excel

I use Excel occasionally and I'm always amazed at how there is always a function that you can adapt to suit a requirement.

To get date 3 working days ahead in Excel there is a helpful WORKDAY function.

It however returns a number that represents a date that is the indicated number of working days before or after a date (the starting date). By default, January 1, 1900 is serial number 1, and January 1, 2008 is serial number 39448 because it is 39,448 days after January 1, 1900.

Working days exclude weekends and any dates identified as holidays. WORKDAY can be used to exclude weekends or holidays

Excel stores all dates as integers and all times as decimal fractions. With this system, Excel can add, subtract, or compare dates and times just like any other numbers, and all dates are manipulated by using this system.

So the formula to get a DATE 3 working days ahead in Excel takes a little more work as we have to convert the serial number representing the resulting date -

=DATE(YEAR(WORKDAY(A1,3)),
MONTH(WORKDAY(A1,3)),
DAY(WORKDAY(A1,3)))


It is assumed here that you have a valid date in cell A1

Many of the Excel functions including WORKDAY are available in Google Docs Spreadsheet as well.
Read More
Deprecated SQL Server 2008 Features

Deprecated SQL Server 2008 Features

"Overnight success takes a long time"
- Paul Buchheit, original lead developer of GMail

If you plan to migrate to SQL Server 2008 or later in the future, you can save yourself a lot of trouble by being aware of the deprecated features. Some of the changes have been made to get in line with ANSI SQL standards.

MSDN has a detailed list of the Deprecated Database Engine Features in SQL Server 2008 and those planned for the future versions. T-SQL expert Itzik Ben-Gan has highlighted some of the more important ones among them & suggested best practices to follow.
Read More
Microsoft Technical Fellows

Microsoft Technical Fellows

"Success is waking up and doing what you love and working long hours and feeling blessed you get to work them, feeling like the luckiest guy on earth that you get to do your job."
- John Wood, Founder and CEO of Room to Read and author of 'Leaving Microsoft to Change the World'

As Mary Jo Foley reports, Ray Ozzie, Craig Mundie and Microsoft Technical Fellows will be filling in the Chief-Software-Architect (CSA) role that Bill Gates held.

She has started interviewing Microsoft's Technical Fellows in a series titled "Microsoft Big Brains". Their profiles make for interesting reading.

Read More
Regular Expression to negate non-matching characters

Regular Expression to negate non-matching characters

While constructing a regular expression pattern, sometimes it may be easier to write a pattern that negates the non-matching characters (did I just write a double negative?) rather than write a more complex pattern to pick matching characters. Let's say you want to ignore a word that has vowels.

The following pattern will match any single character NOT in the specified set of characters.
[^aeiou]

There is some nice info on Character Classes on MSDN.

[^character_group] represents a Negative character group. It matches any character not in the specified character group

Now we want the pattern to match not just a single character but a complete word so we use the + to indicate there are multiple characters. The ^ sign represents start of a string and $ denotes end of a string, so our final pattern to ignore a whole word that has vowels becomes this -
^[^aeiou]+$

Regular expressions can drastically replace several lines of validation code. However we need to test our pattern aggressively to avoid among other things, false positives.

Over the years, the RegExLib.com's Regular Expression Cheat Sheet has been a good reference for me.

Also see: Book Review: Teach Yourself Regular Expressions in 10 Minutes
Read More
HOW TO get thumbails from Amazon, YouTube

HOW TO get thumbails from Amazon, YouTube

There is a pattern in which URLs to generate image thumbnails are created by Amazon, YouTube. The trick to get the images is to manipulate these URLs.

Check these detailed notes on how an Amazon URL to fetch an image is built.

As per this discussion thread, you can adapt the format of the YouTube URLs by replacing the actual VideoId in this URL to get thumbnail images of dimensions 130x97 -
http://img.youtube.com/vi/{VideoId}/1.jpg
and use this for a 320x240 image -
http://img.youtube.com/vi/{VideoId}/0.jpg

You may have to check for the licensing terms before you use them.
Read More

HOW TO use Google Reader for bookmarking useful pages

Social bookmarking sites & online bookmarking sites serve a good purpose but require logging into an additional site. Wouldn't it be good if your Feed Reader (supposing it is Google Reader) doubles as a bookmarker to preserve your favorite pages as well?

This tip requires some familiarity with the Google Reader interface.

While you can pick the special posts from the feeds you already subscribe to by specifically marking them with the "Add Star" and "Add Tags" features to differentiate them from the rest, how do we add web pages that are not provided as a RSS feed to Google Reader?

The tutorial Create RSS Feeds for your Website shows us how to get any web page into Google Reader as if it were a RSS feed. The following are the steps adapted from that tutorial to suit our purpose.

1. Login to your Google Reader account. From the menu on the top left, select Notes. You will find a label titled "Note in reader" in the right frame. Drag & drop the "Note in reader" link from the web page into the bookmarks toolbar (Favorites Bar in IE) of your web browser.

2. Manually open your favorite web page which is not available through RSS.

3. On that page, optionally select some content that describes what the page is about with your mouse and then press the "Note in Reader" button.

4. An inline pop-up dialog opens on top of the web page you want to bookmark in your browser. Click on the "Add tags" link and assign some tag to this page (let's say "Tips & Tricks" or "A1").

Thats it! Assuming you are fond of compiling "Tips & Tricks" in your area of interest, you can now catalog any web page that you find with that tag in Google Reader whether or not they are available through RSS. Next time when you wish to see all posts that you tagged as "Tips & Tricks", select the tag from the menu on the left or using the Search feature.

Screenshots will be posted shortly.

Also see: Google Reader for Beginners
Read More
One week of BigFlix

One week of BigFlix

Last week I signed up for the Monthly Plan of BigFlix, India's version of NetFlix. The largest number of movies are produced from India and this means that there is also a huge audience for it (although they don't generate the kind of revenue that Hollywood movies do). So it makes this movie rental service a cool idea that is first of kind as it leverages the Internet. To get a movie you can place a request through their site, by phone or their Store.

The BigFlix website runs on ASP.NET & utilizes ASP.NET AJAX. The pages are well designed considering an average user can get his work done but slow loading. The UI has some rough edges (search keywords vanish when you change search options) that can be polished to make it better accessible. The movie summaries are terse and badly written. They do not help in deciding if you should pick a particular movie. Given the fact that there will be a large number of subscribers, the site has the potential to build collective intelligence features you see in IMDB & Amazon.

My experience with BigFlix has been good so far. If you've tried it too, how did you find it?
Read More
Infinite Scrolling or Continuous Scrolling UI Pattern

Infinite Scrolling or Continuous Scrolling UI Pattern

One of the innovative AJAX features I like is the Infinite Scrolling or the Continuous Scrolling UI Pattern you seen in websites like Google Reader and Wikia Search (the open source search engine!)

UIPatterns explains Continuous Scrolling in the following way:
In contrast to the Pagination patterns, the Continuous Scrolling pattern has no natural break. When using pagination patterns, a decision to only show a subset of data at a time and then let the user request more data if wanted is chosen. With the Continuous Scrolling, new data is automatically retrieved as the user has scrolled to the bottom of the page. It thus appears as if the page has no end, as more data will be loaded and inserted into the page each time the user scrolls to the bottom of page.

In my opinion, Infinite Scrolling scores over Paging especially for read-only data and it is more intuitive and accessible.

As this Classic ASP sample shows, implementing Infinite Scrolling is simplified with jQuery. In that sample, new records are fetched dynamically on scrolling to the bottom of a page. The same scrolling effect can also be replicated for a table by restricting it's height by wrapping it within a DIV tag & setting overflow:auto style for the DIV. We can invoke an asynchronous fetch by tracking the Scroll event of the DIV and it's scrollTop value. The triggering point is when the difference of the heights of the TABLE and DIV match the DIV's scrollTop value.

Also see:
Implementing Continuous Scrolling UI Pattern in ASP.NET
HOW TO implement AutoComplete with jQuery & ASP.NET
Read More

Popular Audio File Formats

There are three major groups of audio file formats:
  • Uncompressed audio formats, such as WAV
  • Formats with lossless compression, such as FLAC, lossless Windows Media Audio (WMA)
  • Formats with lossy compression, such as MP3, Vorbis, lossy Windows Media Audio (WMA) and AAC.

Zamzar is a free online file conversion service that let's you convert files from one format to other. The audio formats they support can be considered the most popular.

We're keen to be a verb in the Oxford English dictionary: Want to convert a file? Just "Zamzar" it.
Co-founders Chris and Mike Whyley still run Zamzar on a part-time basis without external funding (Picture courtesy: Guardian)

I was curious to know more about formats other than MP3 & WMA and my search took me to Wikipedia. Here is some paraphrased info on popular audio file formats -
  • aac – the Advanced Audio Coding format is based on the MPEG2 and MPEG4 standards. aac files are usually ADTS or ADIF containers. AAC's best known use is as the default audio format of Apple's iPhone, iPod, iTunes, and the format used for all iTunes Store audio (with extensions for proprietary digital rights management). AAC is also the standard audio format for Sony’s PlayStation 3 and is supported by Sony's Playstation Portable, latest generation of Sony Walkman, Walkman Phones from Sony Ericsson, Nintendo's Wii, the Nintendo DSi, and the MPEG-4 video standard. AAC has better sound quality and smaller file size than .mp3.
  • ac3 - lossy audio compression format developed by Dolby.
  • flac – a lossless compression codec. This format is a lossless compression as like zip but for audio. If you compress a PCM file to flac and then restore it again it will be a perfect copy of the original. The cost of this losslessness is that the compression ratio is not good. Flac is recommended for archiving PCM files where quality is important (e.g. broadcast or music use).
  • mp4/m4a – MPEG-4 audio most often AAC but sometimes MP2/MP3.
  • mmf - a Samsung audio format that is used in ringtones.
  • mp3 – the MPEG Layer-3 format is the most popular format for downloading and storing music. By eliminating portions of the audio file that are essentially inaudible, mp3 files are compressed to roughly one-tenth the size of an equivalent PCM file while maintaining good audio quality.
  • ogg – a free, open source container format supporting a variety of codecs, the most popular of which is the audio codec Vorbis. Vorbis offers compression similar to MP3 but is less popular.
  • ra – a Real Audio format designed for streaming audio over the Internet. The .ra format allows files to be stored in a self-contained fashion on a computer, with all of the audio data contained inside the file itself.
  • ram – a text file that contains a link to the Internet address where the Real Audio file is stored. The .ram file contains no audio data itself.
  • wav - a Microsoft and IBM audio file format standard for storing an audio bitstream on PCs. It is an application of the RIFF bitstream format method for storing data in "chunks" unlike the usual bitstream encoding is the Pulse Code Modulation (PCM) format. It is the main format used on Windows systems for raw and typically uncompressed audio.
  • wma – the popular Windows Media Audio format owned by Microsoft. Designed with Digital Rights Management (DRM) abilities for copy protection.
BTW, VidtoMP3.com let's you convert video or music video files into mp3s.
Read More