Thursday, September 28, 2006

Great news!

Google Reader has been updated and it is usable now!

Find out more here!

(Thank you Digg!!!)

posted on Thursday, September 28, 2006 8:25:37 PM (Central Standard Time, UTC-06:00)  #    Comments [0]

If you've seen some of the Vista screenshots lately or even installed the RC1 for Vista, you will undoubtedly have noticed that Windows Vista makes use of the C:\Users directory instead of C:\Documents and Settings that Windows XP had previously used.

I had been a little curious how Vista handled programs that might have the C:\Documents and Settings path hardcoded (which is a bad thing), but I now understand. Documents and Settings still exists! The new Users directory is actually much more like a Junction point (see Scott's post on code organization and junctions for more information if you're unfamiliar with junctions) that references the Documents and Settings directory!

Would you be interested to know how I discovered this?

I was digging around my drive trying to track down a duplicate song that iTunes had found. It showed one beneath my Users directory and one beneath my Documents and Settings directory. That really threw me at first so I dug down into the hidden Documents and Settings directory and found duplicates of all of my document files! The reason I wasn't suspicious about this is because I didn't do a complete format before installing RC1. I still did a clean install, but it simply doesn't perform an upgrade of the existing Windows install... a nuance, but it is still important. The difference is that directories other than your Program Files and Windows directories stay behind.

Anyway, I started to delete what I thought were duplicates and suddenly noticed my User directory was losing files, too! That's when I realized that Windows was using a junction of some sort to tie the User and Documents and Settings directory together.

Thankfully, Vista's excellent Restore previous versions worked great so I didn't lose any pictures.

One note about the Restore previous versions that caught me though is that if you have the folder open, it won't let you restore it. You actually have to collapse the folder in Explorer and right click on it for it to work. Or at least I did.

UPDATE:
Scott Hanselman and Rob Boek both provided some great feedback to my post. I hadn't thought to try the "dir /ad" command like Rob did to show the junction... I was mainly basing my prior statements based off of observations. Thanks for the updates guys!

posted on Thursday, September 28, 2006 8:08:40 PM (Central Standard Time, UTC-06:00)  #    Comments [0]
 Sunday, September 24, 2006

Last month (almost two months ago!), I posted on how to programmatically get the caption for an image in C#. I haven't posted much more on the subject lately, because I've been busy with other things like playing with Vista RC1 and different unit testing frameworks. I also have learned a lot more about the different methods for storing metadata in images. My previous method ONLY works for images where the metadata is in the EXIF format. There are a variety of different metadata formats available and I discovered that not all of my digital pictures use EXIF. In other words, my previous post DOES NOT WORK for those images. I also discovered that there is no reason to use my previous method, because Omar Shahine has already done all of the hard work here.

If you're interested in EXIF metadata, use his PhotoLibrary. It is a very well designed library for setting and retrieving EXIF metadata on images. I really wish I had known about it a couple of months ago, but at least I learned some stuff on my own. That's always nice. The problem is, once again, that it only works with EXIF metadata. Basically, I wanted a solution that gave me the same results that Windows Explorer file properties provides. I wanted the caption regardless of the metadata format.

The solution? Windows Presentation Foundation!!! WPF provides a completely new way to look at images. There is a great overview in the MSDN documentation here.

The short of it is that you can write code like this, though:

ImageSource src = this.image1.Source;

BitmapMetadata bm = ((BitmapMetadata)this.image1.Source.Metadata);

MessageBox.Show(bm.Title);

Neat, eh? What's even better is that it works for every image I've tested with it so far. The only other code in my small example is some XAML to get an image loaded and the code to get a click event handler so I could see the results of my test.

Nice!

I guess my new Gallery Manager application will target the .NET 3.0 Framework!

Note - for uncommon metadata attributes, there is a GetQuery property that BitmapMetadata provides. I haven't looked into much, but it looks like it covers many of the various metadata formats available. You just have to know the query syntax... which I currently don't. If anyone knows of any good resources on this, please let me know!

posted on Sunday, September 24, 2006 9:12:45 PM (Central Standard Time, UTC-06:00)  #    Comments [0]
 Thursday, September 21, 2006

