Tag Archive for Miscellaneous Debris

Saving Your Settings

Tomorrow I am bidding my laptop farewell, and will soon buy me a new one. This results in what I like to call Settings Anxiety. I spend months tuning various aspects of my computer to my liking, and starting afresh with a new machine is wearisome. There are solutions to this, of course. I can make a full settings backup using Windows Easy Transfer or some such tool to store my settings and registry information and reload them on my new computer. I am, however, leery of it. First of all, I don’t trust WET to backup everything, especially 3rd party settings and application data. Secondly, I don’t want to copy all the cruft that’s accumulated in my user settings. One advantage to leaving the old computer is to start fresh.

So my compromise is to do a set of manual exports for various pieces of software, to carry it with me to the new computer, whenever it arrives. I’m going to list the various programs I use here that I bothered to customize, and detail the steps needed to do a manual export. This way I can come back to it the next time I reformat.

1. Outlook 2007

I use Outlook to connect to an Exchange server and to Gmail via IMAP. Both of these use OST files for local offline caching, but the primary storage is on the server. No real need for me to back this up.

Unfortunately, there’s no way to export my Outlook profile’s entire Accounts list to a file, and reimport it later. It means I always have to go to Gmail’s help page to remember the port numbers they use for encrypted IMAP and SMTP, but it’s not too much of a hassle.

2. Visual Studio 2008

Two important customizations here – color scheme (I like grey background) and keyboard shortcuts (single-click build-current-project ftw!). Both are easily exported using Tools –> Import and Export Settings –> Export selected environment settings.

3. Google Chrome

Bookmarks, cookies and stored passwords – things I really don’t feel like retyping again and again after I got my Chrome to memorize it for me. Basically, with all major browsers importing favorites and settings from one another, you only really need to backup one browser’s settings.

Unfortunately, Google haven’t quite gotten around to implementing Export Settings in Chrome – like a lot of other things. To backup my settings, I am copying the C:UsersusernameAppDataLocalGoogleChromeUser Data folder. There’s a lot of useless junk there – the cache, Google Gears data – but it should contain all the interesting bits too.

4. RSSBandit

RSSBandit’s “Export Feeds” option will probably export the feed definitions, but not the actual text of the actual feeds that I already have, offline, in my reader. It does support exporting the list of items in a feed, including read/unread state, though. But a better solution, assuming I am unbothered by space or time, is to use RSS Bandit’s “Remote Storage” option to save the entire feed database to a ZIP file that can be “downloaded” into a new installation. Under Tools –> Options –> Remote Storage set the destination (I use a file share), then do Tools –> Upload Feeds.

When recovering, I’ve found that RSS Bandit doesn’t always succeed in reading the ZIP file – I got a “file was closed” error. What I did was simply open the ZIP file and copy all the XML files into the %AppData%RssBandit folder, et voila.

5. Windows Live Writer

Another useful tool that wasn’t given an Export Settings option. There are two things to backup here:

1. My blog settings – I have 5 different blogs I manage through WLW. Here I had to go back to the Registry. Funny how it seems so old-fashioned. Export all settings from HKEY_CURRENT_USERSoftwareMicrosoftWindows LiveWriter.

2. Blog drafts and recently-written posts are stored in My DocumentsMy Weblog Posts. Would be a good idea to back those up as well.

3. When restoring settings, it initially appears that while the blog settings are properly recovered, the drafts aren’t. All you need to do, though, is double-click on one of the .wpost files in the My Weblog Posts folder, and the Drafts and Recently Posted lists will get populated.

6. Digsby

Digsby, the multi-protocol IM and Social Networking tool, uses a centralized login to store the settings of my different protocols – so I only need to log in with my Digsby ID to have all my IM networks working. There are some tweaks to the client itself which I would like to not lose, but they don’t provide an Export Settings feature either, and it’s nothing I can’t live without.


For most other things, I’d rather not bother until I actually need it.

Screencasts vs. Whitepapers

A few weeks ago, Lawrence Liu (a senior technical PM and community lead for Sharepoint at Microsoft) linked to a few screencasts for learning how to use various features in MOSS2007. In that entry, he mentioned how screecasts are more effective and efficient in training and learning to use a new piece of software. Me, I’m a bit divided about them:

1) Screencasts are great for getting a hands-on view of the system, that’s true. A picture is worth a thousand words, and a movie is worth about 30 frames per second. I know software authors that have replaced the help file completely with a small Camtasia screencast. This, of course, only works for simple programs with few use-cases.

