Friday, January 25, 2013

Tiny Impressions of Windows 8

Since Microsoft gave me a really good deal on the upgrade, I’ve been running Windows 8 since late 2012. For the most part, it feels like Windows 7 without the Start Button UI element and the lack of gadgets. Other than playing with Visual Studio Express for Windows 8 and Disney’s Where’s My ???? games (free with the Windows 8 upgrade), I haven’t really touched the Windows RT side of things much. As far as I’m concerned, WinRT is really for touch and the apps are merely available to desk top users. Is this better than Apple’s approach of separating the two worlds with iOS and OS-X? Only time will tell.

I really wish Microsoft was better at helping us transaction into new design concepts. It is true that I can do everything I did in Windows 7 in 8. The bridges between the old and the new are too small and hard to find. This is really similar to when Microsoft imposed the ribbon on us in Office 2007; I know some people who are still ranting about the bloody ribbon 5 years later. The Start Screen doesn’t really bother me, it kinda reminds me of Program Manager of the old days of Windows 3; I can adjust. I just hope I’m not hearing this “Where’s my Start Button” stuff 5 years from now.

Wednesday, January 09, 2013

“Fake Store” my way of testing the transition from IsTrial Mode

Native Trial Mode is an important feature of Windows Phone 7; there are several articles about simulating being in Trial Mode. My problem was that I had a fairly complex transition between trial mode and full mode I want the premium features to show up right away without requiring the user to restart my application. So I came up with this cute little hack to simulate the session when the user buys.

App Class

Since I want to change the trial state during the running of the program, I need to have a way to re-query trial state and communicate the change of status to the rest of the program. I could query the trial mode every time I ask, but that would be bad for performance and network chatter. Notice that there is a conditional compilation symbol called FAKESTORE, the code within the #if block is only compiled if the symbol is present. Also note the presence of the DoFakeActivate() method, this is called from the Buy Now code below.

        #region Fake Store Code
public static bool IsTrial { get; private set; }

public static event EventHandler ApplicationActivated;
private void DetermineIsTrial()
{
bool armEvent = false;
bool newIsTrial = getIsTrilaFromLicenseInformation();
// I only want to fire the event when we are transitioning from
// trial to full license, I also want to have IsTrial reflect
// the current state, so I will remember to fire the event
if (!newIsTrial && IsTrial)
{
armEvent = true;
}
// Update the IsTrial status
IsTrial = newIsTrial;
// And fire the event (if necessary)
// This code will only be run once per user.
if (armEvent)
{
if (ApplicationActivated != null)
{
ApplicationActivated(new object(), EventArgs.Empty);
}
}
}
private static bool getIsTrilaFromLicenseInformation()
{
#if FAKESTORE
return !_fakeActivated;
#else
var license = new Microsoft.Phone.Marketplace.LicenseInformation();
return license.IsTrial();
#endif
}

#if FAKESTORE
private static bool _fakeActivated = false;
public void DoFakeActivate()
{
_fakeActivated = true;
DetermineIsTrial();
}
#endif
#endregion
Fake Store Code

And I need to determine if the app is in trial mode when the app is launched and activated.

// Code to execute when the application is launching (eg, from Start)
// This code will not execute when the application is reactivated
private void Application_Launching(object sender, LaunchingEventArgs e)
{
DetermineIsTrial();
}

// Code to execute when the application is activated (brought to foreground)
// This code will not execute when the application is first launched
private void Application_Activated(object sender, ActivatedEventArgs e)
{
DetermineIsTrial();
}

Normally when you buy an app using MarketplaceDetailTask, the app is re activated when the user returns from the store. Because I call DetermineIsTrial from the Application_Activted, the app will be in paid for mode when the user returns.

Buy Now Form


When I run the app in Visual Studio, I get an error message from the Store and anyway, LicenseInformation.IsTrial will always return false in Visual Studio.

        private void _btnBuyNow_Click(object sender, RoutedEventArgs e)
{
#if FAKESTORE
if (MessageBox.Show(
"Here we would send you to the app store.\n" +
"Do you want to simulate activation?",
"Fake App Store", MessageBoxButton.OKCancel)
== MessageBoxResult.OK)
{
var x = ((App)Application.Current);
x.DoFakeActivate();
}
#else
MarketplaceDetailTask marketplaceDetailTask = new MarketplaceDetailTask();
marketplaceDetailTask.Show();
#endif
}


