January 2020

thousand separator with C#

If you want to output numbers with thousand separators, this can lead to unpleasant effects in multilingual systems. For example, if the data is in “German” format, but the system is set to English, a misinterpretation can occur here, and the double value 110,045 is suddenly displayed or processed as 110045. (the decimal point is then simply interpreted as a separator and makes a few thousand instead of a few hundred).

Continue reading…

Use code snippets in Microsoft Word

If you like to write your developer documentation in Word documents, you will surely want to write code snippets for examples away more often. Copy and paste from the development environment usually works quite well, syntax highlighting remains the same.

The only bad thing is that Microsoft quickly starts to rampage in formatting, especially when cross-document formatting is applied.

Continue reading…

software development in a nutshell

On an Internet research safari freshly discovered a description of how software development works. Quote:

“Software should be simple, self-explanatory and lightweight. At the same time, it must be robust against errors and as secure as possible. Basically, a bulletproof, water-repellent paper airplane that defies all external influences – preferably completely undamaged.

Nobody really knows how this should work – but “There must be a way. The animation shows very well that it is quite normal (and necessary) to start a project several times over. But it also shows that the software becomes more robust but also heavier with each iteration. Our paper airplane gradually becomes a brick. It is water-repellent, self-explanatory and if you throw it hard enough, it will fly…”

found at icancode.de

“where x in”-SQL query with LINQ

Writing SQL queries for an “in” selection can be tedious for lists in .NET… but it does not have to be!

We switch off: List<CarType> largeTypeList

into: SELECT * FROM CARS WHERE type in ('Audi', 'Ford', 'BMW', 'Nissan', ...)

Thanks to LINQ, you can easily turn a list into an “in” query.

Continue reading…