Random snippets of all sorts of code, mixed with a selection of help and advice.
Writing accentuated characters doesn't work
19 November 2025 @ 7:47 am
I'm having problems figuring out to make mpdf work with accents.
The following code always break, even with a single accentuated character.
$mpdf = new Mpdf();
$mpdf->WriteHTML(mb_convert_encoding('î', 'UTF-8'));
$mpdf->OutputHttpDownload('filename.pdf');
The raised exceptions comes from Mpdf::GetCharWidthNonCore() line 3920
as Mpdf::UTF8StringToArray() return an empty array.
How to fix it?
ActiveProcessorCount is showing "-1" even after specifying CPU limits in Container
19 November 2025 @ 7:44 am
I have my application running on an AL2023 node in EKS cluster.
Below is the snippet of the Container resources in the Pod definition
resources:
# memory ~ heap space +10%
# CPU ~ no more than 1/8 of memory
requests:
cpu: 2000m
memory: 22G
# CPU ~ 4x requested
limits:
cpu: 4000m
memory: 24G
As per my understanding the ActiveProcessorCount value should be equal to CPU Limits which should 4, but it is showing as -1
java -XX:+PrintFlagsFinal -version | grep -E 'ActiveProcessorCount'
intx ActiveProcessorCount = -1 {product}
Does this mean, it is not able to detect the Container Limits with cgroup v2 even with Container Support enabled? I am running openJDK version 1.8.0_392.
cat /proc/self/mounts | grep cgroup
cgroup /sys/fs/cgroup cgroup2 ro,seclabel,nosuid,nodev,noexec,relatime 0 0
java -XX:+PrintFl
How to develop a Rhino plugin that integrates Gaussian splatter rendering
19 November 2025 @ 7:35 am
Besides external calls, are there other methods to overlay Gaussian splatter rendering on the native Rhino window?
AWS ElastiCache notification for key expiry in Cluster mode
19 November 2025 @ 7:33 am
I'm using AWS ElastiCache in cluster mode and enabled the notification to EX. In dev env I'm getting 1 notification for each unique key expiry but in staging getting 2 notification per key expiry any config which I can change to get unique notification?
React Native package compatibility issue
19 November 2025 @ 7:26 am
> Task :react-native-screens:compileDebugKotlin FAILED
> Task :react-native-screens:configureCMakeDebug[x86_64]
C/C++: CMake Warning:
C/C++: Manually-specified variables were not used by the project:
C/C++: ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES
197 actionable tasks: 187 executed, 10 up-to-date
info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor
Redirect Uri is not working properly in React Native
19 November 2025 @ 7:22 am
I have created an mobile app using react native and then i build using **eas build -p android --profile preview....**After that it created an qrcode using that i downloaded my apk file after that I Installed that and if i open the app it is working fine...It Shows and Signin button if i click the signin button means it asks to choose mail after choosing mail it shows one moment Please like that and redirect to browser why what is the error......
This is my code:
import * as AuthSession from "expo-auth-session";
import * as Google from "expo-auth-session/providers/google";
import * as WebBrowser from "expo-web-browser";
import React from "react";
import { Button, Text, View } from "react-native";
WebBrowser.maybeCompleteAuthSession();
export default function GoogleSignInScreen() {
const [log, setLog] = React.useState('');
const [request, response, promptAsync] = Google.useAuthRequest({
androidClientI
`adev` dev mode and prod mode are different. why are these 4 lines not highlighted in the dev mode?
19 November 2025 @ 7:09 am
"yarn docs" is success.
$ yarnpkg docs
yarn run v1.22.22
(node:387868) [DEP0169] DeprecationWarning: `url.parse()` behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued for `url.parse()` vulnerabilities.
(Use `node --trace-deprecation ...` to show where the warning was created)
$ [[ -n $CI ]] && echo 'Cannot run this yarn script on CI' && exit 1 || yarn ibazel run //adev:serve
/bin/sh: 1: [[: not found
(node:387880) [DEP0169] DeprecationWarning: `url.parse()` behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued for `url.parse()` vulnerabilities.
(Use `node --trace-deprecation ...` to show where the warning was created)
$ /home/anlexn/workspace/github.com/anlexN/angular/node_modules/.bin/ibazel run //adev:serve
iBazel [9:24AM]: Querying for files
How to create a dictionary where the keys are the alphabet (A-Z), and values are a letter from a string in Python? [duplicate]
19 November 2025 @ 7:04 am
I have to create a dictionary, where the keys are letters of the alphabet, and the values are the indexed letters of a given string.
Example:
Given the string "BDFHJLCPRTXVZNYEIWGAKMUSQO" create the following dictionary:
translate: dict = {
"A": "B",
"B": "D",
"C": "F",
...
"Z": "O"
}
How do I make reusable HTML elements in a Django project?
19 November 2025 @ 7:01 am
I'm new to Django, and I'm working on a project where I'm reusing static pages and changing them to be suitable Django templates. As a part of the previous project, I made some custom HTML elements using JavaScript files and customElements.define() since I'm not familiar with React.
I realized that Django's templates can't modify the static JS files where these elements live, and in particular links can't be modified. The main element that I really want to be able to port over to this project is a navigation bar at the top of the screen that has a link to the homepage, and, depending on whether the user is logged in or not, will either show "login" + "register" buttons, or a notification icon and profile picture.
I don't really know what the best way to do this is, I've seen some suggestions where I turn the navbar element into a templatetag, and some others are just placing the raw HTML into a file and including that inside the templa
I want to open a web server with ESP32
19 November 2025 @ 5:50 am
I'm not good at English, so I used a translator.
Please understand that we cannot show all the code.
Currently, I am trying to open AP mode in ESP32 and send HTML information to the connected person.
However, I am trying to send chart.min.js or chart.min.js.gz.
The request was clearly received by esp32,
I can't send you data.
What should I do?
idf_component_register(SRCS "main.cpp"
INCLUDE_DIRS "."
EMBED_TXTFILES "html_data/index.html"
"html_data/style.css"
"html_data/chart.min.js"
"html_data/chart.min.js.gz"
"html_data/script.js"
"html_data/favicon.ico"
"html_data/images/heartbeat.png"