Wednesday, 26 August 2015

Windows detected a hard disk problem

I found this when logging in this morning:

Windows dialog

And some related events in the System event log:

Log Name:      System
Source:        Microsoft-Windows-DiskDiagnostic
Date:          26/08/2015 9:20:08 AM
Event ID:      1
Task Category: None
Level:         Critical
Keywords:     
User:          SYSTEM
Computer:      *****
Description:
Windows Disk Diagnostic detected a S.M.A.R.T. fault on disk ST500DM002-1BD142 (volumes D:\).  This disk might fail; back up your computer now. All data on the hard disk, including files, documents, pictures, programs, and settings might be lost if your hard disk fails.  To determine if the hard disk needs to be repaired or replaced, contact the manufacturer of your computer.  If you can't back up (for example, you have no CDs or other backup media), you should shut down your computer and restart when you have backup media available.  In the meantime, do not save any critical files to this disk.

Log Name:      System
Source:        disk
Date:          26/08/2015 9:20:07 AM
Event ID:      52
Task Category: None
Level:         Warning
Keywords:      Classic
User:          N/A
Computer:      *****
Description:
The driver has detected that device \Device\Harddisk0\DR0 has predicted that it will fail. Immediately back up your data and replace your hard disk drive. A failure may be imminent.

Log Name:      System
Source:        iaStorA
Date:          26/08/2015 9:04:54 AM
Event ID:      4102
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      *****
Description:
Error log: Smart event occured on disk :S2AXWXVT 

Fortunately, this is my D: drive. There’s only a couple of virtual machines there, but nothing I can’t recreate if necessary. That’s the first time I’ve seen hard disk SMART diagnostics kick in like that.

Wednesday, 12 August 2015

DDD Melbourne 2015

Last Saturday I attended the DDD Melbourne conference. I’d decided earlier in the year that I’d like to go along, so it was an extra bonus to learn that I had a session submission accepted too.

Swinburne University with DDD sign

I flew over on the Friday, and stayed at the Pathfinder Motel in Kew (nothing fancy, but it did the job, though the traffic can be a bit noisy). I’d originally looked at the map and figured it was pretty close to the conference venue at Swinburne University’s Hawthorn campus. After I’d settled in to my motel room, I decided to do a bit of reconnaissance of the area and walk down to the campus just to check how long it would take me to get there the next morning.

Map showing route from motel to campusTurns out I probably miss-read the scale on the map, as the round trip turned out to be just short of 8kms. Needless to say I caught the tram on Saturday Smile.

On the plus side, there are lots of cafes, restaurants and a cinema on Glenferrie Rd, so plenty of eating options.


People registering in the morningRegistration officially opened around 8.20am on Saturday, but there were quite a few people there even before that. Lots of helpful volunteers were on hand to help with this as well as general venue management, directing pedestrian traffic and helping with morning/afternoon teas and lunch.


Attendees in main auditorium waiting for startStart of conference

This year they had 398 attendees, and the tickets all sold out in just 33 minutes. Wow!


The keynote speaker was Darrel Miller, who spoke about REST, the journey around making it work and separating the concept of REST from a particular implementation.

Darrel Miller presenting with photo of a Poutine

He likes food, so almost all of his slides used food metaphors.

Lucky the organisers laid out some morning tea next before the first session began!

Sarah presenting her talk

First off, I saw Sarah Tabrizi speak about “Agile and Azure”. She had some great Azure demonstrations. I actually liked that the demos were pre-recorded as it meant they all worked properly (no surprises or problems with dodgy network connections) and could be talked over the top of as required.


Philip presenting

Next up I caught Philip Beadle discussing tips on automation. Definitely some Lean influences coming through there.

Some of the key points Philip made were:

  • Active documentation (eg. using MarkDown with Cucumber to do BDD-style Given/When/Then tests that are business-readable)
  • Fully automated applications
  • Signals for hypothesis – provide ways to measure business outcomes of software

Daniel presentingNext Daniel Chambers spoke about making your C# and JavaScript more functional. No surprises that last year Daniel presented on F#!

He suggested that functional languages were the next evolution after object-oriented languages. I asked him what came next, but he wasn’t sure.

Some interesting demos on incorporating functional concepts into C# (via Linq and Reactive Extensions) and JavaScript (via lodash). His talk materials are here.

I’m also embarrassed to admit that I was confused by Daniel’s Twitter picture. He doesn’t look anything like Jack Nicholson.


People in foyer eating lunch

Time for some lunch. Hotdogs with cheese and onions, and drinks/muffins etc.


James Newton-King presenting

Next up, James Newton-King on designing good APIs. James knows a thing or two about this, being the developer behind JSON.NET – one of the most depended upon 3rd-party libraries available for .NET.

