Skip to main content

3 posts tagged with "JavaScript"

JavaScript and Node.js — utility functions, learning resources and issues met inside containers.

View All Tags

ONNX Runtime Dies on Alpine: the ld-linux-x86-64.so.2 Error and Why libc6-compat Won't Save You

· 14 min read
Nguyễn Huỳnh Minh Tiến
Middle Fullstack Developer @ Utop.vn
Summary

onnxruntime-node ships prebuilt binaries built against glibc, and libonnxruntime.so.1 carries a DT_NEEDED entry pointing directly at ld-linux-x86-64.so.2 — glibc's own dynamic loader. Alpine uses musl, where that file does not exist, so dlopen fails at the library-loading step. Installing libc6-compat or gcompat does not fix it: they provide the loader file so you clear the first error, then die on the second one, __vsnprintf_chk: symbol not found. The practical answer is to change the base image to node:22-bookworm-slim, paying about 89 MB more for something that actually runs.

At 21:30 I added a Dockerfile for ClubDay — an event web app whose drawing game is scored by an ONNX model running on the server itself. The base image was reflex: node:22-alpine, because it is small.

The image built cleanly. The container came up. docker ps was green. Then, at the moment the server loaded the model, everything collapsed with an error line that never mentions ONNX:

Error loading shared library ld-linux-x86-64.so.2: No such file or directory
(needed by /app/node_modules/onnxruntime-node/bin/napi-v6/linux/x64/libonnxruntime.so.1)

At 21:44 I changed one line in the Dockerfile and everything worked. But the fourteen minutes in between are worth writing down, because that error line names a file you never installed, never declared in package.json, and which is simply always there on your development machine.

Những hàm JavaScript hữu ích

· 3 min read
Nguyễn Huỳnh Minh Tiến
Middle Fullstack Developer @ Utop.vn
Summary

Bài viết giới thiệu các hàm tiện ích JavaScript hữu ích được sử dụng trong các dự án thực tế, bao gồm các hàm xử lý object như GetValuesByKey, FlattenObject, FlattenObjectWithKey. Mỗi hàm được trình bày kèm code examples, test cases và use cases cụ thể. Các hàm này giúp developers xử lý dữ liệu phức tạp một cách hiệu quả và tái sử dụng code trong các dự án JavaScript/TypeScript.

Ngày nay, JavaScript là một trong những ngôn ngữ lập trình phổ biến nhất trên thế giới. Nó được sử dụng bởi nhiều công ty như Google, Facebook, Microsoft, v.v. để xây dựng các ứng dụng web. JavaScript là một ngôn ngữ rất mạnh mẽ có thể được sử dụng để xây dựng các ứng dụng web phức tạp. Nó cũng là một ngôn ngữ rất linh hoạt có thể được sử dụng để xây dựng các ứng dụng web đơn giản.

Trong bài viết này, tôi sẽ liệt kê một số hàm tiện ích JavaScript hữu ích nhất mà tôi đã sử dụng trong các dự án của mình.

The Best Websites for Learning JavaScript

· 4 min read
Nguyễn Huỳnh Minh Tiến
Middle Fullstack Developer @ Utop.vn
Summary

This post introduces the best websites for learning JavaScript, including MDN Web Docs (the official reference), freeCodeCamp (free courses), JavaScript.info (detailed tutorials) and several other learning resources. Each site is described in terms of its content, its teaching approach and why it is worth using, helping JavaScript learners from beginner to advanced find material that matches their level and goals.

JavaScript is a cross-platform, scripted, object-oriented programming language for the web. It is embedded in HTML to create dynamic, interactive pages, and it can be used for a wide range of purposes — from frontend to backend, from games to complex web applications.

In this post I will introduce some of the best websites for learning JavaScript. I will describe each of them and give you a few reasons why they are worth using.