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.
About technology stuff that piqued my interest
If we store passwords in string objects, we cannot control when the corresponding memory is reclaimed. The SecureString type can partially solve this issue.
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.
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.
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.
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.
Writing unit tests for the IHttpClientFactory interface is not that straightforward. Today, we will explore two different ways to solve this problem.
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.
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.
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 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.