Table variables in SQL Server – The dbo_reader´s friend

Stuck without writing rights in a big database? Only allowed to dbo_reader? Then this baby is for you: [crayon-5ad8b089c8474826879884/] This neat little row can be used instead of temp-tables to store subsets of data to increase performance of your joins. It´s more...

SQL query statistics

This is no work of mine but I wanted to highlight it since it´s such a good thing to utilise when optimizing your database and queries. [crayon-5ad8b089c9a7c675203868/] You get all recently executed queries (which in itself can be useful for a legacy database), the...

View model property generation

Every time I set up a new environment I have to rewrite this short template for generating view model properties in Resharper. It only takes a minute or two but after doing it like twenty times now I decided I'd put it here to reuse instead. This version of the...

New page!

So, finally i´ve managed to setup a new page for Greycastle. It´s quite crude for now with basically the same content as before. The news is however, that I´ll be working hard to keep an alive blog going. I intend to pass on whatever tips on difficulties I come across...

Passing string array from VBScript to C# COM class

I love the way COM interfacing enables you to do awesome scripted things but sometimes (more often than not) it brings me just a little closer to madness. Primarily I've been having huge problems getting things to marshal properly from vbs (visual basic script) to my...

Viewing registered COM interfaces and their signatures

Working with COM is often like hacking away at a black box, throwing something in and hoping you get something else than an invalid HRESULT exception back. I've long been looking for tools to help out with this and only last week I found one real diamond of a helper....

Converting binary data to text in TSQL

By some legacy reason xml-text is currently being saved as pure binary data in a system i´m maintaining. More than often we need to check this xml data to see if everything is as it should and every single time i stumble on how to do this, can't seem to keep it in...

Severity is a priority, or was it the other way around

When you get incoming requests and/or emergency tickets it's important to be able to classify these properly to know whether you should stop what you're doing or possibly if you should be doing it at all. This topic came up in my team the other day and at a prior...

User stories and use cases

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

Get all users in an active directory group

I´ve yet to see one quick and smooth description on how to retrieve all users from an AD group in windows in text form so I thought I´d present a simple solution here. The tricky thing is to get the complete "ad"-object stringthingy for the group to use in the query...

Articles

Total 99 articles published this far.

interface segregation but what about our objects?

The I in SOLID stands for 'Interface Segregation'. This is a fancy way of saying "splitting apart dependencies". Basically, an object should not have to depend on more than it absolutely has too. If it does, it may have to be modified when the dependency changes, even...

Communication in text

These past weeks we have focused on planning at my client. We're figuring out the next steps in the product and this requires a lot of communication. As engineers I find that at times we focus completely at our trade. Often though, good or bad, we spend a huge amount...

User stories and use cases

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

EnumerableExtension

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

Trying out NDepend

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

Tomato is a fruit!

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

WPF editable ComboBox binding

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

Hosting services easily on windows

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

MvvmLight and CanExecute

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

Loggly gotchas

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

Configuring Serilog from json

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

Jenkins with Visual Studio Online

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

Decoding html text to plain text in C#

I’ve found myself having to convert HTML to plain text a few times in a row now and thought I would post my very simple solution for it. It’s got a few caveats, for example it won’t handle pre tags or margins on divs and such thing. Not even paragraphs. But I just wanted a simple conversion so it was enough for me, feel free to extend it.

Lazy day

Today we're not having a post on the soothing music of Enya but the Lazy class in .Net 4.0. This is probably old news to most out there but I just found it recently (having learned that lazy loading is usually something to avoid, temporal dependencies and all that)....

Git credentials on windows

I was sure I had already made a post on this subject for my own reference but as it seems I haven't here it goes. I'm not a great fan of passwords as I've got about three million or some such at this point so if there's a way of not having to enter them every time I'm...

Ruby and DRb

I've been getting into Ruby last week whilst playing with Selenium at work. We're trying to get around quite a big and well known limitation of Selenium, that you cannot reuse a driver already created within another process. Since we're executing our in steps, each...

Mark all mail as read in gmail

It's easy enough to end up with too much unread email and gmail manages to hide some of its features quite well so here is a guide of how to mark all of your email as read. Step 1. Filter on unread mail In the search field, enter in:unread and press enter, this will...

Live Mine Field – Welcome in!

I've started coding Android again and in all honestly it fields like jumping head first into a mine field. Everything is littered with hidden problems that you have to carefully navigate around. This time I'll try to cherry pick some of the problems I've had whilst...

How do I (#,%-+ that integer/date/float?

I've taken up some Android programming again and this time in Android Studio, it really does improve the situation in comparison to Eclipse though it's still far behind Visual Studio + Resharper but since it's based on IntelliJDEA it does have a lot of the Resharper...

Environment variables and too much scripting

I got it into my head earlier this evening that maybe I couldn't reach my files that should be registered in the PATH variable because it had been truncated, after all when I ran [crayon-5ad8b08a0536c349269185/] I did get a truncated text. However that is probably...

DataTemplate based on type in WPF

WPF oftenly provides you with an option to set an ItemTemplate or an ItemTemplateSelector when styling say lists or even content controls (ContentTemplate). This is useful although most would probably just define an implicit style by not giving it a key:...

Keeping it clean

I got around to some cleaning today removing all our project warnings, yes you know which I mean, those nasty yellow things in the bottom of your Visual Studio screen every time you build. The ones we shrug at and say "well, they're just warnings" 🙂 I got most of...