shahine.com/omar/

homepage | Send mail to the author(s) contact

yet another Microsoft blogger

# Thursday, January 20, 2005

Outlook Live

What happens when you take the most utilized business communication tool and team it up with Hotmail as the mail backend and sell that as a subscription? Outlook Live.

This is a pretty cool service! You can use Outlook and have all your mail, contacts, tasks, notes stored on Hotmail. Your data roams and you can access it anywhere. I've been using this for the past few months and love it. It makes Hotmail as my primary non work account really slick. Furtheremore, if you don't own a copy of Outlook 2003, it comes with the subscription.

Posted Thursday, January 20, 2005    Permalink    Comments [4]  View blog reactions

 

# Tuesday, January 18, 2005

dasBlog 1.7 released

Well, I'm a bit late to the party... but as Scott announced, dasBlog 1.7 is finished. There are numerous and substantial improvements in this version. Some of them were done months ago, and the most substantial came in the last 2 months as Scott and I feverishly whipped dasBlog into a fast asp.net app. We hope we've also given folks the tools to help combat referral and comment spam.

Anyhoo, here is the 411:

  • dasBlog is no longer hosted on GotDotNet, and has new home at SourceForge.net. Using CVS as source control actually makes it a joy to check in code to dasBlog.
  • New Features
  • Release Notes
  • YOU MUST UPGRADE your content folder. This is *not* and XCOPY deployment. There were two major bugs fixed in the dasBlog runtime that require that the dasBlog files be rebuilt. Unfortunately there was no avoiding this. Read the instructions in the DasBlogUpgrader download. update: the instructions in the download aren't as clear as those I recently updated in the Release Notes
  • For most other details see the wiki

Anyway, I learned a lot about asp.net, programming and dasBlog working on this release. It was really fun and I look forward to working on 1.8 :-).

Some of my favorite 1.7 features

  • All the search bot referrals to your site are "pretty printed" in your logs
  • CAPTCHA for entering comments
  • MovableType Blacklist and Content based Blacklist for visitors to the site
  • <%ReferralListFiltered()%>Macro that will shrink the number of referrals displayed in the Permalink and expose the rest using javascript and css.
  • Performance
  • Lots of smart Caching
  • Trackbacks/Pingbacks work reliably.

update: if you happen to use dasBlog to do any CrossPosting (post to another blog from dasBlog) DO NOT CrossPost in 1.7. I just found a bug that causes dupes. If you want a fix and can't wait for .2 (which will of course fix these types of things) leave a comment and I will send you an updated patch (one dll).

Posted Wednesday, January 19, 2005    Permalink    Comments [10]  View blog reactions

 

Picasa 2 supports RAW

Finally, a *free* photo album tool that supports RAW images like those from my Nikon D70!

http://www.picasa.com/

update: it appears Picasa does not support auto rotation of images. That sort of bums me out. The data is there, not sure why they would not take advantage of it.

Posted Tuesday, January 18, 2005    Permalink    Comments [2]  View blog reactions

 

# Thursday, January 13, 2005

Programming Teaches

Sometimes I wonder if I was supposed to be a programmer. My job at Microsoft does not require that I write any code... that's not what Program Managers do. Instead I do all sorts of other stuff, but I enjoy it a great deal. However, sometimes all the context switching from multi tasking KILLS me. I mean if I am juggling 2-3 super high priority items at once I get really burned out.

That is why I really enjoy programming so much in my spare time. I don't have to multi-task and I can focus on one problem at a time. I find that to be incredibly rewarding. The ability to create something from nothing, to take an idea and make it work all by myself. I sort of get to do that at Microsoft but the process is lengthy, I don't actually build the thing, and you often don't get that satisfaction till you "ship". Depending on where you work, that could be every 2 months to every 2-3 years, sometimes longer.

