IRCTC Alternatives

The IRCTC.co.in website has to be the most trafficked e-commerce site in India as you can book a train ticket online within minutes by paying a few rupees extra rather than buying them from a Railway ticket counter which has perennially long queues. In April 2010, there were over 7 million transactions carried out. The website has an Alexa Rank of 474.

These impressive figures are probably not due to the quality of the website but due to the monopoly that it enjoys. Like many, I've endured the slow-loading pages but since the last few months I'm happy to have discovered alternatives to IRCTC.

Since a couple of years, IRCTC has started providing an API at a hefty fee for third-party vendors. As a result, there are now a bunch of websites now that offer a superior interface & experience for buying train tickets online at a slightly higher cost, like -
I've tried the first two & am impressed with the clean interface & relative speed with which you can book tickets.


 The MakeMyTrip site interface (click to enlarge)

Booking a Tatkal ticket on Cleartrip appeared faster although it still probably hits IRCTC's servers. Some of these sites also occasionally have special offers. For instance, Cleartrip is giving away a cash back of upto Rs.100 on train bookings done through Net Banking till May 31st, 2010.

Also see:
Travel Planning & Reservation Tips using Online Tools
Read More

Book Review: Learning jQuery 1.3

In a brief span of four years, jQuery has become one of the most popular JavaScript Frameworks. Among the many websites & organizations that have adopted it is Microsoft and we are going to see a lot more of jQuery being used in ASP.NET websites than earlier. I've been using jQuery on & off for more than a year now. I more than agree with jQuery's motto that you will start writing less code & doing more with this nifty JavaScript Framework. What's more, it's all cross-browser code!

The book Learning jQuery 1.3 is written by Jonathan Chaffer and Karl Swedberg. Both are members of the core jQuery team and John Resig, the creator of jQuery speaks glowingly about them in the foreword of the book. This book builds on the earlier edition which was one of the first books on jQuery. I've benefited from reading this book & recommend it to everyone working or starting to work with jQuery.

This book is a comprehensive guide for beginners & a handy reference for experienced developers. Web developers & designers with a fair knowledge of HTML, CSS & JavaScript can sink their teeth into this 400+ paged book & start coding in jQuery confidently after finishing the book.  Spread across 11 chapters, the book covers the basics of jQuery in the introductory chapters, goes progressively into complex topics and concludes with a chapter on developing your own Plug-ins. Like I keep doing, you will probably refer to the Appendices multiple times. The code is download-able from the book's homepage. There are a lot of tips, tricks & best practices in the book and learning about them is sure to make you the jQuery expert at office. Sample this -
..when we plan to use a jQuery object more than once, it's generally  a good idea to cache the selector by storing the resulting jQuery object in a variable as well.

Written in plain-English, the style is conversational & friendly. The book has numerous practical examples (like those for implementing pull quotes, headline rotator, image carousel, table sorting, filtering & pagination) that can be directly used at work. While elaborately explaining how a particular client-side feature can be built, the authors show where something could go wrong and this helps in understanding a concept better.

The authors provide sufficient background & context while getting into topics that may be intimidating to beginners. For instance, this explanation of the hide() and show() methods impressed me -
The .hide() method sets the inline style attribute of the matched set of elements to display:none. The smart part here is that it remembers the value of the display property—typically block or inline—before it was changed to none. Conversely, the .show() method restores the matched set of elements to whatever visible display property they had before display:none was applied.

One place where I remember missing the background though was in a snippet that used the rel attribute. I learnt from W3Schools that the rel attribute of the anchor tag is not really supported by any major browsers and it can take over a dozen possible values. This is a minor detail though & I'm probably nit-picking.

I wish the key features of jQuery 1.3 as well as critical differences from the older versions were highlighted. While it's no doubt good to use the latest version of jQuery, it would have been beneficial to those who have already used older versions to know how breaking changes can impact their code. For example, some folks may miss the fact that if you upgrade jQuery from 1.2 to 1.3, you also have to upgrade the jQuery UI Plugin suite that they may also be using from version 1.6 to 1.7. At a minimum, the Quick Reference at the end of the book could have briefly mentioned when something not in the original jQuery API was introduced or modified. I'm glad however that there is a Quick Reference as I had wished for while reading the first edition.

There is a sample chapter available online(PDF) that you can check to see if the book suits your tastes.

This review is based on the ebook version that I received from a PacktPub representative.

Also see:
My favorite jQuery plugins
180
Read More

Page Speed or YSlow

