MikeScott8 Programming Thoughts

My musings, ponderings, and other posts on programming. And maybe gadgets and other nerd stuff.

Leave a comment

Task.Status refresher and thanks to Jeremy Clark

Last month (Sept 2015) at the user group I help run (http://nwvdnug.org) we had the pleasure of Jeremy Clark come out and give a talk on Task, Await and Async programming.

I’ll Get Back to You: Task, Await, and Asynchronous Methods

There’s a lot of confusion about async/await, Task/TPL, and asynchronous and parallel programming in general. So let’s start with the basics and look at how we can consume asynchronous methods using Task and then see how the “await” operator can makes things easier for us. Along the way, we’ll look at continuations, cancellation, and exception handling.

One of the things he covered was something I saw a fellow programmer at work run into. The issue is when a Task completes you have a couple properties “IsFaulted”, “IsCompleted”, and “IsCanceled” and the fact that IsCompleted just means it is done running and this is set to true even if faulted. Therefore you cant use it to tell that the task ran to completion SUCCESSFULLY.

I remembered in the talk this came up and was discussed and way to handle it nicely was given. I could not recall exactly the way Jeremy showed that handled it and went searching for more on his site. I found the following post


And reading through that post I found the information I wanted.

Thanks again Jeremy! And if you are near anyplace he speaks (which is LOTS of places) I would go see him. He is a really good presenter and covers his topics in a well organized way and really gets the concepts across well.

Check his site and his upcoming speaking is right on his home page.

Leave a comment

Great tip for testing web apps

I often ran into the issue when testing and debugging web applications and sites that I would often have to clear cookies and caches in order to effectively work.

This tip posted by Scott Hanselman is a good one, I had not heard of, let alone thought of. In his post he talks about adding Chrome in incognito mode and Internet Explorer in private mode to Visual Studio. Both of these effectively means any cookies or cached data you create during that session would/should be removed when you close that browser. This should make it easier than having to manually clear that data when testing.

Leave a comment

Quick Unit Testing Thought

Just a quick thought I had the other week while driving to work.

I was driving to work and thinking about a unit test I had been in process of writing the previous night and what assertions I had to add to it. And just from that realized I had written my service that was being tested with multiple database calls that could be reduced to one, and then some local filtering in the service.

So just the THINKING of my unit tests, led me to some reduction in the service to database calls.

That’s all just a quick random development thought I wanted to pass on.

Leave a comment

Desert Code Camp Presentation Oct 2014 Slides and Code

Last weekend I presented a session at Desert Code Camp named “Using BreweryDb.com API with Xamarin Forms” I am redoing it tonight for my user group.

Here are the Slides for the presentation, not that there was much in the slide deck but it’s here in case someone wants it :)

The code is posted to my GitHub :

The code at the end of the presentation is the second commit and that night I added the next step I was going to do but didnt have time to do and that’s the third commit. I hope to add the last item I wanted to do in the presentation with some Xamarin Forms Labs and Geolocation to the project and will add that to the repo as well when I do.


Building native cross platform apps using C# and Xamarin

So last week Xamarin developer evangelist James Montemagno was in Phoenix giving several presentations. Two of which I attended, the first one I went to was at the user group I started in the Northwest Phoenix Valley, NWVDNUG (Northwest Valley .Net User Group) when he gave an overview of Xamarin and it’s capabilities. Then a few days later, on Saturday I went to a workshop arranged by Joe Guadagno which he went deeper into the Xamarin tools, and walked through some of the newest functionality they recently introduced, Xamarin Forms.

I have been learning Xamarin development the past few months, and even submitted my first iOs app done using C# and Xamarin (which did get approved and is in the app store – it isn’t the best looking app as I am a programmer and not a designer). And within a few days (as I recall) of that submission Xamarin announced version 3 and Xamarin Forms. From the announcement it seemed that Xamarin Forms would have been very useful, as well as some of the newer design tools introduced in version 3, as I struggled with some of the Xcode tools trying to get the colors set for the app.

At that workshop, James walked all the attendees through our first Xamarin Forms app. I really liked the ease of use in creating cross platform USER INTERFACES (yes the UI) in C# code, or even using XAML to build the screens to be used across the various platforms. These screens use custom controls that are abstractions of native controls used on the various platforms. Read more about Xamarin Forms over at their site.

Well, originally I started this post to talk about my experience since that work shop, redoing my iOs app using Xamarin Forms, and at the same time creating my first Android app, and also replacing the old WP7/8 app I had created in the past. All these apps will have feature parity with each other and look similar but not exactly the same thanks to Xamarin. Each platform will use native controls and paradigms for the respective platforms while I write the User Interface just one time.

But since I got kind of long winded on this background post, I will hold off on the details of my journey on this trek for future posts. Well I might write one or two tonight, but schedule them to post in the future. Or I might go back to coding, as it’s such fun to so rapidly iterate over the screens and see them on various emulators.

Hope you come back to read future posts in this “series”

Leave a comment

Testing in various versions of Internet Explorer

I found today a nice page with various Virtual machines for testing with various versions of Windows and Internet explorer. If I had my choice I wouldn’t have to test against older versions of IE, or not at all, but we have to honor our clients requirements for their internal IT specifications.

So I thought this might be useful page to others in this situation, so here is the page.


and as an easter egg, scroll down the page to some of the Windows XP VMs and see if you can find the game to “end XP”


Get every new post delivered to your Inbox.

Join 2,821 other followers