It is necessary to call App. DoFakeActivate() to tell the App object to change the value of App.IsTrial. The user experience is radically different than normal


.fakestore_buynow


Setup Custom Configuration


I like to switch between developing / testing this part of the program and other tasks and I don’t want to have to alter actual code to change modes, so I create a custom configuration. To create a new configuration:

1. Build => Configuration Manager

2. Select <New…> from Active solution configuration:

NewConfig


3. Give it a name

4. Click OK

NewConfigName


5. Right click on the StartUp Project => select Properties

6. Select the Build tab

7. Add “;FAKESTORE” to Conditional compilation symbols


AddSymbol

Tuesday, January 01, 2013

The Geek Armando

Return of the Natives

Last week I saw Return of the Natives, a really cool improv at the Blue Door Theatre. They did a show based the Armando, a form where a monologist tells a story and then the improvisers improvise on the story, the monologist tells another story, more improv, each feeding into the other until they run out of time. In this show, the monologist was a standup comedian and she started out with a bit from her show (she now lives in LA), the improvisers where originally from Spokane but have moved away to places where they could get paid to do improv.

.NET Rocks #300 and others

In DNR # 300, Richard Campbell tells geeky tales of his early hacking as a kid in the 1970s and 80s. He told stories about how he built an Electronic Rocket Countdown Timer at 10, fixed computers for grownups, solved a difficult hardware problem by replacing the hardware, built a server farm in his house, etc. He even tells “The Goliath Story” (I can’t give it justice, just listen to it). I’ve heard Richard geek out on other podcasts on other podcasts like Hanselminutiae. I’ve heard other geeks tell tales of great geekdom on blogs, podcasts, the speaker’s room at code camps, at work, etc.

Improv in the workplace

Years ago I learned that Infusion Development offers improv classes to their associates. They even have a video on youtube. This knowledge is one of the factors that lead me to start taking improv classes at the Blue Door. Ted Neward gave an improv session at the 2012 Seattle Code Camp. There are countless articles on the business benefits of teaching improv to your employees from sites like businessweek.com, foo.com & careerbuilder.com. I’ve written about my experience with improv.

Fantasy – Putting it all together

I would like to see an Armando style show based on the monologs of a visionary/character of our industry with improvisers who are geeks. This performance could take place at an industry conference, code camp or such.

Richard Campbell would be an excellent choice to be the monologist, but there are others out there who could tell great stories. I’ve heard other geeks tell tales of great geekdom on blogs, podcasts, the speaker’s room at code camps, at work, etc. The monologist must be someone who can get up there and talk and tell good stories. There could be a dialog in the form of an interview in place of the monolog; a good interviewer can help bring out the character if the principal is otherwise shy.

Infusion Improv would be an excellent choice for the players. I hope there are other companies that offer improv training, one of those companies could send their improv all-stars or the geek improvisers from the host city. If a company provided the improvisers, they could get some recruiting PR points.

Thursday, December 27, 2012

Windows 7 Activation Heck

A long time ago, I noticed that my hard drive was behaving suicidal. so I bought a new one, copied the old one with Ghost and installed the new one. Everything ran fine for awhile (I wasn’t getting updated from Microsoft, but I wasn’t paying attention), so everything was bliss as I continued to use my computer.

Then, behold, I was informed by Windows Activation Technologies that my Windows wasn’t “Genuine”. I figured that my windows license was destroyed with my HD, so I clicked “Resolve online now” and ended up buying a “Get Genuine Online Kit” online. Microsoft gave me a new Product Key on the spot. I entered it and I still got the message. A week later, the software came in the mail; I tried and failed to upgrade couple of times and it failed each time telling me that my computer isn’t compatible with Windows 7.

A couple of days ago I downloaded MGADiag.exe and when I run it, it tells me that my Windows is “Genuine”:

IsItGenuineOrNot

Update

Someone on answers.microsoft.com suggested that I reinstall my Intel Rapid Storage Tech driver and so far so good. Windows Update even works.