There are a bunch of web page performance analysis tools like Page Speed, YSlow, AOL Pagetest, MSFast, VRTA, neXpert  but the first two are probably the most popular among web developers.

I have used YSlow in the past & was curious to know how it differs from Page Speed. There are a few articles that talk about the differences but the Page Speed FAQ sums up it up well -
YSlow and Page Speed use some common "rules" that are based on industry best practices. There are, however, some rules, such as deferring JavaScript until after the page has loaded, that Page Speed implements exclusively. In addition, Page Speed provides you with an activity panel that allows you to do a "before and after" comparison when considering the implementation of Page Speed's suggestions. Finally, Page Speed is an open-source tool that is open to community contributions.

YSlow & Page Speed can be used together but using them both may not be a good idea as it will make Firefox considerably slower. A Stack Overflow user has suggested using a seperate Firefox profile to handle that issue.

Also see:
neXpert - YSlow clone for Fiddler
70
Read More

Google Doodle Pacman game available online/offline

Google has made available the Flash-based Pacman game that it put up as the first-ever playable Google doodle commerating the 30th anniversary of PAC-MAN. It was first intended to be there for only a few days.

Expecting the Flash-based Google Pacman game to be taken off, some enterprising Stack Overflow users have put together an offline copy of it on Github

Commenting on the playable Google doodle, a friend tweeted - Waiting for #google to celebrate #Scrabble's anniversary. #Hasbro, you watchin?

The MAD magazine cover of September 1982

Also see:
Al Jaffee's Mad Fold-Ins in Flash
40
Read More

What is the difference between R2 & SP?

Like me, if you have wondered how the R2 in Windows Server 2008 R2 or SQL Server 2008 R2 differs from a SP (Service Pack), the freely download-able MS Press ebook "Introducing Windows Server 2008 R2" has a good explanation - An R2 release is more than an SP, but less than a full major release.

Beginning with Windows Server 2003, Microsoft moved to a server release cycle that was designed to have a major release every three to fve years (Windows Server 2003, Windows Server 2008), with a minor release at the approximate midpoint of the major release cycle (Windows Server 2003 R2, Windows Server 2008 R2). This change allowed Microsoft to move away from including new functionality in service packs (SPs), while
providing customers with a more stable and predictable server environment. 

An R2 release is more than an SP, but less than a full major release. Windows Server 2008 R2 includes Windows Server 2008 SP2, but it also adds many new features and functionality that were not part of Windows Server 2008.

The eBook has a chapter on IIS 7.5 that may be of interest to developers, especially those getting started with Sharepont 2010.

Also see:
What do CTP, RC, RTM, RTW mean?
45
Read More

Twitter For Dummies

I discovered today that you could just type the command "F username" into the What Are You Doing? text box to follow any user on Twitter. I picked this tip from the Cheat Sheet of the book Twitter For Dummies that is excerpted on the Dummies website.

Impressed with all the tips I found on the Dummies website, I've started following it on Twitter
A fading alert shows up to notify confirmation

I noticed that when you copy and paste content from that site, the URL of page you have copied it from gets added at the end with a "Read More:" label

Thanks Joe Mayo for the link to the excerpts of the book

Also see:
Explaining Technology in Plain English
180
Read More

jQuery is now on W3Schools

Whether you are getting started with Web development or need a good reference, W3Schools is a great online resource you can turn to. In over a decade of it's existence, the Norwegian family-owned company Refsnes Data that runs W3Schools has meticulously created tutorials on close to 50 Web development topics. The tutorials are in plain-English, thorough and to the point. I was glad to see today that jQuery has been added to that growing list of topics.  Also included is a tutorial on HTML5, the next generation of HTML.

W3Schools has been a dependable companion to me for much of my web development career. Just yesterday, I learnt that the rel attribute of the anchor tag is not really supported by any major browsers and it can take over a dozen possible values. rel="nofollow" is used by search engines to let search spiders know they should not follow a link which contains that attribute.

W3Schools is currently ranked 341 on Alexa & enjoys over 103+ million monthly page views (March 2010).

Also see:
Free .NET 4 & VS 2010 Learning Resources
HOW TO block IFRAME based ads
60
Read More

Free MSPress eBook on VS 2010

Microsoft Press plans to release an ebook "Moving to Microsoft Visual Studio 2010" for free later this year. It has the following parts:
Part I, “Moving from Microsoft Visual Studio 2003 to Visual Studio 2010.”
Part II, “Moving from Microsoft Visual Studio 2005 to Visual Studio 2010.”
Part III, “Moving from Microsoft Visual Studio 2008 to Visual Studio 2010.”

