Visual Studio 2015

Illustration

Rejoice, Visual Studio 2015 is here.

Newest member of family is a Community edition and that one will probably be the most popular choice out there for all that can legally own it. Those working for “the man” will find Professional and Enterprise edition at their rather steep prices ($500 and $2500 respectively).

Pleasant surprise is that Express editions are also available for those who cannot use Community edition and their boss is too cheap to get them Professional. This is also an edition which comes with least strings attached so don’t discount it immediately.

There might be no revolutionary feature but lot of small improvements (mostly driven by Roslyn) do make it a slightly better environment for all things .NET.

Retrieving Commit Number in Git

As I moved from Mercurial to Git I got hit with annoying problem. You see, in mercurial it is trivial to get commit number and commit hash. All you need is:

FOR /F "delims=" %%N IN ('hg id -i 2^> NUL') DO @SET HG_NODE=%%N%
FOR /F "delims=+" %%N IN ('hg id -n 2^> NUL') DO @SET HG_NODE_NUMBER=%%N%

Yes, it is not the most beautiful code but it does get the job done. With -i parameter we get hash and -n is what gives us commit number. And commit number is so useful for automated builds. Yes, hash will uniquely identify the build but humans tend to work better with numbers - e.g. setup-53-1d294c0f2737.exe is much better than setup-1d294c0f2737.exe alone. If numbers are there it becomes trivial to determine what is the latest build.

Mercurial has also one more trick in its sleeve. If changes are not committed yet, it will add small plus sign to its output, e.g. setup-53-1d294c0f2737+.exe. Now with one glance in a full directory you can determine order in which builds were done, what branch are they on, and if all changes were committed at the time of build.

How do you do the same in Git?

Getting revision number is trivial. Just ask git to count them all:

FOR /F "delims=" %%N IN ('git rev-list --count HEAD') DO @SET VERSION_NUMBER=%%N%

Getting hash is similarly easy:

FOR /F "delims=" %%N IN ('git log -n 1 --format^=%%h') DO @SET VERSION_HASH=%%N%

But there is one problem here. Hash is exactly the same whether all changes are committed or not, i.e. there is no plus sign if there are some uncommitted changes during build. And I believe such indication is crucial for any automated build environment. Fortunately Git will give you wanted information with a bit effort:

git diff --exit-code --quiet
IF ERRORLEVEL 1 SET VERSION_HASH=%VERSION_HASH%+

So final code to get Git hash and commit number equivalent to what I had in Mercurial was:

FOR /F "delims=" %%N IN ('git log -n 1 --format^=%%h') DO @SET VERSION_HASH=%%N%
git diff --exit-code --quiet
IF ERRORLEVEL 1 SET VERSION_HASH=%VERSION_HASH%+

Windows 10 USB Install

Illustration

Installing Windows 10 via Windows Update works surprisingly well. However, such upgrade leaves you stuck with partition layout you might not like. Sometime best course is installing from scratch.

First step to prepare installation is getting .iso file and Microsoft always provides a way to do it. With Windows 10 it is Microsoft Media Creation Tool.

Second step is to prepare bootable USB drive. This step can be done by tools but, if you want UEFI boot, you want to do it manually. Most of tools currently available format disk as NTFS and that file system is not supported by UEFI boot process. Yes, most BIOSes still have support for legacy mode but you do lose some boot speed improvements and there are security implications.

In regards to UEFI do notice that it isn’t really important if your processor supports 64-bit OS or not - if your UEFI system is 32-bit you better install 32-bit Windows too. This weird situation of having 32-bit UEFI only with 64-bit capable processor often happens with Atom tablets. Just treat them as 32-bit system and you’ll be fine. On more capable laptops and desktops UEFI usually has support for both or rarely for 64-bit only. Rule of the thumb is to get 32-bit .iso if you are dealing with tablet and 64-bit otherwise.

Procedure is actually simple. Just write DISKPART on start screen and you will be greeted with security prompt after which you will have old-fashioned textual interface. In my case USB was disk 3 (you can deduce it based on size) but your case will probably differ. Double check which disk you are selecting because DISKPART does destroy data:

DISKPART> LIST DISK
  Disk ###  Status         Size     Free     Dyn  Gpt
  --------  -------------  -------  -------  ---  ---
  Disk 0    Online          476 GB      0 B        *
  Disk 1    Online          931 GB      0 B
  Disk 2    Online         7168 MB      0 B
  Disk ^^3^^    Online         7648 MB      0 B

DISKPART> SELECT DISK ^^3^^
Disk 3 is now the selected disk.

DISKPART> CLEAN
DiskPart succeeded in cleaning the disk.

DISKPART> CREATE PARTITION PRIMARY
DiskPart succeeded in creating the specified partition.

DISKPART> FORMAT FS=FAT32 QUICK
  100 percent completed

DiskPart successfully formatted the volume.

DISKPART> ACTIVE
DiskPart marked the current partition as active.

DISKPART> EXIT

Assuming that your, newly created and empty, USB drive is under letter U: and your Windows installation disk is at W:, you can use XCOPY to transfer files. Press + to get a prompt where you can enter following command:

XCOPY W:*.* /e /f U:\

Last step is to boot machine while pressing <F2> (or some other key; <Del> used to be popular) to enter BIOS. Since boot is extremely fast, I always need a few attempts to get inside. :)

Depending on the BIOS, option might have a slightly different name but most of them have “Boot override” section somewhere. Your new UEFI USB drive should appear there. Just select it and boot should ensue.

Enjoy your clean installation.

PS: Same procedure actually works for any UEFI system - from Windows Vista onward.

QText 4.00

Illustration

For its 4.00 version QText has received major refactoring with almost 100 changes separating it from the previous release.

Visually it is easy to see where some time went as there is new application icon together with new high-resolution toolbar icons. Yes, QText had high-DPI support for some time now but that always meant dealing with blurry toolbar buttons. With new graphics you should be greeted with crisp graphics no matter which resolution you’re using. It was a long overdue improvement.

Due to its internal structure, detecting external changes in files was not always straightforward as it should have been. Due to this experience with DropBox or similar file syncing software was not ideal. Long hours have been put into this version to recognize many external changes. Whether it is simple file edit in another editor or folder rename, QText will have you covered.

Lastly there was a push to cleanup some of the old and annoying bugs. All these changes should make QText more comfortable to use.

As always, you can download new version directly or use built-in upgrade menu.

PS: Order of your tabs will be reset to alphabetic with this version. This is a one-time change. QText will continue remembering tab order once you (re)order them again.

Books

Cover

Those more observant among you might have noticed there is a books tab up there. Yep, I am a published author now.

While both books are more of a reference material than what you would usually consider a book they did require quite a lot of work - especially getting formatting and publishing just right. Those interested in that aspect can view what raw sources looks like and what goes into making a proper e-book.

(73) AF7RG