Visual Studio Incremental Search (Type-Ahead Find)

This is just awesome – with Ctrl+I, you can perform a type-ahead search within Visual Studio, just like Firefox!

Again, my buddy Sairama to the rescue. Just when I think I’ve pretty much got VS.NET down solid (only being use it since Pre-Beta days, right?) I’m thrown a curve ball called incremental search. I guess I just assumed that a feature that was so cool in so many other editors would never make it into VS.NET. Silly me.

So, lest I be the most ignorant, fire up Visual Studio.NET, get some code in there, hit Ctrl-I and start typing. After you’ve found something, use F3 to Find Next. In the words of Chris Sells – It’s pure sex.

via Scott Hanselman’s Computer Zen – My ignorance proceeds me: Visual Studio.NET Incremental Search.

Consolas as CMD.EXE (Windows Console) Font

2008-09-15_130451

First, you’ll need the Consolas font. If you’re not currently running Windows Vista, then you’ll need to get it via the PowerPoint Presentation Viewer, which will install Consolas, among other nice Vista fonts. (Or, if you have Visual Studio 2005 or 2008, you can just grab the Consolas Font Pack for Microsoft Visual Studio 2005 or 2008)

Once you have this font installed, open up Registry Editor (regedit.exe) and navigate to the following key, as shown below:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont\

2008-09-15_125937

Then, right click in the blank area and choose New > String Value.

Double click this new value and enter the following information:

Name: 00
Data: Consolas

Your window should now look like this:

2008-09-15_130000

Once this is done, open a console window (cmd.exe) and choose Consolas from the Font tab:

2008-09-15_131335

Thanks to Scott Hanselman’s Computer Zen for the tips on how to set this up! 🙂

Update: There seems to be an easier way to do this, as I just found from the IEBlog:

Bryn Spears on the Internet Explorer team gave me the following simple instructions to turn on Consolas in the CMD Window:

reg add “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont” /v 00 /d Consolas

logoff

Note: In Windows Vista, you need to run the reg command from an elevated command prompt.

When you log back in, Consolas will be an option in the “Command Prompt” Properties.  (n.b., Bryn tells me it actually shows up before you relog, but it won’t work.)

Visual Studio 2008 SP1

2008-08-25_104903

I’ve seen a *lot* of hits on my post “Visual Studio 2008 Is Pretty Damn Slow…“, which means that a lot of you are probably still experiencing speed issues with Visual Studio 2008. In regard to this, I thought it might be prudent to post information about the recently released Service Pack 1 for VS2008 and where to find it:

aa700831.VS08_v(en-us,MSDN.10)

Visual Studio 2008 Service Pack 1 (SP1) and .NET Framework 3.5 SP1 Downloads

Visual Studio 2008 SP1 and .NET Framework 3.5 SP1 significantly improve the developer experience during the development process, and at runtime. These improvements address top issues reported by customers. For more information, see Visual Studio 2008 SP1 and .NET Framework 3.5 SP1.

Downloads

Additionally, the original hotfix which was intended to fix the speed issue (and is probably integrated into VS2008SP1) is available here:

And…

Here are all my posts related to this Visual Studio 2008:

Linkback: "Visual Studio 2008 C# IDE is Slow … Really slow."

Here’s a MSDN forum article that links back to my post about the VS2008 hotfix:

I believe there are known issues with VS2008 and web development.  This article contains a link to some hotfixes for VS2008 web development.  Maybe it’ll fix your problem: https://blog.wolffmyren.com/2008/02/11/performance-and-editor-fixes-for-vs2008/

(via forums.microsoft.com/MSDN)

Base64 Valid Character Set

I found this on a forum post, and just wanted to verify that this information is correct:

for base64 the valid charset is:
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwx yz0123456789+/
the = is used as filler for the last bytes, as the length must be mulitple
of 3

(via thescripts.com/forum)

The charset looks reasonable, but must the length be a multiple of 3? (Seems like a multiple of 4 would make more sense.)

Comments very much appreciated!

Null-Coalescing Operator

While at a rather disappointing MSDN event yesterday, I came across one gem of C# 3.0 candy in the form of a null-coalescing operator. This is basically a short-cut for the oft seen:

string emailAddress = parsedValue != null ? parsedValue : “(Not provided)”;

OR

string emailAddress = String.Empty;
if (parsedValue != null) {
emailAddress = parsedValue;
}
else {
emailAddress = “(Not provided)”;
}

Using the Null-Coalescing Operator
These can now instead be re-written using the new null-coalescing operator as:

string emailAddress = parsedValue ?? “(Not provided)”;

This can roughly be read as “Set emailAddress equal to parsedValue unless it is null, in which case set it to the literal (Not Provided)”.

(via Null-Coalescing Operator)

…but its programmers are on the ball.

Shortly after I posted my last entry (Visual 2008…) and left a comment on this blog, two programmers from Microsoft left comments offering assistance in troubleshooting the speed issues with Visual Studio 2008.

Much thanks to David and Jason from Microsoft!