A Byte of Coding Issue 413

A Byte of Coding Issue 413

A Byte of Coding

Hey-yo,

Here’s the issue.

Made possible through generous sponsorship by:

Published: 5 June 2024

Tags: javascript

Armin Ronacher explains how the setTimeout function in Node.js can cause memory leaks due to the retention of Timeout objects and AsyncLocalStorage states. He offers a workaround to manage these leaks until a bug in Node.js is resolved.

Some highlights:

  • Timeout objects in Node.js hold references that prevent garbage collection, leading to memory leaks.

  • AsyncLocalStorage attaches state to timeouts, exacerbating the issue.

  • Using numeric IDs instead of Timeout objects can mitigate the problem, pending a Node.js bug fix.

Published: 4 June 2024

Tags: perl

Thomas Klausner explains how to chop a string to a specific byte length in Perl, dealing with UTF-8 characters. He highlights challenges in handling Unicode within byte-limited formats like USMARC.

Some highlights:

  • UTF-8 uses variable-length encoding, leading to differences between byte and character lengths.

  • Perl’s bytes::length() and bytes::substr() can manage byte-specific string operations, but require care with UTF-8 encoding.

  • Encode::FB_QUIET can be used to avoid invalid byte sequences when truncating UTF-8 strings.

Published: 25 January 2024

Tags: sponsored, auth

WorkOS discusses what Directory Sync and System for Cross Identity Management are, and why they’re necessary for large organizations.

Some highlights:

  • Directory sync “automates the lifecycle management process by providing a single source of truth for identity”

  • “SCIM is an open source protocol for implementing Directory Sync”

  • Includes comparison to just-in-time provisioning

Published: 24 April 2024

Tags: math

Andrei Ciobanu introduces Fourier Series with animations, starting with trigonometric basics and leading up to complex sinusoids and epicycles. The series aims to make Fourier mathematics more accessible and engaging through visual aids and step-by-step explanations.

Some highlights:

  • Trigonometric functions like sine and cosine are foundational to understanding Fourier Series.

  • Euler’s identity and formula connect exponential functions to trigonometric functions.

  • Fourier Series decompose periodic functions into sums of sinusoids, enabling analysis and reconstruction of complex waveforms.

Thanks for your Support!

Big thanks to all of the Patreon supports and company sponsors. If you want to support the newsletter you can checkout the Patreon page. It's not necessary, but it lets me know that I'm doing a good job and that you're finding value in the content.A Byte of Coding Issue 412