2) As Lawrence mentions, most screencasts are way, way too long. It’s understandable – when speaking you want to be as clear and understandable as possible. Too often it turns into a slow, repetitive lecture. To illustrate: last month Microsoft Israel held a Developer Academy conference to give lectures on new Vista dev topics. I squeezed in one Office 2007 talk. Because I was too worried about being clear and understood, I ended up repeating myself. Even a completely non-technical listener who just came in to hear me speak (yes, indeed, it was my mother) said she got the point already and that I should get on with it.

My point? Too many screencasts are way too long. Jan Tielens’ SmartPart (and sons) is a wonderful web-part to use and to learn from, but the screencast takes 16 minutes to describe what the 2-page readme.txt contains.

3) Screencasts are mostly a solution to learn the how, not the why. I can use Lawrence’s screencasts to learn how to add a library to the Records Center, but I would have found that out myself with little effort. What I would really want right now is a good set of whitepapers to understand the goals of the Records Center and how to use, not abuse it in my solutions.

4) A final tip for screencasts and webcasts – when using Windows Media Player you can speed up playback without affecting the pitch. This is to mitigate slow lecturers and needless repetition. It might require downloading the video locally first. Speeding it up to 140% is usually perfectly understandable.
On my Media Player 9, it’s under View -> Enhancements -> Play Speed. Enjoy.

Zune Desktop Theme – A Warning


A few days ago, Microsoft released a new Desktop Theme for Windows XP named the “Zune Desktop Theme” – even though it looks a lot like Vista, all in black and orange. It fits in with Office 2007’s Black skin, so I gleefully installed it.

Everything was fine for a few days until the first time I had to reboot (rather than Standby/Hibernate) – late last night. From that moment on, my Windows Explorer would crash every time you tried to do anything. Windows loaded? Explorer crashed. Tried to open a folder? Expolrer crashed. Save As from Word? You guessed it.

Took me a while to put two and two together since there were a few days between the two, but the solution is to:

a) Uninstall the Zune Desktop Theme.

b) Choose a different desktop theme (Luna, for instance).

c) Reboot.

This solved the problem for me. Even though I’d gotten used to the gloomy Vista-ish look, I won’t be reinstalling it any time soon. Your experience might be different, but beware. If you’re feeling curious or suicidal, here’s the download link:

Zune XP Desktop Theme

One-Click Wonder

It turns out that you can easily close a tab with one click on the middle mouse button. On most modern mice, this would be the scroll wheel button. No fuss, no right-clicking, no selecting the tab and going to the other end of the screen for the X button. Just a single middle-click.

This works in Visual Studio 2005, in IE7, Firefox 1.5 and RSSBandit, to go by the applications I’ve tested it in. Seems to be a common UI convention that I have been entirely ignorant of. It’s probably common knowledge for many people, but I only recently discovered it.
When I shared the discovery with my office-mates, it turned out that quite a few of them weren’t aware of this trick either, so I figured I’d share it here for all the others who have missed it:


VSS2005 – staying in line

Working with Visual SourceSafe always feels to me like walking on eggshells. One wrong move and you get that sickening crunching feeling and things seem to collapse.

My current project’s integrator decided to keep things neat. There’s a central solution containing all the projects, sitting under a central project in VSS. Dozens of projects, divided with Solution folders, all neat and ready for integration builds.
Naturally, most of us don’t really need all those projects open in our solutions when we work. They slow down work and are generally a headache, so we decided that everyone can create his own customized solutions and work against them.
For some reason, the decision was made to create a project folder under VSS for each team member, and have each team-member keep his own solutions there so as to not mess up the main project folder with random SLNs. It goes something like this:

  / MainSolution
  / MainSolution / FirstProject
  / MainSolution / SecondProject
  / Avner

Where my SLN file now sits in $/Avner but references projects in $/MainSolution/FirstProject.

Anyone who’s worked with VSS might already be wincing in anticipation.
Visual Studio doesn’t really like to have project references not sitting underneath the current solution’s VSS root. If I add a new project under my solution and then check it in, it will automatically check that project in under my solution folder ($/Avner/ThirdProject). I have to remember to manually go to File -> Source Control -> Add to Source Control and answer ‘No’ when it asks me whether to add it under the solution folder.

Assuming I made a mistake, I can either spend 20 minutes struggling with moving it around and updating the bindings, or go the easy way: Erase the projects from VSS, remove them from the solution, then re-add them, permanently remove all SCC bindings and re-add them to the proper place. Ugh.

Since no-one enjoys that, I’ll try to list some recommendations:

