Sunday, 12 April 2009

In a previous post I mentioned ways to speed up IE8. For me, having used Spybot a long time ago proved to be the culprit: it had added a slew of sites (hundreds) to the blocked sites zone. I removed it and all was well..

Or was it?

I noticed that IE8 still did not come up as quick as it did on my other computers. Opening a tab was fast, but opening another tab proved to be slow. Actually, I found that the first tab I opened was fast, the next one was slow, the following was fast again. Possibly some pre-creation of processes going on?

Today I finally did the smart thing and hooked up filemon to see what was actually going on. It turns out that there were still hundreds of domains somewhere hidden in my registry. They no longer showed up in any dialog box concerning security, but they were there! I removed the key and now IE8 is really fast. As in, faster than Chrome or Firefox, when opening new tabs. Incredible!

So, if you feel that IE8 is still a bit sluggish for you, go and see what the following registry key contains:

HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains

(Note that I’m on a x64 machine, hence the WOW64 node).

My solution is to delete the Domains key.

(I can’t even convey how happy I am with this simple find. We all spend a lot of our time inside our browser and I like IE8 better than other browsers. It is just a very capable and well-thought-out user experience. But if something is slow, it kills the experience!)

Sunday, 12 April 2009 01:29:47 (Romance Standard Time, UTC+01:00)  #    Comments [26]  |  Trackback
 Sunday, 05 April 2009

The company where I work uses discussion lists quite religiously, and I’m sure other companies do as well. A discussion list or group allows you to subscribe to emails about a particular subject, for instance ‘silverlight’. People can send email to the group and everyone that has subscribed will receive it.

The problem is that this can become chaotic pretty quickly. Of course, everyone will setup a rule in Outlook to move incoming mail from a group to a particular folder, but I’m interested in creating a workflow that will help me stay on top of all of those emails, all the time. That is hard, mainly because you will keep getting email from conversations that you do not care about. Some of these conversations take days to come to a conclusion, making you manually wade through all of that over and over again.

There are many systems devised to deal with email stress and organizing your life inside Outlook. One important system is GTD (Getting Things Done). I find that those do not directly apply to email received from discussion lists.

What is needed, is some way to kill a thread and not be bothered with it again. There are programs that will allow you to do that and I’ve played around with all of them.
However, none quite suited me, maybe because I don’t trust programs to delete email. There is one that is called ThreadKiller, which did not install for me. I believe it does the same as I’m describing here.

I am interested in the following workflow:

  1. email comes, either new threads or replies to old threads
  2. I will look at the new threads and decide if I’m interested in them or not
  3. Threads that I no longer want, should be moved to a folder
  4. When I have time to actually read whole conversations, of the threads that remain, I will first make sure that new replies to threads are removed

Basically it boils down to finding some way to easily find and delete mail that belongs to threads I don’t want any more. Easier said than done! I ended up having to drop to VB macros, which I really wanted to avoid.

Here is a description of my current setup.

Step 1: searchfolder to manage new threads

Each discussion list I am on will have a searchfolder that only shows me ‘new’ mail. You can create one by adding a search folder, and using the ‘advanced’ tab to setup these two criteria:

1. In Folder is (exactly) –the name of the folder that has the mail from the group -
2. Subject doesn’t contain RE:

Step 2: setup a delete staging folder

Create a folder called Delete staging. It will contain the start of threads that you are no longer interested in. Basically I will have a macro later on, that will look in this folder and remove all the mail that belong to the same subject.

Step 3: easily move new threads to the delete staging folder

I’m a keyboard junkie, and I want to easily move emails to that folder.
I dropped into the VB Macro editor and used this code:

Sub MoveToDeleteStaging()
    Dim objItem As Outlook.MailItem
    Set objItem = Application.ActiveExplorer.Selection.Item(1)
        Dim objNamespace As NameSpace
    Dim objInboxFolder As Outlook.MAPIFolder
        Set objNamespace = Application.GetNamespace("MAPI")
    Set objInboxFolder = objNamespace.GetDefaultFolder(olFolderInbox)
    Set deleteFolder = objInboxFolder.Folders("Delete staging")
    
    objItem.Move (deleteFolder)
