Skip to content

Duong's Blog

About technology stuff that piqued my interest

  • English
  • Vietnamese
  • About me

Category: Vietnamese

  • Home
  • Vietnamese

Type erasure và reified trong Kotlin

December 28, 2022December 28, 2022 duongnt.bk1 Comment on Type erasure và reified trong Kotlin

Trong Kotlin ta không thể sử dụng type information của hàm generic tại runtime. Trừ phi ta dùng từ khoá reified trong hàm inline.

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

FastAndFaster và dynamic code generation

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

Thư viện FastAndFaster sử dụng dynamic code generation để tạo object và gọi hàm của chúng tại runtime. Tốc độ của nó không thua gì static code.

C#, Vietnamese C#, dynamic, il

Kluent – FluentAssertions cho Kotlin

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

Unit test không chỉ cần đúng mà còn phải dễ đọc. Với Kluent, chúng ta có viết những assertion nghe giống như ngôn ngữ tự nhiên.

Java/Kotlin, Vietnamese Kluent, Kotlin, testing

Lỗi datetime trong .NET 6 và PostgreSQL

October 17, 2022October 17, 2022 duongnt.bkLeave a Comment on Lỗi datetime trong .NET 6 và PostgreSQL

Trong lúc nâng cấp một project lên .NET 6, tôi gặp phải lỗi datetime khi sử dụng provider npgsql efcore. Hôm nay, chúng ta sẽ tìm cách sửa lỗi này.

C#, Vietnamese bug, C#, datetime

Dùng SecureString trong C# để bảo mật dữ liệu

September 20, 2022September 21, 2022 duongnt.bkLeave a Comment on Dùng SecureString trong C# để bảo mật dữ liệu

Khi lưu mật khẩu bằng string thì ta không biết được bao giờ bộ nhớ tương ứng sẽ được giải phóng. Kiểu SecureString có thể giải quyết một phần vấn đề này.

C#, Vietnamese C#, password, security

AutoFixture tạo test data như thế nào?

September 7, 2022September 7, 2022 duongnt.bkLeave a Comment on AutoFixture tạo test data như thế nào?

Tôi thường xuyên sử dụng thư viện AutoFixture để tạo dữ liệu test cho unit test. Hôm nay, chúng ta sẽ tìm hiểu cách nó sinh dữ liệu.

C#, Vietnamese AutoFixture, C#, random

Mock IHttpClientFactory để chạy unit test

August 24, 2022August 24, 2022 duongnt.bkLeave a Comment on Mock IHttpClientFactory để chạy unit test

Viết unit test cho interface IHttpClientFactory không phải là việc đơn giản. Hôm nay, chúng ta sẽ tìm hiểu 2 phương án giải quyết bài toán này.

C#, Vietnamese fakeiteasy, ihttpclientfactory, testing

Nhược điểm của Ignored trong FakeItEasy

August 8, 2022August 8, 2022 duongnt.bk1 Comment on Nhược điểm của Ignored trong FakeItEasy

FakeItEasy là thư viện tôi hay dùng để tạo mock object. Nhưng property Ignored của nó có thể gây hại nếu ta không cẩn thận.

C#, Vietnamese bug, fakeiteasy, testing

Xử lý lỗi codecs với register_error

July 25, 2022July 25, 2022 duongnt.bkLeave a Comment on Xử lý lỗi codecs với register_error

Trong Python có sẵn một số handler để xử lý lỗi encode. Hơn thế nữa, ta còn có thể tự thêm hàm handler của mình vào module codecs bằng hàm register_error.

Python, Vietnamese encoding, python

Tên trường của ValueTuple trong C#

July 11, 2022July 11, 2022 duongnt.bkLeave a Comment on Tên trường của ValueTuple trong C#

Đặt tên cho trường trong ValueTuple không phải là một tính năng đột phá của C#. Nhưng các bạn đã bao giờ tự hỏi chức năng đó hoặt động như thế nào?

C#, Vietnamese C#, ValueTuple

Posts navigation

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