Random snippets of all sorts of code, mixed with a selection of help and advice.
Book Recommendation in PyTorch
13 April 2026 @ 5:00 am
I am looking to find a book on PyTorch that is suitable for beginners, Ive used sklearn in the past for ML its a simple workflow for me prepare the X and Y data, fit/train a model, and make predictions (different workflow if you are using it for NLP or Images obviously). I know how to make/build a neural network as in a Linear/Fully Connected one and do arithmetic with tensors.
Ive been learning using the documentation and videos and googling as I try to stray away from using AI.
Are there any books you recommend for me as a beginner?
Vite 8: how to load a .node extension in an Electron application?
13 April 2026 @ 4:45 am
Under Vite 7 I load a .node addon with:
import {createRequire} from "node:module";
const rq = createRequire(import.meta.url);
const addon = rq("../build/Release/native") as NativeModule;
Now under Vite 8, inport.meta.url is undefined even inside a normal ts module file for the Electron main process, not an UMD/IIFE module.
The suggested workaround, adding to vite.config.ts:
rolldownOptions: {
output: {
intro: `
if (typeof import.meta === 'undefined' || import.meta.url === undefined) {
// @ts-ignore
import.meta.url = new URL('file:' + __filename).href;
}
`,
don't work. Also the suggestion to define a custom vite plugin to transform a normal import of the .node file is ineffective and complains that import addon from '../build/Release/native.node' cannot parse native.node
Is th
What's the navigator.platform of HarmonyOS both phones and desktop?
13 April 2026 @ 4:35 am
I haven't owned any Huawei device yet as all of the native HarmonyOS products is only available on China or requires emulating them (which my laptop can't afford to do this and take a risk). I need anyone help how it looks like on console when pasting this code
navigator.platform
Bool and int comparisons in C++, and why does putting variable containing integer into if-else goes to if branch?
13 April 2026 @ 3:50 am
While in C++ this code:
#include <iostream>
using namespace std;
int main()
{
int a = 1;
cout << (a == true) << endl;
}
will display 1,
this code:
#include <iostream>
using namespace std;
int main()
{
int a = 1234;
cout << (a == true) << endl;
}
will display 0
- why this code:
#include <iostream>
using namespace std;
int main()
{
int a = 1234;
if (a)
{
cout << 1 << endl;
}
else
{
cout << 0 << endl;
}
}
will display 1?
And why this code:
#include <iostream>
using namespace std;
int main()
{
int a = 1234;
if ((a) && (true))
{
cout << 1 << endl;
}
else
{
cout << 0 << endl;
Geoserver: uploading a file with /external endpoint
13 April 2026 @ 3:44 am
I am uploading a file to geoserver using /external.geotiff endpoint. What I observe is that I have to do it in 2 steps:
First,create store:
PUT
/geoserver/rest/workspaces/{workspace}/coveragestores/{store-name}/external.geotiff?recalculate=nativebbox,latlonbbox
Content-Type: text/plain
Body: /path/to/your/file.tif
Then,publish the layer:
POST
/geoserver/rest/workspaces/{workspace}/coveragestores/{store-name}/coverages
Content-Type: text/xml
Body:
<coverage>
<name>{storeName}</name>
<nativeName>{native file name without extension}</nativeName>
</coverage>
If I don't do second step, WMS endpoint doen't work as expected.
/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers.....
Message returned says layer is not defined.
Is there a way to just have one request to create store as well as publish the layer?
Edi
delay applying styles in nextjs with tailwind
13 April 2026 @ 3:17 am
in the dev mode when adding new style line it doesnt show, i have to add a new line of style then the prev one works but the newest one doesnt work
or i have o comment a line
its like any new line of style doesnt apply unless there is an effect or something happens after it
https://github.com/OSAMA263/tailwind-bug.git
@import "tailwindcss";
.card {
background-color: #fff;
}
the bg doesnt apply i have to add a new line
.card {
background-color: #fff;
color: gray;
}
now the bg applys but the color doesnt apply
idk i tried hard reloud the page, deleting the .next file ,disable cache in the browser tool but noting works
when i disable tailwind the styles works fine
im a newbie to next but tailwind@4 worked fine in react
How to use MAX_BY function in Apache IoTDB to return all timestamps when temperature is at maximum?
13 April 2026 @ 1:33 am
In Apache IoTDB 2.0.6 table model, the MAX_BY function can return the timestamp when the data value is at its maximum. However, my requirement is to return all timestamps if multiple time points have the same maximum value. I tried this function, but it only returns one of them.
Here's my scenario:
select * from sensor_data order by time
+-----------------------------+---------+-----------+
| time|sensor_id|temperature|
+-----------------------------+---------+-----------+
|2024-01-01T08:00:00.000+08:00| s001| 25.0|
|2024-01-01T09:00:00.000+08:00| s002| 30.0|
|2024-01-01T10:00:00.000+08:00| s003| 28.0|
|2024-01-01T11:00:00.000+08:00| s004| 30.0|
+-----------------------------+---------+-----------+
Executed SQL:
SELECT max_by(time, temperature) FROM sensor_data
Returned Result:
Consolibyte Quickbooks
13 April 2026 @ 1:08 am
I'm upgrading from PHP 7.0 to PHP 7.4.
I have downloaded the latest version of the SDK.
I have found several problems with the SDK.
After updating the config.php file and adding a new table in the database.
I had the following errors.
The file Quickbooks/Encryption/Aes.php is still using mcrypt which is incompatible with PHP 7.2
The file Quicbooks/IPP/Object/CustomerCommunicationsEmailAddr.php does not exist
<?php
class QuickBooks_IPP_Object_CustomerCommunicationEmailAddr extends QuickBooks_IPP_Object
{
protected $_EmailAddress;
public function setEmailAddress($email)
{
$this->_EmailAddress = $email;
return $this;
}
public function getEmailAddress()
{
return $this->_EmailAddress;
}
}
After that, it started working.
I think the existing release should be updated.
MaterialSkin2 Font Size and Style
13 April 2026 @ 12:05 am
I want to make the label font size to be a little big bigger. Base on my research, all I have to do is use ROBOTO_REGULLAR_12 but I get the error
'MaterialSkinManager' does not contain a definition for 'ROBOTO_REGULAR_11' and no accessible extension method 'ROBOTO_REGULAR_11' accepting a first argument of type 'MaterialSkinManager' could be found (are you missing a using directive or an assembly reference?)
using MaterialSkin;
using MaterialSkin.Controls;
materialSkinManager.ROBOTO_REGULAR_11 = new Font("Arial", 12f, FontStyle.Regular);
materialSkinManager.ROBOTO_MEDIUM_12 = new Font("Arial", 14f, FontStyle.Bold);
materialSkinManager.ROBOTO_MEDIUM_11 = new Font("Arial", 12f, FontStyle.Regular);
materialSkinManager.ROBOTO_MEDIUM_10 = new Font("Arial", 10f, FontStyle.Bold);
Vibe Coding Is Also Right Way?
12 April 2026 @ 10:39 pm
I am a full stack developer maked many projects through AI agents they are perfectly working and deployed but i want to ask that i dont learned node js perfectly i cant understand many things but i learned to deploy the mern stack project and also learned after deploying what issues can interrupt it but i dont understand completely so i make it from the AI agents and issues resolved with AI agents many developers says vibe coder is not a developer but when i am starting any project i make proper plan pdf before starting it so my error issues resolved 80 percent because of my plan but make from different AI so i am asking this , this is the right path to develop if i follow the agile method ??