Some very interesting reflections from him on things to consider (and watch out for) when designing your own APIs.


And then, it was my turn!

Room full of attendees waiting for my talk to beginMe (David) presenting my talk

As you can see, the room was packed. As a speaker, there isn’t much more of a complement than that (especially as everyone stayed to the end!). My talk seemed to go quite well, though I need to practise my chocolate throwing technique.

(Second photo courtesy of Martin Doms)

 


Paul Stovell speaking about his company

The final speaker for the day was Paul Stovell, founder of Octopus Deploy.

I’ve bumped into Paul a few times over the years (he’s originally from SA, though now based in Brisbane), so it was great to hear his story of how he created the Octopus Deploy software application and then build a successful company around that product.


Final 'thankyous' from Lars KlintThen after a final thankyou from Lars (one of the organisers), it was off to the pub around the corner for free drinks (make mine a dry ginger, thanks)

People at the pub

It was a great conference. Really good speakers, content and organisation.

I made a particular point of talking to a number of the speakers to see if we could get them to present to the Adelaide .NET User Group in the future. I also spent a bit of time talking to Lars about how they’d organised the event, to get ideas about maybe doing a DDD Adelaide again in the future. It was great how helpful and encouraging he and others I spoke to were.

The final big news was that NDC (who were the main sponsors of the conference) announced that they will be holding a conference in Australia 1-5th August 2016. NDC Sydney is now open for registration, and also has a call for papers open until April 1st. At least they’ve given everyone a year to save up for it.

Tuesday, 11 August 2015

ASP.NET Web API for .NET Framework 4 in Visual Studio 2015

This is a pretty unique set of constraints I know – sometimes there are limitations outside your control as to which version of .NET you (or those who will be running your software) can use.

Note that the most recent version of Web API that works with .NET Framework 4.0 is 4.0.30506.0 (The 5.x releases all require at least .NET 4.5)

  1. Open Visual Studio 2015
  2. Create a new project (Make sure you select .NET Framework 4 in the frameworks dropdown list)
    Visual Studio New Project dialog
  3. Open the Package Manger Console
  4. Enter Install-Package -Id Microsoft.AspNet.WebApi -Version 4.0.30506 -DependencyVersion HighestMinor
  5. Update-Package Newtonsoft.Json
  6. (Optional) Install-Package -Id Microsoft.AspNet.WebApi.Tracing -Version 4.0.30506
  7. Add an App_Start folder
  8. Inside this folder, add new class WebApiConfig
  9. Add the following content to the WebApiConfig class:
public static void Register(HttpConfiguration config)
{
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new
{
id = RouteParameter.Optional
}
);

// Uncomment the following line of code to enable query support for actions with an IQueryable or IQueryable<T> return type.
// To avoid processing unexpected or malicious queries, use the validation settings on QueryableAttribute to validate incoming queries.
// For more information, visit http://go.microsoft.com/fwlink/?LinkId=279712.
//config.EnableQuerySupport();

// To disable tracing in your application, please comment out or remove the following line of code
// For more information, refer to: http://www.asp.net/web-api
config.EnableSystemDiagnosticsTracing();
}
  1. In the top-level of the project, add a Global.asax file
  2. Open the Global.asax.cs file and add the following method:
protected void Application_Start()
{
WebApiConfig.Register(GlobalConfiguration.Configuration);
}
  1. Add a Controllers folder
  2. Inside the Controllers folder, add a new class (eg. ValuesController)
  3. Update the ValuesController class to look as follows:
public class ValuesController : ApiController
{
// GET api/values
public IEnumerable<string> Get()
{
return new string[] { "value1", "value2" };
}

// GET api/values/5
public string Get(int id)
{
return "value";
}

// POST api/values
public void Post([FromBody]string value)
{
}

// PUT api/values/5
public void Put(int id, [FromBody]string value)
{
}

// DELETE api/values/5
public void Delete(int id)
{
}
}

Your project should look similar to this:

Solution Explorer showing Web API project

You can now build and run the web application and browse to /api/Values and get a response from your controller (JSON or XML depending on your browser)

Friday, 31 July 2015

Solution to error 0x80240020: Upgrade to Windows 10

So the whole “delete the contents of the downloads directory” thing didn’t work for me.

Today I noticed a tweet linking to an article, which in turn referred to a post in the Microsoft forums.

Apparently, the error 0x80240020 is not an indication of any download corruption – just that you’re computer is in a “holding pattern” waiting for the green light from Microsoft, as they’re staging the upgrade process. I think it would have been preferable to have just had this sitting quietly on my computer, rather than littering my Update History with “Update failed” messages.

