Scott Hanselman

Five Absolutely Essential Utilities that make Windows better

November 18, '11 Comments [68] Posted in Tools
Sponsored By

Yes, I know I'm late in updating my Tools List. I know. Maybe this weekend.

Let me tell you about five tools that are so useful, so compelling and so "should have been built into Windows" that I now think of them as part of Windows. They are that useful to me. They make Windows better. They improve my workflow and then fade into the background. They are so stable and integrated that they have melted away and now feel as if they are part of Windows itself.

Bins by 1UP Industries

Bins was actually written by the same author as Fences, below, so you know it's awesome.

Animation of Windows 7 Taskbar icons jumping into a bin

It's actually ridiculously awesome. For example, I've got four browsers pinned to my Windows 7 Taskbar, which is kind of silly. Now, with bins, I can make a, *ahem*, "bin" and put four browser shortcuts in the space of just one regular icon. Then I make can choose a default program for the bin when I just click, or hover to get my others. All this functionality for $4.99, and he takes PayPal. Sold. Bins almost makes Windows 7 feel like Windows 7.1.

Fences by Stardock

I mentioned Fences here almost two years ago to the day and it's been running happily on all my Windows PCs ever since. I realize that some folks like a clean desktop but if you'd like to get those pixels working for you then I think you gotta put some icons on your desk. When they get out of hand, put a fence around them.

One of the best parts about Fences is that it's pretty smart about changing resolutions. Some people don't like a lot of icons because they fear the inevitable "give a presentation, change resolutions and lose all my icon positions" day. With Fences, this is not a problem. All your icons stay in their little boxes. They'll even rearrange magically if you change icon sizes.

Fences of icons resizing

Fences is truly a fantastic application and one that should be built in. The author of Fences and Bin is a programming god amongst men and I salute you, sir. The next taco is on me.

Window Pad by Lexikos in AutoHotkey

Here's a great graphic from Jim Priest's review of Window Pad that says what it does more clearly than I could. It's a multi-monitor aware window-moving tool. You use the Window Key along with the Number Pad to move windows around. Rather than spending time moving your windows with a mouse, you use the positions of the numbers on the number pad to move them.

It's Aero Snap taken to the next level. Rather than just left and right, there's nine positions per monitor that your windows can go, but because the positions correspond to the number pad you already know there's virtually no learning curve. WindowPad is brilliant and deserves to be in your Startup Folder.

How Window Pad works by Jim Priest

UltraMon Multi-Monitor Taskbar by Realtime Soft

I've used UltraMon as my Windows multi-monitor taskbar utility FOREVER. I purchased it in 2002 (that's a decade, kids) and it's been rock solid ever since.

There are a few other multi-monitor task bar utilities with Aero Peek and some other functions, but UltraMon is fast fast fast and I never think about it. It's never let me down for ten years.

Some real contenders are DisplayFusion from Binary Fortress and Actual Multiple Monitors. They are both actively developed and have more features and polish than UltraMon. I continue to use UltraMon because it's rock solid.

If you're serious about multiple monitors give them both a week of your time and pick one. You won't regret it.

DeskSpace by Otaku Software

I blogged about DeskSpace almost four years ago. I revisited it recently and it's not only in active development but it's gorgeous. Sure, there are other free Virtual Desktop managers out there but I challenge you to find one this polished, this gorgeous and this cleanly baked into Windows itself. It tends to use a bit of memory, but I'm willing to take the hit for the experience. DeskSpace is a beautiful, wonderfully functional piece of software and a fun and productive way to add multiple desktops to Windows.

P.S. One thing, Fences and virtual desktop systems don't always work well together so I keep the same desktop icons on each virtual desktop and change only the wallpaper. The Windows you choose to keep on different desktops stay there.

Amazing 3D Virtual Desktop Manager called DeskSpace

These five utilities should be built into Windows. But even though they aren't, they feel baked in and that's what really counts. Thanks you all, for making my daily Windows experience even better.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

This Developer's Life 2.0.6 - Play

November 16, '11 Comments [7] Posted in Podcast
Sponsored By