As some of you may know, I recently installed RC1 of Vista on my home PC. For the most part, it has been a great experience. I had some early problems because I took the upgrade path instead of a clean install. That lasted about two nights, because though most of my programs still worked, they didn't behave as expected. My memory usage was sky high, too. After the clean install, it has smooth sailing ever since (except for Windows One Care and my HP 2600 All-in-One Printer...).

Anyway, that's not what this post is about. This post is about Windows Vista Secrets!

Tim Sneath, a technical evangelist for Vista, has begun a series on Windows Vista Secrets and they're great tips! I must say, my favorite tips are the built-in Open Command Window Here, Copy as Path, and Running Quick Launch Items. The first two were available before using shell extensions, but having them built in is great. I do wonder if there is a secret to have them always show up as opposed to having to Shift + Right Click, though. That would be a nice feature. Maybe if it is a config setting somewhere, like the UAC stuff is. Another nice feature would be the ability to open PowerShell instead of the standard Command Window.

Anyway, thanks for the great tips Tim! Keep them coming!

posted on Thursday, September 21, 2006 8:08:43 PM (Central Standard Time, UTC-06:00)  #    Comments [0]
 Tuesday, September 19, 2006

Recently, Microsoft released version 3.0 of the Visual Studio 2005 SDK, so I thought I'd download it because I like downloading stuff.

Anyway, I thought I'd share a nifty tool that came along with it under the Visual Studio SDK Power Toys name (not to be confused with the Power Toys for Visual Studio... I'm confused, too). Here's a screenshot of Source Outliner:

Source Outliner

It acts sort of like the Class View tool window, except that it outlines the currently opened file. It also seems a lot cleaner if you happen to be deep in a namespace hierarchy. Once you have the VS2005 SDK installed, you can access this tool either by selecting Tools -> Power Toys -> Source Outliner or by using the CTRL + \ + O hotkey.

Check it out!

UPDATE: I... uhh... added the link to the download. My mistake on forgetting that :-)

Another update: Don't bother downloading the entire SDK if you're just interested in the Visual Studio SDK Power Toys... you can download them standalone! Check out Aaron Marten's post here!

posted on Tuesday, September 19, 2006 1:27:50 PM (Central Standard Time, UTC-06:00)  #    Comments [0]
 Wednesday, September 13, 2006

I recently upgraded Firefox to the 2.0 beta version. It has some nice features built in and it seems a lot more stable than the previous beta version. One complaint I had with it was the lack of support for extensions, though Mike Gunderloy pointed out the Nightly Tester Tools that will attempt to make extensions compatible - and for me, 99% of the time, the Nightly Tester Tools works. In fact, it worked for 100% of my extensions, but Tab Mix Plus didn't pull all its functionality along with it to 2.0. The extension shows as working correctly, but it doesn't actually work correctly and really, it only states compatability with 1.6+ so I shouldn't be surprised. However, as Colin pointed out, Tab Mix Plus has some really great functionality, and I was missing it in Firefox 2.0, like the ability to keep sessions for the next load of Firefox.

I recently discovered that Firefox 2.0 has this ability built in, but it isn't the most intuitive to find yet, at least for me. Here's a screenshot of what the options dialog looks like on my PC:

Firefox Options

What's funny is that this option is right on the Main tab! I guess I should have looked more closely, but I had spent most of the time looking in the tab options. If you're wondering where to find this new functionality, look no further.

posted on Wednesday, September 13, 2006 6:21:01 AM (Central Standard Time, UTC-06:00)  #    Comments [0]
 Friday, September 08, 2006

Windows One Care doesn't work in RC1, but they've still included it in the "Offers from Microsoft" section of Vista's welcome center. That's sort of annoying, because I've already signed up for Windows One Care, but now I can't use it in the system that actually is trying to get me to use it!

UPDATE: Now it does!

posted on Friday, September 08, 2006 4:28:19 PM (Central Standard Time, UTC-06:00)  #    Comments [0]

Last night, I finally completed my install of Vista on my home machine. I sort of wish I had taken the clean install route instead of the upgrade path, because it took forever! One of my coworkers did the clean install and he was finished in half an hour - it took me two nights! Now, those two nights were really because I started it and went to sleep and was greeted with an "End task" dialog on a program that had hung the first morning. I let it continue through the next work day and was greeted with another dialog when I got back the next evening. I did successfully install it, though, and I like it quite a bit. My biggest complaint so far is that Windows One Care isn't currently supported in Vista yet. It's even a Microsoft product for crying out loud!