End Sub

Even though I despise VB, this code is quite simple indeed. You can see that I hard coded the folder “Delete staging” in there.

Now, customize the toolbar to add this macro there. Rename it to something like ‘&Delete Thread’, using the ampersand to indicate the shortcut key.

When you select a mail item and you execute the macro, it will move the item to the delete staging folder.

Step 4: scrub your folder

The real work is to make sure that mail you receive gets deleted. The best way might be to create a rule to do that as the mail comes in. I don’t like that, because I get a kick out of seeing how much mail was removed. So for now I use a manual process. The code can be easily adjusted to run as a rule when new mail arrives.

So, being a VB newbie, I’ve written code that is vey inefficient but luckily very useful. The macro below will iterate through all the items in the delete staging folder and remove any mail it finds in the folder that you are scrubbing.

Sub DeleteMessagesThatAreInDeleteStagingFolder()
    Dim deleteFolder As Outlook.Folder
    Dim currentFolder As Outlook.Folder
    Dim runningItem As Outlook.MailItem
    Dim threadItems As Outlook.Items
    Dim itemToDelete As Outlook.MailItem
    Dim objNamespace As NameSpace
    Dim objInboxFolder As Outlook.MAPIFolder
    Dim Filter As String
        
    Set objNamespace = Application.GetNamespace("MAPI")
    Set objInboxFolder = objNamespace.GetDefaultFolder(olFolderInbox)
    Set deleteFolder = objInboxFolder.Folders("Delete staging")
        
    Set currentFolder = Application.ActiveExplorer.currentFolder
    
    For Each runningItem In deleteFolder.Items
        Filter = "@SQL=" & Chr(34) & _
            "urn:schemas:httpmail:thread-topic" & _
            Chr(34) & "= '" & Replace(runningItem.ConversationTopic, "'", "''") & "'"
        Set threadItems = currentFolder.Items.Restrict(Filter)
        For Each itemToDelete In threadItems
            itemToDelete.Delete
        Next
    Next
    
End Sub

The code uses a filter in the dsal language (some sort of SQL wannabe language used by Outlook) to filter the email in the folder so it can then delete it.

Again, I created a toolbar shortcut for it.

Usage:

Just go to your search folder and quickly triage all the mail that is there by either reading the mail or moving it to the delete staging folder. Then go to the actual folder and scrub it using the second macro. This will remove all the threads that you were not interested in, leaving you with threads to you do want to read!!

I hope that is useful to someone.

Sunday, 05 April 2009 00:45:09 (Romance Standard Time, UTC+01:00)  #    Comments [18]  |  Trackback
 Saturday, 28 March 2009

Completely unrelated to anything on this site, I wanted to talk about IE8 for a minute. It looks like a great browser, but on my home machine, just spinning up a tab took about 3 seconds. When I noticed that other people did not have this problem, I started to investigate. These are the two tips that I’ve found:

The first is by Ed Bot and basically tells you to execute ‘regsvr32 actxprxy.dll’ from an elevated command prompt. That registers a dll that in certain configurations is not registered. It can make a huge difference.

The second on is the the one that saved me. I don’t know the source, but there are several blogs telling you to look at your restricted sites (Tools/InternetOptions/Security/Restricted Sites, press the button labeled ‘sites’ ).
I had used spybot long ago, which had added a huge list of sites there. Apparently this can really slow down outlook and ie!
Remove them by resetting your settings to default (Advanced tab, button labeled ‘reset’).

Now I have a blindingly fast internet explorer, and I must admit, I do love this browser now. Switching back!

Saturday, 28 March 2009 23:08:28 (Romance Standard Time, UTC+01:00)  #    Comments [29]  |  Trackback
 Sunday, 19 October 2008