PlayWhat do you do when you're not staring at your computer screen? What obsession grips you as you drive home? In this episode we ask David Heinemeier Hansson and Pete Brown this very question.

I'd also like to encourage you to check out the last two episodes of This Developer's Life. We realize this isn't your typical podcast. It's not very technical, and it's not packed with information. We mean this show as an antidote to the usual technical talk shows as we try to dig more into issues and emotions that affect developers. We try to get to the center core of the developer and what makes them tick. Give us a listen and if you like the show, please review us on iTunes and Subscribe.

Download Episode 2.0.6 "Play" here or listen online.

Also, please check out our last two shows you might have missed. We're very proud of how they turned out.


Episode 2.0.4 - Taste

2.0.5 Typo

Who cares about typefaces and why should you? Well, these guys do and you should start caring. Rob and Scott explore the world of reading online with one of the godfathers in the world of typeface and fonts.

In this episode we talk to Bill Hill, the bearded Scotsman who created ClearType and Geoffrey Grosenbach, notable typeface enthusiast.


Episode 2.0.4 - Taste

2.0.4 Taste

What is taste? What is style? Do you have it? Scott and Rob have no idea what it is or how to get it - but they know it's important. In this show they talk to a designer who flexxes his good taste for a living - and a developer who is committed to spreading good taste where he can.

Michael Bach Designer at Microsoft
Geoffrey Grosenbach Owner/Founder of PeepCode


I hope you enjoy the show as much as Rob and I enjoy making it.

Again, big thanks to DevExpress. The bandwidth and other costs are picked up DevExpress and CodeRush! Visit them and thank them on Twitter.

This Developer's Life is brought to you by CodeRush for Visual Studio.

This Developer's Life is brought to you by CodeRush for Visual Studio.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

CSI: My Computer - What is netsession_win.exe from Akamai and how did it get on my system?

November 15, '11 Comments [70] Posted in Tools
Sponsored By

I know my system backwards and forwards and I do not like noticing stuff running in the background that I don't recognize. Recently I was checking out the Task Manager (right click on the clock, and select Task Manager or press Ctrl-Alt-Del and click Task Manager) and noticed TWO copies of "netsession_win.exe" running with a peak memory working set of about 25 megs. Ok, what's this? It's the Akamai Net Session Interface. Ick.

netsession_win.exe in my Windows Task Manager

You can always right click on suspicious processes and click Open File Location. This little tip is often enough to jog your memory and go, "Oh, THAT."

Open File Location in Task Manager's Context Menu

Hm, that dropped me into C:\Users\scottha\AppData\Local\Akamai. I know who Akamai is. They are a download accelerator used by lots of companies. Kind of the first large Content Distribution Network or CDN.

Am I sure it's them and not someone evil trying to fake me out? Right click on netsession_win.exe, then Properties.

Akamai's NetSession digital signature is legit

Well, they have a legitimate digital signature, interestingly they signed this on the 11th of November. Looks like this was recently installed automatically by something, perhaps Flash or Adobe Acrobat.

I wonder if someone needs to tell Akamai that their freshly installed service that just (kinda, a little) snuck on my system has a digital certificate that expires in 5 weeks. Are they or one of the companies that uses them going to update this client and cert soon?

Akamai's digital certiticate expires before Christmas

Running services.msc from Start | Run tells me that this runs as an Automatic Service. At least it's a Delayed Start so it doesn't slow down my boot.

Services (158)

The only thing I installed on my machine on the 11th was an automatic update to Adobe Flash. That's my #1 suspect right now as it's the only thing that I ran as Administrator that day.

For now, I'll keep it on my machine because it:

  • Is from a reputable (so far) company
  • Is known to be used by folks like Netflix, etc to speed up downloads
  • Has an uninstall available in Installed Programs
  • Feels legit
  • Has a control panel icon and a Read Me with lots of info about what it does (except who installed them)
  • Has a customer bill of rights online with details with test demo pages about their API.

