DataTemplate based o...

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: XHTML <DataTemplate...

Passing string array...

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 C# classes. I...

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

VMWare problems with...

We’re using a nice vSphere ESXi 5.1 host for a lot of our VMs at work and today I found myself unable to get proper mouse and keyboard capture in the VMs. It just acted really strange, sometimes I could get mouse capture when I was outside the VM and as soon as I pressed any key I lost...

Free coverage contro...

Code coverage is a good tool to force you to keep maintaining and adding unit and integration tests to your solution. It also increases your confidence in making changes if you can see that the code your changing is actually covered by tests both before and after your changes. Problem is,...

Crayon syntax highli...

In the last post I switch to a new syntax highlighter for WordPress that I’d like to recommend to the rest of the word, namely the Crayon Syntax highlighter available on the wordpress plugin site: Crayon It’s got a huge set of features, a wide range of styles, installs and runs...

IndentationSplitter

Time for an update about my recent ventures. I’ve just now uploaded my very first public Codeplex and Nuget package! Yay! It’s called IndentationSplitter and gives right now you a single class called SimpleTree. This class has two methods, Format and Parse. Very simplistic but in...

View model property ...

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 template generates a...

The Web We Want Maj04

The Web We Want

Mozilla is currently doing an interesting drive for the future of the Internet. Internet and the amazing and monstrous opportunities it has raises enumerable philosophic questions. Mozilla asks you to pick one of six possible categories for what you think is most important for the internet,...

Viewing registered C...

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. It’s the...

Online .Net/C# regex...

Update (2014-07-15): Never mind me! I recently came across another tool that does just what I intended to do and not only that, it does it quite a lot better. I think that if you like/use this tool or if you’re looking for something like it, check out Regex Hero. Great tool, quick and...

Sort your list drag ...

So, here’s the web-a-list-a-sortifier.. Ok, I’m gonna need some work on that name. Anyhow, I needed a way to simply drag and drop some arbitrary textual list, say from an excel spreadsheet and to import and export this list in a nice and simple way. Here is a jQuery driven...

Revoke impersonation...

When working with web applications, especially on intranet sites, you sooner or later find yourself dealing with impersonation issues. My last problem was caused by the default impersonation when hosting classic Asp in IIS. I found that my WCF service calls failed upon authentication, digging...

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. PgSQL SELECT SUBSTRING(qt.text, (qs.statement_start_offset/2)+1, ((CASE qs.statement_end_offset WHEN -1 THEN DATALENGTH(qt.text) ELSE qs.statement_end_offset...

Rounding or grouping...

When retrieving data for statistical usage in SQL it´s oftenly useful to group the data to some kind of time interval. Easiest and most used is probably simple grouping by date: PgSQL SELECT cast(Timestamp as date), COUNT(*) FROM MyTable GROUP BY cast(Timestamp as date) 1 SELECT...

Get all users in an ...

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 but you can do...

Debug silverlight in...

Just now I´m sitting with some laborations in Silverlight and found myself unable to debug my code just because it triggered the ”hosting” webpage in Firefox instead of Internet Explorer. I got the following message:   The breakpoint will not currently be hit. No symbols have...

First entry in Play ...

Finally I´ve completed my first Android app and published it to Play Store. It didn’t take that much time to do but you know how things get placed on a shelf, and when they do, well they sit tight. Now it´s there though and by naming it ”Track my training” I assured no one...

Snowball Excercise Jun05

Snowball Excercise

Normally i write about stuff at a very technical level but today I thought i´d raise my head up from the IT-trenches for a minute and reflect about something else for a change. This afternoon I attended a summer-ending/kickoff-thing at my current client Transportstyrelsen, my...

Want to group by dat...

When extracting timed statistics from SQL you usually want these stats grouped by some kind of time and more often than not this time unit is days. I used to do this unnessesarily complicated by converting the dates to varchars in formats I didn’t even want and maybe even use...

Tools of trade ̵...

If you are in an organisation which covers everything under aliases but need to know those ips or hostnames I´ve built a little tool for this. I kept pinging the aliases and using nbtstat -A everyday to find this out and finally I lacked and made myself this little commandline tool for fixing...

SQL Bottlenecks

In our environment we´ve got a heavily loaded SQL Server as a trunk in the system. Most systems look like this and sooner or later you will probably want to troubleshoot bottlenecks in this database. From a nice fellow at Microsoft we got handed the scripts from Jimmy May´s blog that gives us...

Forcing checkout on ...

Have you ever had the problem with editing files offline or outside of Visual Studio only to find these files are neither marked as added or changed in TFS. Seems there isn’t a godd way to fix this in GUI but the following Stack Overflow post specifies a way to do this using the...

Saving binary fields...

The other day I stumbled upon a tool i´ve been long searching for: Sql Server Managment Studio Boost Its got a lot of features but the one I´d like to highlight is the long wanted ”save binary data” -function. Its simple as hell and even got a few presetup formats that it can open...

Yield Return Dangero...

I´m a big fan of neat constructs such as the yield return in C#. The yield return allows you to return results from a method line by line instead of summing it up in a list or such. You can see the differnence in these two methods: C# public IEnumerable<string> ReturnedAsList() { return...