Google PlusFacebookTwitter

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...

Configuring Serilog from json

By on Feb 1, 2016 in Environment | 0 comments

The past weeks I’ve been working with creating a service API in Asp.Net 5 and .Net Core, exciting stuff. We’re running this in a docker container configured from the base Asp Net containers so it’s all easy to deploy. Well almost. you have to have logging right? And the file structure isn’t quite the same when debugging on a windows machine and running it in a *nix based environment. So what to do? File based configuration of course. We’re using Serilog for logging, hooking this into the Asp.Net 5 logging structure. Serilog is a very mature framework and has loads of plugins, only they’re not all ported to .Net Core and in general quite a few things are missing. The Serilog team has been kind enough to open a little entryway for us if we do want to feed it configuration. This is the ReadFrom property on the logger class. I simply read key-value pairs...

Slowness in Selenium RemoteWebDriver using Ruby on Windows

By on Dec 16, 2015 in Development, Performance | 0 comments

I’ve spent the day profiling trying to figure out why our RemoteWebDriver usage of Winium.Desktop is so much slower than just running the tests straight through Winium.Cruciatus. The profile yielded that TCPSocket#initialize was the culprit, strange, opening a socket shouldn’t take that long. A quick google gave me this post for an answer. Could try require 'resolv-replace' before hand, or using 127.0.0.1 instead of localhost. 123 Could tryrequire 'resolv-replace' before hand, or using 127.0.0.1 instead oflocalhost. I didn’t go as far as to require the resolv-replace but just changed my ‘localhost:9999’ to ‘127.0.0.1:999’ instead and my 10 calls of a total 10sec dropped to 0.5sec total. Remarkable. So that’s an easy fix for you if you find yourself in the same...

Jenkins with Visual Studio Online

By on Nov 30, 2015 in Development, Environment, Tooling, Tools | 0 comments

On my current project we’re using Jenkins as a CI platform and Visual Studio Online with TFS for source control. I’ve been wanting to setup the builds on our intranet again to run the integration tests relying on intranet access each check-in. I had an issue with this, as I did last time I tried it and figured I need to retain this information somewhere. If you are doing this with using Git you’ve come to the wrong place though, Microsoft has a great article about that themselves. This is the error I ended up getting: FATAL: com.microsoft.tfs.core.exceptions.TECoreException: The SOAP endpoint https://infuse.visualstudio.com/Services/v1.0/Registration.asmx could not be contacted. HTTP status: 404 java.lang.RuntimeException: com.microsoft.tfs.core.exceptions.TECoreException: The SOAP endpoint https://infuse.visualstudio.com/Services/v1.0/Registration.asmx could not be...