<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>David Kröll | Software Engineer - Student</title><link>https://davidkroell.com/</link><description>Recent content on David Kröll | Software Engineer - Student</description><generator>Hugo</generator><language>en</language><lastBuildDate>Thu, 08 Jun 2023 00:00:00 +0000</lastBuildDate><atom:link href="https://davidkroell.com/index.xml" rel="self" type="application/rss+xml"/><item><title>Migrating My Personal Homepage from Gatsby to Hugo: A Journey of Simplicity</title><link>https://davidkroell.com/posts/2023/migrating-gatsby-to-hugo/</link><pubDate>Thu, 08 Jun 2023 00:00:00 +0000</pubDate><guid>https://davidkroell.com/posts/2023/migrating-gatsby-to-hugo/</guid><description>&lt;h1 id="introduction"&gt;Introduction&lt;/h1&gt;
&lt;p&gt;As web technologies evolve, developers constantly explore new tools and frameworks to enhance their websites&amp;rsquo; performance and maintainability.
One such transition involves migrating a personal homepage from Gatsby,
a popular React-based web framework, to Hugo, a static site generator written in Go.
In this blog post, we will explore the motivations behind such a migration and discuss the steps involved in making the switch.&lt;/p&gt;
&lt;h2 id="why-migrate-from-gatsby-to-hugo"&gt;Why Migrate from Gatsby to Hugo?&lt;/h2&gt;
&lt;p&gt;There are three main points, with the last one being the most impactful on my decision to finally migrate.&lt;/p&gt;</description></item><item><title>Switch is Faster than If (in C#)</title><link>https://davidkroell.com/posts/2022/switch-is-faster-than-if/</link><pubDate>Tue, 24 May 2022 00:00:00 +0000</pubDate><guid>https://davidkroell.com/posts/2022/switch-is-faster-than-if/</guid><description>&lt;p&gt;C# does support multiple control structures such as &lt;code&gt;if&lt;/code&gt;, &lt;code&gt;else&lt;/code&gt;, &lt;code&gt;switch&lt;/code&gt;, &lt;code&gt;while&lt;/code&gt;, &lt;code&gt;for&lt;/code&gt; (and some more).
With a control structure you can split your code in multiple possible paths, based on a codition.&lt;/p&gt;
&lt;p&gt;&lt;img src="control-structure.png" alt="A general graphical representation of a control structure"&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;A general graphical representation of a control structure&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;if&lt;/code&gt; and &lt;code&gt;switch&lt;/code&gt; statements are very well-known and adopted in most programming languages nowadays.
They are also often applied for the same use-case.&lt;/p&gt;</description></item><item><title>A Time-Scoped Registration Mechanism for Microsoft .Extensions.DependencyInjection</title><link>https://davidkroell.com/posts/2022/timescoped-registration-with-ms-di/</link><pubDate>Mon, 18 Apr 2022 00:00:00 +0000</pubDate><guid>https://davidkroell.com/posts/2022/timescoped-registration-with-ms-di/</guid><description>&lt;p&gt;The Microsoft Dependency Injection (DI) container provides three different types of registrations.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Transient&lt;/li&gt;
&lt;li&gt;Scoped&lt;/li&gt;
&lt;li&gt;Singleton&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A &lt;code&gt;Transient&lt;/code&gt; registration will always create a new instance of a service when requested.
When registered as &lt;code&gt;Scoped&lt;/code&gt;, there will be a single instance within a scope.
A scope can be anything and is created via the &lt;a href="https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.serviceproviderserviceextensions.createscope?view=dotnet-plat-ext-6.0"&gt;&lt;code&gt;IServiceProvider.CreateScope()&lt;/code&gt;&lt;/a&gt;
extension method.
For example, in ASP.NET every HTTP request has it&amp;rsquo;s own scope.
The last type is the &lt;code&gt;Singleton&lt;/code&gt; (a GoF design pattern), this resolves always the same instance, as the name suggests.&lt;/p&gt;</description></item><item><title>Don't use String.ToLower() in C# when comparing strings</title><link>https://davidkroell.com/posts/2022/dont-use-tolower-to-compare-strings/</link><pubDate>Tue, 15 Mar 2022 00:00:00 +0000</pubDate><guid>https://davidkroell.com/posts/2022/dont-use-tolower-to-compare-strings/</guid><description>&lt;p&gt;When comparing strings, often the casing should be ignored in the comparison.
Most of the times, this is required because every user writes text different.
I do not really care when there is &amp;ldquo;Apple&amp;rdquo; or &amp;ldquo;apple&amp;rdquo; in a dataset.
To me, this is the same.
On the other side, &amp;ldquo;A&amp;rdquo; and &amp;ldquo;a&amp;rdquo; are different characters for computers.&lt;/p&gt;
&lt;p&gt;To overcome this problem, a working and very wide-spread approach is to first lowercase (or uppercase)
all letters and then compare them.
Most of us done it, me too - but no longer.
Although there is a drawback you should keep in mind when it comes to performance.&lt;/p&gt;</description></item><item><title>A Simple Trick to Boost Performance of Async Code in C#</title><link>https://davidkroell.com/posts/2022/boost-async-code-in-csharp/</link><pubDate>Tue, 08 Feb 2022 00:00:00 +0000</pubDate><guid>https://davidkroell.com/posts/2022/boost-async-code-in-csharp/</guid><description>&lt;p&gt;Performance is something every developer cares about.
Even if most of us care about it too early, sooner or later it will impact the user experience if we do not improve performance.
A very crucial part of performance is the latency a user is exposed to.&lt;/p&gt;
&lt;h2 id="tl-dr"&gt;TL; DR:&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;Use &lt;code&gt;Task.WhenAll()&lt;/code&gt; to execute tasks in parallel,
if the following task does not depend on a return value of the previous one.
This will reduce latency dramatically - without having to optimize every single code-path (if even possible).&lt;/p&gt;</description></item><item><title>Homemade DI: The How's and Why's of Dependency Injection (in dotnet)</title><link>https://davidkroell.com/posts/2021/homemade-di-the-hows-and-whys-of-dependency-injection/</link><pubDate>Thu, 04 Nov 2021 00:00:00 +0000</pubDate><guid>https://davidkroell.com/posts/2021/homemade-di-the-hows-and-whys-of-dependency-injection/</guid><description>&lt;p&gt;Once upon a time, a junior developer asked himself:
&amp;ldquo;What is this dependency injection thing that all the seniors are talking about?&amp;rdquo;
He know how to use it, but he was not familiar with the principles behind it,
nor he fully understood why all of them are using it.&lt;/p&gt;
&lt;p&gt;Once, I&amp;rsquo;ve been this developer, but now I&amp;rsquo;m one of the seniors who believe that dependency injection (DI)
is a very important and useful concept we all should be familiar with.
Then I sometimes thought how hard could it be to create a DI framework myself?
How hard could it be to create some instances of classes which are registered first?
It&amp;rsquo;s not magic, neither is it hard.
I&amp;rsquo;d like to show you now how to do it - and maybe it will help you understand it better.&lt;/p&gt;</description></item><item><title>Strategy Design Pattern with Dependency Injection</title><link>https://davidkroell.com/posts/2021/strategy-design-pattern-with-di/</link><pubDate>Tue, 21 Sep 2021 00:00:00 +0000</pubDate><guid>https://davidkroell.com/posts/2021/strategy-design-pattern-with-di/</guid><description>&lt;p&gt;The strategy pattern is a behavioral design pattern which
lets you select an algorithm at runtime.
Rather than implementing it directly, you will end up having multiple code parts
with the same interface, which are completely interchangeable.
This design pattern was invented by the famous GoF back in the &amp;lsquo;90.&lt;/p&gt;
&lt;p&gt;In this article I&amp;rsquo;d like to show a different implementation of it
using dependency injection and discuss the pros and cons
in contrast to the &amp;ldquo;classic&amp;rdquo; implementation.&lt;/p&gt;</description></item><item><title>Zero to Hero: Containerizing .NET 5.0 WebApis</title><link>https://davidkroell.com/posts/2021/zero-to-hero-containerizing-dotnet-5-webapis/</link><pubDate>Sat, 10 Jul 2021 00:00:00 +0000</pubDate><guid>https://davidkroell.com/posts/2021/zero-to-hero-containerizing-dotnet-5-webapis/</guid><description>&lt;p&gt;In this guide I&amp;rsquo;d like to show the most important topics and aspects when talking about containerizing a .NET 5.0 WebApi application.
There are many articles about it online but no one takes care of all aspects - until now.
With this guide you&amp;rsquo;d be able to go from zero &amp;#x30;&amp;#xfe0f;&amp;#x20e3; to hero &amp;#x1f5fb; when talking about containers and .NET 5.0 WebApi.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;This articles focuses on building the app inside a Linux container.
I won&amp;rsquo;t talk about .NET Framework (4.x) which would require the Windows platform to run.&lt;/p&gt;</description></item><item><title>Custom Phone Mockups for Onyx Boox Note Air</title><link>https://davidkroell.com/posts/2021/custom-mockups-for-onyx-boox-note-air/</link><pubDate>Sat, 09 Jan 2021 00:00:00 +0000</pubDate><guid>https://davidkroell.com/posts/2021/custom-mockups-for-onyx-boox-note-air/</guid><description>&lt;p&gt;When I&amp;rsquo;m doing mockup prototyping for user interfaces, I still prefer painting by hand rather than using mockup tools.
I feel confident with &lt;a href="https://draw.io/"&gt;draw.io&lt;/a&gt;, but not for the first prototyping session.
There you just have to be creative. And creativity does not come from a UI design tool.&lt;/p&gt;
&lt;p&gt;Since I just got a new Onyx Note Boox Air, I&amp;rsquo;ve created new templates for mobile device mockups.
There are three version inside the package, two iPhone and an Android mockup.&lt;/p&gt;</description></item><item><title>Custom screensaver for Onyx Boox Note Air</title><link>https://davidkroell.com/posts/2020/custom-screensaver-for-onyx-boox-note-air/</link><pubDate>Fri, 25 Dec 2020 00:00:00 +0000</pubDate><guid>https://davidkroell.com/posts/2020/custom-screensaver-for-onyx-boox-note-air/</guid><description>&lt;p&gt;Since I&amp;rsquo;ve noticed that you may customize the screensaver for the Onyx Boox Note Air, I searched the web for some nice screensavers but there were none.
So I had to create my own. I&amp;rsquo;ve chosen (as always) mountains for the background.&lt;/p&gt;
&lt;p&gt;At the time of creating this screensaver, I was reading Reinhold Messners Book &lt;code&gt;Über Leben&lt;/code&gt;,
so I chose to take the dolomites for the background. More specifically, these are the &lt;a href="https://www.google.at/maps/place/Odlegruppa/"&gt;Geisler Spitzen&lt;/a&gt; in Messner&amp;rsquo;s hometown.
The base image is from Unsplash, shot by &lt;a href="https://unsplash.com/@stefanobaz"&gt;Stefano Bazzoli&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Progress indicator for console applications</title><link>https://davidkroell.com/posts/2020/progress-indicator-for-console-applications/</link><pubDate>Tue, 01 Dec 2020 00:00:00 +0000</pubDate><guid>https://davidkroell.com/posts/2020/progress-indicator-for-console-applications/</guid><description>&lt;p&gt;Every piece of software should inform the user about it&amp;rsquo;s current state and progress. For longer-lasting operations it&amp;rsquo;s sometimes very difficult to evaluate the level of completion.&lt;/p&gt;
&lt;p&gt;Whether it can also be impossible, most of the time it&amp;rsquo;s not worth the complexity.&lt;/p&gt;
&lt;p&gt;So I would like to show you a dead-simple but very effective way to tell the user that the app is still running but it will take some time.
The solution below is impressively easy but works very well.
Hence the simplicity it is almost always worth to make use of this approach.&lt;/p&gt;</description></item><item><title/><link>https://davidkroell.com/index-about/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://davidkroell.com/index-about/</guid><description>&lt;h1 id="hello"&gt;Hello,&lt;/h1&gt;
&lt;p&gt;my name is David and I work as a software engineer in the Austrian city of &lt;strong&gt;Graz&lt;/strong&gt;.
I&amp;rsquo;m currently enrolled in TU Graz&amp;rsquo;s &lt;strong&gt;Software Engineering &amp;amp; Management&lt;/strong&gt; programme.
In addition, I work as a Cloud Platform Engineer at &lt;a href="https://anexia.com/"&gt;Anexia&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I enjoy using code to design and create products of excellent quality.
I always use state-of-the-art technology to achieve the best results.
Naturally, this involves a &lt;strong&gt;lot of passion&lt;/strong&gt; and a lot of openness to self-paced learning.&lt;/p&gt;</description></item></channel></rss>