I will say this, though. Whatever program installed it should have told me first before chaining it in. At least with Evil Toolbars I can see them. Not cool Akamai. Who installed you?

You're on notice.

UPDATE: Looks like this is using my own computers bandwidth to upload to other Akamai users. They're using our computers and network to make other people's uploads faster. That sounds like I'm running a Torrent and no one asked if it was OK. I'm continuing to dig into this, like disk space usage, etc.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

How To: Convert a PowerPoint Presentation from 4:3 ratio to 16:9 without distorted or stretched images

November 15, '11 Comments [21] Posted in Musings
Sponsored By

It always sucks to show up to a conference with a slide deck that looks lovely with lots of pictures and evocative hipster stock photography all nicely formatted for a 4:3 ratio (1024x768 pixels is common) and then find out their projectors are 16x9 and run something like 1280x720 pixels.

Nobody wants to be THIS stretchy guy:

My giant head with the wrong ratio

It is true that some people have a genetic inability to see that 4:3 content has been uncomfortably stretched to fit a 16:9 screen. We have a name for these people. They are called "Bad People.™"*

As an aside, there are few sadder technical things than 4:3 content stretched across an expensive 16:9 widescreen HDTV. From electronic stores to hotel lobbies, airport status displays to café menus. Make it stop.

What's the easiest way to convert your 4:3 slide deck to 16:9 in a pitch and still have your images look nice? There' s a number of ways on the internet but they all involve "math" and "ratios" and "thought." Nonsense. Too hard. Here's what I do.

Step 0 - Switch to 16:9 and see bad images.

Click Design | Page Setup and switch from 4:3 to 16:9. Other folks say to enter in custom numbers and do multiplication. Hang in there, this is easier.

First, switch to 16x9

At this point, all your images WILL be stretched out.

Step 1 - Fix image ratios without messing up their sizes

Here's the trick. Right click on an image and select Size and Position. From this dialog, click in the Height box. Now, just click up once and down once. As long as the Lock Aspect Ratio checkbox is checked, just changing the scale by 1 step and then switching back will fix your image. You can do it with your keyboard even faster.

Step two, change the scale up and down

Here's trick #2. You don't need to close the Size and Position dialog. It's modeless. You can leave it open and go from slide to slide quickly changing your images. Just click the image, click Height, then up/down, then do another image. Repeat until it's all done. It'll take just a few seconds per slide.

My enormous corectly ratio-ed head. Or IS IT?!

This trick will fix all your image ratios, but expect to do one more pass to make sure that you're using all the space afforded by this new widescreen layout. Regardless of how you images are sized you might want to make some tweaks to the layout and spacing of your text and images.

How to you switch your slides from 16:9 to 4:3? Exactly the same steps except adjust the ratio in Step 0.

Hope this helps someone.

* They aren't really bad people. They are good people with bad presentations. Relax. It's a blog post.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Solving the Shakespeare Million Monkeys Problem in Real-time with Parallelism and SignalR

November 12, '11 Comments [26] Posted in ASP.NET | Javascript | SignalR
Sponsored By

A monkey with a skull. Oh yes.A little over 18 months ago I was talking to Stephen Toub (he of the Parallel Computing fame) about parallelism and the kinds of problems it could solve.

I said, naively, "could we solve the million monkey's problem?"

He said, "the what?"

"You know, if you have an infinite number of monkeys and an infinite number of keyboards they will eventually write Shakespeare."

We brainstormed some ideas (since Stephen is a smarter than I, this consisted mostly of him gazing thoughtfully into the air while I sat on my hands) and eventually settled on an genetic algorithm. We would breed thousands of generations of (hypothetical) monkeys a second and then choose which ones would be allowed to perpetuate the species based solely on their ability to write Shakespeare.

We used the .NET 4 Task Parallel Library to make it easier for the algorithm to scale to available hardware. I mean, anyone can foreach over a million monkeys. But loops like that in parallel over 12 processors takes talent, right? Well, kinda. A lot of it is done for you by the Parallelism Features in .NET and that's the point. It's Parallel Processing for the Masses.

