Random snippets of all sorts of code, mixed with a selection of help and advice.
Cannot minimize matplotlib window
23 January 2026 @ 5:58 am
I am creating a dashboard using matplotlib. The following is my python3 code. When I minimize the window, the window jumps back up and the window does not stay minimized. What should I change in my code to make the window stay minimized? I could not find an answer online.
import matplotlib.pyplot as plt
import numpy as np
def on_close(event):
event.canvas.figure.axes[0].has_been_closed = True
print('The Figure is Closed!')
fig, ax = plt.subplots(2, 3)
ax[0,0].has_been_closed = False
fig.canvas.mpl_connect('close_event', on_close)
fig.set_size_inches(15, 8)
while True:
for i in range(ax.shape[0]):
for j in range(ax.shape[1]):
ax[i,j].clear()
ax[0, 0].plot(range(10), np.random.rand(10,1), 'r')
ax[1, 0].plot(np.random.rand(10,1), 'b')
ax[0, 1].plot(np.random.rand(10,1), 'g')
ax[1, 1].plot(np.random.rand(10,1), 'k')
ax[0, 2].plot(np.random.rand(10,1), 'g')
ax[1, 2].plot(np.random.rand(10,1), 'k')
plt.pause(
Social Science VEER SIR
23 January 2026 @ 5:57 am
1. TheGreatStupaatSanchiwasoriginallycommissionedbywhich
ruler?
A) Ashoka the Great B) Chandragupta Maurya C) Harsha
D) Samudragupta
2. The Ajanta Caves are famous for their
A)Rock-cutsculptures B)BuddhistPaintings C)AncientTemples D)Fortresses
3. Who was the founder of the Mauryan Empire, known for uniting most of India?
A)Ashoka B)ChandraguptaMaurya C)Bindusara D)Harsha
4. WhichIndianmonumentisknownastheSymbolofEternalLove?
A)RedFort B)QutubMinar C)TajMahal D)Charminar
5. The Iron Pillar of Delhi is famous for
A)Itsheight B)Rustresistance C)Inscriptions D)Beingthe
tallest pillar
6. ThecapitaloftheGuptaEmpire,famousforitsculturalachievements, was
A)Pataliputra B)Ujjain C)Mathura D)Nalanda
7. The art of miniature painting flourished most during which period?
URL(fileURLWithPath:) resolves tilde (~) as home directory in iOS 26 but not in iOS 18
23 January 2026 @ 5:51 am
I encountered a breaking change in iOS 26 when using URL(fileURLWithPath:) with filenames that start with a tilde (~).
The Problem:
let filename = "\~MyFile.txt"
let url = URL(fileURLWithPath: filename)
print(url.lastPathComponent)
Output:
iOS 18 → ~MyFile.txt ✅
iOS 26 → 924AF0C4-C3CD-417A-9D5F-733FBB8FCF29 ❌
On iOS 26, the tilde (~) is being interpreted as the home directory symbol, causing path resolution to the app container. The lastPathComponent then returns the container UUID instead of the original filename.
Debug Output:
iOS 18:
URL created: file:///~MyFile.txt
Window is smaller than requested in CreateWindowExW()
23 January 2026 @ 5:47 am
I wanted to create a 300×100 window with CreateWindowExW:
HWND hwnd = CreateWindowExW(0,
WndClassName,
L"300 x 100 window",
WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU,
CW_USEDEFAULT,
CW_USEDEFAULT,
300,
100,
NULL,
NULL,
hInstance,
NULL);
But, I got a 286×93 window. Why?
Furthermore, when I create it in position (0, 0), it is actually created in (7, 0). Why?

Furthermore, when I create it in position (0, 0), it is actually created in (7, 0). Why?

