Did you know that 7-Zip can open and extract ISO archives? I had to install OneNote today from the MSDN ISO and I didn’t have an virtual drive/ISO mounting tool installed on my work PC. So I tried to open the ISO in 7-Zip and it opened it just fine. All I then had to do was to extract the files to a temp folder and did the install from there.
In my opinion, the top three hardware items that help maximize programmer productivity are sufficient RAM, multiple monitors, and a fast multi-core CPU. For RAM, try to have at least 2GB for Visual Studio development, especially if you have additional applications such as Resharper, a local SQL Server instance, IIS, etc. Remember that on Windows XP or Vista 32-bit, the maximum usable RAM is limited to about 3.2 GB or so.
My current company-provided laptop, which I must perform most programming activities on, is a Core 2 Duo 2.4 Ghz. It is satisfactory for what I am doing. Given the choice however, I would go for a quad-core CPU desktop. Desktop usually has faster drives, better video cards, etc. And the additional cores allow for smooth multitasking and better performance when using virtual machines.
Plenty of RAM and multiple fast CPU cores will keep the waiting down to a minimum. Now you need to give yourself the ability to see all of those things that you have going on. Research has demonstrated that multiple monitors increase productivity. For most programmers, I would recommend two monitors. Adding that second monitor is a relatively inexpensive affair. Most laptops or desktop video cards has built-in support for a second monitor so all you have to do is getting that second LCD, which cost very little these days compared to three years ago. The third monitor and beyond is where things start to get complicated. You either have to install a second video card, or use a second PC/laptop in conjunction with a software application named MaxiVista. Unless you have spare monitors sitting around, I think the return on investment starts to diminish greatly beyond two monitors.
Another way to use that third or fourth monitor is to simply attach them to additional computers. Sure, you won’t be able to control all those monitors with the same mouse and keyboard but this setup is not without advantages:
- When the first computer is rebooting or not responding, you still have a fully functioning computer.
- The screens on the second computer are not using CPU/memory resources on the first computer.
My 5-Monitor Setup
I work from home most of the time and on my desk, there are five monitors, hooked up to three laptops. I know… it’s over the top but it’s not like I bought all of these laptops/monitors specifically for this setup. The second laptop is my personal laptop. The third one is another old personal laptop that would otherwise would be sitting around gathering dust. I might as well put them all to use. Here’s how the monitors are arranged:
The main laptop is hooked up to monitor #1, an ASUS 24″ running at 1920×1080 resolution and monitor #2, the main laptop’s built-in 15.4-inch LCD running at 1680×1050. I spend most of my time on these two monitors. The ASUS 24″ is great for programming/debugging and is where I normally park Visual Studio 2008 or Rational Software Architect. If you can get one with more vertical resolution (such as 1920×1200), that’s even better.
The extra width on the main monitor allows me to permanently open supporting panes like Solution Explorer that I otherwise would configure to “auto hide”. Note where I have my Start menu: on the right edge of the main monitor. This gives me more vertical space so I can see more code without scrolling. The additional benefits are that more opened windows can fit on the task bar, and that I don’t have to move the mouse as much to access the start menu.
The built-in laptop monitor (#2) is where I have miscellaneous supporting windows such as rolling logs, instant messaging client, email client, documents, etc.
For taking notes, I use Microsoft OneNote and since it’s not installed on my company PC, I use my own laptop for it. This laptop is monitor #3, sitting to the left of the main monitor. Monitors #4 and #5 are used once in a while to display server logs, various server telnet and remote desktop connections, and anything I don’t need to control often.
Update 2/25/2008 – Synergy
Rohan kindly pointed out to me a free keyboard/mouse sharing utility called Synergy. You should give this a try if you have multiple computers on your desk. Synergy lets you use a single keyboard/mouse to control multiple computers, running multiple operating systems. Additional features include clipboard sharing, screen saver, and single password login. The configuration is not the most intuitive but once you have everything set up correctly, it works like a charm.
I now can control all three laptops and 5 monitors with one mouse/keyboard combo! Very nice.
- Thread synchronization: Wait and Pulse demystified. By Nick Butler.
- Use a shortened GUID for file names and request strings. ShortGuid – A shorter and url friendly GUID class in C#. By Dave Transom.
- Top Ten Tips to Using XPath and XPointer. By John E. Simpson.
- Client-side caching for script methods access in ASP.NET AJAX, by Jeffrey Zhao.
- A very nice two-part introduction to jQuery, by Rick Strahl.
- A COMPARISON OF MICROSOFT’S C# PROGRAMMING LANGUAGE TO SUN MICROSYSTEMS’ JAVA PROGRAMMING LANGUAGE. By Dare Obasanjo.
- Silverlight 2 End to End Tutorial: Building a Digg Search Client, by Scott Guthrie.
- Fluid Canvas in Silverlight, by neo.
- Performance Improvement for WCF Client Proxy Creation in .NET 3.5 and Best Practices. By Wenlon Dong.
- A comprehensive guide to using MsmqIntegrationBinding with MSMQ 3.0 in WCF. By Simon Evans.
- If your WSE 3.0 Mutual Certificate Authentication web service runs very slowly, try setting establishSecurityContext to true.
- PowerShell Community Extensions has very useful cmdlets such as Get/Set-Clipboard, Write-GZip, Start-Process, Select-Xml and many others.
- John D. Cook’s PowerShell Cookbook has lots of useful PowerShell recipes.
Apps and Tools
- Microsoft Windows SteadyState (free) is great for maintaining public-access computers.
- Anatomy of a malware scam – The evil genius of XP Antivirus 2008. By Jesper M. Johansson. If you’ve had to help your relatives and friends clean up after XP Antivirus 2008/2009, read this very detailed analysis of the malware.
A while ago I had been posting my Finds of the Weeks series and this is the continuation of that. Instead of weekly though, this series will be more of a “whenever possible” kind of thing.
- Some code optimizations can actually slow down your app. Beautiful Code: False Optimizations by sernaferna.
- Quad core + 8GB RAM + Server 2008 with Hyper-V = A Great Dev Environment. By Craig Lussier.
- jqModal is a modal dialog plug-in for JQuery. Worked great for a project I was working on two months ago.
- Safari Books Online is a great online programming books service. For a monthly fee, you get to read several books using your browser. The browser interface is not great, but the price is much lower than actually buying the book.
- Randomly ordering an array is simple. That’s what I thought until I ran across Techniques for Randomly Reordering an Array (by Scott Michell).
- Eugene Osovetsky explained a few peculiarities when consuming WCF services from Visual Studio 2003: Solving the “disappearing data” issue when using Add Web Reference or Wsdl.exe with WCF services.
- If you have a DataReader and don’t intend to read all records from it, call IDbCommand.Cancel before you call IDataReader.Close so that the rest of the unread records are skipped.
- Scott Hanselman: Assembly Fiefdoms: What’s the Right Number of Assemblies/Libraries?
- VS.NET Tip of the Day: Reusing C# Source Code Across Multiple Assemblies. By ShawnVN.
- Setting the log file location at runtime with a DOM configured log4net. By Keyley on Kode.
- WCF – Recommended Settings for Tracing and Message Logging. MSDN.
- WCF – Enabling Performance Counters. By Nicholas Allen.
- One of these days I’ll get back into Windows Mobile programming. Adjust Your Ring Volume For Ambient Noise, Chris Mitchell.
- Did you know ReSharper supports wildcards in its Go To Type dialog box? Joe White’s 31 Days of ReSharper series is a must read for ReSharper fanatics like me.
- Is image processing in C++ a thing of the past? Discover Enhanced Image Manipulation with GDI+ (by Tade Oyebode).
- DataContractSerializer can be used to deserialize WCF messages.
- Unraveling the Mysteries of .NET 2.0 Configuration, by Jon Rista.
- Stefan Delmarco talked about the NEWSEQUENTIALID function in SQL Server 2005.
- Mutexes are fun: Application Locks (or Mutexes) in SQL Server 2005. Mladen Prajdic.
- Experiencing strange issues with your Windows (like dialog boxes that don’t show up)? You may be having a desktop heap issue. Try these articles:
- Windows XP flakiness – solved. By Kevin Dente.
- “Out of Memory” error message appears when you have a large number of programs running. Microsoft Support.
- If IE crashes when you try to open SharePoint documents, try this fix: regsvr32 “C:\Program Files\Microsoft Office\OFFICE11\OWSSUPP.DLL”.
Software, Tools, etc.
- If you have a Linksys WRT54* router, I highly recommend loading Tomato firmware. I have been using it for about 6 months now and it’s so much better than the built-in Linksys firmware. Tomato’s QOS works great to make sure my Vonage phone line remains usable at all times.
- Ben Pierce posted a series of very useful PowerShell command-line demos: Demo1 (Administering Windows), Demo 2 (Administering Servers in bulk), Demo 3 (How do I Know Which Class to Use), Demo 4 (Administering Hyper-V).
- World War is a very nicely done digital animation by Vincent Chai. My son can watch it for hours.
- Your browsing history can be used by any web site out there to guess your gender. Using your browser URL history to estimate gender, by Mike on Ads.
- Humans can fly (video).
- A fascinating into the human mind: The Interpreter (Has a remote Amazonian tribe upended our understanding of language?). By John Colapinto.
On my home network, I have a media file server running Vista 64-bit that serves out music and movies. Since everything is behind a router, I decided to make the shared media folders accessible to anyone on my home network. All you have to do is browse to the media server and start accessing content, without having to log in.
To enable anonymous browsing of a shared folder that is shared by a Vista PC (that is not on a domain), do the following:
- Enable the Guest Account:
- Run "lusrmgr.msc", select the Users folder.
- Right click on the Guest user and choose Properttes.
- Uncheck "Account is disabled".
- Enable "Public folder sharing" and disable "Password protected sharing":
- Choose Start, right click on Network, and choose Properties.
- Enable "Public folder sharing".
- Disable "Password protected sharing".
- For each shared folder:
At home, I occasionally need to print color posters and black and white flyers. I’ve found FedEx Office Online Printing Service to be very convenient for this (if you know exactly what you want… more on that later). After you upload your file in one of the supported formats (Word, PowerPoint, Excel, RTF, Post Script, PDF, Text, JPG), select a paper size, and set print options (color/black and white, copies, collation, paper stock, etc.), the web site gives you a preview of the final print output.
For my last print job, the file I wanted to print was in CorelDRAW format, so all I had to do is go into CorelDRAW and export it to Post Script format. The final print output looked perfect to me.
There is a "minor" problem with the service however: there are no prices to be found on the site anywhere. No, the printing is not free, sorry. You do eventually see the total price when you check out. The only reason I can think of for this strange "price hiding" practice is so that people can’t easily compare online prices vs walk-in prices. They obviously have complete pricing data in the system, because the site does give you a total at checkout. This lack of up-front pricing is a major hassle, especially if you are not sure which options you want (type of paper, etc). You can’t easily/quickly compare the different printing options (and there are tons of them). Changing your order and going through the checkout process just to see the price is too cumbersome.
One has to ask, what were they thinking??? I certainly hope this is not a trend among online stores. And don’t you hate it when you google something (such as "FeDex Kinko’s prices") and the first thing you find is other people also looking for the same info and not finding any :-).
Here are some actual prices I got recently (December 2008) for my local FedEx Kinko’s (Richmond, VA):
– 8×11, B&W, 30% Recycled Paper: 10c/page.
– 8×11, B&W, Standard Laser Paper: 12c/page.
– 8×11, Color, Standard Laser Paper: 59c/page.
– 17×11, Color, Standard Paper, 1.78/page
There is a volume discount when you order more than x copies. It seems that the discount starts at 100 copies.
Against popular wisdom, I decided to upgrade my bedroom home theater PC to Vista 64-bit a couple days ago (just have to make full use of all of my precious 4GB of RAM). Everything is working surprising well so far, with the exception of sound! Whenever I play any audio, my speakers now produce all kinds of pops and crackles along with the normal audio stream. Urgg.
After a couple of days of googling, tweeking various sound settings, uninstalling/reinstalling drivers, etc. without success, I almost gave up on the thing. Then I decided to try just one more thing, changing the default sample rate to “2 channel, 16 bit, 44100 Hz (CD Quality)” from the default “2 channel, 24 bit, 48000Hz” and just like magic, the pops and crackles are gone.
Nice surprise logging into Gmail just now: Themes! I tried out a few and have to say they are nice to look at. I almost forgot I have actual emails to read. I’m going to try out a cheery theme to offset the grim news from Wall Street.
There’s even a Terminal theme for die UNIX shell diehards. It’s actually kind of cool… if only for a few minutes.
More info from the official Gmail blog.
Ever since Windows 2000, menu keyboard shortcut characters are not underlined by default. According to Microsoft, the underlined letters are hidden until you press the Alt key. Let’s try that… First, use the mouse to click on the Help menu in Visual Studio:
Now, press Alt to show the underlined letters right? Poof, the menu is gone. Ok, that’s an easy one. I’m sure everyone have figured out that Alt key must be pressed before you access the menu. But can anyone tell me this? How do I show underlined letters for right-click/context menus with the Alt key? Well, the short answer is you can’t! If you don’t believe me, try it yourself. I’ve tried Alt+right-click, Alt then right click, right click then Alt, etc. Nothing works.
The only thing I’ve found to work is the Application key (this is the key with the image of a mouse pointer on a menu, between Alt and Ctrl). Interestingly, the Application key will always show underlined letters regardless of the “hide underlined letters” settings. The keyboard combination Shift-F10 also brings up the context menu, however that keyboard shortcut does not show underlined letters.
You can forget about all of this nonsense and have Windows always show the underlined letters by changing a setting (instructions below are for Windows XP):
If you do any web scraping (also known as web data mining, extracting, harvesting), you are probably familiar with the main steps: navigate to page, retrieve HTML, parse HTML, extract desired elements, repeat. I’ve found the SgmlReader library to be very useful for this purpose. SmglReader turns your HTML into XML. Once you have the XML, it’s fairly easy to use built-in classes such as XmlDocument, XmlTextReader, XPathNavigator to parse and extract the data you want.
Now to the labor intensive part: before your program can make sense of the XML, you have to manually analyze the HTML/XML first. Your program won’t know jack about how to extract that stock price until you tell it exactly where the stock price is, typically in the form of an XPath expression. My process of getting that XPath expression goes something like this:
- Scroll to/find desired element in the XML editor.
- Does element have unique attributes that can be used?
- a – If yes, code XPATH statement with filter on attribute value. Example: //Table[@id=”searchResultTable”].
- b – If no, code an absolute XPATH expression. Example: /html/body/div/pre/font/table/tr/td/table/tr/td/span.
Step 2b is where it gets very labor intensive and boring, especially for a big web page with many levels of nesting. Visual Studio 2005 XML Editor/Resharper have a couple of features that I find useful for this:
– Visual Studio’s Format Document (Edit/Advanced/Format Document) command formats the XML with nice indentation and makes it a lot easier to look at.
– With Resharper, you can press Ctrl-[ to go to the start of the current element, or if you are already at the start, go to the parent element.
Even with the above tools, it’s still a painful and error-prone exercise. Luckily for us, Firebug has the perfect feature for this: Copy XPath. To use it, open your HTML/XML document, open the Firebug pane (Tools/Firebug/Open Firebug), navigate to the desired element, right click on it and choose “Copy XPath”.
You should now have this XPath expression in the clipboard, ready to be pasted into your web scrapper application: “/html/body/div/table/tr/td/table”.
A feature that I would love to have is the ability to generate an alternate XPath expression using “id” predicates, such as this: “//Table[@id=”searchResultTable”]”. With web pages that are not under your control, you want to minimize the chance that changes on the pages impact your code. Absolute XPath expressions are vulnerable to any kind of changes on the page that change the order and/or nesting of elements. On the other hand, XPath expressions using an “id” predicate are less likely to be impacted by layout changes because in HTML, element IDs are supposed to be unique. No matter where your element is on the page, if it has the same ID, you should still be able to get to it by looking up the ID. Hmm… this sounds like a good idea for a Visual Studio Add-in.