Setting Up Foundation and FontAwesome with Ember-CLI

October 02, 2014 by Damien White

If you followed along with my previous posts on Ember CLI, you were able to setup Emblem and CoffeeScript as well as Sass and Compass with Ember CLI. In this post we’ll start using some styling libraries, like Zurb Foundation and Font-Awesome.

Laying the Foundation

We already have Bower and a bower.json file from Ember CLI, so adding a Bower dependency is easy.

bower install --save foundation
Read More »

Setting Up Sass and Compass with Ember-CLI

September 04, 2014 by Damien White

If you followed along with my previous post on Ember CLI, you were able to setup Emblem and CoffeeScript with Ember CLI. Now let’s move on to some styling with Sass. Well, SCSS and Compass.

Setting Up Sass

Sass is super easy to setup thanks again to Broccoli:

npm install --save-dev broccoli-sass

Now you can change the styles/app.css file to app.scss. Restart your server and you’re now using SCSS.

Read More »

DLL Hell Strikes Again

August 10, 2014 by Damien White

I was working on an old MVC4 project that was running on .NET 4. I couldn’t upgrade it to 4.5 because this app runs on a Windows 2003 server and .NET 4.5 doesn’t support Windows 2003. Thus, I was stuck targeting good old .net 4. Not the end of the world, or so I thought. I then went to upgrade Kendo UI for MVC by Telerik. I used the MVC 4 version of Kendo since I’m using MVC 4 and that’s just the logical thing to do. I built and got a warning that prevented me from using the Kendo.Mvc DLL.

The primary reference "Kendo.Mvc, Version=2014.2.716.440, Culture=neutral,
PublicKeyToken=121fae78165ba3d4, processorArchitecture=MSIL" could not be resolved
because it has an indirect dependency on the assembly "Newtonsoft.Json, Version=,
Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" which was built against the
".NETFramework,Version=v4.5" framework. This is a higher version than the currently
targeted framework ".NETFramework,Version=v4.0"
Read More »

New Framework, New Sites

July 26, 2014 by Damien White

It’s been long overdue, but both the Visoft main site and our blog have moved off of WordPress. We are now using Jekyll to statically generate both sites. This allows us to host our sites just about anywhere as Jekyll spits out plain old HTML, JavaScript, and CSS. Aside from a static site, Jekyll allows us to cleanly use Markdown for our posts. We were using Markdown with WordPress and while it worked ok, it would occasionally mess up our content. No longer is this the case with Jekyll.

Read More »

Setting Up Ember CLI with Emblem and CoffeeScript

July 24, 2014 by Damien White

I’ve been using Ember CLI for various projects. Two things that I like to do right out of the gate is to enable CoffeeScript (instead of JavaScript) and Emblem JS (instead of Handlebars templates). Both of these tasks are pretty easy thanks to Broccoli.

Start by creating a new Ember CLI application:

ember new <my_app>


Now let’s get CoffeeScript working, it’s as easy as installing a Broccoli component

npm install --save-dev broccoli-coffee
Read More »

Logitech Ultrathin Keyboard Mini Review

June 26, 2014 by Damien White

I figured I haven’t done a product review in a long time, so here we go!

I’m lucky enough to own both an iPad and iPad Mini. At times the Mini is more convenient, and I like using a real keyboard, so I decided to try the Logitech Ultrathin Keyboard Mini (Figure 01). I ended up getting it for around $20 on Amazon, so I figured it was worth a gamble.

Figure 01: The Logitech Ultrathin Keyboard Mini
Figure 01: The Logitech Ultrathin Keyboard Mini

I’m writing this review using the keyboard on my lap, like a mini laptop. There is a magnetized slot that holds the iPad Mini at an angle. The magnet is pretty strong as I’m able to pick up the iPad and have the keyboard stay where it is (Figure 02).

Figure 02: Picking up the iPad with the Keyboard in the magnetic slot
Figure 02: Picking up the iPad with the Keyboard in the magnetic slot
Read More »

The “Ultra Intuitive” WCF Test Client

April 30, 2014 by Damien White

Did you know that Visual Studio includes a WCF Test Client? No? It’s very useful for testing out various services, especially SOAP ones. RESTful services are much easier to test as you just need a browser, but SOAP requires some sort of client.

Browse to the following path (note, this is Visual Studio 2013, adjust the 12.0 to whatever version you have):

C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE

Once you’re there look for the icon shown in figure 1.

Figure 01: WCFTestClient.ext Icon
Figure 01: WCFTestClient.ext Icon

Now, while this is a useful tool, it’s so unintuitive, it’s not funny. One of the stumbling points has to do with Arrays so let’s look at this example.

Fun With Arrays