The draft of the 6 chapters that make up Part II & III are currently available in PDF & XPS format for download.

Also see:
What do CTP, RC, RTM, RTW mean?
25
Read More

jQuery, Cloud Computing, Sharepoint 2010 sessions at MUGH Meet

Microsoft User Group, Hyderabad (MUGH) was formed in 2003. It has members from many of the 100+ software companies in Hyderabad. Since being at the very first UG meeting, I've made many friends over the last 7 years at these meets.

For long, I've been a member of the audience but last Saturday on May 15th, I delivered a session on jQuery. I had a kind & patient audience who sat attentively for more than an hour while I went on with all the jQuery tips, tricks and trivia that I've picked up during the past year. I also showed some simple code samples & explained about Plugins.

Accomplished MVP & author, Arun Ganesh presented an engaging session on Cloud Computing with Azure. It included a demo on Visual Studio 2010 & Windows 7.

Phani of Brainscale showed what's new with SharePoint 2010 from a developer's perspective. He made an interesting observation that SharePoint 2010 works best with the 32-bit version of Office 2010, because quite a few features of Sharepoint don’t work with 64-bit version of Office 2010.  This Technet article has more on browser support -

Some of the features in SharePoint Server 2010 use ActiveX controls. In secure environments, these controls must be able to work on the client computer before their features will function. Some ActiveX controls, such as those included in Microsoft Office 2010, do not work with 64-bit browser versions.

Also see:
MS MVP Authors from India
 60
Read More

Google Translate can now SPEAK Hindi

Although Hindi is the national language of India, it is spoken by less than half the population. For those among the other half & non-citizens who want to learn Hindi, Google Translate's text-to-speech functionality can be a good tool. Hindi is currently the only Indian language supported.



On clicking the Speaker icon in front of the translated text, the Hindi words are read out by a female voice. This feature relies on Flash. The translation is not perfect always.


As Google admits...
Clear and accurate speech technology is difficult to perfect, but we will continue to improve the performance and number of languages that are supported.

I hope more Indian languages get supported by Google Translate & it's text-to-speech functionality lets Indians appreciate languages they don't know.

Also see:
Google Script Converter transliterates between Indian languages
Read Telugu news sites in transliterated English
40
Read More

HOW to continuously refresh any web-page in IE8 & FF

Have you ever felt hassled by a website that provides continuous updates (like cricket scores or live event updates) but requires you to reload the page manually? While Opera browser has an option to automatically reload a web page at pre-defined intervals, Internet Explorer, Firefox & Safari do not have any such feature by default.

I found this code for a browser bookmarklet to automatically refresh any web-page in IE on StackOverlow-

