I just learned that James Kim and his family are missing. James is a former TechTVer and now part of CNET. If you live in the Oregon / Northern California area your help is needed. Please go to http://www.jamesandkati.com/ to get the full details and see what you can do to help. Thanks!
While we are on the theme of tools that snap, I thought I’d introduce AllSnap. AllSnap is a handy utility that doesn’t have much to display graphically but is a real gem. If you have ever used WinAmp, you are familiar with it’s “Snap” feature. When you get WinAmp close to the edge of the screen, it automatically moves itself to the edge.
AllSnap is a free tool that gives that functionality to ALL windows. Available at http://www.cs.utoronto.ca/~iheckman/allsnap/, it’s one of those tools you will quickly get addicted to.
AllSnap puts an icon in your System Tray, through which you can access it’s settings window. Be sure to check this out, as you can adjust things like the number of pixels you get to the edge in order to trigger a snap, whether it snaps to just the edges or a vertical and horizontal center, and much more.
I’ve installed AllSnap on all of my systems, and it’s made life in the windows world just a little nicer.
Today is my oldest daughter’s birthday. Happy Birthday Raven!
Rather than doing something technical today I thought I’d give her and you a fun little gift. I’ve found a great internet comic strip by a guy named George Sfarnas called Being Five (http://beingfive.blogspot.com/). It’s about a five year old boy who blogs using voice recognition software. Go take a look, but don’t be drinking milk when you do. You’ll laugh so hard it’ll squirt out your nose!
I had the need to capture some screen shots, and old Print Screen wasn’t cutting it. I was unable to capture the menus I needed for my documentation. A quick search found a tool so cool I just had to blog about it.
WinSnap, available at http://www.ntwind.com/software/winsnap.html has all sorts of features for doing screen captures. It will do rounded corners, allow you to capture in various color schemes, such as grayscale and sepia, and save in all the standard formats (jpg, gif, bmp, png, and tiff). You can also add watermarks, which is cool.
There are more options than I can cover here, most useful is the time delay feature. To capture an image you just click the new snapshot button. WinSnap hides itself, then after a user specified number of seconds it takes a screen capture. By default it is one second, you’ll probably want to bump it up so you have time to get your app like you want it. I’ve found five seconds to be a good default.
Rather than repeating what they already have on their site, I’ll just point you to the features page (http://www.ntwind.com/software/winsnap/feature-highlights.html).
Take a look, this tool will be valuable to anyone who has ever had to capture screen shots. And since it’s free, the price is perfect!
One of the things I really like about WordPress is that you can see the search engine terms that lead people to your site. In the lists I see some search terms that occur frequently. I thought it might be fun to take a guess at what the googlers were looking for, and take a stab at answering them.
exit full screen remote desktop
Move your mouse to the top, center of the display. A little yellow bar will scroll down, with the machine name. On the left is a push pin you can use to make it stick. On the right is the traditional Min / Max buttons you see on a window.
virtual pc exit full screen
Alt + Enter will exit full screen, but it has to be the Alt key on the right side of the keyboard. (This assumes you haven’t changed you hot key mappings).
command to close virtual pc
There’s several ways to close a virtual pc. The simplest, and best is to do a shutdown of what ever OS you are running. When the guest OS shuts down, the Virtual PC exits.
You can also select Action, Close on the menu, VPC will prompt you to see if you want to close and save state (sort of like Hibernate on a laptop) or exit and discard changes. If you are running a Windows OS, VPC will also give you the option to shut down. You can get the same prompt by clicking the X (cancel) button on the window your guest OS is running in.
This is one that shows up a lot in my searches. Event toaster is part of the Visual Studio Enhancements Add-In from Microsoft. See my entry on November 15th (https://arcanecode.wordpress.com/2006/11/15/visual-studio-add-ins-ms-visual-studio-enhancements/ or http://shrinkster.com/kdt ) for more info.
virtual computer usb
Virtual PC does not support USB in either version 2004 or Server 2005. And, despite being the most asked for item in Virtual PC 2007, Microsoft still does not have any plans to include it in the next version.
VMWare, on the other hand does support USB. In the VMWare Server product, USB is not entered by default. You can add it, however by Editing the Virtual Machine Settings. In the dialog under Hardware click Add, and pick USB.
zone alarm remote desktop client
Another one that appears frequently, I’m guessing there’s a need to know how to get remote desktop to cooperate with Zone Alarm. Open the Zone Alarm settings panel, and click on Firewall. By default the Internet Zone Security is set to High. Drop this to Medium to get it to work with remote desktop. You will also need to go into Program Control and put checks for Remote Desktop Connection for all four columns.
defrag a single file
Use the SysInternals Contig tool. See https://arcanecode.wordpress.com/2006/11/06/sysinternals-contig/ for more info.
There’s a few of the top searches from my history, hopefully I’ve answered questions for a few of you out there!
Over the Thanksgiving holidays I did a lot of traveling. Before I left I downloaded a lot of videos and podcasts from the internet to keep me busy during those slow times when everyone else had keeled over from too much turkey. One video that caught my eye was on the Channel 9 website. Channel 9 ( http://channel9.msdn.com/ ) , by the way, is the Microsoft sponsored site where the Channel 9 team goes out and videos other folks in Microsoft, talking about new technologies or interesting activities they are doing. This is the same place famous (or infamous) Rory Blyth ( http://www.neopoleon.com/home/default.aspx ), former co-host of DotNetRocks went to.
This particular video, http://channel9.msdn.com/Showpost.aspx?postid=226791 talked about the CodePlex team. CodePlex, by the way is the Microsoft site ( http://www.codeplex.com/Default.aspx ) for open source development projects. I rather like the way it’s laid out, easy to find and organize a project, however that’s beside the point of this post.
During the video they revealed the entire CodePlex team works in a single office. Not an office with nice cubicles, not a section of a building, no all 8 of them are crammed into a single small office. Each has a small workstation or laptop on a small table or desk. Apparently this is some take off on Agile Development. Their claim was that if one guy runs into an issue, it’s very easy to say “Help!” and get immediate help on a coding issue and not delay his work. My thought was, hey that’s really great. For that one guy.
For the rest of the team, it seems to me it would be incredibly disruptive to the creative process. As developers, we often get into what Tony Robbins ( http://www.anthonyrobbins.com/ ) refers to as “The Zone”, that creatvie point where the juices are flowing and we lose all track of time. You’re solving problems, creating code, really making your application flow well. You know you’re there when you reach over for that cup of coffee to find it’s ice cold.
Then boom, someone interrupts you. Doesn’t really matter if they were asking, all that matters is you are rudely jarred out of “The Zone” and back to reality. After dealing with the interruption, it can be difficult to get back into “The Zone”, I’ve seen some studies that suggest it can be as long as half an hour before your mental processes have returned to full focus on the issue.
There are some aspects to Agile that appeal to me, for example the short release schedules. But cramming a bunch of coders into a single room? No thanks. I prefer to hang out in “The Zone”.
But hey, that’s just my opinion. I could be wrong.
SmartOutline is a tool for creating regions in your code without having to use Region / EndRegion tags. Available at http://submain.com/default.aspx?nav=products.smartoutline, this tool took third place in the Microsoft Visual Studio Extensibility Contest packages category.
SmartOutline is a product that’s easier to show you how it works than describe, so let’s look at a few pictures. Let’s say I have a simple if statement. Highlighting it gives me a new pop up, as you can see below.
Clicking on the Create new SmartOutline Region command brings up the following dialog, where you key in the name for your region.
In this example I’ve keyed in “My If Statement” for the name. Assuming I then check the “Collapse region” box, my code will update as you see below.
Clicking the + button will expand my region back to the original state, as you can see.
SmartOutline is useful for hiding long lengths of code that add safety but not value. For example, you might have to do a lot of validation to input parameters, but they don’t add to the real purpose of the method. SmartOutline is a great way to hide that.
You might assume that SmartOutline is altering the source files using Region tags and intercepting them. Not so, as this command window dump of the source file proves:
Some useful situations to use SmartOutine to hide code segments might include:
- Lengthy error handlers
- Long parameter checks
- Long comments
- Code that is commented out, perhaps something for a future version or older version that you’re not sure you want to delete
- Using (or Imports) sections
- Entire Methods
These are just a few ideas, feel free to post a comment with your own thoughts.
My one complaint / wish list item for enhancement is that SmartOutline left aligns the name you give to the smart region. This breaks up the visual flow of indents. You can add spaces yourself when you give the name, for example I could have keyed in six spaces then “ My If Statement”, but if I were to indent the code later SmartOutline doesn’t change to reflect this. You should also know this is a VS2005 tool only, sorry 2003 users.
Overall a useful tool for adding to the readability of your code, well worth the download, and like many of the other tools mentioned so far, it’s free.
VSCmdShell is a handy add-in that places a Command window inside of Visual Studio. Available at http://www.codeplex.com/Wiki/View.aspx?ProjectName=VSCmdShell, after a simple install you can launch the command window from the View, Shell Window command. By default it launches as free floating, I chose to dock mine down at the bottom with the Command and Output windows.
From here, you can issue your typical array of commands, such as getting a directory, but the cool thing I use it for is my deployment scripts. I have a cmd file (sort of the new version of a batch file) that compiles my web apps then deploys to the development server.
VSCmdShell has some nice customizations. It has the things you might expect, like being able to change the text and background colors, but you can also select the shell. For example, you could install the new Windows PowerShell, and use it as your default shell window.
To get to VSCmdShell’s options, click on Tools, Options. Scroll down to “Power Toys”. Note if you previously installed the Visual Studio Enhancements (which I blogged about at https://arcanecode.wordpress.com/2006/11/15/visual-studio-add-ins-ms-visual-studio-enhancements/) you’ll actually have two entries for power toys. The “PowerToys” (no space) is from the enhancements, the “Power Toys” (with a space) is from the VSCmdShell. Here’s a quick shot of the dialog:
As you can see, you can change the font and colors, the shell, and even set the initial directory for the command shell. Best of all, VSCmdWindow automatically sets up all the VS variables for you. If you ever have need of a command prompt, this free tool is well worth the download.
If you are like most programmers, you tend to fiddle with your SQL in some tool where you can run, test, and optimize your SQL before you paste it into your app. Or perhaps you have some long static text info (such as instructions) that you need to display to the user. You type it all in, then you have to mess around with getting it onto a string. You break it into multiple lines, perhaps you are using a string builder to hold it. The whole time you’re thinking there’s got to be an easier way. Well, there is!
The great add on, Paste As… from
http://weblogs.asp.net/alex_papadimoulis/archive/2004/05/25/Smart-Paster-1.1-Add-In—StringBuilder-and-Better-C_2300_-Handling.aspx (or if you like shorter URLs, I’ve shrinksterized it, http://shrinkster.com/jut ).
This add-on takes whatever text you have in the buffer and pastes it into your code in one of four ways: as a comment, as a string, as a string builder, or as a region. Let’s take a fake SQL statement and render it the various ways. First, here is a SQL Statement that you’ve worked on inside your SQL tool (it’s fake, but you’ll get the idea.)
select FirstName, MiddleInit, LastName, Street, City, State, Zip, PayRate, HireDate from SomeEmployeeTable order by LastName, FirstName, MiddleInit
Here it is as a comment:
//select FirstName, MiddleInit, LastName, Street, City, State, Zip, PayRate,
//HireDate from SomeEmployeeTable order by LastName, FirstName, MiddleInit
Now here it is as a string:
@”select FirstName, MiddleInit, LastName, Street, City, State, Zip, PayRate, “ +
@”HireDate from SomeEmployeeTable order by LastName, FirstName, MiddleInit”
All you have to do is put “myString = “ on the front, and (if you are in C#) a ; at the end and you’re done. Now here it is as a StringBuilder. Note it will prompt you for the name of your StringBuilder variable, and how cool is it that it automatically calculates the size of the string for you (in this case 147).
StringBuilder myStringBuilder = new StringBuilder(147);
myStringBuilder.AppendFormat(@”select FirstName, MiddleInit, LastName, Street, City, State, Zip, PayRate, “);
myStringBuilder.AppendFormat(@”HireDate from SomeEmployeeTable order by LastName, FirstName, MiddleInit”);
The final option is Paste As Region. While you would not typically paste a single SQL statement as a region, let’s see how it looks anyway:
select FirstName, MiddleInit, LastName, Street, City, State, Zip, PayRate, HireDate from SomeEmployeeTable order by LastName, FirstName, MiddleInit
In the context we’ve presented above probably not something you’d do. Where this would come in handy is when you’ve copied a bunch of code to the clipboard, and want to paste it into a new region. Since it does no reformatting, this makes it an easy way to bring in new code to your application.
This tool works with both VS2003 and VS2005, and works in both C# and VB.Net. It has quickly reached the top of my “indespensible” list and is one of the first I install when setting up a new instance of VS. And it’s free! How cool is that.
Our next tool is very handy for those of us who blog, or perhaps just want to share code snippets with friends using HTML enabled e-mail. Copy Source as HTML, available at http://www.jtleigh.com/people/colin/software/CopySourceAsHtml/ does just what it says. It takes the lines of source code you have highlighted in your Visual Studio editor and copies them to the clipboard as HTML.
For an example, I’ve pasted this simple HTML into my blog so you can see what it looks like. This is HTML text, not a picture:
9 namespace WinTest1
11 public partial class Form1 : Form
13 public Form1()
There are several options, as you can see from the dialog below.
You can have line numbers (as I’ve done above), set the line number to start at, or omit them entirely. You can activate word wrap, over ride the default tab size, font and font size. If you’re a CSS guru there are even tabs for entering your own CSS for both the entire section (surrounded in DIV tags) or the individual line.
Another great free add-in, it has both 2005 and 2003 versions. If you ever need to convert your code to HTML this is a great, easy way to do it.
DPack is an add-on I’ve used for quite some time, coming in both VS2003 and VS2005 versions. Available from USysWare (http://www.usysware.com/dpack/) this add-on has a wide variety of tools including Code Browser, File Browser, Solution Browser, Framework Browser, Numbered Bookmarks, Surround With, Code Navigation, Solution Statistics, and Solution Backup.
Some of the items, like the browsers have some overlap with other tools mentioned already. For example, I find the solution browser from Microsoft (see my previous post) easier to use. However, the DPack browsers add a lot of useful statistics that the other tools don’t.
Surround With is probably the tool I use the most. Right clicking highlighted text and picking Surround With produces a pop up window.
As you can see here, I selected for from the list:
Solution Backup is another tool I use frequently. Whenever I reach a milestone in my code, such as completing a bug, I use Solution Backup to take the entire project and save it to a ZIP file.
Take a look at the website, USysWare has some good demonstrations and snapshots of the tools included in the pack. Like the other tools, it’s totally free, so worth adding to your toolkit.
The next add-in I guess technically isn’t an add-in, since it doesn’t reside in the Add-Ins window, but it’s close enough. Coming from Microsoft itself, this handy download is named Visual Studio 2005 IDE Enhancements, but I notice the file name is vssdk_powertoys. Cool.
You can download this set of five tools from http://www.microsoft.com/downloads/details.aspx?familyid=cd7c6e48-e41b-48e3-881e-a0e6e97f9534&displaylang=en or http://shrinkster.com/jwx .
The first, and incredibly useful tool in this free add-in is the Source Outliner. Seen in the window below, it builds a source tree that resides in a window with the toolbox and server explorer. To activate, click on View, Other Windows, Source Outliner.
You can quickly and easily navigate through your project using the tree. On a large project or class this will be very useful, I can tell this is a tool that will get a lot of work out in my environment.
Next is a collection of Visual C++ snippets. Great if you’re a C++ guy, just sort of there if you’re not.
Third is something they call Indexed Find. This uses the Microsoft Index Service to provide advanced search capabilities. You indicate what you want to look for, what directory (or directories) to look in, file types, and away it goes.
I can see where this would be handy, let’s say you have another project that you know you’ve written a routine in, but can’t recall which file it’s in. Whip out this handy tool and let it look for you. Like the other tools here, it’s available via the View, Other Windows menu.
Fourth up is the Super Diff Utility. Just what you’d expect from the name, it will let you specify two source files and does a compare, highlighting differences. Very handy when you want to look back upon a previous version you’ve pulled from your source repository, or perhaps you’ve got conflicting versions on different disk drives and want to determine which you should be using.
The final tool in the pack is the Event Toaster Utility. Unlike the other tools, this one is access via the Tools, Options dialog. Down in Power Toys, EventToaster you can see a list of VS events you can hook into.
As you can see, there are a wide variety of tasks you can launch, from something as simple as a sound to something as complex as a macro.
Microsoft has done a nice job with these tools, extending the Visual Studio IDE in some very useful ways.
We’ve spent a while talking about tools you can use outside Visual Studio to help you with your application development. It’s time now to look at some tools we can use inside Visual Studio.
First up is a brand new set of VS Add-Ins from SlickEdit (http://www.slickedit.com/content/view/441), called SlickEdit Gadgets. This free add-in comes with five tools: Editor Gadgets, Command Spy, File Explorer, Data Object Analyzer, and the SLOC Report.
The first tool, Editor Gadgets, contains four useful items. First, there is an Indentation Guide that draws a line down the screen at the current indent level for your cursor. Next is a Line Ruler, that highlights the current line and displays the tab settings. Both of these are illustrated in the following graphic:
Third is a very useful feature called Auto-Copy. When text is selected with the mouse, it’s automatically copied to the clipboard. To paste, click with the middle button (or scroll wheel, if you have a clickable scroll wheel).
The final option is the ability to place a graphic over the editor window. In the example on their website they have a green bar paper image behind the editor text. These various features can be enabled and disabled via the options window inside Visual Studio. For example, I thought the blue background and black border on the Ruler Line to be distracting, so I reset to a white background and light gray border.
As you can see, much less distracting. I also opted to turn off the indentation line.
Next up is the Command Spy. If you are a VS Macro writer, you’ll find this tool indespensible. Command Spy is a small window (you can dock it with the Output and other windows). As you activate various commands in VS, Command Spy shows you the command in the window. Again, very useful if you want to write macros.
The third is what I consider to be the most useful tool, right behind Auto Copy: File Explorer. It’s just what it sounds like, it puts a File Explorer tab into your VS environment.
You can then drag any of these items into your project solution window. I can see where this handy tool will get used a lot.
Next up is the Data Object Analyzer. This tool lets you examine what you put on the clipboard, see it’s properties, and generate code to handle it. How useful this will be remains to be seen, if you find creative uses for it feel free to post a comment.
The final tool in this free kit is the SLOC report. SLOC stands for Source Lines of Code, it creates a Pie Chart style report that shows you the ratio of comments, white space, and actual lines of code. You can run the report for individual files or entire projects.
This can be handy if you need some quick statistics, perhaps you are doing a code review and want to be sure the ratio of code to comments is respectable. Most times though you won’t find this tool all that useful.
One thing to note, it only works with VS 2005, if you are still in the 2003 environment you’re out of luck.
There you go, a new tool from Slick Edit that’s free and adds several useful features to Visual Studio. Please leave a comment, I’m curious what your favorite features are and how you are using the tool.
If you are willing to invest a few dollars, you can get the Cadillac of text editors: UltraEdit (http://www.ultraedit.com/). At forty dollars (US) this editor does everything. It can handle multiple files, has syntax highlighting, is totally customizable. You can create macros for repeated commands, and the coolest feature to me is the ability to edit columns of text. You can cut and paste columns, move them around, etc. Very handy when editing data files that are fixed length records.
Here’s an example shot, in it you can see I have two files loaded (see the two tabs, Program.CS and ReleaseNotes.xml). You can also see I have a column of text highlighted, the Application namespace.
There are far more options than I can document here, but I’ll list a few of my favorites.
- You can open files from, and save them to an FTP site. Great for editing files located on your Unix/Linux servers.
- You can configure UltraEdit to work with Visual Source Safe, checking files in and out.
- You can modify the dictionary to add your own words to spell check for. Very handy when you work in an industry that has a lot of special syntax.
- As previously mentioned, you can write macros to handle complex or repetitive tasks.
- Search / Search and Replace can use both straight text and Regular Expressions. Additionally, there are some special characters to represent often uses characters. ^p for example represents a carriage return / line feed combo.
- Has a Hex Mode.
- The toolbars across the bottom allow you to insert commonly used HTML tags, great for doing those tweaks on your web pages. I’ve gotten to where I do a lot of maintenance to my wesites using UltraEdit.
- Handles huge files with no problems. I once FTP Opened a 1.5 gig (yes GIG) log file. Because of the slow connection it took an hour and a half to open, but once it had it locally it literally zoomed through the file. I could go from the beginning to end in about a second. Like I said, big files, no problem.
- The ability to edit (cut and paste) columns of text. This is a feature I haven’t seen in any other text editor in a long time.
UltraEdit is the one tool I use every day. It’s shareware, so go give it a try. You can use it for 45 days with no issues. I’d bet after you try it you’ll be so hooked you’ll happily shell out the forty bucks. I’ve been using it since version 4, and am a happy camper.
Standard disclaimer, I receive no financial considerations and have no business affiliation with IDM (who makes UltraEdit). I’m just a happy customer who loves the product.
As developers we frequently need to delve into a text file. Be it an XML file, looking at some HTML, or a quick look into a CS or VB file to grab a routine to paste into our current app. It always makes me wonder when I run across a programmer who settles for the less than mediocre notepad that comes with Windows.
A handy tool I found via Scott Hanselman’s site (http://www.hanselman.com/blog/) is Notepad2 (http://www.flos-freeware.ch/notepad2.html) is a freeware text editor. It has most of your standard text editing capabilities, with a few great features for developers. First and foremost is syntax highlighting. Here’s an example of an XML file loaded in Notepad2:
Here’s another example with a C# app loaded:
Using the zoom buttons (the + and – in the toolbar) you can zoom the font easily, great for doing presentations.
It also supports an alternate color scheme, for those who like the high contrast look:
Notepad2 is highly customizable:
If you decide you really like Notepad2, you may wish to add it to your Right Click menu. Steve Clarke has a registry change you can make to add it, see his blog at http://steve.wedevelop.net/archives/000252.html.
Like the SysInternals tools, Noteapd2 requires no installation. I keep this tool along with the SysInternals tools on my USB thumb drive, to make it easy for me to edit files on computers. If you are still stuck with notepad, I high recommend you try out this FREE alternative!