I stumbled upon this useful blog about SQL Server instance names. In short, you can find the installed instance names in the registry under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL. It also tells you which instance name is associated with which data directory (default names by SQL Server are MSSQL.1, MSSQL.2 and so on).
woensdag 27 mei 2009
vrijdag 22 mei 2009
iContact phantom contact
Recently I installed iContact (supware.net) on my Windows Mobile phone (HTC Touch Cruise). Works a lot nicer than the built-in contact manager.
Then I started synchronizing my contact through an Outlook Web Access connection (so far I synced with Outlook on the desktop). Something went wrong, and I ended up with two versions of every contact entry. That's not funny. At the office - with Outlook having a connection with Exchange - I de-duplicated all the entries. Sync the phone again - all well, you might expect.
However, in iContact I still had all the double contacts. One thing changed: With all contacts, one of the two did not contain any data. What was wrong?
De-installed iContact, so I could see the original contact manager. There I saw that the data was allright. No duplicates. So the problem was in iContact. Re-installed iContact, thinking that might help. Not so. So it had to be in the iContact settings that had remained on the memorycard after the uninstall. Retry:
- uninstall iContact
- I found the directory <storage card>\Program files\iContact, with allcontacts.dat and favorites.dat files in it. Deleted the directory
- re-installed iContact
Yes, now it was ok.
Conclusion: iContact does not detect it when you remove contacts outside of iContacts' own program interface. If in trouble: remove the allcontacts.dat files from the program files\iContact directory.
Edit: the iContact faq also gives a solution: "While viewing the "all contacts" tab, touch the contacts tab at the bottom of the screen again."
Then I started synchronizing my contact through an Outlook Web Access connection (so far I synced with Outlook on the desktop). Something went wrong, and I ended up with two versions of every contact entry. That's not funny. At the office - with Outlook having a connection with Exchange - I de-duplicated all the entries. Sync the phone again - all well, you might expect.
However, in iContact I still had all the double contacts. One thing changed: With all contacts, one of the two did not contain any data. What was wrong?
De-installed iContact, so I could see the original contact manager. There I saw that the data was allright. No duplicates. So the problem was in iContact. Re-installed iContact, thinking that might help. Not so. So it had to be in the iContact settings that had remained on the memorycard after the uninstall. Retry:
- uninstall iContact
- I found the directory <storage card>\Program files\iContact, with allcontacts.dat and favorites.dat files in it. Deleted the directory
- re-installed iContact
Yes, now it was ok.
Conclusion: iContact does not detect it when you remove contacts outside of iContacts' own program interface. If in trouble: remove the allcontacts.dat files from the program files\iContact directory.
Edit: the iContact faq also gives a solution: "While viewing the "all contacts" tab, touch the contacts tab at the bottom of the screen again."
maandag 18 mei 2009
WinDiff with Visual Studio
Microsoft has built a nice tool for comparing files and folders ages ago, and it's called WinDiff. It used to be deployed along with Visual Studio, but as of version 2008 I cannot find it anymore. So if you want to save your WinDiff, you can copy it from VS2005\Common7\Tools\Bin\Windiff.exe. Looking for it in VS2008 is useless.
Of course you can also download it on numerous places on the web, or use WinMerge.
Of course you can also download it on numerous places on the web, or use WinMerge.
The right keyboard settings
Today somehow I found myself with smart quotes. It's that annoying option in Windows where you type a quote, nothing appears, then you type a letter, and you get an accented letter. If I type a quote, I mean a quote. If I want an accented letter, I can type in the alt-code.
So I had to find out what the solution was (not for the first time, this also happens with fresh Windows installations, but I did not remember exactly). For me it was (on Windows XP SP3):
So I had to find out what the solution was (not for the first time, this also happens with fresh Windows installations, but I did not remember exactly). For me it was (on Windows XP SP3):
- Open Control Panel, Regional Options, tab Languages, button Details.
- Remove everything but Dutch (as language) and US (as keyboard layout).
- Make sure that you don't use US International keyboard layout, since that comes with the smart quotes.
- Hit OK a few times and logoff/logon.
woensdag 11 maart 2009
Throw ex
No, don't throw your ex anywhere. It's just that a collegue mentioned something I didn't know about re-throwing exceptions in .Net.
Say you want to catch an exception and rethrow it after you're done with it:
Try
' try something
Catch ex As Exception
' do something useful
Throw / Throw ex
End Try
There's a difference:
- Throw: ex is rethrown, and stack trace is left intact.
- Throw ex: ex is thrown, but stack trace is erased.
So, generally you want to do Throw, not Throw ex.
C# works the same, although with other syntax of course:
try
{
// try something
}
catch (Exception ex)
{
// do something useful
throw; / throw ex;
}
Also see MSDN for an explanation.

