OSX Mavericks – WiFi – FIxed in 10.9.4?

This is good news! Seems that Apple have finally released an official fix to the WiFi issues introduced with Mavericks. Might seem trivial but one of the nice things about the Mac is that you should be able to just open, and start. Not open and wait 5 minutes for the WiFi to not do anything, even when it knows all the network info.

I blogged about this before where it seemed to be related to Bluetooth config, which is plain daft, anyway. I’m off to install the update and see what happens.

Read the official release here.

Share

modulusmusic.me

A chap I’ve known for a long time now is on the verge of releasing his first synthesiser through his new venture Modulus Music.  The new synth called modulus.002 is going to be released very soon.  Very exciting.

Paul really is lovely chap and very passionate about what he does and from working with him in  the past I know what it is that he’s always wanted to do with hardware.  Its going to be interesting to see what he’s done and I wish him all the best.

Check out their site here:

http://www.modulusmusic.me/

Share

Wrapping HttpClient

I’ve been recently revisiting a WebAPI client implementation that uses DotNetOpenAuth for authorising calls to an OAuth 2.0 protected WebAPI.  So I thought I’d share the generic methods I wrote to perform the actual calls.

The call to CreateAuthorizingHandler(AuthorizationState) is the part of the implementation that appends the required access tokens using some of the internals of DotNetOpenAuth so your own implementation of this bit will be different as will the exception that gets thrown (you may not even want to throw anything at all.  Anyway, here’s the methods:

Post Json

        /// <summary>
        /// Posts the json asynchronous.
        /// </summary>
        /// <typeparam name="TReturn">The type of the return.</typeparam>
        /// <typeparam name="TData">The type of the data.</typeparam>
        /// <param name="url">The URL.</param>
        /// <param name="payload">The payload <see><cref>{TData}</cref></see></param>
        /// <returns>an instance of <see><cref>{TReturn}</cref></see>
        /// </returns>
        /// <exception cref="MoodApiClientException">thrown if object fails validation or the request fails</exception>
        private async Task<TReturn> ExecutePostJsonAsync<TReturn, TData>(string url, TData payload) where TData : class
        {
            ICollection<ValidationResult> validationResults;
            if (!payload.IsValid(out validationResults))
            {
                var validationErrorMessage = ObjectValidationExtensions.BuildValidationErrorMessage(validationResults);
                var typeName = payload.GetType().ToString();
                throw new MyClientException(HttpStatusCode.BadRequest, string.Format("payload type: {0} Failed validation: {1}", typeName, validationErrorMessage));
            }

            using (var httpClient = new HttpClient(CreateAuthorizingHandler(AuthorizationState)))
            {
                var response = await httpClient.PostAsJsonAsync(ApiRootUrl.WellFormedUri(url), payload);

                if (response.IsSuccessStatusCode)
                {
                    var data = await response.Content.ReadAsAsync<TReturn>();
                    return data;
                }

                throw new MyClientException(response.StatusCode, response.ReasonPhrase);
            }
        }

Post Async

        /// <summary>
        /// Executes the post asynchronous.
        /// </summary>
        /// <typeparam name="TReturn">The type of the return.</typeparam>
        /// <param name="url">The URL.</param>
        /// <returns>an instance of type TReturn</returns>
        /// <exception cref="MoodApiClientException">thrown if not successful</exception>
        private async Task<TReturn> ExecutePostAsync<TReturn>(string url)
        {
            using (var httpClient = new HttpClient(CreateAuthorizingHandler(AuthorizationState)))
            {
                using (var response = await httpClient.PostAsync(ApiRootUrl.WellFormedUri(url), null))
                {
                    if (response.IsSuccessStatusCode)
                    {
                        return await response.Content.ReadAsAsync<TReturn>();
                    }

                    throw new MyClientException(response.StatusCode, response.ReasonPhrase);
                }
            }
        }

Get Async

        /// <summary>
        /// Executes the get asynchronously.
        /// </summary>
        /// <typeparam name="T">The Type to attempt to deserialise from the response</typeparam>
        /// <param name="url">The URL.</param>
        /// <returns>an instance of type T</returns>
        /// <exception cref="MoodApiClientException">throw if not successful</exception>
        private async Task<T> ExecuteGetAsync<T>(string url)
        {
            using (var httpClient = new HttpClient(CreateAuthorizingHandler(AuthorizationState)))
            {
                using (var response = await httpClient.GetAsync(ApiRootUrl.WellFormedUri(url)))
                {
                    if (response.IsSuccessStatusCode)
                    {
                        return await response.Content.ReadAsAsync<T>();
                    }

                    throw new MyClientException(response.StatusCode, response.ReasonPhrase);
                }
            }
        }

Delete Async

        /// <summary>
        /// Executes the delete asynchronous.
        /// </summary>
        /// <typeparam name="T">The expected type to deserialise from the response</typeparam>
        /// <param name="url">The URL.</param>
        /// <returns>an instance of type T</returns>
        /// <exception cref="MoodApiClientException">thrown if not successful</exception>
        private async Task<T> ExecuteDeleteAsync<T>(string url)
        {
            using (var httpClient = new HttpClient(CreateAuthorizingHandler(AuthorizationState)))
            {
                using (var response = await httpClient.DeleteAsync(ApiRootUrl.WellFormedUri(url)))
                {
                    if (response.IsSuccessStatusCode)
                    {
                        return await response.Content.ReadAsAsync<T>();
                    }

                    throw new MyClientException(response.StatusCode, response.ReasonPhrase);
                }
            }
        }
Share

All Our Patents Are Belong To You

As far as I can tell Elon Musk is doing an amazing job of being pretty damn cool in my book.  What with his Space X efforts launched off the back of sale of PayPal (which netted him a small fortune as you can image).  It’s what he’s done with that money that is really impressive.

On top of all that coolness he appears to have designed a perfect car, all the reviews you’ll find online just rave about the quality of the Tesla Model S.  Now on top of that, Elon and Tesla have seen fit to announcing the “Open Source” approach to the list of patents that Tesla Motors are in control of.

Basically to stimulate the production of electric cars using their technology.  It’s worth mentioning that the company name Tesla is very loaded as the real owner of a lot of their Tech dies in the 1940s – Nicola Tesla.

You can read all about this on the Tesla Web SiteTesla_circa_1890.

“Yesterday, there was a wall of Tesla patents in the lobby of our Palo Alto headquarters. That is no longer the case. They have been removed, in the spirit of the open source movement, for the advancement of electric vehicle technology.

Tesla Motors was created to accelerate the advent of sustainable transport. If we clear a path to the creation of compelling electric vehicles, but then lay intellectual property landmines behind us to inhibit others, we are acting in a manner contrary to that goal. Tesla will not initiate patent lawsuits against anyone who, in good faith, wants to use our technology.

When I started out with my first company, Zip2, I thought patents were a good thing and worked hard to obtain them. And maybe they were good long ago, but too often these days they serve merely to stifle progress, entrench the positions of giant corporations and enrich those in the legal profession, rather than the actual inventors. After Zip2, when I realized that receiving a patent really just meant that you bought a lottery ticket to a lawsuit, I avoided them whenever possible.

At Tesla, however, we felt compelled to create patents out of concern that the big car companies would copy our technology and then use their massive manufacturing, sales and marketing power to overwhelm Tesla. We couldn’t have been more wrong. The unfortunate reality is the opposite: electric car programs (or programs for any vehicle that doesn’t burn hydrocarbons) at the major manufacturers are small to non-existent, constituting an average of far less than 1% of their total vehicle sales.

At best, the large automakers are producing electric cars with limited range in limited volume. Some produce no zero emission cars at all.

Given that annual new vehicle production is approaching 100 million per year and the global fleet is approximately 2 billion cars, it is impossible for Tesla to build electric cars fast enough to address the carbon crisis. By the same token, it means the market is enormous. Our true competition is not the small trickle of non-Tesla electric cars being produced, but rather the enormous flood of gasoline cars pouring out of the world’s factories every day.

We believe that Tesla, other companies making electric cars, and the world would all benefit from a common, rapidly-evolving technology platform.

Technology leadership is not defined by patents, which history has repeatedly shown to be small protection indeed against a determined competitor, but rather by the ability of a company to attract and motivate the world’s most talented engineers. We believe that applying the open source philosophy to our patents will strengthen rather than diminish Tesla’s position in this regard.”

Share

Compile Time Checking for MVC Views

One advantage of MVC Razor could also be deemed a disadvantage.  No comile time checking of views.  I personally love the dynamic nature of build the Razor views but you can get caught out occassionally and find yourself navigating to a view that is actually broken and generates an error and crashes the web site.

To help allieviate this problem there is a project level setting that you can use to pre-compile the Razor views which will help highlight issues like this before they hit production.  Yes, yes we should all be picking up issues like this well in advance of production and generally that is true but even the hardiest and more comprehensive set of UI testing can miss things or not be quite as comprehensive as one would imagine.

Anyway, the project setting is called MvcBuildViews and you can add it to a project level property group:

<MvcBuildViews>true</MvcBuildViews>

However, use with caution, this can dramatically increase build times and for any large project really is impractical for using in Debug mode. I only ever add this to Release mode meaning that this will get checked in your build process on it’s way to production, if not staging before that.

Share

50,000 Go Unnoticed – Occupy London

An estimated 50,000 people marched against austerity measures in London today. Starting the march right outside the BBC headquarters in Portland Place.

So why did the BBC stay so quiet about it? I saw a post about this march on the ubiquitous Facebook feed in the morning and immediately popped over to the BBC site to start searching. I found nothing. There really wasn’t a single mention of the entire thing (at that point in time) about the march.

A 50,000 strong ground of people with Russell Brand showing his face and not the tiniest bit of notice from the mainstream media?

Searching the BBC site now returned one link to a “Your week in pictures” gallery for that week and the bottom image is a shot of the protest (see here). That there is now a small mention of it here published the next day.

There was a lot of huffing and puffing  from the anti-establishment side and there was also a lot of huffing and puffing from the opposing side.  I personally find it a bit odd that the media would be as quiet about it as they were.  Nothing untoward happened and so it seems peaceful protesting risks going unreported and deemed not of interest to the wider public.

A quick Google of “bbc austerity march” shows the Your Week In Pictures link I mentioned earlier and little else. I’ve seen figures of complaints to the BBC over this pegged at about 6,000.

Here is some video evidence of the day:

OK, some of the other things they did deem of importance to report on that same day was stuff like the twitter guy Jason Buzi hiding money around the place, I don’t know but I’m a little confused why this march really has really registered at all on the BBC web site.

Surely if any news agency out there should have “the people back” it should be the BBC, we pay for it after all so why shouldn’t they prioritise things like this? That surely should be within their remit if it isn’t already.

It’s also easy for a lot of us to not pay much attention when something doesn’t direct impact us but there are some really sad stories kicking around of people really suffering as a result of these continued cutbacks, one older chap, just blew his head off when the letter arrived to tell him his benefits were stopping. Truly horrific.

I don’t usually want to go into stuff like this here but I’m really not impressed with the BBC over this and to be honest I feel gutted to think so negatively about the BBC as they have made some seriously impressive things over the years and I actually felt quite proud of the BBC as an export.

My grandfather was actually good friends with Chris Patton and they visited each other socially, I think hes probably turning in his grave at the thought …

Thought I’d come and make an update to this on the 7th July 2014 as it seems this pattern is being repeated elsewhere, Bust the budget! Thousands of Australians protest Abbott’s austerity.

Share

Nuget Strikes Again

Honestly, for tool that’s supposed to make life easier and more robust I find myself battling with it often.

I’ve been upgrading some of the packages in one of my projects and ran into this pretty error:

The schema version of 'Microsoft.Bcl' is incompatible with version 2.1.31002.9028 of NuGet.
The schema version of 'Microsoft.Bcl.Build' is incompatible with version 2.1.31002.9028 of NuGet.
The schema version of 'Microsoft.Net.Http' is incompatible with version 2.1.31002.9028 of NuGet.
etc ...

Er …

OK, so initially I thought I’ll update the version of Nuget that TeamCity is running. Updated that, reran the build … same problem. Odd I thought … did some Googling around and found out that you have the MANUALLY … yes you read that right MANUALLY update Nuget … What the very fuck? This tool gets worse in my opinion the more I learn about it.

SO, go to you .nuget directory in your solution and run this:

nuget.exe update -self

So just what the hell is happening when VS tells me Nuget Package Manager needs an update? … yet my nuget.exes in the solution where still launguishing around at version 2.1 … honest, this is shit!

Now I’ve gotten my Debug build to work, but I keep getting these errors on my release build:

The build restored NuGet packages. Build the project again to include these packages in the build.

WHAT????

This is EXACTLY what Nuget is supposed to bloody do! That is one of it’s core functions … run the build again? Can you tell that I’m seriously pissed off with this tool right now?

Share

Windows Store

Hmm … not much to say really. The UI sucks, it’s sluggish to use and inaccurate.

Why show me an Install button for apps that are already installed? Why have I got to fart around trying to find the uninstaller when I want to uninstall it?

Not an inspiring experience so far Microsoft.

Share

BSOD!! Well, Well Old Friend

My Current Windows box is fantastic, runs like a dream and has done since I built it about 3 years ago. It’s been through many many hardware changes in that time and the current specification is (I know geeky but it’s good to have this all in one place) fantastic.

So along comes Windows Update on Wednesday morning, on Thursday I have THE first BSOD ever on the machine. I know people bang on about how crap Windows is but I really couldn’t disagree more. Windows 7 is rock solid and believe me I push this machine. From all my development work, to high end games occasionally, to audio production work, graphic design, photo process and video editing. It does it all and just works. I’ve honestly had more issue with my MacBook Pro in the 12 months I’ve owned it than I have with my Windows box in 3 years.

Machine Spec
Component Name Manufacturer Model Link
Case CoolerMaster ATCS 840 Link
PSU Corsair Enthusiast Series™ TX750 V2 Link
Mainboard MSI P6T Deluxe V2 Link
CPU Intel i7-920 (8M Cache 2.66 GHz 4.80 GT/s Intel® QPI) Link
CPU Fan Corsair Hydro Series™ H50 Link
RAM Corsair Vengence (24Gb 1866Mhz) Link
OS Drive OCZ Vertex 3 240Gb Link
Optical Drive Plextor PX-LB950SA BluRay Link – Dead
Storage 1 Western Digital Velociraptor 140Gb Link
Storage 2 Seagate Barracuda 7200.8 250Gb Link
Storage 3 Maxtor L080L0 ???
Storage 4 Lacie D2 Quadra 2TB Link
Storage 5 Lacie D2 Quadra 2TB Link
Storage 6 Seagate FreeAgent GoFlex 2Tb Link
Keyboard Ducky Shine 3 10-Keyless Link
Monitor Dell Ultrasharp U3014 Link
Audio MOTU Traveler (v1) Link

Anyway, I had a nasty issue with some drivers being VERY out of date. Usually the driver download apps that keep getting pushed your way are annoying at best. However I just found a really good free one! Check it out here SlimDrivers it actually worked. Although it did offer me a slightly older Intel driver than I had already installed it got everything else bang on and if any of you out there have gone through this process manually you can forgive it for getting 1 out of 30 drivers wrong by a .0x version.

Share

Loading Entity Framework Navigation Properties with Stored Procedures

I don’t see a lot of posts about this but it is possible to achieve.

Classes

public class MyContext: DbContext
{
    public MyContext()
    {
        Configuration.LazyLoadingEnabled = true;
        Configuration.ProxyCreationEnabled = true;
    }

    public DbSet<Table1> T1 { get; set; }

    public DbSet<Table2> T2 { get; set; }
}

[Table("Table1")]
public class Table1
{
    public int Id { get; set; }

    public int Tabel2Id { get; set; }

    [ForeignKey("Tabel2Id ")]
    public virtual Table2 Table2 { get; set; }
}

[Table("Table2")]
public class Table2
{
    public int Id { get; set; }

    public string SomeValue { get; set; }
}

Example Stored Procedure

SELECT * FROM Table1 WHERE Id = @SearchId

Using a DbSet … this DOES NOT WORK if you are using a full DbContext class.

var searchIdParam = new SqlParameter("@SearchId", searchId);
var searchResults = _dbSet.SqlQuery("LoadMyTable1s @SearchId);

You’ll find that your navigation properties are in fact loaded. I’ve been using this since at least EF5 …

Share

OpenSSL Hits The News Again

Good grief, this latest issue with OpenSSL (the library that keeps most of the internet encrypted and safe) is no less that 16 years old …

“A researcher has uncovered another severe vulnerability in the OpenSSL cryptographic library. It allows attackers to decrypt and modify Web, e-mail, and virtual private network traffic protected by the transport layer security (TLS) protocol, the Internet’s most widely used method for encrypting traffic traveling between end users and servers.

The TLS bypass exploits work only when traffic is sent or received by a server running OpenSSL 1.0.1 and 1.0.2-beta1, maintainers of the open-source library warned in an advisory published Thursday. The advisory went on to say that servers running a version earlier than 1.0.1 should update as a precaution. The vulnerability has existed since the first release of OpenSSL, some 16 years ago. Library updates are available on the front page of the OpenSSL website. People who administer servers running OpenSSL should update as soon as possible.”

The Advisory is here

OpenSSL

Share

WWDC – Comments

I should start this by saying that I’m really not an Apple fan boy or a Microsoft fan boy or any tech fan boy to be honest. I’ve been involved in too many technical pursuits like running recording studios to managing servers to buy into it. If you want to see REAL fan boys get involved in the music industry and insult someone’s synthesiser or guitar, you’ll live to regret it. I use a Mac, PC and Android phone every single day. I use Windows 7, OSX, Android and Ubuntu every single day. Command line hacking and nice clicky graphics, every single day. An I an expert? No, but I do have an opinion!

Anyway, I just wanted to make a few comments about the content of the WWDC. Sure some interesting stuff was shown, the graphic processing on the iPad was seriously impressive it has to be said. Everything else was bit – Meh, so what? And then the figures that were shown. I mean come on Apple that was weak. You’ve got the tech world watching and you roll out some of the most ridiculous figures as proof.

Swift

All I can say is thankfully I’ll never have to learn Objective-C. Every time I’ve opened XCode a shudder has gone down my spine and within 30 mins I’ve closed it again. Just horrible. So you’ve obviously spent considerable resources designing a new language – great! That’s also reset the experience of the majority of your developers as they have to learn it. But really, boasting that it’s 220x times faster than Python doing encryption is pathetic. Sure, my Lambourginis 0-100 time is faster than this Orange!! Go me!

It’s also a bit like finally admitting that Obj-C is crap, which it is. Anyway, I’m looking forward to taking a look.

Mobile

There is no denying it Apple – Android has over 80% market share. So poking fun at Android for fragmentation is a little unfair. I’m developing an Android application at the moment and I’ve decided to target v4 + as that will cover over 80% of the Android market. And don’t forget that there a LOT of old iPads out there that cannot be upgraded past iOS 5 … your own market is fragmented.

OSX – Windows Bashing

This argument is getting tired …

You also stated that Mavericks was the fastest adopted OS in history. This is also a completely unfair comparison when you slate Windows. Windows is often used in environments where upgrading is either insanely expensive or not even an option. Governments and mission critical scenarios. Basically its used in places that if anyone even suggested using your OS for the job would be sacked on the spot.

For all it’s faults Windows is a different beast to OSX, used in places for tasks no-one would ever think about using OSX so again you’re comparing apples and oranges (‘scuse the pun). My Windows 7 box is amazing, hugely powerful and VERY capable, even though I have a Retina MacBook Pro it’s still my goto machine for serious work – Audio, Video, Development etc. Stop making idle comparisons, especially when the majority of your audience is “in the know”.

Also, remember that iCloud is using Microsoft Azure …

Anyway, I’ve got work to do …

Share

WWDC – Well, Well!

Lots of very interesting things coming out of the WWDC, I’ve just finished watching the presentation. Seems Apple have been very busy. The graphics rendering stuff was supremely impressive it has to be said.

But I went off looking for the free book about the new programming language called Swift and couldn’t find it in iBooks, but found it here.

About time as every time I looked at Objective-C I wanted to barf.

Share