Random snippets of all sorts of code, mixed with a selection of help and advice.
Converting non-constant wide character strings to multibyte character strings, C not C++
23 April 2026 @ 8:01 am
The standard library function wcsrtombs converts wide character strings to multibyte character strings. However, it only does so if the source string is declared const.
I am working in an environment in which data is stored in linked lists of wide characters. I'm seeking to output multibyte character strings. I'm working in GCC 14.2.0, using flags including -std=gnu23
I've been trying to follow the pattern shown here, and my current code is:
char *lisp_string_to_c_string( struct pso_pointer s ) {
char *result = NULL;
if ( stringp( s ) || symbolp( s ) ) {
int len = 1;
for ( struct pso_pointer c = s; !c_nilp( c ); c = c_cdr( c ) ) {
len++;
}
About Learning Big Data for First Time
23 April 2026 @ 7:32 am
Hey so I'm an information systems students who wants to start learning about data up to big data, but doesn't know what step should I learn first...I feel it's so confusing, so everyone..can you guys advice what something simple that I should learn?I do have MySQL workbench and excel, and tbh I never use excel in my entire life. Please help
Which tools are best for cross-browser testing?
23 April 2026 @ 7:14 am
I’m working on a web application that needs to be tested across multiple browsers (Chrome, Firefox, Edge) and devices to ensure consistent behavior.
I’m looking for tools or frameworks that:
Support automated cross-browser testing
Allow testing on different browser versions and environments
If possible, I’d prefer solutions that are actively maintained and work well with modern JavaScript frameworks.
What tools have you used for this purpose, and what limitations should I be aware of?
Old App icon appears in Push Notifications
23 April 2026 @ 7:07 am
I am working on the iOS application that was Present on the AppStore previously. Now I have Rebranded my application, changing the name, app icon, meta-data. All is working fine except,
When I have released the rebranded application to the App Store, with the new version, of-course.
Problem:
Push Notifications still showing the old App Icon, which is weird. And it got fixed when I restarted my iPhone.
Now, I am telling the users to restart their iPhone, which is even weird. Is there a fix for this?
How to start DSA?
23 April 2026 @ 6:22 am
I'm realy confused as to how to start learning DSA. Can anybody help me and tell me how I can start learning and practicing it?
I'm currently learning Java so I want to practice DSA in Java, is it a good choice? Or should I stick to some other language?
Errors while upgrading a Perl script version around 5.8.8 to 5.32.1 (Fedora Core 7 to Rocky 9.6)
23 April 2026 @ 6:14 am
The below codes I had been using for many years in order to replace a part of text string in multiple files.
It works super. This code runs at Perl version 5.32.1 around (Rocky9.6).
However, when I tried to more modernization of this code, which means that eliminating -w at the first Hash-Bang line, and includes [ strict; warnings; ] two lines, then the newer Perl interpreter shows errors, somewhere around foreach or opendir or somewhere.
Around this part of codes are came from old Perl interpreter version 5.8..8 (Fedora Code 7).
I just copied this part of codes from textbook or elsewhere.
Which part of the Old Codes doesn't work with the newer [ strict; and warning; ] standard beginning of nowadays?
type here#! /usr/bin/perl -w
## 2026-04-23
## Global Replacement a transition scr60a6_01_transition_to_rocky9.6.pl
## (-w を削除して )
## strict;
## warnings:
##
##
my $filename = "";
$MAGIC_PATH
Do any ARMv8 processors exhibit load buffering?
23 April 2026 @ 3:18 am
In weak memory models, the load buffering (LB) litmus test asks: for the following program (pseudocode),
// Initially, shared variables X = Y = 0.
void thread1() {
int tmp0 = X;
Y = 1;
}
void thread2() {
int tmp1 = Y;
X = 1;
}
is it possible for both threads to read tmp0 = tmp1 = 1 (a result not possible in any sequentially consistent execution)?
ARMv7 allows this behavior: section 7 of this paper has a good explanation of LB, and shows experimental observations of it happening on a few different 32-bit ARM machines.
ARMv8 simplified and strengthened its memory model compared to ARMv7, but it still allows LB, as you can see for instance in the official online interactive memory mo
Difference in static initialization order depending on main class in Java inheritance hierarchy [duplicate]
22 April 2026 @ 2:10 pm
I am trying to understand Java class loading and static initialization order in an inheritance hierarchy, but I am getting different behavior depending on which class contains the main method.
I have two very similar cases where the only difference is the location of the main method (either in A1 or in A4). The class structure is the same in both cases.
First code:
package javatest;
// A1.java
import java.io.Serializable;
class A1 {
static {
new A2(new A1());
System.out.println("A1-S");
}
{
System.out.println("A1-N1");
}
private A1 a1;
public A1() {
System.out.println("A1()");
}
public A1(A1 a1) {
this();
System.out.println("A1(A1)");
this.a1 = a1;
new A2(a1);
}
public void metoda1() {
new A1();
System.out.println("A1.metoda1()&qu
Update start/stop time of state table and insert if state changes
22 April 2026 @ 8:31 am
I have a table that looks something like:
| Device id | Starttime | Stoptime | State |
|-----------|-----------|----------|-------|
Is it possible to make a MySQL request where, if the latest "state" of each "Device ID" is unchanged the Stoptime is updated to current time otherwise insert a new row with start and Stoptime set to now.
Angular Material: "'imports' must be an array of components, directives, pipes, or NgModules"
16 April 2026 @ 1:24 pm
I'm following the Angular Material documentation. https://material.angular.dev/guide/getting-started
When using MatSlideToggle in a standalone component I get this error:
'imports' must be an array of components, directives, pipes, or NgModules. Value could not be determined statically.
Environment:
Angular: 21.2.9
Angular Material 21.2.6
Minimum reproducible code:
Boton.ts
import { Component } from '@angular/core';
import { MatSlideToggle } from '@angular/material/slide-toggle';
@Component({
selector: 'app-boton',
standalone: true,
imports: [MatSlideToggle],
templateUrl: './boton.html',
styleUrl: './boton.css',
})
export class boton {}
boton.html
<app-boton>Toggle</app-boton>