Figma to Gutenberg block using OpenAI – block renders but styles are not applied
23 January 2026 @ 5:36 am
I’m trying to convert a Figma design into a Gutenberg block plugin for WordPress using OpenAI.
The block itself is generating and rendering correctly, but the styles are not showing up. The layout appears, however none of the expected styling is applied.
I’ve already written a prompt to generate the block, but it seems like only the structure is being created and not the styling (or it’s not being loaded properly).
Has anyone faced a similar issue?
Any help would be appreciated. Thanks!
How to pass a std::thread::scope as a parameter with another reference
23 January 2026 @ 5:34 am
This works fine:
fn main() {
test1();
}
fn test1() {
let data = "data".to_string();
std::thread::scope(|scope| {
scope.spawn(move || {
println!("print out {}", &data);
});
});
}
This does not work:
fn main() {
test2a();
}
fn test2a() {
let data = "data".to_string();
std::thread::scope(|scope| {
// This gives the error
test2b(scope, &data);
});
}
fn test2b<'scope>(scope: &'scope std::thread::Scope<'scope, 'scope>, data: &'scope String)
{
scope.spawn(move || {
println!("print out {}", data);
});
}
It gives the errors "borrowed data escapes outside of closure". Here is it written out in the playground:
Hostinger CPU usage hitting 100% on WordPress sites
23 January 2026 @ 5:32 am
I host multiple WordPress websites on Hostinger, and my CPU usage frequently reaches 100%, causing slow performance and occasional downtime.
This happens under normal traffic, not traffic spikes. Caching is enabled, WordPress and plugins are updated, and no malware has been found.
I am on the business web hosing with six sites with total traffic of about 30k visitors a month.
Questions:
What typically causes high CPU usage on Hostinger WordPress hosting?
How can I identify the specific site, plugin, or process consuming CPU?
What optimizations should I try before upgrading my hosting plan?
Bitbucket Pipelines SonarQube scan fails with cp: cannot create regular file when using SonarQube Scanner 3.0.0
23 January 2026 @ 5:21 am
I am trying to run SonarQube static analysis in Bitbucket Pipelines for a TypeScript project.
The goal is to execute the SonarQube scan as part of the CI pipeline (for pull requests and branches).
The pipeline runs the SonarQube scanner, and the scan itself appears to execute successfully, but the pipeline fails afterward with the following error:
cp: cannot create regular file '/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/sonarsource/sonarqube-scan/...': No such file or directory
Here are the pipeline logs with debug mode
13:12:02.757 DEBUG Closing server
13:12:02.757 DEBUG WebSocket connection closed: (code: 1006)
13:12:02.757 DEBUG WebSocket client disconnected: with code 1006
13:12:02.757 DEBUG Closed WebSocket connection
13:12:02.757 DEBUG The bridge server shut down
13:12:02.757 INFO ╔═══╤══════╤═══════════╤══════�
How to Migrate from Java 8 32-bit to Java 17 32-bit? Eclipse Support Issues
23 January 2026 @ 5:15 am
I have been assigned a Java migration task. Currently, I am using Java 8 (32-bit), and now I need to migrate to Java 17 (32-bit). However, I noticed that there is no 32-bit version of Java 17 available, and Eclipse does not seem to support Java 17 on 32-bit systems.
Could you please guide me on how to migrate from Java 8 (32-bit) to Java 17 (32-bit)? If possible, I would appreciate step-by-step instructions. If migrating to Java 17 (32-bit) is not possible, please suggest alternative solutions.
Thank you!
Yii2. ActiveRecord's with() method does not pull in a relationship
23 January 2026 @ 5:06 am
I encountered a situation where the connection through with() is not pulled up if there are multiple records in the selection. If there is only one record, it works correctly, but in other cases, it returns null. The query is simple:
$modelClass::find()
->with(['shopPartner'])
->where([$modelClass::tableName() . '.id' => $ids])
The link is through the shop_code field of the model to the code field of the linked model, which contains a string such as "test".
public function getShopPartner(): ActiveQuery
{
return $this->hasOne(ShopPartner::class, ['shop_code' => 'code']);
}
If you remove the link from with(), the linked model is correctly retrieved when you access -\>shopPartner, but this behavior is not expected in a loop.