The funny thing is, when I came to Microsoft I didn't really ever write code. I took two 4 months classes in college (C++ and Java). I hated C++ cause after 4 months all I could do was write a console app. Java was neat in that I could draw stuff, make games, silly and cool little apps in days. After that I pretty much never tried again. In May of 2003 I was frustrated at how difficult it was to add words to the Tablet PC Dictionary (which was supposed to improve recognition). I was on a mailing list where some one forwarded a word doc that described how to add words to the dictionary in VB.NET. I installed Visual Studio that day, and started to work on the application. I marveled at how cool the .NET Framework was. I read a few dozen books, not understanding most of the stuff, but learning little by little. I sent the application around to the Tablet Discussion List we have at Microsoft and a few days later I got an email from some folks on the tablet team asking me if I wanted to publish the application as a PowerToy.

That was really thrilling for me. It demonstrated that I had the creative power to take my own idea and make something that people could download and use. Looking back at this application and the code, I can't help but laugh. I later rewrote the thing from scratch cause none of it made sense to me, and I had long since switched to using C#, so VB looked funny and confusing. Soon after that I discovered BlogX and started playing around with that. I was mostly interested in the Windows application for posting to BlogX but soon after I started to dive into ASP.NET which was a rather difficult thing to get my head wrapped around. My hunger for learning more, and doing more really accelerated. I wrote a bunch of little applications, utilities etc and finally got most of it out of my system ;-). But the ability to do things like extending Media Center, Outlook and add value where I wanted was like an addictive drug. I was empowered to make things the way I want. Such things were:

  • Making the Vacuum Fluorescent Display on my Media Center do something useful
  • plugin for Outlook that could create OneNote notes from Emails and other items
  • NewsGator plugin to post to dasBlog
  • An application to edit the DateTime of photos as well as automatically rotate pictures
  • A small program to zip and unzip files quickly
  • An application to clean all the cruft from a VS.NET project (bin, obj)
  • An application to download RSS and send that to OneNote
  • An Outlook toolbar to replace the GettingThingsDone toolbar out there (that I dislike)
  • A Pocket PC Phone Edition app to switch the device to Vibrate during meetings
  • A Smartphone app for calculating tips
  • An ASP.NET Mobile Forms app for Wine that I have tried.

Some of these things I've shipped, and others I haven't cause I don't have the time to finish the last 10% to make them shareable. Finally, the product that I currently am having the most fun working on, dasBlog, is also one that I have learned the greatest from. Both Clemens and Scott Hanselman have taught me an immense amount about programming through their code, or through interactions with them. Scott actually spent a bunch of time the past few weeks chatting over IM, Skype and Phone explaining things to me, and is a really great teacher. Clemens wrote so much code in dasBlog that there are still parts of it that are teaching me new things, and some I don't quite fully understand. But each time I decide to tackle some area of the code base that I'm unfamiliar with, I learn a bunch load more. Fixing bugs forces you to understand and learn how things work, which is a great way to learn new stuff.

The amazing thing about .NET is you can really take your skills and apply them to the Internet, Win32 apps, Mobile apps, Media Center plugins, Tablet PC, Office, COM, etc. Knowing the language is an incredibly powerful tool and can be used consistently across a large spectrum of devices and products. I'm not sure you can do that with anything else. Since I am such a gear head, and out of the box never satisfies me, I have currently touched almost every product we sell that can be extended using .NET for about 12 months of investment of time on my part. That's a pretty decent value proposition for the framework. From my Smartphone to my Media Center, and everything in between, I can change things, make things, and custom tailor software to my liking.

What's my point? Well I'm getting to that. In the last 18 months I have learned a crap load about programming and .NET. When I was in the MacBU this had zero relevance to my job. However, now in Hotmail it has a lot of relevance, especially since my team is responsible for the Front Door Architecture and Infrastructure. This means that I often spend an enormous amount of time with our developers thinking about .NET, designing for scale, solving problems when things break etc. The interesting thing is that every time I learn something new about programming or ASP.NET it comes up a few days later at work. This past month it's happened at least twice. This means that I can actually play a part in the design or the solution for a problem, and help to actually influence direction and add value where I can. In many ways I feel like my job is a lot like being a student. I learn every day that I am here, in almost every meeting I am in, and from most of the people I interact with. I really find it rewarding to also learn from looking at other people's code and trying to influence my ideas into something that ships. That's really what makes working her addictive for me, and would really make it hard for me to do anything else at this point in my life.