Wednesday, November 28, 2012

Testing and Medicine

Lately I have been thinking about testing in areas outside programming. This time I will tackle the area of Medicine.

Medicine

One problem is that you can’t do a unit test without killing the subject. The issue is that you can’t isolate your heart from the rest of the system. It is an area where you are doing maintenance, Doctors don’t build bodies; they have to keep the bodies designed by God or Nature in good working order. Sure they have a limited opportunity to do some refactoring using surgery and medication; there is no Green Field Medicine. It is all maintenance work.

Medical tests appear to be closer to code metrics that the kind of testing we do in software. For example, we know that too much cholesterol in the blood is a bad thing that people with too much cholesterol are more likely to have heart attacks. Does cholesterol cause heart attacks? I don’t know, but based on what we know right now, we need to keep it down below a certain level. Same for blood sugar, blood pressure, etc. There is a correlation between what we are measuring and what we care about. Just like too many GO TO statements and long procedures tend to appear in rotten code.

Modivation

I got a bad cough in September and it has continued through November. I have seen more doctors in the last 2 ½ months than I have in the last 10 years.

Wednesday, October 31, 2012

Testing and The Law

I work in software where test is paramount (some would say that we've gone overboard and spend more time testing than getting real work done...a discussion for later). Well, anyway, I've been thinking about testing in other fields.

Legal

Here testing appears to be expensive. There are many legal documents out there but few are ever tested. By testing I mean brought before a judge or jury for a decision, and the test isn't complete until the appeal process is completed.

The result of the test is based on human interpretation of the document and the law. There are various theories of law and you may get a different result based on who hears the case.

Much of it is settled without testing. The two sides asset their position and the law and come to an agreement. It is often based on the strength or weakness of each side of the case.

Since the law is based on president, or what was decided before, some people will deliberately test a law (bring it to trial) in hopes of changing the law based on the decision - a test case.

Motivation

I am trading my condo for another one of greater than or equal value. Well, anyway, the other party dropped off the documents to complete the deal. Reading them got me thinking.

Sunday, September 30, 2012

Healthcare: My Struggles with a Complex System

Earlier this month my decided to be less cooperate and developed a condition that I still don’t understand. So far I’ve been to “the doctor” 3 times and visited the pharmacists’ after each visit. I’ve missed more days this month that I’ve missed in the previous 3 years. I was even tested for Whooping Cough (I don’t have it).

I am dealing with a complex system that I don’t understand. Right now this system is important to me, so I am forced to wade through it the best I can. Perhaps this is the way non-nerds teal with technology and other things that I deal with every day.

First I didn’t know how to enter the system. I had the cough for over a week and things weren’t getting better; I hadn’t bothered to doctor up before the crisis (I should schedule these things better). Now supposed that I was a 75 year old woman who wanted to get a new tablet (my improv skills come in handy here). Do I get an iPad, Kindle Fire, Nook Color or some other thing I’ve never heard of? Would I even know of anything other than the iPad? What is it supposed to do anything? How much do I want to bother my son with question about the new thing? Etc.

So, I finally get myself to the doctor’s office. What do I say? What is relevant? What is too much information? Did I leave something out? Am I falling into the “ask your doctor about [sponsored drug name here]” trap? Now suppose that I need custom software to solve some problem. How much does the program need to match my current process? Do I care if it is written in Java, .NET or X86 Assembler? How do I know if the software vender is any good?

As a programmer, Search is my friend; I can Bing with Google and get quick answers to my programming query. I can even tell the good from the bad. When I searched for medical stuff over the last couple of weeks, I would find things to feed my paranoia. (Things like “Lung Cancer”, “Throat Cancer”, anything else with “Cancer” in the name; my perceptions of my symptoms would morph to match WebMD.) When a customer (or friend or family member) finds some article about I’m doing that turns out to be less than relevant or downright dangerous, I should think about my experience with WebMD and deal with them gently.

So, what, I don’t understand this whole medical stuff. What I am trying to do here is suggest that I can use this pain to emphasize with my customers. I mean I can’t forget all the things that I know about programming and technology and even if I did, I would still think different. So when they appear to struggle in my area, I need to remember what it was like to struggle in someone else’s area.