Parsing floating point numbers

One of my StackOverflow answers is about converting string to double. I answered the question long time ago, but it still gets me some upvotes. It looks like this topic requires some more attention. In this post I’m going to show you about possible pitfalls of parsing float/double numbers. You’re also going to learn how to safely convert string to float and string to double. This post is language agnostic, meaning that the concepts do not depend on specific language. However I’m going to include code snippets in C#. ...

September 24, 2018 · 4 min · Zbigniew

Making things invisible in CSS

This post will teach you the 3 ways to make elements invisible in CSS. Each one behaves differently and has it own use case. Let me introduce you to the display, visiblity and opacity properties. CSS display property Every element on a page is a box (rectangle). Display specifies behavior of this box and how to renders on page. There are many values that can be used (full list here), but there are just a few commonly used, e.g.: ...

August 5, 2018 · 3 min · Zbigniew

ASP.NET Core routing introduction

This article will introduce you to the concept of routing in ASP.NET Core framework. What is routing? Simply said routing is a process of mapping URLs to controllers and actions. If you’ve ever wondered how does your app “know” that /Home/Index request should be handled by HomeController.Index method then routing is the answer. You can make special routes, which allow you to provide additional parameters as a part of url. A common example is an “id”. In the “old days” URLs looked like this: http://localhost/page?id=1 now you can easily map it to more human friendly http://localhost/page/1 or even http://localhost/page/about-us. ...

July 22, 2018 · 8 min · Zbigniew

Entity Framework Core Snapshot

In this article you’re going to learn what is a mysterious <DBName>Snapshot.cs file in your solution. I’m going to teach you why snapshot file exists and how it relates to migrations. Introduction to migrations You create new app which requires a database. But you change the model (classes) often so every time you change your model (e.g. you add new column) you need to update your database schema. It’s a lot of work, but there’s a way to automate it. ...

June 3, 2018 · 3 min · Zbigniew

Learn/Teach LINQ using TDD/TDL

Long time ago I’ve created a project which purpose is to teach LINQ using tests. Technically it’s not exacly TDD. I’d rather call it TDL (test-driven learning), an “invention” of my own ;) Before we start let me point you to source code located on my GitHub repository. Learning LINQ The basics of LINQ are fairly easy. We have to learn how to filter, sort and project data. It can be used in two ways: the method syntax and the query syntax. This can feel weird in the beginning. Method syntax is my prefered way of using LINQ. I also think that LINQ newbies should start with it. ...

May 20, 2018 · 3 min · Zbigniew