Skip to content

Duong's Blog

About technology stuff that piqued my interest

  • English
  • Vietnamese
  • About me

Category: English

  • Home
  • English

Type erasure and reified in Kotlin

December 28, 2022December 29, 2022 duongnt.bk1 Comment on Type erasure and reified in Kotlin

Due to type erasure, we cannot access type information of generic methods at runtime. Unless we use the reified keyword inside an inline method.

English, Java/Kotlin generic, Kotlin, reified, type erasure

FastAndFaster and dynamic code generation

December 2, 2022December 2, 2022 duongnt.bk1 Comment on FastAndFaster and dynamic code generation

FastAndFaster is a library to create objects and invoke their methods using dynamic code generation. Its performance is very close to static C# code.

C#, English C#, dynamic, il

Kluent – FluentAssertions for Kotlin

November 13, 2022November 17, 2022 duongnt.bk1 Comment on Kluent – FluentAssertions for Kotlin

A unit test not only needs to be correct but also needs to be readable. With Kluent, we can write assertions that sound like natural language.

English, Java/Kotlin Kluent, Kotlin, testing

Datetime error with .NET 6 and PostgreSQL

October 17, 2022October 17, 2022 duongnt.bk1 Comment on Datetime error with .NET 6 and PostgreSQL

While upgrading a project to .NET 6, I ran into an datetime issue with the latest npgsql efcore provider. Today, we will look at the cause and try to fix it.

C#, English bug, C#, datetime

Use SecureString to store secrets in C#

September 20, 2022September 21, 2022 duongnt.bk1 Comment on Use SecureString to store secrets in C#

If we store passwords in string objects, we cannot control when the corresponding memory is reclaimed. The SecureString type can partially solve this issue.

C#, English C#, password, security

How does AutoFixture create test data?

September 7, 2022September 7, 2022 duongnt.bk1 Comment on How does AutoFixture create test data?

I frequently use the AutoFixture library to generate test data for my unit tests. Today, we will checkout the way it generates bool, enum, and int type.

C#, English AutoFixture, C#, random

Mock IHttpClientFactory for unit testing

August 24, 2022August 24, 2022 duongnt.bk1 Comment on Mock IHttpClientFactory for unit testing

Writing unit tests for the IHttpClientFactory interface is not that straightforward. Today, we will explore two different ways to solve this problem.

C#, English fakeiteasy, ihttpclientfactory, testing

FakeItEasy Ignored might be harmful

August 8, 2022August 8, 2022 duongnt.bkLeave a Comment on FakeItEasy Ignored might be harmful

FakeItEasy is my favorite library to create mock objects for unit tests in C#. One of its features, the `Ignored` property, can be harmful if used improperly.

C#, English bug, fakeiteasy, testing

Codecs error handling with register_error

July 25, 2022July 25, 2022 duongnt.bk1 Comment on Codecs error handling with register_error

Python supports built-in handlers to cope with encoding errors. Not only that, we can also define our own handlers and register them with the codecs module.

English, Python encoding, python

All about ValueTuple field names in C#

July 11, 2022July 11, 2022 duongnt.bk1 Comment on All about ValueTuple field names in C#

Naming fields in ValueTuple is not a ground-breaking feature. After all, it is just syntactic sugar. But have you ever wondered how that feature is implemented?

C#, English C#, ValueTuple

Posts navigation

Older posts
Newer posts
Copyright © 2025 Duong's Blog All rights reserved. Theme: Flash by ThemeGrill. Powered by WordPress