We created a WinForms version of this application and I've used it on and off to demonstrate parallel computing on .NET. Then Paul Batum and I went to the Keeping It Realtime conference to demonstrate SignalR this last week. I didn't want to do the same "here's a real-time chat app" or "here's a map that shows its results in real-time" demos that one always does at these kinds of things. I suggested that we port our WinForms Shakespeare Monkey demo to ASP.NET and SignalR and that's what Paul proceeded to do.

Looks like 80,000 generations of monkeys

When doing something that is crazy computationally intensive but also needs to return real-time results you might think to use node for the real-time notification part and perhaps spawn off another process and use C or something for the maths and then have them talk to each others. We like node and you can totally run node on IIS or even write node in WebMatrix. However, node is good at some things and .NET is good at some things.

For example, .NET is really good at CPU-bound computationally intensive stuff, like, I dunno, parallel matrix multiplication in F# or the like. ASP.NET is good at scaling web sites like Bing, or StackOverflow. You may not think IIS and ASP.NET when you think about real-time, but SignalR uses asynchronous handlers and smart techniques to get awesome scale when using long-polling and scales even more in our labs when using an efficient protocol like WebSockets with the new support for WebSockets in .NET 4.5.

So, we wanted to see if you combined asynchronous background work, use as many processors as you have, get real-time status updates via SignalR over long-polling or Web Sockets, using C#, .NET 4.5, ASP.NET and IIS.