Anyway, this post is about UAC, though :)

On my PC, whenever the UAC dialog appears, my entire screen goes black and, when it comes back, the dialog is the only thing that isn't a darker color. When the screen goes black, it is almost as if my monitor has lost the signal from the computer, like when you're rebooting your machine. That is probably my biggest complaint with it right now, because the process isn't very responsive. (Is that a performance issue on my machine? I don't know, but I do have more memory on the way)

Here's what I'd like to see: the ability to have a true Administrator account that doesn't have to have the UAC dialog pop up for administrative-related tasks; HOWEVER, I do understand why Microsoft is hesitant to do this. My parents have been using Windows since version 3.1 and they've never had a dialog like this. *nix users have always (?) had the idea of a root user, so that is something they know, but my parents probably have no idea if they're admins or not. In fact, they only have one account set up and they never even see the welcome screen in Windows XP.

How does Microsoft get them to go from that to having one or more logon accounts and then an admin account that doesn't have annoying dialogs and actually expect them to use the one that HAS the dialogs? We might know not to use the admin account for security reasons, but do you really expect users to read the warning message? Users don't read messages now and I'm guessing they won't read them in a new version of Windows either. I'm sure it can be done, but it won't be easy.

posted on Friday, September 08, 2006 7:22:53 AM (Central Standard Time, UTC-06:00)  #    Comments [1]
 Thursday, September 07, 2006

Having trouble changing your PowerShell Script Execution Policy in Vista because of access problems? This whole limited user thing will take some time to get used to, but it certainly is a good idea for security. What I did to fix this problem was I ran the command prompt as an admin. If you go under your start menu and accessories, you'll see a link to the command prompt. If you right click on it, you'll see an option to run as administrator. Here's a screenshot:

Once you do that, you'll be able to start up Powershell and then you'll have authority to change the execution policy. I've typically been setting mine to RemoteSigned (Set-ExecutionPolicy RemoteSigned).

Unrelated to Powershell, but wow will I need more memory if I want to run Vista! I barely have any programs open and my pagefile is getting hit like crazy! I'm probably averaging a gig of memory usage... with only one program open!

posted on Thursday, September 07, 2006 8:09:55 PM (Central Standard Time, UTC-06:00)  #    Comments [0]

When you're creating a GUI control in Visual Studio, your public properties will be displayed in the Property Grid and you can customize this by using attributes such as the Category attribute or the DisplayName attribute. Another nice attribute to use sometimes is the Browsable attribute. If you set the Browsable attribute to false (i.e. <Browsable(False)> in VB.NET), it won't be displayed in the property grid. I typically use this to hide properties that really have no function from the GUI side.

Here's the point of the post though: even if you set a property's Browsable attribute to false, it will still be accessed by the designer. In other words, if you've got code like a Debug.Assert or something in there, it will still fire, regardless of the Browsable attribute's value. So, you might consider putting a DesignMode check around code like that because it will give you some weird behavior when running in the designer.

UPDATE:
No one ever told me about the DesignerSerializationVisibilityAttribute! You can set DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) on a property and it won't get serialized into code!

posted on Thursday, September 07, 2006 7:53:25 AM (Central Standard Time, UTC-06:00)  #    Comments [0]
 Thursday, August 31, 2006

Back in January, Gaston Milano posted a sort of wishlist for the next version of Visual Studio. One of the features he wanted was the ability to filter properties down in his Properties window. Here's a screenshot of what he had in mind (from his posting):

Well, I've got great news! Corneliu from his parallelthinking blog has created an addin to do just that! It works by using his Hawkeye application, which is a sort of superpowered Spy++ for .NET. Hawkeye allows you to attach to any running .NET application and inspect various .NET controls and their properties as well as methods, events, and all sorts of other fun things. With Hawkeye, you can even CHANGE properties and INVOKE methods! On the fly! And the other .NET application never even has to know about it!

His VS Properties Extender uses the functionality of Hawkeye to add a text box to the properties window at run time which allows you to filter to commands. It works great, too. Now I'm really curious what other sorts of functionality could be added to an application like Visual Studio by using Hawkeye. Check it out!

(found via Larkware)

posted on Thursday, August 31, 2006 10:57:37 AM (Central Standard Time, UTC-06:00)  #    Comments [0]