Changing the location of "Import Pictures and Videos using Windows"

Saturday, 27 February 2010

For some reason, if you uncheck the “Prompt for a tag on import” under the “Import Settings” of the Windows 7 “Import Pictures and Videos” wizard, then as far as I can tell there is no way to get back the “Import settings” dialog again.

A quick search of the registry reveals that these settings are stored under the following key: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Photo Acquisition

For example, there’s a “Camera and Portable Device” subkey with a value named “RootDirectory”, and also one named “FilenameTemplate”. Changing these should alter where the wizard saves photos.

Comparing this subkey with the “OpticalMedia” and “Scanner” subkeys showed one interesting difference. All three have an AcquisitionFlags value, but the latter two had it set to 0x82 whilst the former was 0x8a.

Reverting the AcquisitionFlags value to 0x82 in the following registry key seems to restore the import wizard to prompting you for an optional tag, and allowing you to click on the “Import Settings” link again:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Photo Acquisition\Camera and Portable Device

To make this change yourself, follow the following steps (with the standard warning that editing the Windows Registry incorrectly can completely mess up everything!):

  1. Run regedit.exe
  2. Navigate through the registry tree to find the following subkey: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Photo Acquisition\Camera and Portable Device
  3. Double-click on the “AcquisitionFlags” value
  4. Type in “82”
  5. Click on “OK” and close the Registry Editor

ReSharper 5 – Structural Search and Replace

Thursday, 25 February 2010

I found a use today for a new feature that will be in ReSharper 5.0 - "Structural Search and Replace". Essentially it's a way to add code matching templates into R# to add new refactoring patterns in addition to those that come in the box.

For example, Microsoft recommends (and Code Analysis/FxCop generates appropriate warnings) if you are doing a comparison between a string value and an empty string, to use the String.IsNullOrEmpty() method.

I always wanted R# to make this change for me, and now I can:

  1. Go to Resharper | Tools | Patterns Catalog
  2. Click on 'Add Pattern'
  3. Enter "$value$ == "" " in the Search Pattern textbox.
  4. Click on 'Add Placeholder' and add an 'Expression' placeholder named 'value' of type System.String
  5. Enter "string.IsNullOrEmpty($value$)" in the Replace Pattern textbox
  6. Ensure Pattern Severity is set to at least 'Show as suggestion'
  7. Click on 'Add'

R# will now use this pattern and highlight code that matches. You can then hit the QuickFix shortcut (Alt-Enter by default) and get a smart tag offering to refactor/replace your code.

 Resharper 5 - Smart Tag showing option to replace with String.IsNullOrEmpty

If you can't wait for the final release of ReSharper 5 (due in the next few months) then install beta 2 or one of the recent nightly builds.

Passed 70-451

Tuesday, 23 February 2010

If one wasn't enough this week, today I passed another exam – 70-451 PRO: Designing Database Solutions and Data Access Using Microsoft SQL Server 2008.

Combining that with yesterday's success means I am now a Microsoft Certified IT Professional (MCITP): Database Developer 2008.

Doing the exams are an interesting (and educational) process but they have other advantages too – they'll be useful to my employer (LobsterPot Solutions) and might benefit efforts for me to become a Microsoft Certified Trainer.

Passed 70-433

Monday, 22 February 2010

This morning I took the Microsoft exam "TS: Microsoft SQL Server 2008, Database Development 70-433". I was quite chuffed after I hit the 'Finish' button and it said I'd passed!

One thing different about today's exam was that I chose to do it at Rockfort International Pty Ltd. An impressive name, but it turns out they appear to be a 2-man outfit in a quite tiny office. I wasn't even sure I was in the right place until the guy turned up and confirmed that yes they did do exams! Having said all that, once I sat down at the exam PC it was pretty good – quiet, comfortable and the PC had a reasonable screen. I've done most of my other exams at Excom, and last time I was there they still had a crumby old CRT monitor (running at a really low refresh rate) and that room had pretty noisy air conditioning. So even though the office may not be quite as swish, I'd rate the actual examination environment higher.

Over the weekend I was doing some study toward the exam and came across the following things that were new to me. Some of them may be obvious to others, but they're not things I've used before or been aware of.

Note – these were things I came across BEFORE I did the exam. I am definitely not indicating these topics were either in or out of the exam (and no, there's no hidden meaning here, I  really mean that). All I am saying is that by reviewing the curriculum I happened to learn some new things.

Finally, let me pre-empt the inevitable lazy sod who emails me and asks for some hints or answers to this exam (apart from the fact that by taking the exam, I've agreed to Microsoft's Non-Disclosure Agreement which includes not "Disseminating actual Exam content" ) ..

Do what I did – use the product, and know all (or enough of) the stuff it says you need to know and you should pass!

BSOD - "A clock interrupt was not received on a secondary processor within an allocated time"

Sunday, 21 February 2010

I mentioned yesterday that the Hyper-V server had been experiencing the Blue Screen Of Death with the message "A clock interrupt was not received on a secondary processor within an allocated time" (0x00000101). The problem is that it doesn't really give you any clues as to what was the cause of the error.

Yesterday morning I changed the BIOS defaults to "Fail safe" and things had been working fine… until this morning, when it crashed again. Researching this error is not that encouraging:

Presumably Microsoft are slightly more interested in the crash as today's Windows Error Reporting asked for me to submit extra debugging info. I'm happy to do that, though I don't expect to get any quick answers.

This is quite frustrating as until I can identify and resolve the cause of this problem, I don't have a lot of confidence in the server.