A lot of the time my wife looks at me staring at my computer screen and has no freaking idea what could be so interesting that I would glue myself to the same chair for hours typing away. Sometime I wonder myself, but often I hardly even notice. I've tried to explain it to her, but just like I can't understand what it's like to save some one's life, deliver their child, or help them create a baby when they cannot otherwise do so (things she does), it's hard for her to understand how this drives me. I consider myself pretty dammed lucky that my ability to do my job benefits from this kind of learning, and that as I learn more, I can contribute more. It's sort of win-win I guess.

Posted Friday, January 14, 2005    Permalink    Comments [0]  View blog reactions

 

# Monday, January 10, 2005

Referral Spam and Movable Type Blacklist

Well, just in time for a wave of referral spam that is hitting my blog (mostly from http://www.ownsthis.com) I spent part of today writing a class that can consume the Movable Type Blacklist. The class will allow you to download this file from the server periodically (no more than once a day). I have written it such that anyone can integrate this into their .Net blogging package, or any other .Net program. I just checked this into the dasBlog 1.7 tree. The nice thing about this is that the Blacklist is maintained in real time, and you won't have to rely just on content filtering (the stuff that Scott did) but you'll get a pretty long and decent blacklist of bad sites. So far, in the past few hours I've gotten 100% of the referral spam and no false positives...

We are a few days away from releasing the final version of dasBlog 1.7. A very small number of folks have been running the bits over the weekend and as a result we've fixed a few bugs. A couple more days and we'll post the bits to SourceForge.

When that happens I'll post the MovableTypeBlacklist class. I've also considered writing an HttpModule to send these guys 404s, but didn't really think that was appropriate. The list is basically loaded into a long string, delimited by "|" and passed into a Regex to match a url. Interestingly enough, when I tried to Compile the Regex, my little console app balooned to 150 MB and it never quite finished running. Using a static Regex with the long static string I was able to execute matches in 0 - 10 milliseconds.

Here is a dump of the class:

6p.org.uk : True
Executed in : 20 milliseconds

microsoft.com : False
Executed in : 0 milliseconds

shahine.com : False
Executed in : 0 milliseconds

flatbedshipping.com : True
Executed in : 0 milliseconds

apply-to-green-card.org : True
Executed in : 0 milliseconds

ownsthis.com : True
Executed in : 10 milliseconds

Posted Monday, January 10, 2005    Permalink    Comments [2]  View blog reactions

 

# Sunday, January 09, 2005

Adobe Premiere Elements 1.0

A few days ago I was in CompUSA doing the usual... walking aisle by aisle as my wife did some shopping in Union Square, and was surprised to find that Adobe had created an "Elements" version of Premiere. Finally, a DVD creating, Video Editing, Movie Making piece of software that does not suck. One of the biggest things missing on my PC is a quality all in one Movie Editing and DVD creation package. Sure, Windows Movie Maker 2 is nice, but it can't burn to DVD. Photo Story 3 is a sweet application for creating movies of your pictures (with unparalleled Ken Burns affect and photo re-sampling as well as music creation) but also lacks the ability to take those .wmv files and then add things like DVD Chapters, DVD templates, and the most crucial step, burning to DVD.

Well for you Mac folks, you have a sweet package with iMovie and iDVD. iMovie is no good for it's Ken Burns affect, and neither package will generate music for you like Photo Story 3 does (you can select a classical composer, like Mozart and the tempo/mood for your Photo Story and it will generate audio for you). However, iMovie and iDVD excel at Capture of DV video, Authoring of a DVD and have wonderful integration.

I have tried Sonic, Roxio and Nero products for doing the above and all have fallen short of my expectations... heck I used a Mac for this stuff so I know where the bar is! But I have to say, THANK YOU ADOBE for giving us an affordable, quality, software package that finally puts Windows on par with the Mac for creating DVD's and Editing Videos. And of course, you can just drag and drop your Photo Story 3 movies directly into Premiere Elements making for a pretty seamless experience.

I'm really diggin the Elements suite of products. I own Photoshop CS, but if I didn't I would buy Photoshop Elements 3 now this supports the Adobe RAW Plugin. Now if Adobe would just update Album to support RAW photos from my Nikon D70 I'd be psyched. You can purchase Photoshop Elements 3 and Premier 1 for $139 and save a bundle.

Posted Sunday, January 09, 2005    Permalink    Comments [6]  View blog reactions

 

Skype 1.1 Install Problems

Jeff is having problems installing Skype 1.1. I am having the same problems. This is the first time I've ever used Skype, so this is not leaving a good impression.

Anyway, booting into Safe Mode allowed me to install it. Not sure why.

Posted Sunday, January 09, 2005    Permalink    Comments [1]  View blog reactions

 

# Saturday, January 08, 2005

Microsoft AntiSpyware

Not very often does a piece of software come along that blows me out of the water. A few months ago I got a very real experience dealing with spyware. Even after coaching my sister through fixing her computer, on my visit home over thanksgiving I found that all the spyware she had was still installed. When I looked in Add/Remove I was horrified at the number of strange entries in there. My attepmpts to remove them were difficult as well as the uninstallers for these products did such things as:

"Are you sure you don't want to not uninstall this program as it does x y or z for you"? [Yes] [No]

Basically they tricked you into not uninstalling the software by confusing the heck out of you with double and tripple negatives and the like. Eventually I got rid of all of it, and my sister now runs AdAware every few days, but it appears that she still has SpyWare issues every so often.

With my parents it was a lot easier. They had a 3 year old Compaq PC that was falling apart, and so we got them a new Dell that is super sweet. On this machine I made everyone a Limited User, except for my father's account since I've found that some programs just don't install correctly when you try (even though I try and authenticate during the install by running them with admin permissions). Anyway, on their machine, spyware will find a harder time making it's way there since my Mom can't be tricked into downloading something that is not good for her.

But I was still left uneasy knowing this could happen again. Well a few weeks ago I started beta testing the GIANT AntiSpyware software. I admit, my expectations were low having used some of the other stuff our there. However, I was BLOWN away by how nice a piece of software this is. Not only does it protect you from AntiSypware but it tells me what the heck is going on with my computer. I love knowing when applications are adding themselves to the Startup process, adding Contextual menus, modifying x, y or z. It just leaves me feeling like I'm in control of my PC when installing programs.

It doesn't stop there. My Dad installed the software and called me up telling me how much he loved it! I really hope this gives assurance to all those people out there that have been burned by SpyWare to not be affraid of their computers any more (or screwing them up). I'm really proud and happy that Microsoft is providing good tools to protect our users.

Download it now.

Posted Saturday, January 08, 2005    Permalink    Comments [0]  View blog reactions

 

RSS xhtml:body

A while ago there was some hubub about support for xhtml:body in the RSS item tag. Since all RSS aggregators must support the description tag, which contains all the escaped html content of the post, having another tag in the RSS feed that duplicates all this content into a tag that only some RSS readers understand seems silly. My RSS feed is 162k today, and if I stop including the body tag it goes down to 82k. Given that I'm doing about 400 MB in bandwidth transfer at my hosting provider and a large chunk of that is RSS, I'm thinking if folks want the body tag from dasBlog they can use the Atom feed.

Posted Saturday, January 08, 2005    Permalink    Comments [1]  View blog reactions

 

# Friday, January 07, 2005

Nullable Types

I'm pretty excited about Nullable Types in Whidbey. The primary reason I care about this is that in my PhotoLibrary (library that exposes EXIF properties of a picture) has lot of value types like int. One neat thing about the class is that using something like a PropertyGrid you can just point it at the Photo object and it will automatically reflect all the meta data and display it (with very little work). Well if a Picture doesn't contain certain properties, the reference types simply don't appear because they are null. Well, unfortunately all the value types appear in the property grid because they are set to 0. I never found an easy to way filter these out, and there are quite a few EXIF properties out there, which leads to a lot of unnecessary data in the property grid.

Anyway, this should fix that :-)

