For Resharper users: Goto Type supports title caps and wildcards. Joe White wrote about it here.
Paulo Reichert provided a good tutorial on how to implement your own configuration sections using .NET 2.0’s ConfigurationElement/ConfigurationElementCollection/ConfigurationSection.
There is a Richmond Geek Dinner this coming Tuesday. Organized by Justin Etheredge.
Roy Osherove proposed that someone comes up with unified API for testing and mock framworks like ADO.NET for database access. Hmm Microsoft and Scott Guthrie, are you listening?
Looking for a free sharepoint host? You can get a free sharepoint account with 5MB disk space, 5 users from Frontpages Web Hosting Network. Link is here.
Gadgets
The HD format war is over. I am waiting for Blu-ray players go go down to the $150 range before I’ll get one.
And Now, Something A Little Different
If you are the type who crack sarcastic jokes a lot: you may want to read this.
With the above code, anytime the order of columns in the SQL statement or stored procedure changes, the code is broken. And if you have lots of columns to read from, it’s a real nightmare to maintain the indexes.
The next time you write another DataReader loop, consider doing it this way instead:
using (IDataReader dr = cmd.ExecuteNonQuery())
{
int ORDER_ID = dr.GetOrdinal("OrderID");
int CUSTOMER_ID = dr.GetOrdinal("CustomerID");
int EMPLOYEE_ID = dr.GetOrdinal("EmployeeID");
int ORDER_DATE = dr.GetOrdinal("OrderDate");
int FREIGHT = dr.GetDecimal("Freight");
while (dr.Read())
{
int orderId = dr.GetInt32(ORDER_ID);
string customerId = dr.GetString(CUSTOMER_ID);
int employeeId = dr.GetInt32(EMPLOYEE_ID);
DateTime orderDate = dr.GetDateTime(ORDER_DATE);
double freight = dr.GetDouble(FREIGHT);
// do stuff
}
dr.Close();
}
Using GetOrdinal makes the code much more readable and maintainable. You are calling GetOrdinal just once for each column, any performance penalty is insignificant compared to the benefits. Be careful not to put the GetOrdinal code inside the while block as that will unnecessarily slow you down (about 3% according to this article).
Looks like Google has fixed the problems that were plaguing Gmail IMAP on Windows Mobile devices. Read the blog entry from the official Gmail Blog here. And here’s a related article from PC World: Google fixes Gmail IMAP problem on Windows Mobile.
Viigo is a free RSS reader for Windows Mobile. I have not really used it that much but it seems to work ok.
Skyfire is another promising Windows Mobile browser currently in private beta. Via Engadget.
If you have a Samsung Windows Mobile device, try the included PicSel browser. Here’s a review of Picsel browser, with a lot of useful how-to information included. By Tam Hanna.
Microsoft Expression Encoder is my new tool of choice to perform batch compression of digicam movies. Batch processing is handled very nicely, especially on my new Quad Core PC. I used to use MeGUI/x264 before, but it was just taking too much time to work through the various bugs and issues.
Reading Nazmul Idris’ post on Microsoft OneNote 2007 prompted me to try it myself…. and I loved it. It’s a great application to keep track of notes, journal entries, work logs, etc. It’s going to be an essential app for me from now on.
I especially like offline mode support for USB flash drives. You can keep your Notebooks on a flash memory card. OneNote automatically synchronizes its local cache with the flash card when the card is inserted. When not inserted, you can still work on the local cached copy.
What I don’t like: no VBA macro support. One of the first thing I tried was pressing ALT+F11 to bring up the VBA IDE… nothing happened. A quick search in Online Help confirmed my sinking feeling: no VBA support. Supposedly, you can write add-ins.
I learned from Sara Ford that the File.OpenContaingFolder command I wrote about last week is actually available by default in Visual Studio 2005/2008 from the context menu for each file tab:
Windows Vista has a very useful but hidden Copy as Path feature (Via Luke Foust). In Windows XP, the Send To X Powertoy used to provide this feature.
And Now, Something Different
I enjoy doing graphics design now and then. Here’s a cover I did this past weekend for the Richmond Vietnamese Association’s annual Tet (lunar new year) magazine issue (click image for full-size):
I think this is useful and not well known enough to warrant its own blog post.
Did you know that there is a Visual Studio command called File.OpenContainingFolder? Asmita A Wankhede wrote about it, but he left a few important details out.
By default, this command does not have a shortcut, so you would have to assign one to it (try CTRL+SHIFT+ALT+O). Also, the "item" that this command works on is the currently opened item in the editor, not the selected item in the Solution Explorer. See my Visual Studio tips article for instructions on how to create new shortcuts (section 3 – Make New Shortcuts).
I can’t believe I didn’t know about this Visual Studio command before: File.OpenContainingFolder. Asmita A Wankhede mentioned it, but he left a few important details out. By default, this command does not have a shortcut, so you would have to assign one to it (try CTRL+SHIFT+ALT+O). Also, the "item" that this command works on is the currently opened item in the editor, not the selected item in the Solution Explorer. See my Visual Studio tips article for instructions on how to create new shortcuts (section 3 – Make New Shortcuts).
Aaron Lerch shared a tip on how to use Powershell to perform search-and-replace on an entire folder hierarchy.
Aaronontheweb made 8 Bold Predictions for Web 2.0 in 2008. One of the predictions is that Google will have its first failure in 2008. I thought Google Answers was it.
If like me, you have heard about SubSonic but don’t know much about it, Kent Sharkey’s Introduction to SubSonic (Dotnetslackers) provides a quick primer.
Software And Tools
Did you know that something called Robocopy (short for Robust File Copy, not Robot Copy), is the new XCOPY? It’s a standard tool in Windows Vista and is also available as part of the Windows Resource Kit. Via Don Box’s Spoutlet on Pluralsight.
I recently tried and liked GhostDoc very much. It’s a free Visual Studio add-in to help write XML documentation comments. Roland Weigelt wrote a nice intro article on GhostDoc on DotnetSlackers here.
SyncBackSE is a great folder synchronization utility. It has tons of features… maybe even a little bit on the bloated side. It costs $30 for a single license. If you just want something simple, Microsoft’s free SyncToy may do the trick for you.
Gadgets
From CES, it looks like Blu-ray will be the winner of the HD format war. No, the war is not completely over, but this was the landing at Normandy… so to speak. The loss is just too great for the HD-DVD camp to recover.
I have been a little bit busy this past week enjoying the holidays and playing some of my old favorite games like Rome Total War and The Elders Scrolls IV: Oblivion.
No big news in .NET world this week. We are still waiting for the .NET framework source code to be released.
Here is a screenshot from the game Rome Total War: