Skip to content

Data Analysis

How to Track Down the Elusive 0x00 Character in Your Data

There are a whole bunch of non-printable characters in ASCII like tabulator, end of medium or shift in that sometimes finds its way into a user input. This often happens when copy and pasting data from Microsoft Office.

We can find most of those special characters by copying the data from SQL Server Management Studio into Notepad++. A little visible indicator is all we need to find the special character and remove it. However, 0x00 represents NULL and has no visual indicator, what makes it uncatchable for our usual process.

Last week we got this exception that started an unprecedented hunt for a special character:

System.Xml.XmlException: '.', hexadecimal value 0x00, is an invalid character. at System.Xml.XmlConvert.VerifyCharData(String data, ExceptionType invCharExceptionType, ExceptionType invSurrogateExceptionType)

We checked, double-checked and triple-checked all the data and found nothing. We fixed a bunch of entries, but nothing changed. The exception kept showing up.

Why Jetpack Stats Could Be Giving You a Skewed Picture of Your Visitors

As with many other websites these days, the number of page views for this blog has plummeted. The lower the numbers are, the more important it would be for the statistics tool to report the correct numbers. Unfortunately, Jetpack Stats is not up to the task. After collecting data for the last 12 months, I concluded that Jetpack misses up to 30% of the page views.

Access your C# Projects Through Code With Roslyn

Roslyn allows us to access our code through code. That permits us to analyse and work with code in a way that was impossible before. In this post we look at the basic parts of working with a Visual Studio solution to figure out what parts make up our application.

The syntax of Roslyn has not changed much in the 5 years since my first experiments. However, the same is not true for the dependencies and the things that work behind the API. Here we need a new combination of Roslyn and its dependencies to explore our solutions through code.

My Highlights of NDC Oslo 2022

Back in Oslo at last. After an online edition of NDC Oslo in 2020 and the travel restrictions at the start of the Omicron wave in 2021, I haven't been to Oslo for a while.

Visiting in September is in many ways different from June. It is colder, and it gets dark early (around 7 pm), yet Oslo is still the same with its constant changes. The Munch museum and the new Deichman main library are now open. After seeing for years how those buildings grow, I now had the opportunity to visit them. Both are close to the Oslo Opera House and worth a visit.

How to Calculate the Time Between Two Rows in SQL Server

I had an interesting problem to solve: How long did a task take to complete? The challenge was that our task history table contains one row for the start and another one for the end of a task:

Id TaskId Action Timestamp
1 100 Start 2022-08-01 08:00:00.000
2 101 Start 2022-08-02 07:30:00.000
3 100 Stop 2022-08-03 17:00:00.000
4 102 Start 2022-08-04 08:00:00.000
5 102 Stop 2022-08-04 17:00:00.000
6 101 Stop 2022-08-05 18:00:00.000