Again

Illustration

More observant among you might notice that there is already new version of VHD Attach. Those who use it on Windows 7 and Windows Server 2008 R2 have no reason to worry: only difference between versions 3.00 and 3.01 is that VHD Attach now supports Windows Thin PC.

If you happen to use Windows Thin PC than just remember to install .NET Framework 4.0 before VHD Attach and you should be just fine.

VHD Attach 3.00

Few last tweaks are completed and it is time for new version of VHD Attach.

Biggest change to this version is addition of dynamic virtual disks creation. In addition to this, application now recognizes stolen extensions and offers fix. Upgrades should also be a little bit easier since there is in-application check for new versions.

There is lot of small cosmetic adjustments. Like switching focus to Explorer upon attaching Bit Locker drive or drag&drop support in main window. And lets not forget that those who love analyzing virtual disks just got few more details about VHD.

Check it yourself.

Renaming a File

Renaming a file is quite simple job in C#. You can just call File.Move(oldPath, newPath) and it works. That is until it doesn’t. Problem with this function is that it cannot rename file that differs only in case. E.g. test cannot be renamed to Test. And believe it or not, people sometime want to change case of their file.

Solution that first comes to mind is renaming file to something temporary and then back. E.g. test will be renamed to test-temp and then back to Test. While this solution works it makes exception handling annoying. Just what are you supposed to do if there is exception after you already created test-temp?

Fortunatelly Windows API is not so restrictive. Things can be as simple as calling MoveFile function. Or in our case MoveFileEx with parameters that ensure that we can move between volumes (MOVEFILE_COPY_ALLOWED) and that function returns only after work is done (MOVEFILE_WRITE_THROUGH). Quite straightforward code indeed:

public static void MovePath(string currentPath, string newPath) {
    if (currentPath.StartsWith(@"\\?\", StringComparison.Ordinal) == false) { currentPath = @"\\?\" + currentPath; }
    if (newPath.StartsWith(@"\\?\", StringComparison.Ordinal) == false) { newPath = @"\\?\" + newPath; }
    if (NativeMethods.MoveFileExW(currentPath, newPath, NativeMethods.MOVEFILE_COPY_ALLOWED | NativeMethods.MOVEFILE_WRITE_THROUGH) ==  false) {
        var ex = new Win32Exception();
        throw new IOException(ex.Message, ex);
    }
}

internal static class NativeMethods {
    public const uint MOVEFILE_COPY_ALLOWED = 0x02;
    public const uint MOVEFILE_WRITE_THROUGH = 0x08;


    [DllImportAttribute("kernel32.dll", EntryPoint = "MoveFileExW", SetLastError=true)]
    [return: MarshalAsAttribute(UnmanagedType.Bool)]
    public static extern bool MoveFileExW([InAttribute()] [MarshalAsAttribute(UnmanagedType.LPWStr)] string lpExistingFileName, [InAttribute()] [MarshalAsAttribute(UnmanagedType.LPWStr)] string lpNewFileName, uint dwFlags);
}

QText 3.00 (Beta)

Those with big number of files in QText have reason to rejoice. This version brings support for multiple folders. Unfortunate “victim” here are hidden files that are no longer with us. Do not worry - they are still accessible - installation procedure will move them into separate folder.

Corporate users might find it useful to run QText without installation. Running without installation was possible in previous versions but it also meant that QText left it’s traces around system. Now QText will only write in sub-folder from which it was started and nowhere else.

While QText has no synchronization mechanism by itself, special care was done in this version to make it behave more friendly toward third-party software (e.g. SugarSync and DropBox). This should prevent crashes caused by someone else holding file open.

Saving is now done 2.5 seconds after your typing has stopped. If file cannot be written to because some other program is holding it (see DropBox) three retries will be done. In addition to that immediate save will be triggered by folder change and closing of program. Of course you can save manually at any time.

I hope that not many users will cry for menu which is gone. All functions are accessible both from toolbar and context menu so there was not much sense in keeping it. Keyboard heavy users can always useorto access toolbar and+to access tab-specific menu. As beforewill bring you context menu for text.

There are some changes to existing shortcuts (++and+) and few new ones. Do consult ReadMe.txt for full list. If you are wondering where key is, that is that key next tothat has picture of menu. And Microsoft called it. Go figure…

Lot of effort has gone into this version to make it as stable as possible so I would encourage all to update regardless of beta status.

Check it at beta page.

One PCB, to Go

Illustration

My hobby is playing with electronics. And that is quite expensive hobby to have. Few years ago any soldering iron would do, but as world moved toward more and more SMD and RoHS components, one needs a little bit better piece of equipment. And that is just start…

As your projects get complicated, sooner or later, you will need professionally made PCB. Things are made little bit more difficult by the fact that you have no need for thousands of boards. All that you need is one or two of them. And you need that at affordable prices.

One place where amateurs can get PCBs made cheaply is Laen’s PCB Order at Dorkbot PDX site. Whole PCB manufacturing is work of one guy. You send him design, he will add it to his PCB panels combining it with orders from other customers. As he collects enough orders he just forwards this to professional PCB manufacturer. Since there is whole panel or more, cost (per board) is way lower than what you would be able to get at from same company.

PCB that you get from Laen is very recognizable since it is colored purple! Although he promises just plain lead-free HASL almost every time I got nice ENIG (aka gold) finish. On amateur level there is hardly need for such good finish but I must confess that it looks brutally good on purple board. Specification of PCB includes 6/6 traces on 2-layer board with soldermask and silkscreen on both. Not bleeding edge but probably more than any amateur will need.

Small curiosity is also that you can order PCB only in threes. That is, you can have 3, 6, 9 or any other multiplier at humble $5 per square inch (per three). If you have board design that measures 4 square inch, you will pay $20 for three PCBs. While shipping is free withing US, international customers need to pay $5 more (which is better deal than anywhere else).

While I do use some other companies as well (e.g. BatchPCB and Fusion PCB) I would say that Laen has simplest process of them all. Just zip damn files and he will sort it out. :)

I would not say that Laen is cheapest option for any board size. Nor I would say that boards are absolutely best quality. Neither I would call purple best color there is. What you get here is high-quality board at more than acceptable price and helpful human on other side. As long as it stays like this, I have found my PCB house.