I’m very excited that Silverlight 2 has been released. I’m too new to Microsoft to claim even the slightest involvement, but it’s wonderful to see the excitement both within Microsoft as outside.
It will be interesting to see what will happen with the (already great) uptake of Silverlight by the market.

As I am spending most of my days knee-deep in Xaml nowadays, I always try to find things that will help me be more productive. It happens quite often that I want to select a complete xaml tag. It’s way too much effort to use the mouse to select it, so I often use the control-m-m shortcut to collapse a tag and then select it. However, a few days ago I took 5 minutes to automate this.

image

When you put your mouse somewhere in the Grid tag, and use my macro, you end up with this:

image

You can even put your mouse in the endtag. I bound it to Control-Q and it has made my life that much better!

The macro is as simple as this:

    Sub SelectXMLTagContents()
        DTE.ActiveDocument.Selection.StartOfLine(VsStartOfLineOptions.VsStartOfLineOptionsFirstColumn)
        DTE.ExecuteCommand("Edit.ToggleOutliningExpansion")
        DTE.ActiveDocument.Selection.StartOfLine(VsStartOfLineOptions.VsStartOfLineOptionsFirstColumn)
        DTE.ActiveDocument.Selection.EndOfLine(True)
        DTE.ExecuteCommand("Edit.ToggleOutliningExpansion")
End Sub

It collapses a tag, jumps to the first column, selects the line and then does an uncollapse.

For those using a tool like Karl’s ‘Xaml Power Toys’, it might also be a worthwile addition to their shortcuts.

Sunday, 19 October 2008 21:17:36 (Romance Standard Time, UTC+01:00)  #    Comments [26]  |  Trackback
 Sunday, 31 August 2008

I’m kind of a tool freak, and when mouse gestures were added in some browsers, I really felt they added value.
I was interested in using gestures in more applications (like Visual Studio) and found the tool ‘StrokeIt’. It is a great tool, fast, accurate, highly configurable and when I introduce it to team members they tend to giggle. So that’s all cool.

However, it does not work well with UAC and X64, much to the dismay of many users on the strokeIt forums. The tool hasn’t been updated since 2005, so that does not bode well.

Now I have found gMote and it is everything I could ever ask for (well, except for a more fun name).
It works very well and has a very nice workflow for defining gestures and assigning tasks for it. I already setup gestures for navigating tabs, paging up and down, minimizing windows and closing tabs/windows.

One tip: I used to use the right mouse button to draw gestures, but that seems to work less reliable. Instead, I now use the middle mouse button.

Go and download gMote now! I couldn’t be happier.

Sunday, 31 August 2008 19:25:56 (Romance Standard Time, UTC+01:00)  #    Comments [0]  |  Trackback
 Thursday, 28 August 2008

I installed IE8 beta 2 yesterday and it rocks. It is much faster than IE7, seems rock stable (fingers crossed) and has all kind of nifty new features. It has taken away my need for Firefox at the moment.

In FF I had a button that allowed me to subscribe to a blog in google reader and it works in Internet explorer as well:

javascript:var%20b=document.body;var%20GR________bookmarklet_domain='http://www.google.com';if(b&&!document.xmlVersion){void(z=document.createElement('script'));void(z.src='http://www.google.com/reader/ui/subscribe-bookmarklet.js');void(b.appendChild(z));}else{location='http://www.google.com/reader/view/feed/'+encodeURIComponent(location.href)}

Basically, you can navigate to a page with a blog in it and just press this bookmark. It will open up reader and it will show you the feed it finds.

But, given those cool accelerators in IE8, I thought it would be a nice exercise to create an accelerator that I can click when I am on a blog.
Here it is:

<?xml version="1.0" encoding="UTF-8"?>
<os:openServiceDescription
    xmlns:os="http://www.microsoft.com/schemas/openservicedescription/1.0">
    <os:homepageUrl>http://www.google.com</os:homepageUrl>
    <os:display>
        <os:name>Subscribe to rss feed </os:name>
        <os:description>View the feed in google reader</os:description>
    </os:display>
    <os:activity category="Blog">
        <os:activityAction context="document">
            <os:execute action="http://www.google.com/reader/view/feed/{documentUrl}" method="get">
            </os:execute>
        </os:activityAction>
    </os:activity>
</os:openServiceDescription>

Since the accelerator api will not recognize an url like this: http://www.sitechno.com/Blog/SyndicationService.asmx/GetRss as a ‘Link’, I had to use the document context. When you install this accelerator, you can navigate to the actual feed and then rightclick anywhere in the page. There should be an option to ‘subscribe to rss feed’ and hitting that will take you to google.

These accelerators have potential: it was very simple to write this and it is well integrated into IE. I hope they extend it so we can get accelerators to work on more ‘stuff’!

Install googlereader subscription accelerator

Thursday, 28 August 2008 20:09:13 (Romance Standard Time, UTC+01:00)  #    Comments [7]  |  Trackback
 Wednesday, 13 February 2008

I'm working on a sweet project at the moment using both WPF and WF. One of my custom activities has a property of type Type, where it would be cool for the user of the activity to be able to use the designer to select a type, just like what happens in the WF designer when I choose a type. However, no type picker popped up.

So I went googling and found that Daniel Cazzulino also ran into this problem and created a fantastic little project to harness the power of the real WF typebrowser. He writes about it on this blogpost and later moves the project to code project. You can find the article and his download code here.

However, as you can read in the comments, something was broken. Looking through the code, although small, made me not want to waste time on understanding the System.ComponentModel namespace in that much detail at this point ;-) (although, when working with WF, you will soon need to customize property pickers, so I will have to look into it someday soon).
Daniel himself points to the Patterns and Practises entlib library: they offer the same functionality. I downloaded their sourcecode, and I'm quite sure they just used Daniels code and improved upon it a bit. However, with all the Entlib references, the project felt a bit heavy.

What I have done is rip out all the references to entlib that I do not care about, used a few files from Daniels original solution and worked around a few shortcomings. Nothing fancy, I just hacked at it until it worked.

image

 

Now, since I have used some code (without license) by Daniel and code by the Entlib group, I'm not sure if I can publish a derivative without getting into problems. However, I've read their license, and I think it's okay.

You can download the project here, don't ask for changes because I'm not interested in spending more time on it. All credits go to Daniel.

(Also, find out how to create your own typefilters in his post).

Have fun with it. Leave a comment if you find it useful.

Wednesday, 13 February 2008 13:30:24 (Romance Standard Time, UTC+01:00)  #    Comments [9]  |  Trackback
 Wednesday, 07 June 2006

I've completely rewritten the RssBandit to Grazr converter, so that alphabetic order is used. That looks way nicer, doesn't it?

Program.cs (4.49 KB)

Wednesday, 07 June 2006 13:54:35 (Romance Standard Time, UTC+01:00)  #    Comments [0]  |  Trackback

People that know me, know that I love Resharper. They now have a 2.0 version for Visual Studio 2005 and my bet is that I will love it as soon as I try it. But there was always one thing that I disliked about Resharper: the caching of the solution took ages on big projects.

Visual Studio 2005 gives us some refactoring tools and code snippets. Although they lack the power of Resharper, they will do for me. But what I can not live without is the fast code navigation that Resharper brought us. Their type navigator works instantly and that feels so incredibly smooth and silky, I just can't do without.
The last couple of months, I have used a new free tool that brings the instant navigation power without the caching costs. DPack has been pushed to the limits and performed incredibly.

Of course, I still miss a few Resharper features, such as 'find all references', which is light years ahead of the Visual Studio offering. But the speed of which my solutions now open does seem to make it up.

Try it, you might like it.

Wednesday, 07 June 2006 12:50:45 (Romance Standard Time, UTC+01:00)  #    Comments [1]  |  Trackback