So if you don’t want to wait, there’s a registry key you can set. (Instructions for setting registry key repeated here from the forum post)

  1. Locate the registry key: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade]

  2. It should exist, but if not, create it.

  3. Create a new DWORD (32-bit) Value with Name = "AllowOSUpgrade” (without the quotes), and set the Value = 0x00000001.

Now go back to the Windows Update in Control Panel, and tada – a new screen appears!

Windows Update in Control Panel, prompting to Get started

Click on the Get started button and things start happening..

It thinks for a short time, then the Windows Update prompt appears on your desktop:

Dialog prompting to start the upgrade now

And back in the Control Panel, you’re also prompted to restart. Clicking Start the upgrade now, or Restart now both do the same thing

Windows Update in Control Panel, prompting to restart

Your computer reboots, and the upgrade proceeds.

After a little while, and a few reboots later, you now have Windows 10!

About Windows 10 dialog

Woohoo!

Wednesday, 29 July 2015

Installation Failure: Windows failed to install the following update with error 0x80240020: Upgrade to Windows 10 Pro.

Update – Note that this didn’t work for me. Still waiting to find a workaround, otherwise I’ll try using an ISO instead

Eagerly waiting for Windows 10 to upgrade my PC.. But nothing was happening. I noticed this error in the Event Viewer System Log:

“Installation Failure: Windows failed to install the following update with error 0x80240020: Upgrade to Windows 10 Pro.”

This thread suggests the cause may be a corrupt download.

The solution (repeated here):

  1. Delete the contents of C:\Windows\SoftwareDistribution\Download
  2. Open an elevated Command Prompt and run
    wuauclt /updatenow
  3. Go to Control Panel | Windows Update and click Check for updates.

After a minute or two, you’ll notice some new files appear in the Download folder, and the Windows Update status will change similar to this:

Downloading Windows 10

I’ll update this post if there’s anything else that requires attention to complete the upgrade successfully.

Later that same day…

Windows Update - Preparing for installation

and even later…

The installation failed with the same error Sad smile

Tuesday, 28 July 2015

Little Lunch

Just been watching a few episodes of this new TV series Little Lunch with the kids.

Hilarious! Can’t stop gigglingSmile

I did need to explain to the youngest that “little lunch” is another name for what they call “recess” (the mid-morning break my kids have at school).

Australian viewers can watch all the episodes on ABC iView.

Monday, 27 July 2015

Windows Phone Podcast apps

It seems such a simple thing to want:

  1. A podcast app
  2. One that doesn’t crash (too much)
  3. Can list and play episodes in most recent order
  4. Can download in the background

You’d think?

Way back in the day, Windows Phone 7 to be specific, podcasts were supported natively in the operating system. Except if you didn’t live in the USA. For some never explained reason, they never enabled this feature for non-US phones. Bizarre.

If I recall correctly, the original Windows Phone 8 was no different, but then eventually Microsoft released the Podcast feature as a separate app – “podcasts”.

wp_ss_20150725_0001

It is a very basic app. Unfortunately I think that some of the developers of alternate podcast apps seemed to have given up when the official app came out – even if their own efforts had more features.

Carboncast

Carboncast app screenshotwp_ss_20150725_0007

One of the first apps I tried on WP8 was Carboncast. The layout and design still impress me, but sadly it proved quite unreliable (and no background downloads). Unfortunately the developer apparently lost interest too – the last update was December 2013.

Podcaster

This was my next app of choice for a fair while. It aims to be more like the original built in app (as it was released before that app was made available to the rest of the world).

Podcaster app screenshotwp_ss_20150725_0005

Background downloading was added in later versions, though I had occasional trouble with corrupted downloads.

Podcast+ Pro

Podcast+ Pro app screenshot

I then moved to this app – Podcast+ Pro. Pretty good, but no background downloading.

Podcast Lounge

Podcast Lounge app screenshotwp_ss_20150725_0010

I came across this one earlier this year (I think someone recommended it on Twitter) and had been using it until recently. It is quite good, but alas it didn’t do background downloads. A recent release supposedly added this feature, but the implementation appears to be buggy as it never worked for me.

A few issues also with strange ordering of episodes and frustration with episodes previously ‘marked as played’ reappearing as unplayed. Feedback emails were sent, but no responses.

Castcenter

Castcenter app screenshotwp_ss_20150725_0008

And so, another search of the store to see if there was anything else worth trying and I came across “Castcenter”. A free app, but you need to pay (in-app purchase) to unlock managing more than three podcasts. You can create custom playlists, and it does background downloads.

So far so good.

If you’re into podcasts and have a Windows Phone, let me know what app are you using?