Saving binary fields to disk aswell as other neat stuff

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

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

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

A* algorithm

From time to time I appear at a local school (IT Gymnasiet Örebro, Sweden) trying to perform some kind of half assed presentations about all things under the sun. This week I´m doing a reading about the Heuristically weighted Dijkstra (I find it important to actually...

Stumbling in Linq

Ever faced any of these questions? My enumeration is empty!? Where did my items go? Why do Linq remove things I don't want removed? Where´s the items in my Where?! I just did. Linq is a nice little feature but when using enumerations you really need to keep your...

Parsing IIS-logs to SQL

Hi, I know this information is spread around the web a bit here and a bit there so I´m just adding already existing content but I need to save this somewhere I can find it again so here it goes. It´s a pain trying to look through or get statistics from IIS using the...

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

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

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

Zipping folders with FastZip

I often find myself forced to zip or unzip files if not for the sake of compression then just for bundling files together. There´s actually quite few libraries for zipping out there but they do exists. One example is SharpZip which i´ve started using, its lightweight...

Articles

Total 102 articles published this far.

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

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-5ca1ee8db50af873355097/] 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-5ca1ee8db574f972792917/] 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-5ca1ee8db8590149088321/] 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.