javascript:( function(){ i=0;setInterval("i++;var x=new ActiveXObject('Microsoft.XMLHTTP');
x.open('GET',location.href+'?'+i,true);x.setRequestHeader('Content-Type',
'application/x-www-form-urlencoded');
x.onreadystatechange=function(){if(x.readyState==4)
{document.body.innerHTML=x.responseText;}};
x.send(null);",5000); }() )


I made the following minor change to it by replacing the use of Microsoft.XMLHTTP ActiveXObject with XMLHttpRequest object so that it works in all new browsers -

javascript:( function(){ i=0;setInterval("i++;var x=new XMLHttpRequest();
x.open('GET',location.href+'?'+i,true);x.setRequestHeader('Content-Type',
'application/x-www-form-urlencoded');
x.onreadystatechange=function(){if(x.readyState==4)
{document.body.innerHTML=x.responseText;}};
x.send(null);",5000); }() )


Note that in the code snippets I have added newline characters for readability & formatting. Make sure you remove the newline characters so that the whole code is on just one line. The code uses a JavaScript Timer to refresh the page every 5 seconds or 5000 milli-seconds. Change it to set an interval of your choice.

To add the bookmarklet in Firefox, enable the Bookmarks Toolbar (View > Toolbars > Bookmarks Toolbar). Right click on the Bookmarks Toolbar & select New Bookmark. In the Add Bookmark dialog box that opens, type "Refresh Page" as the name of the bookmarklet & paste the second code snippet that's above into the Location textbox as shown in the screenshot below.


A good way to share Bookmarklets (like the jQuerify Bookmarklet or these popular Bookmarklets) is to host it on a webpage as hyperlinks. I could not find a way to embed it on a webpage as a hyperlink (because the code involves using nested quotes) nor a clean way to add the above Bookmarklet to the Favorites Bar in IE8. The following steps to add the Bookmarklet though a little clumsy, get the job done -
1. With the Favorites Bar (View > Toolbars > Favorites bar) open, add any webpage from the tabs as a Favorite.
2. Right click on that Favorite in the Favorites Bar & select Properties from the context menu.
3. In the URL text box of the Web document tab, add the Bookmarklet code shown above


4. A warning "The protocol 'javascript' does not have a registered program. Do you want to keep this target anyway?" appears. Click on the "Yes" button
5. Go to the General tab & type the name for the Bookmarklet as "Refresh Page"


Now whenever you need a webpage to be reloaded automatically, click on the Bookmarklet while you have that page open.

I've tested the Bookmarklet for a short while with Google News. Please report if you find any issues with the Bookmarklet or any other feedback that you may have.

Also see:
View Selection Source in IE
.120
Read More

Raman Effect can fingerprint the universe

This week's Swaminomics column in the Sunday Times of India, based on an article in The Atlantic Magazine explains how India's Noble prize winning scientist C.V. Raman's discovery has finally become a breakthrough technology.
Handheld scanners called Raman scanners, weighing just one-third of a kilo, are being used by US narcotics squads and airports to detect drugs.

The scanners work by detecting the molecular structure of the object they are scanning. If you shoot a beam of light on an object, a very small part of it interacts with the atoms of the object and scatters light in a pattern or spectrum unique to that particular molecule.This is the Raman Effect. It is difficult to detect, and typically needs lasers to amplify the signal. Every molecule has a different Raman pattern. This is why Raman scanning has been called the fingerprinting of the universe: it can identify substances as surely as fingerprints can identify humans.

Scanners have a laser, spectroscope and an electronic heart that can recognize Raman patterns. This yields almost instant recognition of target substances.

Scientists aim ultimately to create a database of Raman patterns of every substance for easy identification.

The Atlantic reports other mash-ups of the Raman Effect -
The potential medical applications of Raman technology are perhaps the most exciting. Researchers at Stanford University are experimenting with it as a non-invasive tool to diagnose breast, lung, and other cancers. River Diagnostics, in Rotterdam, is marketing a bacteria-strain analyzer to identify pathogens in real time and combat hospital-acquired infections. Diabetics may someday be able to monitor their glucose without poking themselves to get a drop of blood. Allergy sufferers may be able to instantly detect which pesky pollens are in the air and respond accordingly.

I found it interesting that I read this article by my favorite Indian columnist who probably first read it in an American magazine that carried this feature about an Indian scientist's path-breaking discovery that is finding application outside India scores of years after he first observed it. Goes to show how geographies are irrelevant for ideas & why good ideas should keep flowing.

The funny cover of The Atlantic that features the Raman article

Also see:
Accidental Discoveries
Geniuses
.120
Read More

Web Security Tutorials from Google & MS

Google Code University hosts tutorials on a variety of topics including Web Security. A recently added tutorial is called "Web Application Exploits and Defenses". A blog post announcing this has an interesting statement -
The maxim, "given enough eyeballs, all bugs are shallow" is only true if the eyeballs know what to look for.

For web developers interested in security, Microsoft E-Learning offers a two-part course called Microsoft Security Guidance Training for Developers

Also see:
Google Browser Security Handbook
OWASP Development Guide
Read More

Collaborative JavaScript debugging tools - jsFiddle & JS Bin

Stuck with a JavaScript issue & need help debugging it? jsFiddle & JS Bin are online Web editors that save your samples & generate a random URL for it so that you can share it on a forum or with those who can help you with it.

Though both are not ready for prime-time, jsFiddle currently appears to have more options than JS Bin. It can format code to make it more readable. Both of them help you build quick & dirty code samples using Frameworks like jQuery, while you are experimenting or building a prototype. Without having to sign-up, you can save your code & generate a public link for it. You can then send this link to others anywhere across the world to review or seek help with debugging.

(JS Bin - click on the image to view enlarged screen-shot)
.60
Read More

Learning Resources on Computers & Programming for School kids

Life is a team sport - Janine Benyus

If you have to engage school-going kids constructively, there is nothing like introducing computers to them  through the Tux4Kids line of free & Open Source products -
  • Tux Paint  is a free drawing program for children (ages 3 to 12)
  • TuxTyping is an educational typing tutor
  • TuxMath is a fun way for kids to practice their mathematics
Tux the penguin can only catch the fish if you type the right letters in time

If they are ready for programming, there are some good & free options, like -


Small Basic IDE
(to be continued...)
Read More