Make A Game

Today we´re going to have a little seminar again. This time for 1st and 2nd years of the IT Gymnasie in Örebro. The resources we´re going to use is the simplistic yet fantastic program Game Maker from Yo Yo Games, download it  here: Game Maker Lite (f0r Windows) Game...

VS 2010 SP 1 Breaks SQL Server Management Studio Intellisense

I´ve been frustrated about the lack of intellisense in SQL Server Management Studio, I´m using the 2008 R2 version which I later found should have this. Looking around I found that apparently the SP 1 of Visual Studio 2010 breaks this intellisense, no wonder I never...

Abusing SEO

SEO (Search Engine Optimization) is based largely on crosslinking. That is, every link on the web pointing to your site increases your chance for a higher page rank. For an example Loopia (my domain provider) just setup a competition in which signing up is made up of...

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

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

Textblocks and implicit labels in WPF

Ok, I´ll just do something you don't want me to, says Mr Label. Styles are one of the main reasons in, my opinion, to why WPF  is a preferable choise of GUI base but sometimes, well I most definatly hate it 🙂 Look at this here xaml for my default styles:...

Dangerous cache

Caching is good. Generally speaking that is. However when applied to a legacy system without regard to the actual system, well then it might lock your users out 🙂 Frankly I´m quite suprised we didn't see worse scenarious. The case We´ve got this site previously...

SkyDrive in 5 minutes, who would have guessed?

Ok, so finally I got the so called thumb out of my so called arse and setup some kind of second backup for all my imagery. I shouldn't take the real credit though It was my fiance that said "ok now we really should back stuff up", you just gotta love having a fiance...

Table size

When using large databases it might be interesting to keep an eye out on what of your tables that actually consumes all that disk. There´s a lot of resources on this out there but I thought I´d repeat it anyways since its such a neat little thing:...

Entity Framework query sql

Ever tried to build complex joins using Linq with Entity Framework and finally ending up with something you just suspect might be a hell of a lot less efficient than possible? In that moment it might prove useful to get the clean actual SQL your Linq query actually...

Articles

Total 101 articles published this far.

Crayon syntax highlighter

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

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

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

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

Sort your list drag & drop in the web

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

Revoke impersonation in C#

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

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-5b9d87173be5c401072960/] You get all recently executed queries (which in itself can be useful for a legacy database), the...

Rounding or grouping datetime in SQL

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: [crayon-5b9d87173c349350103913/] However, some times you will want to go even deeper in...

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

Debug silverlight in firefox

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

First entry in Play store – Track my Training

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

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

Want to group by date? Cast to date!

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

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

Yield Return Dangerously Delicious

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: [crayon-5b9d87173e0b1899979985/] You...

Comparing exact datetimes in entity framework

Seems there´s still some issues you have to struggle with in Entity Framework even though the latest releases have made it actually possible to work with. This time I got a problem whilst trying to retreive av bunch of items logged with the same timestamp. Entity...

Copy from WPF Datagrid

I´ve used the WPF builtin Datagrid for presenting data easily in like tooling applications and such. Problem is, sooner or later you´ll find yourself wanting to copy that darn data to excel or a mail. I´ve been struggling with this and found some quite poor ideas on...

Table size

When using large databases it might be interesting to keep an eye out on what of your tables that actually consumes all that disk. There´s a lot of resources on this out there but I thought I´d repeat it anyways since its such a neat little thing:...

Dangerous cache

Caching is good. Generally speaking that is. However when applied to a legacy system without regard to the actual system, well then it might lock your users out 🙂 Frankly I´m quite suprised we didn't see worse scenarious. The case We´ve got this site previously...

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

First pingback

Yay! Greycastle´s got its first Pingback. Thanks out to Craig for actually reading this blog 🙂   It´s a short mention at least.

Select on on TextBox Focus

For once I´ll ramble less and provide more 🙂 A simple class to help you make the WPF TextBox able to select the text when it gets focus. I´ve gotten tired of subclassing all the time so this is a neat little class that you can just attach to any TextBox-control. The...