<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener("load", function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <iframe src="http://www.blogger.com/navbar.g?targetBlogID=8211560&amp;blogName=Tech+Tips,+Tricks+%26+Trivia&amp;publishMode=PUBLISH_MODE_BLOGSPOT&amp;navbarType=BLUE&amp;layoutType=CLASSIC&amp;searchRoot=http://mvark.blogspot.com/search&amp;blogLocale=en_IN&amp;homepageUrl=http://mvark.blogspot.com/&amp;vt=-5147029996388199615" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" height="30px" width="100%" id="navbar-iframe" allowtransparency="true" title="Blogger Navigation and Search"></iframe> <div></div>

Tech Tips, Tricks & Trivia

by 'Anil' Radhakrishna
A seasoned developer's little discoveries and annotated bookmarks.

Search from over a hundred HOW TO articles, Tips and Tricks


Search Innovations

Friday, February 27, 2009
Google's prime properties like Google Earth, Gmail, Picasa, Google Docs, Blogger, YouTube, Google Calendar are said to have been developed in the "20 percent time" or one workday a week Google gives it's developers to work on whatever projects fan their passions.

Among the other "20 percent time" projects that NY Times's tech columnist David Pogue highlights is a somewhat trivial but interesting Google Sets.

...type in several items in a series (like “cleveland browns” and “dallas cowboys”); Google fleshes out the list with others like it (all the other football teams). Great when something’s on the tip of your tongue (a kind of fruit, president, car, holiday, currency) but can remember only something like it.

These are nice conveniences on the Internet that let you find you what you want based on correlated things. You can now even search an image with a correlated image or identify a song by humming a few lines on your mobile.

Labels: ,

HOW TO spot a bad apple or a problem team member

Saturday, February 21, 2009
A study on team dynamics has found that groups that had a bad apple (a person with a personality type of "Depressive Pessimist" or "Jerk" or "Slacker") would perform worse and other team members begin to take on the bad apple's characteristics.

...the worst team member is the best predictor of how any team performs.

Jeff Atwood writes...

While it's depressing to learn that a group can be so powerfully affected by the worst tendencies of a single member, it's heartening to know that a skilled leader, if you're lucky enough to have one, can intervene and potentially control the situation.

Still, the obvious solution is to address the problem at its source: get rid of the bad apple.

Even if it's you.

So how to spot a bad apple in a team or know if you are turning into a bad apple?

Jeff quotes Steve McConnell on the possible warning signs that you're dealing with a bad apple on your team:

1. They cover up their ignorance rather than trying to learn from their teammates. "I don't know how to explain my design; I just know that it works." or "My code is too complicated to test." (These are both actual quotes.)

2. They have an excessive desire for privacy. "I don't need anyone to review my code."

3. They are territorial. "No one else can fix the bugs in my code. I'm too busy to fix them right now, but I'll get to them next week."

4. They grumble about team decisions and continue to revisit old discussions long after the team has moved on. "I still think we ought to go back and change the design we were talking about last month. The one we picked isn't going to work."

5. Other team members all make wisecracks or complain about the same person regularly. Software developers often won't complain directly, so you have to ask if there's a problem when you hear many wisecracks.

6. They don't pitch in on team activities. On one project I worked on, two days before our first major deadline, a developer asked for the day off. The reason? He wanted to spend the day at a men's clothing sale in a nearby city -- a clear sign he hadn't integrated with the team.

Related: Book Review: Software Project Survival Guide

Labels: ,

Google Search - Then & Now

Friday, February 20, 2009
Speaking at WSDM 2009, Google Fellow Jeff Dean in a keynote talk shared how Google has grown from 1999 to 2009. Various search engine enthusiasts have blogged about the facts presented in the talk from their own notes.

Excerpts:
  • Google handles 1000 times more queries now with 1000 times more processing power (# machines * speed of the machines).
  • It uses 1000 machines to handle a single query compared to just 12 previously.
  • Query latency has improved from under 1000ms to normally under 200ms now.
  • Crawler updates now take minutes compared to months in 1999.
  • For many pages, search results now change within minutes of the page changing.
  • Rolled out seven major rearchitecture efforts in ten years.
  • In-house design from the ground up: rack design, pc class motherboards, linux, and in-house software (GFS, BigTable, etc...)
  • Google's machine translation models use a million lookups in a multi-terabyte model just to translate one sentence.
Popularity comes at a price. Google is now accused of harming the environment with it's energy consumption (a typical search uses "half the energy as boiling a kettle of water" and produces 7 grams of CO2) and for not practicing what it preaches.

Also see: How LARGE websites manage performance & scalability

Labels:

neXpert - YSlow clone for Fiddler

Wednesday, February 18, 2009
neXpert is a add-on to Fiddler similar to the YSlow add-on that integrates with Firebug on Firefox. The version 1.0 released recently still has some rough edges but looks to be a good addition to any ASP.NET Developer's toolkit.

neXpert looks for performance issues and generates a HTML report with recommendations based on it's findings. Some recommendations include -
  • Be aware that IIS is case-sensitive and changing the case (Upper, lower, Title) for an object requested is considered a new request.
  • ..the best practice is that the size of the ASP.NET View State does not exceed 30% of the total page size.
  • The ETag header is used for validation of objects in a user's cache. There have been many issues with the implementation of ETags in both web servers and web clients. The current performance best practice is to verify the correct configuration of ETags if the(y) are necessary and to turn them off if not.

But as Jeff Atwood says about YSlow -
There is no such thing as one-size-fits-all guidance. Strive to understand the advice first, then implement the advice that makes sense for your specific situation.

Labels:

The Collective Decisions of Competitors

Tuesday, February 17, 2009
Analogous to the collective wisdom of the masses that some websites mine for the benefit of users, it is heartening to see competing search engines join hands to make search results and the Web more effective. 

Microsoft Live, Yahoo & Google now allow you to "normalize" urls by picking one "canonical" url so that you link consistently within your site. This feature will help search engines solve complex duplicate content issues and make search results more relevant.

To implement this simply add the following link tag inside the head section of the duplicate content URLs to specify your preferred version of several similar URLs:
<link rel="canonical" href="http://www.example.com/products" />

A few technical details:
  • This is a hint, not a directive/mandate/requirement. Search engines choose when to use the suggestion
  • You can use relative or absolute URLs in the “href” attribute of the link tag.
  • The page and the URL in the “href” attribute must be on the same domain. 
  • The pages do not have to be bit-for-bit identical, slight differences are okay.
  • The link tag will be treated similarly to a 301 redirect, in terms of transferring link references and other effects to the canonical form of the page.
Google, Microsoft and Yahoo had earlier agreed on the rel="nofollow" attribute in the anchor tag (to prevent comment spam) and the Sitemap protocol

Labels:

Free OCR Tools

Sunday, February 15, 2009
Optical Character Recognition, or OCR, is a technology to convert different types of documents, such as scanned paper documents, PDF files or images captured by a digital camera into text so that they are editable and searchable.

There are both free & commercial tool-kits.

Free -
  1. SimpleOCR - 9.3MB application. SDK/Command Line versions are commercially available
  2. InstantOCR - web based OCR
  3. OCR Terminal beta - web based OCR, converts TIFF, JPEG, GIF, BMP formats to .doc, .txt, .rtf, .xml formats; PDF to Word
Free, Under development -
  1. GOCR
  2. Tesseract
Commercial OCR Toolkits -
  1. ABBYY FineReader
  2. OmniPage
Also see:
Experimental OCR feature to create editable Google Documents from high-res images
HOW TO identify a Font

Labels:

HOW TO convert a video's format with free tools

Saturday, February 14, 2009
FFmpeg is a free computer program that can record, convert and stream digital audio and video in numerous formats. It contains multiple components including a a command line tool to convert multimedia files between formats. FFmpeg is developed under Linux, but it can be compiled under most operating systems, including Apple Inc. Mac OS X, Microsoft Windows and AmigaOS. An indirect proof of it's popularity is the number of imitators who flout FFmpeg licensing terms.

WinFF is a GUI for the command line video converter, FFmpeg. It can convert multiple different files all to the same format at once. You can for example convert mpeg’s, flv’s, and mov’s, all into avi’s all at once. WinFF is available for Windows 95, 98 , ME, NT, XP, Vista. The WinFF version 0.43 Windows Installer is just 3.4MB and is available on Google Code. WinFF is published under the GNU public license.

Also see: HOW TO view YouTube videos offline

Labels: ,

HOW TO identify a Font

Friday, February 13, 2009
If the text for which you want to know the font type is editable, you can identify it using it's related application. If it is on a website, you can usually find it by viewing it's HTML source. If the character is in an offline source like a newspaper, it would take a human font expert to identify a complex font type OR you can turn to two free online resources -
On the WhatTheFont website you would need to submit the digitized form of the offline source like a scanned or photographed image of the text containing the font or submit the URL containing the image.

To let Identifont find the typeface you have to answer approximately twelve questions questions to get the closest match in their huge database of typefaces.

Related:  Internet Explorer Developer Toolbar Color Picker

Labels: ,

HOW TO add subtitles to YouTube videos

Wednesday, February 11, 2009
"Why do people go to India to find themselves? India is where you go to LOSE yourself." ~ found on the Internet

I love watching movies on DVD with subtitles turned on as I can understand the dialogues better. Captions/Subtitles make videos and movies accessible to a wider audience. In India, PlanetRead reaches out to 300 million early literates by providing automatic reading practice using their Same Language Subtitling (SLS) technology on Bollywood songs shown on national television - Doordarshan. There are numerous other indirect advantages of Subtitling.

Last year, YouTube launched a Captions and Subtitles feature. YouTube currently supports a subtitle format that is compatible with the formats known as SubViewer (*.SUB) and SubRip (*.SRT). A SRT file (see sample) is a text file with captions and time at which it should appear in the video, written in a predefined format. YouTube Help Center has an entry on the list of free & commercial tools that can help you get these captions/subtitles files made for your videos. Uploading these generated caption files is then just a few easy steps. This process reminded me of how you can use a KML file to show custom locations on a Google Map or Live Map.

What's more YouTube can also Auto-Translate the subtitles. Although it may not be as effective as a human translation, it still helps. So if a song video has caption text, you can follow it better in the original language as well as in a language of your choice (for which translation is supported).

Captions in Hindi

Also see: Sound Search Results

Labels:

Book Review: Software Project Survival Guide

Tuesday, February 10, 2009
"How does a project get to be a year late?... One day at a time" - Fredrick P. Brooks


When you are setting out on a long journey along an unknown path, it pays to seek advice from folks who know that path well. Similarly you can count on the book Software Project Survival Guide by Steve McConnell, the accomplished author of the classics Code Complete and Rapid Development, for guidance on completing your project successfully.

The author draws inspiration from the best practices suggested by numerous Software Project Management publications and his rich experience to prescribe a Staged Delivery approach to tackle small & medium sized projects. His pragmatic & optimistic approach has some elements from the Agile methodology. He emphasizes the power of "Process" and shows how it can lead to better predictability, visibility and control. There was just one instance where I felt this may have been romanticized -
The completed Software Project History provides a useful supplement to each team member's individual memory. Holding a printed, bound history document provides a sense of closure, and each project member should recieve a personal copy.
(Chapter 17, End-of-Stage Wrap-Up)

Having worked for a CMM Level 5 company, I initially detested all the documentation but soon understood the value of metrics and the discipline it enforces which pays dividends in the long run. I agree with the author that "the cost & schedule penalty for having too much process is far smaller than the penalty for having too little process".

Running across some 300 pages, the book is filled with practical recommendations, documentation templates, checklists, dos and don'ts for a newbie Project Manager or Lead on a medium sized project. Overall, I think this is a great reference for software engineering practitioners.

Labels: ,

Sing your songs with Songsmith

Monday, February 09, 2009
It is said that A R Rahman, the Mozart of Madras, composes his tunes for film songs first & then the song-writers fill in the words. He is also said to have a bank of tunes that he mixes and matches to create award-winning songs.

Everyone likes to sing (some at least secretly). Although only a talented few can have the chance of singing for the likes of Rahman, you need not any longer keep your song inside. Songsmith (a 98MB download) is a fun application developed by Microsoft Research that provides adaptive musical accompaniment as you croon. You can save the songs you record in MP3 or WMA format. The tool may not help you win you awards but it may well bring out the singer in you.

SeattlePi nicely describes how it works:
Start up Songsmith, pick a style and a tempo, click record and sing a melody to the beat.

Songsmith tracks the pitch of your voice.

An algorithm, trained by analyzing the chords in a database of 300 songs, takes the pitches and figures out what chords match.

Songsmith then plays back the melody, along with the accompaniment it creates.

Then users can get creative.

Move a slider to one side and the accompaniment is "sad." Move it the other way and it's "happy." Another slider can adjust the "jazziness" of the accompaniment.

The UI is pretty intuitive and the software can be used by both amateurs and professionals. This is also a good tool for absolute newbies interested in Western music genres. You can try the software for 6 hours and then choose to buy.

Also see: Giveaways

Labels:

AJAX Frameworks for ASP.NET

Friday, February 06, 2009
If you are planning to AJAX-enable a ASP.NET website, a good option is of course the ASP.NET AJAX Framework from Microsoft due to it's better integration with the Visual Studio IDE and documentation. Occasionally I see questions on the Forums from folks having issues making ASP.NET AJAX work. Very often this is because they have not picked the correct version of ASP.NET AJAX to go with the ASP.NET Framework version.

So here is a quick summary. If your web application is based on ...
  • ASP.NET 3.5 - you need ASP.NET AJAX 3.5 and it comes built-in with VS 2008. If you need specialized controls from the AJAX Control Toolkit use Toolkit version 3.5. If you are specifically building on top of .NET Framework 3.5 SP1 using Visual Studio 2008 SP1, use Toolkit version 3.5.20820. (System.Web.Extensions, Version= 3.6.0.0 corresponds to ASP.NET 3.5 Extensions December CTP)
  • ASP.NET 2.0 - you need ASP.NET AJAX 1.0 and you have to manually install it in VS 2008 or 2005 and make sure the web.config of that application correctly points to the 1.0 assembly. Toolkit version 1.0 will only work with ASP.NET AJAX 1.0.
  • ASP.NET 1.1 - ASP.NET AJAX is not supported. You would have to choose a Framework like the free, cross-browser Anthem.NET which works works with both ASP.NET 1.1 and 2.0.
For implementing simple AJAX functionality in any of the ASP.NET Framework versions, you can also consider using jQuery. Some of the jQuery plugins fare better than the Extenders in the ASP.NET AJAX Control Toolkit.

If you want to compare AJAX Frameworks for ASP.NET, this outdated article on the comparative features of various Frameworks can give you some pointers to base your research on.

Related links:
Free ASP.NET AJAX E-learning course
HOW TO implement AutoComplete with jQuery & ASP.NET
Is ASP.NET AJAX truly cross browser?

Labels: ,

IE8 Developer Tools Tips & Tricks - #5: Find Link Paths

Thursday, February 05, 2009
Cloaking hyperlinks is a cunning trick that comment spammers & phishing attackers use to ride on the popularity of websites that are in the good books of search-engines. If you run a public website that allows comments or accepts input, you should keep an eye on URLs submitted by users that could be cloaked under unsuspecting hyperlink text.

Developer Tools has a nice feature called Link Paths that will show the URLs corresponding to hyperlinks on a specified page as labels overlaid on the link text. You can also have it generate a report of all Links in a page. This can also be helpful while debugging a database-driven web page that you may have built with dynamic URLs based on values retrieved from a database.

To try this feature, open Developer Tools from the menu or using the keyboard shortcut F12 after you have opened the web page whose hyperlinks you want to inspect. From the View menu, select Link Paths. Switch to the web page and you will see the actual URLs as labels wherever links are present. From the same menu, you can choose Link Report to have a complete list of links on the page generated for you.

Labels: ,

IE8 Developer Tools Tips & Tricks - #4: Edit CSS Visually

Wednesday, February 04, 2009
Debugging CSS in an inherited web application or trying to adapt CSS from an inspiring design of someone's website is generally not an easy task. One of the interesting features in IE 8 Developer Tools is the facility to edit CSS visually.
  1. After you open the desired web page of which you want to debug CSS, open Developer Tools from the menu or using the keyboard shortcut F12.
  2. Click on the CSS tab.
  3. If you already know the Class and ID information, select it from the treeview of all Class and ID style definitions for the corresponding web page otherwise go to the View menu in Developer Tools and select Class and ID information. On choosing this all the CSS Classes and IDs will be displayed as small labels on the web page that you are debugging CSS for.
  4. You can see how the attributes of a particular style definition operate by un-checking the checkboxes next to each element's style definition & view the changes immediately in real-time by switching to the web page.
Edit CSS Visually

Labels: , ,

IE8 Developer Tools Tips & Tricks - #3: Customize HTML Source Viewer

Tuesday, February 03, 2009
Developer typically look at the HTML Source to locate possible coding issues. Notepad is not an ideal viewer as it lacks the sophistication of EditPlus or NotePad++ or any of the numerous editors. Luckily it is easy to change the viewer in IE8 (RC1).

Hit F12 to invoke Developer Tools. From the menu, choose File > Customize Internet Explorer View Source and then from the cascading menu, select Other. This will allow you to specify the path of your favorite editor's executable. Once you set it, the HTML Source will be shown in your favorite editor whenever you choose View Source from the browser.

Labels: ,

Make the most of IRCTC

Sunday, February 01, 2009
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.
If you have any tips using the website, please leave a comment.

Also see:
Travel Planning & Reservation Tips using Online Tools

Labels: