Conversational Search

Although Google is my main search tool Bing has gotten much better over the years. These days when I use it, mainly while at work, I'm finding it very good at keyword based searches. So if I'm looking up a specific class in the .net framework and I know the name (or most of the name) then it's great at getting me directly to the URL I want.

This applies to local destinations as well. If I know, roughly, the name of the place I want to go then bing finds it very quickly. And I've grown to like the beautiful artwork you see when bing loads.

But when it comes to more exploratory search, where I don't have an exact keyword that I know will locate the result, Google really shines here and has gotten way better at this. These days more and more it seems I can just ask my question in conversational English and google finds it.

For example, I use OneNote extensively but something that annoys me about its copy/paste functionality is that it stuffs these "from ..." footers whenever you paste a link. 99 times out of 100 I don't really care about the source URL. Especially if the link is included in the pasted text.

I suspected that there's an option for controlling this but didn't want to wade through all of the options to find it. Glanced at a few of the option settings, didn't see anything obvious. So I go to Google. I start typing "OneNote copy paste" and 5 search suggestions appear. The last one "OneNote copy paste from link to original" looks promising so I try it. At the bottom of the first screen full of results is a link to a page titled "OneNote Stop Including Link to Original Source" which is exactly what I'm looking for. Options -> Advanced -> Include link to source when pasting from the Web. Uncheck that and we're done.

Musings on Lock Free algorithms: Trading Generality For Speed. Trading Simplicity for Complexity.

While talking with a coworker (much more senior than me - one of the awesome things about working at Microsoft) the subject of lock free algorithms came up. It was in the context of operating systems but got me to thinking about the issue in a more general way.

I am by no means an expert on lock-free programming. Only once in my professional career have I ever converted a lock based approach to a lock free approach (and yes it was both frustrating and exhilarating). But I've read a bit about it and played with some of what I've read out of curiosity.

At one level they seem to trade generality for speed (and, often, memory). In the same way that a general purpose sort can't* do better than O(n log(n)) but specialized sorts (e.g., radix sort, postman's sort) can (some are even constant-time!).

The specialized sorts take advantage of the structure of the thing being sorted (e.g., must be integral), hardware limitations (word-size and max addressable memory), uniqueness, etc... While it's true that these sorts can sometimes be adapted to a different class of elements (e.g., by tagging the element with the underlying sort element) doing so comes at the cost of increased memory (e.g., the width of the tag) and increased complexity. The adaptations still depend on the underlying constraints on the sort to achieve the performance gain.

Similarly, lock free algorithms tend to come with similar constraints: the expectation of a certain word size, uniqueness of index or uniqueness via algorithm (e.g., a GUID). Serializing (lock-based) access to a resource is conceptually quite simple. Limiting access to that resource to consumers that intrinsically can't collide (either by giving them a unique index or generating a guaranteed* unique GUID) increases the complexity of exclusive access at a cost of increased memory and/or increased computation (e.g., generating the GUID, indexing the consumer). But it also makes for much faster access as consumers no longer need to queue up waiting for a lock.

The more I think about it, the more I think lock free programming can be characterized by 2 propositions:
  1. Trading Generality for Speed.
  2. Trading Simplicity for Complexity.
As an aside, this is another wonderful exception to the general rule of thumb that simplicity is always preferable to complexity.

Win 8.1 Dispatch: Of Clouds and Virtuous Cycles

Finally getting around to upgrading to Windows 8.1. I very rarely upgrade before the first service pack, especially for workaday machines, but a driver issue made upgrading a little more urgent than normal. Once the primary workstation has been upgraded I've tended to shortly thereafter upgrade all home machines to make working remotely easier. Plus the habits of an OS tend to become second nature; I don't want to have to maintain two different modalities (one for work, one for home).

I started the upgrade (Windows 7 to Windows 8.1) of the home desktop box at 10:34pm. By 10:49 pm the entire process was done. I don't mean "you can see the desktop but can't do anything with it" done. I mean "logging onto facebook to post how fast this was" done. The desktop box is pretty well stocked (core i7 920, ssd-only storage, 12 gigs of ram) but it's by no means a beast.

Over the past few months I've gradually migrated all documents, pics, videos and the like to Skydrive (also a fan of gdrive and google docs but that's a post for another day). Ditto for programs that I've become accustomed to having installed on every machine: Notepad++ (formerly Ultraedit),, 7zip, etc... Because the bits I care about are in the cloud I can finally feel comfortable wiping and reinstalling the OS without fear of a herculean, days-long-til-it-feels-right chore to get back up and running.

In a sense this lowered barrier to reinstalling the OS mirrors the recovery oriented trend in software engineering. Skydrive and the internet in general are providing the persistent store. Since Skydrive is limited* to 25gb I don't keep the bigger application bundles (office, windows itself, Cakewalk Sonar, etc...) on it but download them (and store them on a 1TB freeagent drive plugged into the wifi router) as needed.

The less time it takes to reinstall the OS and key apps the more likely I am to use this as a solution for the inevitable problems that creep up from time to time with any complex piece of software. 10 years ago wiping and reinstalling the OS + Apps was at least a 4 hour time commitment (usually longer) that lingered on for weeks while hunting down the various apps and settings it took to make the system feel like home. Under those constraints it makes sense to spend a few hours hunting down the cause of a glitch because a few hours is shorter than a few days.

Since then I've reliably installed windows 8.1 from USB 4 times in under 15 minutes. I expect there to be far fewer glitches that *have* to be tracked down (unless it's one that captures my interest). And over time I expect it to counteract the "don't install any software unless it's from the manufacturer" ethos that has crept into windows land because the OS + Apps situation was so precarious (of course race-to-the-bottom preloaded TSRs* didn't help).

I upgraded my work laptop last week but over the weekend discovered that it's still using a spin drive! (7200 RPMs but still, a spin drive!). So I swapped out an 80gig SSD that was lying around and proceeded to reinstall (as an aside, keeping intel chipset series 4/5/6/7/8+ drivers on a USB thumb drive really helps here). Lo and behold Windows recognizes the name of the machine (I used the same name) and offered to speed up the process by using the most recently saved settings for it! Not just desktop background or bookmarks/favorites either. It even remembered the File History backup location (on the freeagent plugged into the wifi router).

Ordinarily I'd be wary of using a drive so small (80gigs isn't very much after Windows and Office) but another consequence of cloud storage is that I'm realizing I need much less space on the laptop. The things I care about are either on Skydrive (and have started making it the default documents location - another awesome Win 8 feature) or can be downloaded from other sites (e.g., the app store,, etc...) as needed. Skydrive is limited to 25gigs and, because it's contents have to be downloaded, is somewhat self-limiting. Less space on the laptop makes the wipe-reinstall scenario even faster. A virtuous cycle :)