Posted Saturday, January 08, 2005    Permalink    Comments [0]  View blog reactions

 

# Wednesday, January 05, 2005

Dying Thread on Trackbacks, Referrals and Pingbacks

Part 2 of 2

Bug 2: TrackingHandler Thread Dies

Another problem that Scott Hanselman informed me of was that he would frequently stop receiving Trackbacks, Pingbacks and Referrals on his posts. Furthermore, it was intermittent. This was troubling since losing a Trackback means it's lost forever. Well we went hunting in the code, and thanks to some UnitTest of a theory I had found the answer.

Basically the situation is this. Scott gets a lot of traffic. More than I do. There is a thread in dasBlog that sits around waiting for Trackbacks and the like. You use it by calling trackingQueue.Enqueue(tracking) and then trackingQueueEvent.Set(). So basically dasBlog can sit there and queue a bunch of trackings, and when it's ready the thread runs to execute them. The code looks like this:

private void TrackingHandler( )
{
    while ( true )
    {
        Tracking tracking;

        trackingQueueEvent.WaitOne();
        while ( true )
        {
            lock( trackingQueue.SyncRoot )
            {
                tracking = trackingQueue.Dequeue() as Tracking;
            }
            if ( tracking != null )
            {
                try
                {
                    InternalAddTracking( tracking );
                }
                catch (Exception e)
                {
                    ErrorTrace.Trace(TraceLevel.Error,e);
                }
            }

            if ( trackingQueue.Count == 0 )
            {
                break;
            }
        }
    }
}

The objects below are created like so:

trackingQueue = new Queue();
trackingQueueEvent = new AutoResetEvent(false);
trackingHandlerThread = new Thread(new ThreadStart(this.TrackingHandler));
trackingHandlerThread.IsBackground = true;
trackingHandlerThread.Start();

So, can you figure out what is wrong? Well I created a unit test that called this 100 times. What I quickly found out was that even though the code was calling break when the trackingQueue.Count was equal to zero the trackingQueueEvent.WaitOne() call wasn't blocking the while loop from continuing. This caused trackingQueue.Dequeue() to throw an unhanded exception (which should have been in a try catch anyway).

Not knowing a whole lot about this kind of threading I looked at a couple of docs and found the answer. Before calling break I added trackingQueueEvent.Reset(). Problem fixed (I hope).

Posted Thursday, January 06, 2005    Permalink    Comments [1]  View blog reactions

 

DateTime.ToString("yyyy-MM-dd")

Recently I found the answer to two very hard questions about bugs in dasBlog. They were kinda tricky to figure out, but also really interesting (bug 2 will be in a follow up post)

Bug 1: DateTime.ToString()

One of the classes in dasBlog that stores information like Comments, Trackbacks and Pingbacks determines it's filename like so:

public string FileName
{
   get
   {
      return DateUtc.ToString("yyyy-MM-dd") + ".dayextra.xml";
   }
}

Well a few weeks ago Scott Hanselman emailed me with some files with names like 1425-05-05.dayextra. Can you figure out why this is?

Well as I found out, DateTime always assumes Gregorian Calendar, so DateTime.ToString() will output a filename with a Culture.Invariant filename. Well what happened to Scott is that he got comment spammed by some one who's Windows Region was set to a Culture that uses the Hijri Calendar. So, 1425-05-05 is the equivalent of 2004-06-22.

The reason this happened was because this person happened to be the first person to leave a comment, and thus the file was created using the CultureInfo from their machine!

The fix was to do the following:

