Immediate Window and Visual Studio Hosting Process

Illustration

When you are debugging in Visual Studio it might be really hard to tell whether you are using Visual Studio hosting process or not. Yes, there are subtle differences but nothing that would affect anybody developing full-trust desktop applications. Unless you are fan of Immediate window (Debug -> Windows -> Immediate).

I personally adore that little window. When you hit a break-point you can use it to view whatever expression your heart desires, all with variables as they are during runtime. If you notice error (or you deliberately want to have it) in one of your values you just write myVar = 42 and value is there. Complexity of what you can do has no limit.

You can use this window even if application is not running. Just write whatever expression you want (e.g. ? 4 + 2) and you will get your result. Unless you have compile error and Visual Studio hosting process is disabled.

Among a few documented usages there is mention of design-time expression evaluation. It simply states that, in absence of hosting process, any evaluation (even simple addition) will trigger starting executable. This is not really something to worry about because it is done seamlessly. Unless you happen to have compile-error.

If you love immediate window, don’t uncheck Visual Studio hosting process debug option. Otherwise you will lose Immediate’s window functionality when you need it the most.

No More Triple-double

Illustration

After seven years of www.medo64.com I decided to follow fashion and drop www. I was pleasantly surprised how easy it was.

Since these pages are WordPress-based, first step was simply changing WordPress and Site address. Since I do want all www.medo64.com requests to be redirected, I decided to adjust .htaccess file. For any request with domain other than current one, it will do simple redirect:

RewriteCond %{HTTP_HOST} !^jmedved\.com$ [NC]
RewriteRule ^(.*)$ http://jmedved.com%{REQUEST_URI} [R=301,L]

And that was it. Frankly, I am still shocked how easy everything went.

[2013-08-18: I went back to www.medo64.com; it just looks better to me.]

Forced Change

For a long time my text editor of choice was PSPad. Over time I got very much used to it and it became standard part of all my installations. Yes, few versions back it had some toolbars that you could deselect if you wanted to. I guess if Oracle can pack a crap with Java installation, so can everybody else.

Nitpickers would say that you can always download files without installer and copy them on system manually. In my opinion, installer is integrated part of software experience and, if you don’t have installer, software is unsuitable for any use. It will get on my system only if it offers something that you cannot otherwise get. I have few such tools and almost all of them are part of Sysinternals family.

Latest version of PSPad went a bit too far for me. In EULA you will find that “PSPad editor installer contains third party bundled software provided by InstallMonetizer.” And there is no way to install PSPad without getting it on your system. No checkbox, no anything. Just a paragraph that is visible ONLY if you scroll down to the very end of EULA. Yes, we all read those.

There is only one real replacement for it - Notepad++. It comes at same price point (freeware) and it covers most of my text editing needs. No, it does not have hex mode. No, it does not know how to wrap and unwrap HTML and XML. But those operations I used rarely anyhow. Most important feature at this time is clean installation.

Other program I had to replace is GOM Player and I already wrote a bit about it. Something that used to be nice and comfortable player became bundling annoyance during installation and upgrades. It might seem that I have some sort of fetish when it comes to Korean media players.

My new choice is named PotPlayer and I haven’t found a thing missing compared to GOM Player. Downside is that home page comes only in Korean which is not really language I understand. Fortunatelly, there is up-to-date list change log in English and there is an English installation.

Now only if I could find some other Java installation…

PS: And don’t even mention KMPlayer. It is bundled with Softronic’s download manager.

UEFI Windows 8 Install on Asus N56VJ

First thing I always do on a new computer is fresh installation of Windows from USB. With Asus N56VJ I had an issue. Everything worked when I used BIOS compatibility mode, but UEFI boot failed.

In order to create USB installation media I used Microsoft’s Windows 7 USB/DVD download tool. Use of that tool results in NTFS on USB. UEFI usually requires FAT32 installation media. Therefore I had to create bootable medium myself as I used to do..

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:

[PID]
Value=XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

After copy finishes, we have a Windows installation USB on our hands. Since Asus stores its Windows key in a BIOS you will have an issue if you want to apply your own Windows key - setup just never asks for it. One solution is to create PID.txt under U:\sources. It should have following content (with XXXXX-XXXXX-XXXXX-XXXXX-XXXXX being your key):

[plain] [PID] Value=XXXXX-XXXXX-XXXXX-XXXXX-XXXXX [/plain]

Next step is to boot machine while pressing <F2> to enter BIOS. Since boot is extremely fast, I always need a few attempts to get inside. :)

In BIOS we just select USB disk under Boot Override on Save & Exit tab. Once setup starts, proceed as normal. Windows will create GPT disk and all needed partitions itself.

[2014-09-20: Same procedure works for Windows 8.1 too]

Death and Its Consequences

My love/hate relationship with HP 6730b ended in ultimate death for one of us last Thursday. I cannot say it came as a surprise because it started acting up after (accidental) fall off a desk in a lab.

From that time on it would sometimes power off if tilted or shaken. Since I used it mostly as my work desktop, I just took care not to tilt it and I was golden. My goal was to prolong its life until I get back home. I almost succeeded.

Since Friday was a working day, I had to find suitable solution before morning was up. To make things worse, installation I needed was in bootable Windows 7 vhd on top of a Windows 8 system.

I took my other laptop and swapped hard disk nervously awaiting Windows 8 boot loader to give me some nonsense about incompatible drivers. Windows 7 booted up, detected new chipset and graphics card, and rebooted. Next boot brought me to perfectly working desktop.

Yes, Office did complain about license. Yes, passwords for wireless networks were forgotten. Yes, not all drivers were in order. But, you know what? I survived my work day just fine.

Last time I did this procedure it was on Windows XP and it was a pain-in-the-ass to sort everything out. It is nice to see that Windows boot and driver handling has improved tremendously during years.