Connect to a service, and you’re given a tree-view of the methods that you can call on the service. So far, so good. If you click on a method, then you’re given the opportunity to add test values and then execute it to get the result. But wait, what do we have here? Our service takes an array of ints, what’s this weird length=0 stuff. Oh, of course we don’t have any items yet (Figure 02).

Figure 02: The Curious Length
Figure 02: The Curious Length
Read More »

My RubyGem Release Workflow

March 31, 2014 by Damien White

When going through and doing a release for ruby_odata, I had a workflow problem that resulted in extra, unneeded, work. I originally posed the question going on three years ago now (wow). You’d think I would remember the solution, but I find that I keep looking for my StackOverflow post where I answered my own question. I figured that was a sign that I should add to the Visoft blog. Before we get to the problem, here’s my basic release workflow for my RubyGems.

Git, Bundler, and RubyGems

I use git for source control whenever I can. The project that I was working on was ruby_odata, my Ruby “wrapper” to interface with Microsoft OData Services. I used to be a huge Microsoft “fanboy” as you know, and have turned very critical of them as of a few years ago. That said, OData Services is really a pretty cool thing. It was magical to be able to have an Entity Framework model, and easy expose it over the web by just adding one service file. Sorry, I digress.

Ok, where were we? Oh yes, git. In addition to git, I like using @nvie‘s gitflow. It makes branching fun. It’s a simple tool, that allows you to issue commands like git flow release start v0.1.6 and that will start a new git branch, and change you over to that release branch. You make all of your changes, checking them in as you go along, then you can run git flow release finish v0.1.6 and gitflow will add a tag of v0.1.6 and merge everything into your master and develop branches. Nothing you couldn’t do manually of course, but gitflow makes it a snap.

Read More »

Lights, Camera, ActionBlock!

February 28, 2014 by Dave Marini

The TPL Dataflow library available from the NuGet Package Manager is a great way to manage in memory asynchronous data processing. It’s especially useful in producer/consumer situations because it greatly simplifies the amount of ceremonious code required to manage and synchronize multiple asynchronous processes happening in parallel. Last but not least, the library is written on top of the Task Parallel Library introduced in .NET 4.0, so it makes judicious use of Task and Task<T>, which as of .NET 4.5 can be awaited using the new async/await keywords. You could just say that it’s awesome-sauce in a NuGet Package. While the library offers a number of classes that have different specialties, there is one class that I believe to be the rockstar of the group: ActionBlock<T>.

ActionBlock Jackson

Basically the ActionBlock class takes in an Action<T>, which will serve as the code that will be run for every item passed to the block. So if I wanted to email “Hello” to a number of email addresses, I can represent that like so:

var emailer = new ActionBlock<string>(email =>
    using (var smtpClient = new SmtpClient("myhostserver"))
        var message = new MailMessage
            From = new MailAddress(""),
            Subject = "Hi",
            Body = String.Format("Hello {0}!", email)
        message.To.Add(new MailAddress(email));

Here I’m defining my ActionBlock and passing in an anonymous delegate that will send an email to the provided email address. After the block is initialized, I can call the Post method to send items into the block to be processed. The Post method is synchronous and returns a boolean that indicates whether the item was accepted by the block for processing. If you want to send data to the ActionBlock asynchronously you can call the SendAsync method, which returns a Task<bool>, and await it’s return. When we’re done posting data to the ActionBlock and we don’t expect to post any more, we call the Complete method on the ActionBlock. This method indicates that no more data will be posted and allows the ActionBlock to finish up any running threads and end itself gracefully.
Read More »

You Have Chosen Poorly – MaxLength vs StringLength

February 25, 2014 by Damien White

You Have Chosen Poorly

Are you using Entity Framework and ASP.NET MVC along with client side validations? Are you trying to restrict the length of a string only to find that you client side validation isn’t working? Me too, and there is a solution!

MaxLength Attribute

In a recent project, we are using ASP.NET MVC 5 and Entity Framework 6 (EF for short). We are using Code First along with EF Migrations to update our underlying SQL database. We use Data Annotations throughout the project. A reoccurring pattern for many of our properties looked like this:

public string Name { get; set; }

Our goal here is to obviously require a Name value and to limit the length to 30 characters. This results in an EF migration entry that looks like this:

    c => new
            Name = c.String(nullable: false, maxLength: 30),
              ... Other Properties ...

From an Entity Framework and EF Migration point of view this is exactly what we wanted. Now flip to our client experience with ASP.NET MVC. For our Views, we often use shared templates to generate our forms. This uses the ModelMetadata to build the form. For the Name property, we generate an input plus a span for our validation messages, using the Html.Editor and Html.ValidationMessage helpers. It yields your average label and input combo in the UI (Figure 01).

Figure 01: The Name input Field
Figure 01: The Generated Name input Field
Read More »