Posts

Showing posts from September, 2009

The Beauty of Command-line Utilities

I like the way command-line tools can be adapted for automating complex tasks. For instance, if you had to populate the list of names of computers in your LAN in a combo box, the net.exe command can be utilized with the Process.Start() method in C# Process netsend = new Process(); netsend.StartInfo.FileName = "net.exe"; netsend.StartInfo.CreateNoWindow = true; netsend.StartInfo.Arguments = "view"; netsend.StartInfo.RedirectStandardOutput = true; netsend.StartInfo.UseShellExecute = false; netsend.StartInfo.RedirectStandardError = true; netsend.Start(); StreamReader sr = new StreamReader(netsend.StandardOutput.BaseStream, netsend.StandardOutput.CurrentEncoding); string sss = ""; while ((sss = sr.ReadLine()) != null) { if (sss.StartsWith("\\")) comboBox1.Items.Add(sss.Substring...

Book Review: Beginning SQL Server 2005 for Developers

Image
Beginning SQL Server 2005 for Developers by Robin Dewson lives up to it's title of being a helpful resource for beginners to SQL Server 2005. The author patiently walks the reader through the basics & a wide breadth of topics with adequate examples in the 500+ paged book spanning 14 chapters. Many of the examples are demonstrated using multiple modes - SQL Server Management Studio, TSQL & Templates. The book is filled with interesting facts, "gotchas", practical tips & tricks that make the chapters engaging. I have used the SELECT statement for years but I did not know that $IDENTITY & $ROWGUID can be used with the SELECT statement to return the value from the IDENTITY column & the ROWGUID column if such columns exist within the table being querying upon. Similarly I have used the COUNT function but didn't know there was a COUNT_BIG function as well that returns a bigint data type value unlike COUNT which returns an int type value. I feel the info...

Book Review: Cancer Has Its Privileges

Image
We have put a man on the moon decades ago, but it's sad that science doesn't have a solution yet to wipe out the scourge of Cancer which has been there for centuries. The Big C is a devastating illness that cripples it's victims physically, monetarily & more than that, mentally as it affects their loved ones as well. Cancer Has Its Privileges: Stories of Hope and Laughter is a poignant compilation of thoughts, anecdotes, poems and "chicken soup for the soul" type of experiences by brave cancer survivors & their loved ones. This is the fourth book of the author Christine Clifford, a cancer survivor & founder of The Cancer Club , who believes in the therapeutic value of positive thinking & humor. The book has tips for cancer patients, their family & friends on coping with the dreaded illness. Sometimes well-meaning well-wishers of a patient get disconnected not knowing how to help. There is a chapter on how friends & family can help. Some w...

Doloto - useful addition to a Web Developer's Toolkit

Image
I have been using the following Web Development tools over the past few years and they have helped me to be more productive - Firebug YSlow neXpert Fiddler I discovered 2 new tools that not just tell you what is inhibiting performance of a page but also cut the fat off web pages making them speedier - Doloto & Smush.it Doloto is a JavaScript download optimizer developed by Ben Livshits of Microsoft Research. Smush.it is an image optimizer. It reports how many bytes would be saved by optimizing the page's images and provides a downloadable zip file with the minimized "lossless" image files. Are there any other indispensable Web Developement tools that I'm missing?

Free eBook: The Principles Of Successful Freelancing‏

Image
SitePoint occasionally gives away ebooks of some of their publications. In the recent past, they have given away titles like "The Art & Science Of CSS" and "Firefox 3 REVEALED". For a limited time, they are offering a free eBook "The Principles Of Successful Freelancing" if you follow them on Twitter or provide your email address (they will email the link from where you can download the eBook). The book has around 200+ pages & 8 chapters - Chapter 1: Considering Freelancing? Chapter 2: Prepare for the Transition Chapter 3: Manage Your Money Chapter 4: Set Yourself Up Chapter 5: Win the Work Chapter 6: Give Great Service Chapter 7: Achieve Work–Life Balance Chapter 8: Where to from Here? Also see: Startup 101 - free, online serialized book for first-time entrepreneurs Giveaways Building non-technical skills

See what Google is suggesting

Image
Google does not seem to keep the secret questions we ask anonymously to itself :-) ... nor does it mind poking fun

Appending to file with BCP

I found an interesting tip about BCP (the SQL Server command line tool) on the MSDN Forums While exporting data from SQL Server to a file using BCP, it always overwrites the contents of the file specified in command if it already exists or creates a new file but it cannot append. If ever you need the output of a query appended to the info in a existing data file, use an intermediary file to manage the updation of the data file - Exec master..xp_cmdshell 'bcp "select name from sysobjects" queryout "c:\tempexportfile.txt" -c -T -SYourServerName' Exec master..xp_cmdshell 'type "c:\tempexportfile.txt" >> "c:\mainexportfile.txt" Also see: Exporting to Excel with bcp

Excel Tips & Tricks

Image
My Wife & I, share a liking for Excel (& good food). Once in a while, we exchange Excel tips & tricks that we may have picked up. I recognized this common interest a couple of years ago, when she pointed out that the count of rows & columns have thankfully increased since Excel 2003 and marvelled at the improvements in Charts in Excel 2007 with the same excitement that is usually reserved for a special dish. I did not loose a chance then to tell her how to get a Ribbon-less pre-Excel 2007 UI . Just so that I do not forget the tips & tricks we discuss, I plan to document them here. 1) Find & replace a special character - This trick is adapted from a response on the MrExcel Forum Let's say you have received an Excel file with a pesky non printing character at several places in a sheet and now you need to replace it with something else. How to go about it? Get the numeric code of the pesky character using the CODE function. For instance, the formula =CODE(...