Mapping an Pivot Query in EntityFramework6

At work I had a challenging problem in the last days (in fact I like challenging problems and they’re not that rare which is why I like my job).

This time the problem was this:

  1. Let T be a table with columns C and X.
  2. Let the column E be of an enum type with a short, static defined values E1, E2, E3.
  3. Let the column X be a space separated list of tokens (values look like „ABC“, „ABC DEF“, „XUT OSH OJR“, with an arbitrary number of tokens).
  4. We look for the following information:
    For a given token x in the values of X get a tuple R = (#(E1), #(E2), #(E3)), where #(Ei) denotes the number of rows in T, where x is included in X and the row has value Ei in column E.

Mapping an Pivot Query in EntityFramework6 weiterlesen

Ozcode’s export object(s) feature, a first review (part 1)

Nearly half a year ago, in November 2015 I wrote a first article about a feature of the OzCode, an awesome debugging tool that plugs into Visual Studio and enhances it by many features in the debugging field I don’t want to miss again.

Recently Version 2.0 of OzCode has been published and today I finally found the time to test it in more depth. The whole article is based on OzCode version 2.0.0.1413.

For testing I wrote a very small test project with some XUnit tests. Unit testing as such is not necessary in this case, but these tests are easy to run as a single, separated piece of code, so it was the easiest way to go. The test project is published on GitHub as ozcode-export-test.

When OzCode 2.0 was announced on twitter and I asked for a test version, they finally answered (fixed the link here that was a wrong shortlink on Twitter due to missing space):

@jongleur1983 Wait is over http://o.oz-code.com/announcing-ozcode-v2.1-beta. Doesn’t address the issues you mentioned in your post yet, but we will be looking into that.

So I do not expect any issue mentioned in my first post to be addressed, but nevertheless the feature might be quite useful, so let’s give it a try.

As this article get’s lengthy again and it’s past midnight, I decided to split it, so this post is about single-object exports only for now, I’ll try to write a next one about exporting object graphs assembled from more than one object. Ozcode’s export object(s) feature, a first review (part 1) weiterlesen

Wrapping Arbitrary HTML to Assign a common Universal Attribute

A few days ago I checked the HTML validity of my own blog. I have to admit that I didn’t do that after I wrote the jugglingPostLang plugin (wrote about that in my blog post Simple Language-Defined Posts in WordPress) for WordPress. I realized that my plugin produced invalid html in many cases, so that was an issue:

The issue is, that <span> elements forbid block level content, while <div> elements are not allowed as a child of any element that only accepts phrasing content (which is roughly running text and what’s inside).

To solve that I read through the html specifications to find a solution but unfortunately there isn’t a simple solution on the horizon.

In the following I’m going to summarize the html specification details on the topic and give a rough sketch on the algorithm to determine what’s a valid wrapping node. Wrapping Arbitrary HTML to Assign a common Universal Attribute weiterlesen

Strange behaviour of String Interpolation Refactorings in VisualStudio 2015/Roslyn/Resharper

We switched to VisualStudio 2015 at work a few days ago, using Resharper inside as before. VisualStudio has some great new features in this version, a few bugs, and some strange behaviours I don’t understand.

In some articles I’m going to talk about some strange refactoring suggestions I discovered, starting with string interpolations here.

Just to ask beforehand: Is there any way to identify where a refactoring comes from (is it a suggestion and/or implementation of Roslyn or Resharper?) Strange behaviour of String Interpolation Refactorings in VisualStudio 2015/Roslyn/Resharper weiterlesen

Open Question: How to always run a custom tool in Visual Studio on Project Build?

In a project at work we have some T4 templates running in a Visual Studio (2015) environment. Those templates should run whenever some dependent files have changed. As it’s kind of a compilation step, a best fit, I thought, would be to run the templates on every (re-)build of the project, but how to achieve that? Open Question: How to always run a custom tool in Visual Studio on Project Build? weiterlesen

HTML5-Audioplayer für 1LIVE

In einem anderen Artikel habe ich bereits darüber geschrieben, wie unnötig die großen deutschen Medienanstalten bis heute auf den Flash-Player als Abspielsoftware für Medieninhalte setzen.

Die Audio-Streams auf einslive.de habe ich mir mal etwas genauer angesehen. HTML5-Audioplayer für 1LIVE weiterlesen

Flash-Zwang beim öffentlich-rechtlichen Rundfunk

Vor einigen Tagen habe ich Windows frisch installiert. Wie üblich kommt dann die wichtigste Software zuerst, weniger Wichtiges kommt erst später, oder fällt dabei letztlich weg, weil ich feststelle, dass ich es doch nicht benötige.

Diesmal traf es (beinahe) Adobes Flash-Player: Zunächst hatte ich nur etwas weniger Werbung im Netz (obwohl sich hier offenbar viele Werbetreibenden mittlerweile von Flash abgewandt haben oder zumindest Alternativen ausliefern).

Größere Probleme hatten interessanterweise vor allem der öffentlich-rechtliche Rundfunk. Flash-Zwang beim öffentlich-rechtlichen Rundfunk weiterlesen

Simple Language-Defined posts in WordPress

For different audiences I write blog posts in different languages. Developers usually understand English and often even talk in English, it’s their lingua franca of the programming domain.
On the other hand other articles are about more local topics, so their target audience is mainly Germans. Here I prefer writing in my mother tongue. Unfortunately there seems to be no easy and simple solution to define the language per article in WordPress, so I considered to write one myself.

The plugin is available for download on github now.

Read further for more details on What it does, How it is done, Why I did it and What could be added. Simple Language-Defined posts in WordPress weiterlesen

IEnumerable, ICollection, IReadOnlyCollection – an API analysis on .NET and XUnit

Today for the first time since I use XUnit I wrote a theory where the individual test parameters could not be easily defined as compile time constants.

In the next chapter I’m going to explain the motivation and the use case that arose here, before the next chapter will try to give a summary over the .NET API that’s behind that issue and what’s wong with it. IEnumerable, ICollection, IReadOnlyCollection – an API analysis on .NET and XUnit weiterlesen

Ozcode upcoming feature tweet: serializing objects for debugging

Currently oz_code asks about what developers want to see in future versions of their Visual Studio extensions to simplify and enhance debugging experience.

We use oz_code at work for complex .NET/WPF desktop applications and it is an invaluable tool for various use cases while debugging.

Today I read this tweet from @oz_code:

Would you like to be able to serialize objects from your debugging session and then use those objects in a Unit Test? (feature planning)

And I didn’t have to think twice about it: yes! But it didn’t take a minute thinking about what would be possible – and was a developer myself: What might be challenges of such a feature (even though I don’t have to implement it myself).

Ozcode upcoming feature tweet: serializing objects for debugging weiterlesen