1) When working with multiple solutions, it’s best to have them all reside in the same root solution project.
2) If you must put them in alternate folders, it’s best to create any new projects from the master solution to ensure they are created in the right place, then add them to the sub-solution using File->Add Existing Project -> From SourceSafe (LAN).
3) If you created them directly from the subsolution, make sure you don’t check them in immediately, but manually add them to the right place from File -> Source Control -> Add Project To Source Control.
4) If you did, don’t try to fix it. Just erase from VSS and from the solution and re-do from start.

When is a dash not a dash?

An interesting an unusually frustrating pitfall that I’ve stumbled into a few times:

Many times when we’re preparing for deployment of a software product, we find ourselves preparing a Word document with the steps for installation. In the case of my current system, installing the server requires several manual steps, among them running a command-line utility to set some Kerberos security parameters.

Naturally, being the friendly and considerate developers we are, we supplied the full command-line that is to be run on the target machine, complete will all options, parameters and variables.

Imagine our surprise, then, to learn that the command line simply fails to run, claiming a syntax error in the inputs. Even when we went over to the system to see it for ourselves, we saw that a direct copy-paste operation from the Word document to the commandline fails mysteriously. What is even stranger is that typing out the command-line, letter by letter, will cause the command to succeed.

The answer, as you might guess by the title of my post, is that Word tends to be a bit too smart for its own good. When I copied the command-line to the document with a option parameter like this:

setspn.exe -a http/MyServerName.domain.com

it replaced the dash in “-a” automatically with this:

setspn.exe –a http/MyServerName.domain.com

Similar at first glance, but what we have on the first line is a Hypen-Minus (U+002D) and on the second an En Dash (U+2013). Word’s grammar rules changes the minus-sign to a Dash, and the command-line parser chokes on it and dies. This is almost impossible to spot; command-line fonts don’t display the difference to any discernable degree. The only way we stumbled onto it is because we tried replacing every other element on the command-line with no success.

So remember – by default Word allows itself freedom in altering your documents. For letter-perfect preservation, consider disabling AutoText/AutoCorrect in word, or just storing syntax-sensitive data in normal text files.



Macro Origins

I’ve been wondering about the origin and etymology of the term “macro” as it is used in programming. The general use for it is to mean something large – the opposite of “micro” – but it didn’t seem to fit for the concept it’s used for.

Luckily, the Online Etymology Dictionary came to my rescue:

“As a stand-alone word, in computer programming, meaning “a macro-instruction,” it is attested from 1959. “



Outlook Miscellany: Erasing a name from the Autocomplete Cache

The drop-down list of names that Outlook gives us to auto-complete a name or address being written is stored in a file called .NK2 in our Application DataMicrosoftOutlook directory. This file is stored in a proprietary binary format, and there's no known documentation for it as far as I know. There seems to be a company that (apparently) reverse-engineered the format and are selling a cache-editing tool, but it's pricey – the basic desktop version can edit, import/export and print for $35. The network/helpdesk editions can do remote NK2 editing for all computer on the network, but gets really pricy with per-seat licenses and so forth.
(They're called Ingressor, if anyone needs those tools)

It turns out, however, that the most common usage for such an editor isn't necessary. If we just want to remove an item from the cache we can do it from within Outlook itself – simply navigate the drop-down options using the arrow keys and press Del on the one we want to erase – and away it goes.

Very simple, and even logical when you think about it. We're just not used to live editing of an auto-complete list.

Debugging HTML that is rendered at runtime.

A little tip when we’re generating HTML content on-the-fly using client-side code, whether HTC behaviours or javascript:

As we all know, when we try to View Source on such a page, the HTML we see is the base HTML that was received from the server, not the final layout after all the client-side code has run and changed things. This often makes it hard to debug, since we can’t see the final layout that the user sees. This technique will help us get the final, rendered page for debugging.

We’ll add this script block to the end of our HTML:

This can be written with our choice of scripting languages, of course. I don’t know if other platforms have objects equivalent to the FileSystemObject for easily creating a text-file. We’ll have to allow the browser to run ActiveX’s for this to work, of course.

The RenderedPage.html file we save here is the final version of the page as it is rendered, running after all other code has run (at least code that runs on load). This can often point the way to the source of the bug – especially layout bugs.

A man’s home (network) is his Castle

The Longhorn Identity System (codename “Castle”) is a long-awaited feature.
It replaces the ancient Workgroup model in home Windows installation with something that’s more lightweight than a full-blown Active Directory. Been hoping for something like that. (And by “hoping”, I mean “idly wondering about it at some point in the past”).
Too bad it’s a Longhorn feature. It’s also apparently based on WinFS, which has been pushed back to, what is it now, 2050?

Here are some slides about it from PDC ’03. Does anyone know if there’s any newer information about this?