It takes about 80,000 generations of monkeys at thousands of monkey generations a second (there's 200 monkeys per generation) to get the opening line of Hamlet. So that's ~16,000,000 monkeys just to get this much text. As they say, that's a lot of monkeys.

Here's the general idea of the app. The client is pretty lightweight and quite easy. There's two boxes, two buttons and a checkbox along side some text. There's some usual event wireup with started, cancelled, complete, and updateProgress, but see how those are on a monkey variable? That's from $.connection.monkeys. It could be $.connection.foo, of course, as long as it's hanging off $.connection.

Those functions are client side but we raise them from the server over the persistent connection then update some text.

<script src="Scripts/jquery-1.6.4.min.js"></script>    
<script src="Scripts/json2.min.js"></script>
<script src="Scripts/jquery.signalR.min.js"></script>
<script src="signalr/hubs"></script>
<script>
$(function () {
$('#targettext').val('To be or not to be, that is the question;\nWhether \'tis nobler in the mind to suffer\n\The slings and arrows of outrageous fortune,\n\Or to take arms against a sea of troubles,\n\And by opposing, end them.');

var monkeys = $.connection.monkeys,
currenttext = $('#currenttext'),
generationSpan = $('#generation'),
gpsSpan = $('#gps');

monkeys.updateProgress = function (text, generation, gps) {
currenttext.val(text);
generationSpan.text(generation);
gpsSpan.text(gps);
};

monkeys.started = function (target) {
$('#status').text('Working...');
$('#targettext').val(target);
$('#cancelbutton').removeAttr('disabled');
};

monkeys.cancelled = function () {
$('#status').text('Cancelled');
$('#cancelbutton').attr('disabled', 'disabled');
};

monkeys.complete = function () {
$('#status').text('Done');
$('#cancelbutton').attr('disabled', 'disabled');
};

$.connection.hub.start({}, function () {
$('#startbutton').click(function (event) {
$('#status').text('Queued...');
monkeys.startTyping($('#targettext').val(), $('#isparallel').is(':checked'));
});

$('#cancelbutton').click(function (event) {
monkeys.stopTyping();
});
});

});
</script>

The magic start with $.connection.hub.start. The hub client-side code is actually inside ~/signalr/hubs. See how that's include a the top? That client-side proxy is generated based on what hub or hubs are on the server side.

The server side is structured like this:

[HubName("monkeys")]
public class MonkeyHub : Hub
{
public void StartTyping(string targetText, bool parallel)
{
}

public void StopTyping()
{
}

}

The StartTyping and StopTyping .NET methods are callable from the client-side via the monkeys JavaScript object. So you can call server-side C# from the client-side JavaScript and from the C# server you can call methods in JavaScript on the client. It'll make the most sense if you debug it and watch the traffic on the wire. The point is that C# and Json objects can flow back and forth which blurs the line nicely between client and server. It's all convention over configuration. That's how we talk between client and server. Now, what about those monkeys?

You can check out the code in full, but StartTyping is the kick off point. Note how it's reporting back to the Hub (calling back to the client) constantly. Paul is using Hub.GetClients to talk to all connected clients as broadcast. This current implementation allows just one monkey job at a time. Other clients that connect will see the job in progress.

public void StartTyping(string targetText, bool parallel)
{
var settings = new GeneticAlgorithmSettings { PopulationSize = 200 };
var token = cancellation.Token;


currentTask = currentTask.ContinueWith((previous) =>
{
// Create the new genetic algorithm
var ga = new TextMatchGeneticAlgorithm(parallel, targetText, settings);
TextMatchGenome? bestGenome = null;
DateTime startedAt = DateTime.Now;

Hub.GetClients<MonkeyHub>().started(targetText);

// Iterate until a solution is found or until cancellation is requested
for (int generation = 1; ; generation++)
{
if (token.IsCancellationRequested)
{
Hub.GetClients<MonkeyHub>().cancelled();
break;
}

// Move to the next generation
ga.MoveNext();

// If we've found the best solution thus far, update the UI
if (bestGenome == null ||
ga.CurrentBest.Fitness < bestGenome.Value.Fitness)
{
bestGenome = ga.CurrentBest;

int generationsPerSecond = generation / Math.Max(1, (int)((DateTime.Now - startedAt).TotalSeconds));
Hub.GetClients<MonkeyHub>().updateProgress(bestGenome.Value.Text, generation, generationsPerSecond);

if (bestGenome.Value.Fitness == 0)
{
Hub.GetClients<MonkeyHub>().complete();
break;
}
}
}
}, TaskContinuationOptions.OnlyOnRanToCompletion);
}

If he wanted, he could use this.Caller to communicate with the specific client that called StartTyping. Inside ga.MoveNext we make the decision to go parallel or not based on that checkbox. This is where we pick two random high quality parent monkeys from our population for a potential future monkey. Hopefully one whose typing looks more like Shakespeare and less like a Regular Expression.

By simply changing from Enumerable.Range to ParallelEnumerable.Range we can start taking easily parallelizable things and using all the processors on our machine. Note the code is the same otherwise.

private TextMatchGenome[] CreateNextGeneration()
{
var maxFitness = _currentPopulation.Max(g => g.Fitness) + 1;
var sumOfMaxMinusFitness = _currentPopulation.Sum(g => (long)(maxFitness - g.Fitness));

if (_runParallel)
{
return (from i in ParallelEnumerable.Range(0, _settings.PopulationSize / 2)
from child in CreateChildren(
FindRandomHighQualityParent(sumOfMaxMinusFitness, maxFitness),
FindRandomHighQualityParent(sumOfMaxMinusFitness, maxFitness))
select child).
ToArray();
}
else
{
return (from i in Enumerable.Range(0, _settings.PopulationSize / 2)
from child in CreateChildren(
FindRandomHighQualityParent(sumOfMaxMinusFitness, maxFitness),
FindRandomHighQualityParent(sumOfMaxMinusFitness, maxFitness))
select child).
ToArray();
}
}

My 12 proc desktop does about 3800 generations a second in parallel.

Hexacore Super Computer!

Big thanks to Paul for the lovely port of this to SignalR and to Stephen Toub for the algorithm. 

The code for the SignalR monkeys demo is on my BitBucket. Right now it needs .NET 4.5 and the Visual Studio Developer Preview, but you could remove a few lines and get it working on .NET 4, no problem.

Note that that SignalR works on .NET 4 and up and you can play with it today. You can even chat with the developers in the SignalR chat app in the 'aspnet' room at http://chatapp.apphb.com. Just /nick yourself then /join aspnet.

No monkeys were hurt in the writing of this blog post.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.