MyApollo

MyApollo

Learn programming languages and the latest technology trends with ease, and embark on your programming learning journey!

Awesome Article Sharing — 5 Cool Chrome DevTools Features You Might Not Know

“5 Cool Chrome DevTools Features Most Developers Don’t Know About” outlines five useful Chrome DevTools features. After reading, I realized I only knew one out of the five, and the other four are quite handy… The four features are: Live Expression This allows you to monitor the change of a value in real-time, such as the screen width, a specific element, or a JavaScript variable. Logpoints You can insert console.log() without modifying the JavaScript code.

Posted on  Jun 4, 2024  by  Amo Chen  ‐ 2 min read

Feature Flags Are Ruining Your Codebase

Feature Flags are a commonly used technique when releasing new features. They allow us to quickly turn specific features on or off, such as in the following Python code example, where you can switch between the new and old payment services through configuration settings: USE_NEW_PAYMENT_SERVICE = config.get('NEW_PAYMENT_SERVICE') is True if USE_NEW_PAYMENT_SERVICE: ...(the new logic) else: ...(the old logic) While Feature Flags are convenient, they also bring many issues that we should be aware of or may have experienced ourselves.

Posted on  Mar 25, 2024  by  Amo Chen  ‐ 3 min read

Security Alert — Beware of Malicious Links in GA4, Search Console, and Other Services

Recently, a type of malicious attack method has emerged, which uses the Referer header in HTTP to spread harmful URLs. Because the Referer header is collected by website traffic monitoring services like GA4, Search Console, and Webmaster, attackers exploit it to create popular links. This tactic is aimed at sparking curiosity in data analysts who might then click on these malicious URLs, potentially leading to security issues (such as malicious programs being injected through browser vulnerabilities)!

Posted on  Mar 21, 2024  by  Amo Chen  ‐ 1 min read

Latest articles

Explanation of MongoDB Write Concern and Read Concern

Understanding MongoDB Write Concern and Read Concern is essential when working with MongoDB cluster environments. Lack of familiarity with these two crucial concepts may lead to unexpected operations and even result in bugs.

This article aims to introduce MongoDB Write Concern and Read Concern in an easy-to-understand manner.

Posted on  Jan 11, 2024  by  Amo Chen  ‐ 8 min read

Python - Learning the weakref Module Through Examples

Python is a programming language equipped with a garbage collection (GC) mechanism, which is essentially an automated memory management system. In essence, it reclaims memory spaces that are no longer in use by the program, releasing them to prevent the problems associated with steadily decreasing available memory, such as program errors or failure to execute processes.

The GC mechanism is designed to lessen the burden on developers. In contrast, languages like C require manual memory deallocation (further details can be found in the free() function), and failure to release memory often leads to memory leaks. By relying on GC, developers can avoid worrying about memory management issues, thus improving development efficiency and reducing the likelihood of errors.

Python implements its garbage collection mechanism using a technique known as reference counting.

Last updated on  Jul 28, 2024  by  Amo Chen  ‐ 9 min read

Introduction to a Handy Python Package - structlog

When starting with Python’s logging module, many of us have encountered confusion, as with the following code example:

import logging

log = logging.getLogger(__name__)
log.info('Hello')

We might expect this code to print the string Hello, but it doesn’t.

This is because the default log level for Python’s logging module is WARNING, so only messages at WARNING, ERROR, or CRITICAL levels are displayed.

To properly use the logging module, setting it up is necessary, which often means consulting the Python documentation. This isn’t a problem with Python per se, but rather a design philosophy difference.

So, is there a package more intuitive and easier to use than the built-in logging module?

The answer is “yes,” and that is the structlog package, which this article introduces.

Posted on  Aug 30, 2023  in  Python Module/Package Recommendations , Python Programming - Beginner Level  by  Amo Chen  ‐ 4 min read