Friday, June 26, 2009

VirtualBox and Windows 7

I'm writing this from a Windows 7 computer. It's running on Sun's VirtualBox, a free, open-source virtualization product that is installed on my Vista box. I can put Vbox into fullscreen mode, and then there's no hint that it's running on a virtual box. It looks and feels like you have a pc with Win7 installed. Or... I can put Vbox into seamless mode, and then I'm back at my Vista desktop, but I can still run Win7 apps and they appear on my desktop as if they were Vista apps. Pretty cool.

I tried using the Microsoft Virtual PC 2007, and it did work, but I think the Sun product works better, and it definitely gives me access to more of the physical machine's resources. Sun's Vbox required me to go into the BIOS and enable the iVT setting (Intel Virtualization Technology®) before I could successfully install Vbox. Windows 7 is a free download from Microsoft until August 2009. It expires in July 2010, but until then it's a free preview of Microsoft's next OS.

I just tried to upload a screenshot - and totally forgot that the pictures are on my "real" computer. That's how good the illusion is. I'll publish what I have and switch back to the real computer where my photos are located. (Back in Vista now.) This is my Windows 7 desktop before I began installing applications. (Click image to enlarge.)

Win7

(Back in Windows 7.) Now, check this out. I wanted to post a picture of the Windows 7 desktop in fullscreen mode. So I went back to Windows 7, put it in fullscreen mode, hit "Print Scrn", opened Paint, hit Ctrl-V, saved the image to my Win7 pictures folder, started up Firefox and now I'm writing from Win7 again. Here's the desktop in fullscreen mode. (You'll notice I've added a few icons to the desktop.) Notice, also, the desktop is no longer in a "box" as in the above photo. There's no way to know that this Windows 7 desktop is really just a process running on a Vista machine.

Thursday, June 25, 2009

Dog Zoe

My previous post was about Zack and Zoe, only I didn't have a real photo of Zoe, only a composite photo, a 'shopped impression of Zoe, all fur and teeth. And bark. A lot of bark. I managed to get this photo of Zoe. (OK, maybe it's been 'shopped just a little.) I don't know what Zoe looks like when she's being nice. I haven't yet experienced that side of her nature.

Wednesday, June 24, 2009

Dog Zack

I mentioned my neighbor's Schnauzers, Zack and Zoe. Here's Zack...

He's a sweetheart. He just wants to be friends and lick you and get petted.






I don't have a picture of Zoe; however, through the magic of Photoshop (actually, Paintshop) the picture below represents my impression of Zoe when I got a little too close to her. I imagine this is the last thing you would see as Zoe lunges for your jugular and bites your head clean off.

Carey, her owner, says she's going to train Zoe not to do that.

I say, capital idea.

Windows 7

Even as I type these words, I'm installing Windows 7. I want to take it for a test drive, and see if the software I've written will run on it.

I downloaded Windows 7 RC (release candidate). The only pc I have with enough horsepower to run Windows 7 is my home pc with Vista Home Premium. I certainly don't want to upgrade my Vista system to a release candidate of unknown stability that will expire next year, and making a dual-boot system offers ample opportunity to screw up my computer (recall Murphy's law: If anything can go wrong, it will go wrong.).

I decided to install Windows 7 on a Virtual Machine. I would have liked to use VMWare Workstation, but that costs $189. Microsoft Virtual Machine 2007 is free, and I already have it installed on my pc. I use it to test software in a Windows XP environment. So I created a new virtual machine and started the Windows 7 installation. Even though I have a 64 bit computer, I had to install the 32 bit version of Windows 7. The Microsoft Virtual PC program apparently can't handle 64 bit code, but that's a minor detail.

(Time passes...)

It's done. The installation went quite smoothly and took about 20 minutes, then came the setup (account name, time zone, product key, etc.) which took about 5 minutes.

Here is a screenshot of the Windows 7 default desktop after a clean install. This is the default desktop background - Windows 7 comes equipped with a number of images from which you can choose your desktop background.


(More time passes...)

At this point I am writing this blog from the new Windows 7 machine in full screen mode. I had to reboot my computer before I was able to install VMAdditions. I probably only needed to reboot Windows 7, but rebooting the host covers all the bases. If you install VPC you will definitely want the VMAdditions. And, when I tested a program I had written primarily for Vista, it didn't function properly until I rebooted.

Here's the desktop background photo I decided to use - for a while, anyway.

Tuesday, June 23, 2009

RxReminder tested again / Zack and Zoe

Yesterday, I finished coding version 3 of the RxReminder task scheduler interface (one for Vista, one for XP). Last night it underwent its first sea trial, and it hit a sandbar.

I puzzled out what had gone wrong. There was no bug in the task scheduler interface; it worked as designed. There was no bug in RxReminder; it worked as designed. The new task scheduler interface has a different behavior than the old interface, a behavior that RxReminder was not designed to accommodate. Adding about 4 or 5 lines of code to RxReminder should take care of that. I'll test it again overnight.

