Skip to content

Duong's Blog

About technology stuff that piqued my interest

  • English
  • Vietnamese
  • About me

Tag: python

  • Home
  • python

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

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

Deep copy trong Python hoạt động như thế nào?

April 20, 2022April 20, 2022 duongnt.bk1 Comment on Deep copy trong Python hoạt động như thế nào?

Hàm deep copy đảm bảo rằng mọi thay đổi trên bản sao không làm ảnh hưởng tới bản gốc. Hôm nay chúng ta sẽ cùng tìm hiểu cách thức hoạt động của nó.

Python, Vietnamese copy, deepcopy, python

Python deep copy in action

April 20, 2022April 20, 2022 duongnt.bk3 Comments on Python deep copy in action

The deep copy method makes sure that changes made to a copy don’t affect the original object. Today, we will see how it works behind the scenes.

English, Python copy, deepcopy, python

Thủ thuật với Context Manager trong Python

April 2, 2022April 2, 2022 duongnt.bk1 Comment on Thủ thuật với Context Manager trong Python

Context manager trong Python thường được dùng để quản lý việc cấp phát và giải phóng tài nguyên. Nhưng hôm nay ta sẽ dùng nó cho những mục đích khác lạ hơn.

Python, Vietnamese context-manager, python

Python Context Manager and some tricks

April 2, 2022April 2, 2022 duongnt.bk1 Comment on Python Context Manager and some tricks

Context manager is an interesting feature in Python. Its main use is to manage resources. But today, we will explore some of its more exotic uses.

English, Python context-manager, python

Dùng init_subclass để thay thế cho metaclass

February 17, 2022February 17, 2022 duongnt.bk1 Comment on Dùng init_subclass để thay thế cho metaclass

Metaclass là một tính năng thú vị của Python. Nhưng trong một số trường hợp, nó là phức tạp hơn mức cần thiết. Lúc đó, ta có thể sử dụng hàm `init_subclass`.

Python, Vietnamese init_subclass, metaclass, python

Use init_subclass to replace metaclasses

February 17, 2022February 17, 2022 duongnt.bkLeave a Comment on Use init_subclass to replace metaclasses

Metaclass is an interesting feature in Python. But in many situations, it is overkilled. From version 3.6, we can replace it with the `init_subclass` method.

English, Python init_subclass, metaclass, python

Tạo adversarial example bằng Tensorflow

January 16, 2022January 24, 2022 duongnt.bk1 Comment on Tạo adversarial example bằng Tensorflow

Adversarial example là tên gọi các ví dụ được tạo ra để đánh lừa model deep learning. Ta sẽ dùng Tensorflow và FSGM để tạo ra một ví dụ như thế.

Python, Vietnamese adversarial-example, deep-learning, python, TensorFlow

Create adversarial example with Tensorflow

January 16, 2022February 2, 2022 duongnt.bkLeave a Comment on Create adversarial example with Tensorflow

An adversarial example is a data point specifically crafted to fool a deep learning model. Today, we will use Tensorflow and FSGM to create one such example.

English, Python adversarial-example, deep-learning, python, TensorFlow

Posts navigation

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