public string FileName
{
    get
    {
        // Use Invariant Culture, not host culture (or user override), 
        // 
for date formats.
        IFormatProvider mmddFormat = new CultureInfo(String.Empty, false);

        // Ignore local DateFormatInfo (could say CCYY-DD-MM), 
        // always use CCYY-MM-DD.

         return DateUtc.ToString("yyyy-MM-dd", mmddFormat) + ".dayfeedback.xml";
   }
}

DateTime stuff is very tricky and dasBlog has 4 different kinds of DateTime so it can get confusing.

  1. DateTime for Server (timezone the server is in)
  2. DateTime for Author (timezone the author is creating the post)
  3. UTC, which is how all data is saved
  4. Browser DateTime (where the reader is reading the post)

In all these cases dasBlog must know how to convert back and forth between all these formats and preserving the window of time that equals a single Day (24 hours of time, in the server, author, or UTC timezone).

Posted Thursday, January 06, 2005    Permalink    Comments [1]  View blog reactions

 

# Monday, January 03, 2005

Donate

Well, I haven't said anything about the recent disaster, but since I have already given (including any Google Adsense money I was due) and had that matched by Microsoft (thanks!) I thought I would try and make it easy for my readers to give as well. If your company does not do matching donations, there are probably dozens of places you can donate. Click below to do so through Amazon. If your company does do matching donations, you should take advantage of that.

Amazon Honor System

Click Here to PayLearn More

Posted Monday, January 03, 2005    Permalink    Comments [0]  View blog reactions

 

# Sunday, January 02, 2005

Enclosure support in dasBlog

Well, thanks to some encouragement from Jeff Sandquist, I just recently added Enclosure support to dasBlog. It was a bit tricky because RSS 2.0 only allows for a single enclosure per item. I didn't want to get burned by the spec changing at some point, so dasBlog actually support any number of attachments, but only one enclosure. Right now there is no UI for adding anything except for one. Eventually I'll add things like Photos, or whatever.

The nice thing about this is that when you add an attachment they are automatically added in your content/binaries/[entryId]/ folder. So now, when you delete an entry, the folder goes away as well and you don't have any straglers lying around.

If this worked, you should be able to download registry keys that will prevent office documents from opening in IE. Click the enclosure icon below (if you are reading this in an RSS reader it may not display the enclosure link).

Just one of many things coming to a dasBlog near you. Seriosly, Scott just finished setting up our SourceFourge site, and once we give a beta out to a few folks to make sure nuthin is broken, we'll have a public beta release. The Runtime has changed a lot, so we want to be carefull. However, I think Scott fixed a ton of threading bugs in the process (dasBlog wasn't very threadsafe, and this caused lots of wierd stuff).

 

# Friday, December 31, 2004

Do Not Deliver Before

My buddy Reeves just pointed me to a sweet Outlook feature that I never knew about called Do not deliver before. In a recent post I commented on how I'm trying to get in the habit of not doing work email on weekends, vacations etc. Well one problem with this is I could be on a plane or a train and I want to hammer out some mails from my inbox (but don't want to send them, because that sets a bad example). Additionally, if people are on vacation, I know that my email will just sit in their inbox and drift down to the bottom and possibly get lost. Worse, if they check their email over their vacation, I don't want to create work for them and stress them out.

Here is a good example. It's 1 am, and I just thought of something I want to tell my manager and our admin. Well they are both on vacation till Monday. So what is the point of sending this to them now? It could get lost, or read and left in the inbox. Instead I have scheduled to have it delivered Monday afternoon.

So, using "Do not deliver before", you can just tell Outlook not to send the message before a specific date and time. To do this simply:

  1. In a new mail message select Options from the Toolbar (if you are using Word Mail)
  2. Click the Do not deliver before checkbox and enter a date and time.
  3. Hit send

Viola!

Update: Thanks to Chris Graham for letting me know that if you have an Outlook Deferred Deliver Rule this will override the per message option and deliver the mail according to those settings.

Posted Friday, December 31, 2004    Permalink    Comments [1]  View blog reactions