Recently I had a task to create MS SQL tables with dynamic names and my first thought was ok, I pass this as a parameter. But I was wrong, MS SQL (as of today) does not allow parameters as table names. Note: One can argue that dynamic table names are bad programming practices, but let’s … Continue reading C# and SQL Injection Attacks
Category: .NET
C# throw vs throw exception
Recently Clounce was browsing some C# code and noticed that sometimes junior developers use throw exception rather than simply throw in try..catch clauses. Let’s see an example and then examine the results. Consider this piece of code: Of particular importance is the catch block in Method1() at line 22. In this block, the developer is … Continue reading C# throw vs throw exception
Linq Deferred Loading impact on atomic operators
When working with Atomic Operators and deferred operations provided by the Linq extensions, it is important to understand the behaviour of the program. Consider the following code: int i = 10; var q = (from m in Enumerable.Range(1, 5) select ++i + i++); foreach (var n in q) { Console.WriteLine(“i = {0}; n = {1}; … Continue reading Linq Deferred Loading impact on atomic operators
Fun with MNIST dataset
Recently Clounce was carrying out some experiments with MNIST dataset and he wanted to glimpse at how the digits in this dataset looks like. So he thought of displaying them using ASCII art in a console window. What is the MNIST dataset? MNIST (http://yann.lecun.com/exdb/mnist/index.html) is a subset of NIST (https://www.nist.gov/srd/nist-special-database-19), a database for handwritten digits. … Continue reading Fun with MNIST dataset
Nuget Sitecore Habitat
Sitecore Habitat is an open source library that provides over 50 modules for Sitecore that can be used within any project. This article outlines one way of building Sitecore Habitat project into Nuget Packages using TeamCity. Note: It is assumed that: You already have configured TeamCity Server and at least one TeamCity Build Agent. You … Continue reading Nuget Sitecore Habitat