Say you want to catch an exception and rethrow it after you're done with it:
Try
' try something
Catch ex As Exception
' do something useful
Throw / Throw ex
End Try
There's a difference:
- Throw: ex is rethrown, and stack trace is left intact.
- Throw ex: ex is thrown, but stack trace is erased.
So, generally you want to do Throw, not Throw ex.
C# works the same, although with other syntax of course:
try
{
// try something
}
catch (Exception ex)
{
// do something useful
throw; / throw ex;
}
Also see MSDN for an explanation.
dinsdag 3 maart 2009
Entering string parameters in constructors with Unity
A Microsoft.Practices.Unity container will try to resolve any parameters that a constructor expects. However, for simple string (or int) parameters, that won't work. My example for this was a queue that expects a name parameter:
Public Class Queue
Private mName As String
Public Sub New (name As String)
mName = name
End Sub
End Class
This can be solved, and Microsoft explains how in this section of the documentation.
In this case it results in code like this:
MyContainer.Configure(Of InjectedMembers)() _
.ConfigureInjectionFor(Of Queue)( _
New InjectionConstructor("testqueue"))
Public Class Queue
Private mName As String
Public Sub New (name As String)
mName = name
End Sub
End Class
This can be solved, and Microsoft explains how in this section of the documentation.
In this case it results in code like this:
MyContainer.Configure(Of InjectedMembers)() _
.ConfigureInjectionFor(Of Queue)( _
New InjectionConstructor("testqueue"))
donderdag 26 februari 2009
Picture organizing software
I have used Photoshop Elements for about 4 years now, starting with PE3, and now PE6. It's nice, though not free. I primarily bought it for organizing my pictures, and have come to appreciate the many editing capabilities as well. But, I have found some pretty annoying 'features' as well:
One thing on the upside: As of version 6, PE uses an SQLite database for it's data. So with some SQL knowledge and common sense you can do some nice things. Like moving all the pictures to another disc.
Well, if PE is starting to fail on me, let's look at all those free alternatives that have emerged lateley. After some reading on the Internet I decided to try Picasa 3 (I was already using 2 for exchange with PicasaWeb), open source My Photo Index and Microsoft Photo Gallery.
My Photo Index: Indexing the first small directory of pictures looked promising. So let's try one with (Panasonic FZ-50) RAW files in them. Hmm, it stops responding. That's not good. OK, it's open source and .Net, so theoretically I could try to fix this myself. But hey, I was working on my other hobby now.
Picasa 3: Indexing goes well, also with the RAW files. As per version 3 it also correctly recognizes multi-word tags (instead of breaking them up), that's nice. Less impressive: labels can not be ordered in a hierarchy. Let's try the search. Simple search box in the upper right corner. Type in 'cat': It matches not just on the label, but on all sorts of things. I cannot find an option to search just the labels, let alone to combine multiple labels. PE is doing far better here! Adding labels however, can be done entirely with the keyboard. I like that.
Photo Gallery: This is Microsoft, so 'My Pictures' is by default indexed. And cannot be deleted from the index either. Well, MS, not everyone saves his pictures in 'My Pictures'. Duh. However, you can add other directories as well. From here the story is pretty much the same as with Picasa. No hierarchy, no obvious way to add labels, same search-problems. File | Exit.
So, the sad conclusion is that I will have to stick to PE, or install Linux on my main machine. Since digiKam or F-Spot is said to do this very well. But that is still one bridge too far for me.
However, while writing this I have gave F-Spot a try on my secondary PC with WUBI (Ubuntu alongside Windows). Wow! Tagging with the keyboard, hierarchical tags, search on multiple tags (And + Or functionality), correct import of multi-word tags and RAW files. If you press '/', you get a Find-typing area that understands both tags and filenames. It just does as promised. Why can't all the others do this??? Maybe I should turn over to Ubuntu after all. Whooaa, I need some time & beer to get used to that!
If you have any other good ideas, please keep me and other readers posted.
- By now there are some 12000 pictures in it, and the organizer is getting really slow (on my AMD Athlon64 3000+, 2GB). You use the organizer constantly, so that is a problem.
- The tagging system is basically very good. But the interface to work with it is not. All tags are displayed in a hierarchial list. You assign tags to photo's by dragging the tag to the photo. For searching, you click a checkbox in front of the tag. If you have many tags (I have), you're constantly scrolling the tag list. You cannot easily do this with some shortcuts.
- You cannot zoom further than 'fit in window' in the organizer itself. For that you have to start the preview (F11). Which has another problem: it is horribly slow on RAW files.
- The editor has very many functions inherited from it's big brother Photoshop, and together with my Wacom tablet it's a fun to use. If... it would not crash about every 5 minutes. I must say, on the aforementioned PC. On my Dell - Intel laptop, this problem is not present.
- The program is very eager at doing things automatically. Just now, I switched to it (simple Alt+Tab), and then it started 'updating...' for 2 minutes or so. No clue what needed updating though....
One thing on the upside: As of version 6, PE uses an SQLite database for it's data. So with some SQL knowledge and common sense you can do some nice things. Like moving all the pictures to another disc.
Well, if PE is starting to fail on me, let's look at all those free alternatives that have emerged lateley. After some reading on the Internet I decided to try Picasa 3 (I was already using 2 for exchange with PicasaWeb), open source My Photo Index and Microsoft Photo Gallery.
My Photo Index: Indexing the first small directory of pictures looked promising. So let's try one with (Panasonic FZ-50) RAW files in them. Hmm, it stops responding. That's not good. OK, it's open source and .Net, so theoretically I could try to fix this myself. But hey, I was working on my other hobby now.
Picasa 3: Indexing goes well, also with the RAW files. As per version 3 it also correctly recognizes multi-word tags (instead of breaking them up), that's nice. Less impressive: labels can not be ordered in a hierarchy. Let's try the search. Simple search box in the upper right corner. Type in 'cat': It matches not just on the label, but on all sorts of things. I cannot find an option to search just the labels, let alone to combine multiple labels. PE is doing far better here! Adding labels however, can be done entirely with the keyboard. I like that.
Photo Gallery: This is Microsoft, so 'My Pictures' is by default indexed. And cannot be deleted from the index either. Well, MS, not everyone saves his pictures in 'My Pictures'. Duh. However, you can add other directories as well. From here the story is pretty much the same as with Picasa. No hierarchy, no obvious way to add labels, same search-problems. File | Exit.
So, the sad conclusion is that I will have to stick to PE, or install Linux on my main machine. Since digiKam or F-Spot is said to do this very well. But that is still one bridge too far for me.
However, while writing this I have gave F-Spot a try on my secondary PC with WUBI (Ubuntu alongside Windows). Wow! Tagging with the keyboard, hierarchical tags, search on multiple tags (And + Or functionality), correct import of multi-word tags and RAW files. If you press '/', you get a Find-typing area that understands both tags and filenames. It just does as promised. Why can't all the others do this??? Maybe I should turn over to Ubuntu after all. Whooaa, I need some time & beer to get used to that!
If you have any other good ideas, please keep me and other readers posted.
Abonneren op:
Posts (Atom)