• Managing your Azure Storage account with Zudio posted on 03 May 2014

    Messing around with Azure Queues, using the C# library to create a queue, add messages, read them, delete them... all is well and good...

    But at some point I wanted to view what I was putting into the queue...

    The Azure blog has a recent post listing a few Azure Storage explorers. I tried a couple of them, but they were so buggy!

    Infact, I'm sorry to say... Azure Storage Explorer was the worst. When I attempted to refresh a queue, nothing happened. I had to add a second queue, then swap between each queue in order to review the list. Most of the buttons don't seem to do anything at all.

    Then I remember Mark Rendle tweeted me about his Zudio site. Funnily enough he got a mention on the blog post. I decided to login and check it out again.

    Read more...

  • Creating a drop area to drop a file in HTML 5 posted on 01 May 2014

    In the first post we uploaded a file and viewed it in the browser without sending it to a server, now we are going to create a drop area so that you can drag a file from a folder, into the website.

    Using the same HTML as before, lets add a drop area:

    <div>
        <input type="file" id="image-input">
        <input type="button" value="Load Selected Image" id="load-image" />
    </div>
    
    <div id="drop-area">
        Drop File Here...
    </div>
    
    <div>
        <img id="image-container" width="360" />
    </div>
    

    And add a bit of CSS to make it a little more visible:

    Read more...

  • Loading an Image or Video from a File Input control. posted on 29 Apr 2014

    So you've got an input control, and you want to display the video/image before the user uploads, maybe so they can verify it first...

    The File API allows you to get more information from a <input type="file"... control than we could get before.

    So lets start with Video:

    Video

    Ok so we have a basic HTML page with an <input type="file"..., <video..., and <input type="button'...

    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8" />
        <title></title>
    </head>
    <body>      
        <div>
            <input type="file" id="video-input">
            <input type="button" value="Load Selected Video" id="load-video" />
        </div>
    
        <div>
            <video id="video-container" controls></video>
        </div>
    </body>
    </html>
    

    So if we load up a file, our UI should look something like this:

    Read more...

  • Levelling up your logging. (part 2) posted on 28 Apr 2014

    Part 2: Levelling up your Logging.

    Make sure you've read Part 1: If you're not logging, you're doing it all wrong before you continue.

    Production logging : This.Changes.Everything ™

    Localhost development is easy. Live/production logging is where This.Changes.Everything. ™
    Instead of sending all the logging information to your localhost Sentinal app we now send it to LogEntries.

    Why LogEntries (or any other Logging Service as a Service)?

    1. You can access this information any time.
    2. You local computer cannot be online 24/7
    3. When you need to triage a problem, the problem as already occured. Therefore, the problem is already historical. As such, you can't suddenly turn 'on' logging. You need to go back into time and look at what has already happened.

    Read more...

  • Fixing OSX as a Windows User... posted on 26 Apr 2014

    I'm slowly in the process of moving away from my huge desktop computer and moving to my good old 15" Mac Book Pro w/ Retina, as my main computer. Running windows in parallels. But moving to OSX is really hard, things that I take for granted in Windows are just hard in OSX, even after 2 years of having this laptop, and having used OSX for a few years when I lived in New Zealand....

    Sooo I'm making this blog post, mostly as a reference for the future, on what I've done to make life a little easier.

    Fixing Home / End keys

    Ahhh I know you can use cmd + and cmd + , but I just prefer the Windows key mapping.

    Read more...

  • If you're not logging, you're doing it all wrong. (part 1) posted on 23 Apr 2014

    Part 1: If you're not logging, you're doing it all wrong.

    Really? Seriously?

    Synopsis: Simple way to start logging your .NET application.

    Maintaining some production software is most overlooked until a problem arises ... which by then it could be more costly to support and fix if some simple, basic procedures were not considered from day zero. In my opionion, adding the ability to get acess to the internal runnings of your system is crutial to seeing what is going on under the hood and helping you get some facts to help problem solve a production issue.

    Logging is one of these mechanisms and should be considered and planned before you even start any coding.

    Read more...

  • Fixing Github with Chrome Plugin - GitHub.Expandinizr posted on 07 Feb 2014

    So if you've ever visited Github, and thought 'Oh, I'll browser a repository and find a file', no doubt you've probably ended up in a suituation like so:

    OH Joy, this is so readable... I honestly have no idea who at Github approved this...

    Read more...

  • If you're going to use repositories, don't have generic or base repositories... posted on 31 Jan 2014

    Repositories are one of those patterns we hate to love or love to hate, but seems to be getting more hate lately than love.

    Personally I don't have any real problem with repositories themselves, I just have a problem with the way it is used.

    If you run the following search in Google:

    BaseRepository OR GenericRepository OR IRepository site:stackoverflow.com

    You will get about 10k results on Stack Overflow for questions that contain something related to a generic repository or base repository. You end up with code snippets such as:

    public interface IRepository<TEntity> : IDisposable where TEntity : class
    {
        IUnitOfWork Session { get; }
        IList<TEntity> GetAll();
        IList<TEntity> GetAll(Expression<Func<TEntity, bool>> predicate);
        bool Add(TEntity entity);
        bool Delete(TEntity entity);
        bool Update(TEntity entity);
        bool IsValid(TEntity entity);
    }
    

    Read more...

  • Snow's new server feature! Runs up a testing website for you. posted on 25 Dec 2013

    Just now I released Snow v1.4.0 :) with this we have two new features.

    1. New server=true argument on Snow to run up an Owin testing website.
    2. Merged assemblies

    New server argument

    When running Snow, you can now pass in an additional argument server=true which will start up a self-hosted website which will allow you to test your updates before pushing them.

    Given my blog for example, my config looks like so:

    .\Snow\_compiler\Snow.exe config=.\Snow\ debug=true server=true
    

    Now when I run this:

    Read more...

  • Unit testing Workflow Foundation Bookmarks... easily... posted on 18 Dec 2013

    I'm not a fan of Workflow Foundation, but you got to do what you got to do. Usually when using WF, unit testing an activity is rather easy. Invoke with some data, assert the out value, possibly watch some methods on some dependencies...

    But when it comes to testing Bookmarks, if the bookmark is created, and resuming it, it's not easy...

    Well that is unless you're using Microsoft.Activities.UnitTesting

    So creating some new projects, a workflow project and a class library for testing...

    Read more...