Google PlusFacebookTwitter

User stories and use cases

By on Sep 23, 2016 in Development | 0 comments

TL;DR; Use cases are higher level and describes to the user what a feature/story does and the user story describes how the system solves this need. My team is currently fleshing out some new features for the next version of our software and this morning I started thinking, how should we actually do this. We’ve got a rough idea about what we want done but how can we communicate this to everyone involved in the right level. We need to be able to tell our stakeholders what we’re going to do without getting bogged down in details on exactly how we will do it. Not to mention, until we know how we will do it we can’t prioritize and decide which of the how’s we’re going to do. So, how do we put this into text and communicate? Googling user stories and how to write them I ended up instead reading about what differs use cases from user stories. We’ve used the...

EnumerableExtension

By on Sep 2, 2016 in Development | 0 comments

Now I use the enumerable extensions in C# a lot. First(), Single(), Select() is everywhere. However, I’ve found that there’s a few I’m missing and that sometimes they just don’t exactly suit my purposes. So, sometimes I create an additional extension method or two, like the two below: View the code on Gist. TryGetFirst I use because the Try-pattern is nicer sometimes than the if(result != null) pattern. The TryGetSingle is mostly due to the fact that the Single() enumerable extension throws (or at least used to throw) the same message for when there were no items in the list and when there were more than 1. I usually find that if there’s more then one, then there’s an error and if there isn’t one I want to handle that in a different...

Trying out NDepend

By on Sep 2, 2016 in Development, Statistics, Tooling, Tools | 0 comments

What is this? I got the chance to try out NDepend, although with everything else, it took me quite some time until I finally got around to picking it up. Now NDepend is a tool, both command line, stand alone and as an addin to Visual Studio which allows you to do static analysis and reporting on your .Net projects. It uses a Linq based paradigm to build rules around the code metadata it reads from the solution making it incredibly versatile in terms of extending and customizing. In this blog post I’ll take you through my initial 2-3h user journey in trying out the tool. Installation After writing a few installers myself using both the old fashion visual studio included tools and lately using Wix I can appreciate that the NDepend team didn’t waste time trying to do this. NDepend simply comes as a zip file which contents you drop in a folder, completely fine and it’s a...

Tomato is a fruit!

By on Aug 26, 2016 in Deployment, Development | 0 comments

So what’s the most pointless thing you’ve done this week? I’ve made a game to settle the score once and for all. And maybe, in the end, it’s not so pointless after all, though, if you do feel I could’ve spent my time doing something more worthwhile I’ll admit to that 🙂 The game is available at http://fruitorvegetable.greycastle.se/. Try it out! It was a very good experience in trying out Ruby on Rails. And a few comments on this: I used Heroku for deploying this app and this was actually a breeze, a really, really good service, auto pushing code from github and all. Only thing, it’s running on Ruby 2.0 and Rails 4.1.0 which caused me a fair level of grief. Also, my page didn’t use a database, for which Rails is optimized to have which also forced me to do some additional fixes. But, if you start off in the right end, I’d really...

WPF editable ComboBox binding

By on Aug 24, 2016 in Development | 0 comments

Today (and most of my night) I’ve been stuck with trying to bind to an editable WPF combo box. It sounds stupid and it is, really. The scenario is this: You have an editable combo box to which you bind a list of view models. I specify a data template in order to get the correct binding to a property on the view model. This however, doesn’t display the selected item properly. I specify a ToString() override to solve this and get a value. However when the property that feeds the ToString is updated I get no update. The thing is that the SelectedItemValue and such doesn’t come in to play and certainly doesn’t care about updates to your view model. So in order to fix this I create a wrapper subclass to the ComboBox class and make it listen to changes to the SelectedItem and trigger an internal update method when needed. The example, code and fix are all available...

Hosting services easily on windows

By on Apr 15, 2016 in Deployment | 0 comments

Building applications, even servers, as console applications is great. Easy to run, easy to debug. Easy to host in a safe, error recoverable fashion.. wait what? Yes that’s right. Not out of the box of course, and not using any of the multitude of service installers out there. Use NSSM, Non-Sucking Service Manager. It’s been around for quite some time actually, I think I used it first time a few years ago but still going strong. Basically it provides an interface on top of the windows services runner and allows you to configure all the options you need, error and standard output logs, rolling, recovery and arguments for your executable. Simply...

MvvmLight and CanExecute

By on Mar 2, 2016 in Development | 0 comments

Today is going to be a very short post, more of a pingback really. We are using MvvmLight as it is the defacto mvvm library of WPF but when I upgraded the libraries from the .Net 4.0 versions to .Net 4.6.1 the other day most of our application broke down. The CanExecute callback of all our relay commands stopped working (and I would’ve know this far earlier if the CI had been working, lesson learned again). After a whole lot of digging I came across this comment in the source code: If you are using this class in WPF4.5 or above, you need to use the GalaSoft.MvvmLight.CommandWpf namespace (instead of GalaSoft.MvvmLight.Command). This will enable (or restore) the CommandManager class which handles automatic enabling/disabling of controls based on the CanExecute delegate. Which can be tracked back to the release notes of MvvmLight version 5.0.2: Important note about issue 7659: In...

Loggly gotchas

By on Feb 23, 2016 in Deployment | 0 comments

I’ve setup Loggly today, really nice service but I found a few gotchas you need to keep in mind to get it working. I’m doing this on a docker instance, I’m sure there are other and better ways of doing this (suggestions are very welcome), since I wanted it to be a scripted part of our current platform that’s the road I went down though. We are using the scaled down Debian Jessie AspNet vNext container as a base file when we’re deploying. Basically I’ve copied their dockerfile and built on it. This means there were quite a few packages missing that are required to get Loggly working. Required packages Here is a docker run statement to install the required packages. RUN apt-get -qq update && apt-get -fqqy install telnet sudo rsyslog wget We need these packages in order to be able to run the configuration command to setup rsyslog to push the...