I was outside a little while ago when I heard a lot of barking and looked up in time to see a gray schnauzer go whizzing past, chasing a black cat and trailing a pink leash. It was running faster than I could, but not faster than Carey - my neighbor two doors down the street. She caught it, so I said congrats on being in good shape - a hundred fifty foot sprint and she's not even breathing hard. So she stopped, we talked, and I got introduced to her two dogs, her "children" Zack and Zoe. They're siblings. Both are barkers, but Zack soon showed he was a lover, not a biter. He just wanted to lick my face and hands. Zoe, however, has pretensions of being a pit bull. She's definitely a biter. I wish Carey luck and patience while training those dogs. Sometimes you can get a dog and end up being lucky; you get a dog that requires little or no training. Some dogs just have very good natures. Other times you get a dog that has a nervous disposition, or neurotic, or irritable, or whatever. And then you have to train your dog. You'll be happier, and the dog will be happier. Too many people don't want to bother.

I wish I had thought to take out my cel phone and get a picture of Zack and Zoe. I'll try to remember to do that next time I meet them.

New task scheduler interface runs aground

I finished version 3 of the RxReminder task scheduler interface yesterday, and last night it got its first sea trial, and it hit a sandbar.

I entered med Alerts for 8 AM and 8 PM. Here's what the revised scheduler should have done. At 12 midnight, the computer should awaken and run RxReminder. RxReminder would have looked for the first Alert time (8 AM) and put it into the scheduler. Actually, there is a factor called WakeAnticipate: a lead time subtracted from the wakeup time to allow the system time to wake up; the default is one minute. RxReminder should therefore schedule itself to run at 7:59 AM. I checked the computer shortly after 10 AM. I was hoping to see a red X on the reminder's status, indicating the Alert was issued but there was no response. Instead, I saw a question mark, meaning the Alert was not issued. This was disappointing and puzzling.

I looked at the program's log file, and this excerpt was very interesting:

Stopped : 11:26 PM, Monday, June 22, 2009
Started : 12:00 AM, Tuesday, June 23, 2009
Resuming: 12:00 AM, Tuesday, June 23, 2009
Stopped : 12:00 AM, Tuesday, June 23, 2009
Started : 12:00 AM, Tuesday, June 23, 2009
Stopped : 12:00 AM, Tuesday, June 23, 2009
Started : 8:00 AM, Tuesday, June 23, 2009
Resuming: 10:10 AM, Tuesday, June 23, 2009

I stopped the program at 11:26 PM; I wanted a full test of the scheduler, meaning that the program should start itself. At 12 AM it did. Here, something strange happened. The program shut down (not logged), resumed, stopped, started, and stopped again, all at 12 AM. It apparently did schedule the 8 AM Alert, but it should have awakened at 7:59 AM. Instead, it awakened at 8 AM. The Alert is issued at the moment when 7:59 AM changes to 8 AM

Monday, June 22, 2009

RxReminder Task Scheduler Interface - Redux

I just finished version 3 of the Task Scheduler interface - make that two task scheduler interfaces, one for XP and one for Vista.

The first version put a wakeup task into the Task Scheduler for each Alert time. Conceivably, you could have scores of tasks in the Task Scheduler just for RxReminder Alerts. It was bulletproof enough; all the scheduled Alerts were in the Task Scheduler, so there was no way the Task Scheduler could miss an Alert. But with possibly dozens or scores or, conceivably, hundreds of RxReminder tasks in the Scheduler, it sure didn't seem very elegant. So I came up with version 2.

Version 2 put just one task in the task scheduler, but it had multiple triggers: one trigger for each Alert time. It seemed like a fine idea, and once again a bulletproof solution - all Alerts had triggers in the RxReminder task - but then I discovered (by experimentation) that there is a maximum value for the number of triggers a task can have. I had both daily and runonce triggers, and when I hit 47 it would take no more triggers. So I came up with version 3.

Version 3 puts one RxReminder task into the Task Scheduler and that task has 3 triggers. When RxReminder is started, and whenever a change is made to its dataset, the program searches for the next med alert and next appointment alert for the current day and adds their times to the RxReminder task triggerlist. And, the RxReminder task also includes a daily trigger at 12 AM. The 12 AM trigger ensures the computer wakes up and runs RxReminder at the start of each day to scan for the first Alert of the day and put its time into the Task Scheduler.

This version is NOT bulletproof, because the Task Scheduler contains only the next Alert for the day and not all scheduled Alerts. But I like this version. It seems to be the most elegant version, and I hope it is the final version.

Oh yeah, I also mowed the yard and washed and dried and folded and put away laundry today. The fun just keeps on coming.

Wednesday, June 10, 2009

RxReminder inches closer to finish

RxReminder is getting closer to its final destiny, which possibly is a big yawn. In the last few weeks I've finished writing the code that calls upon the Task Schedulers (both XP and Vista) which wake the pc from sleep mode so an Alert can be issued. Also, I've tweaked the code to keep the system from going back to sleep until the Alert is closed.

What else have I done lately? Oh yeah ... there was a bush in my back yard, kind of tall and scraggly-looking and with no function other than to serve as an obstacle to vehicles entering or leaving the back yard. I called it George. You know - George the bush. Now, it's gone. Or, mostly gone. There's a 12 inch (30 cm) tall "stump" (more like the top of a rootball) that I still have to deal with.

2004_0424Image0019 (left) George the bush in his more "blossomey" days, which occurred mostly in April. The rest of the year he was an obstacle to mow around or dodge with a car.






DSCF0961b
(right) George the bush  sporting his new buzz cut. Gone but not forgotten; not until I get that dang rootball chopped down to ground level. I see a pickaxe in my future...






Speaking of "Gone", whatever happened to Joey Heatherton?