Random snippets of all sorts of code, mixed with a selection of help and advice.
string String^ System::String^ what the difference in C++
24 December 2025 @ 3:55 pm
I am started coded in C++ not so far ago, and I still don't understand some things.
For example, what is system. And if I declared "using namespace system;" at the top of code then I should wtrite just String^, instead os System::String^. And what the difference between string and String^? What is ^? What is ::? Of cource you can give me advice to search it for in GPT chat. But I wanna humans answer me.
Google drive API list files in specific folder always returns empty
24 December 2025 @ 3:50 pm
im trying to fetch the number of files in a specfic google drive folder but it always returns an empty array of files.
const folderHasFiles = async (folderId) => {
try {
const query = `'${folderId}' in parents and trashed = false`;
const encodedQuery = encodeURIComponent(query);
const response = await fetch(
`https://www.googleapis.com/drive/v3/files?q=${encodedQuery}&fields=files(id,name,mimeType,parents)&pageSize=100`,
{
headers: {
Authorization: `Bearer ${accessToken}`,
},
}
);
if (!response.ok) {
const errorData = await response.json();
console.error('Google Drive API Error:', errorData);
throw new Error(`API Error: ${response.status}`);
}
const data = await response.json();
// Debug logging
console.log('API Response:', {
queryUsed: query,
folderId: folderId,
totalFiles: data.files?.lengt
On-boarding the Service/Functional Account into the CyberArk
24 December 2025 @ 3:48 pm
How to on-board a Service/Functional Account into the CyberArk for Password reconciliation?
Weird ArrayIndexOutOfBoundsException being thrown by Spring Framework
24 December 2025 @ 3:43 pm
I have a Spring- based application (not Spring Boot) that I am trying to run on several machines, including a Windows machine and a Linux machine. The application is using Spring 3.0.1 libraries and is running under Tomcat 9 using Java 17.
When I run the application, I am getting the strangest stuff upon startup:
09:40:20.638 [main] INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [/WEB-INF/NBSvc2-servlet.xml]
09:40:20.865 [main] INFO org.springframework.beans.factory.config.PropertyPlaceholderConfigurer - Loading properties file from class path resource [ll/nbsvc2/nbsvc2.properties]
09:40:20.889 [main] INFO org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1d289c7: defining beans [NBSvcController,org.springframework.web.servlet.mvc.annotation.DefaultAn
How to create a backup of my keyboard's firmware?
24 December 2025 @ 3:30 pm
I have a Gaming Keyboard from Attack shark, model X65 HE.
and the information summary of it from usb-tree view is as below,
========================== Summary =========================
Vendor ID : 0x3151 (Yichip Microelectronics (Hangzhou) Co., Ltd)
Product ID : 0x502D
Manufacturer String : " "
Product String : "Gaming Keyboard"
Serial : ---
USB Version : 2.0 (480 Mbit/s)
Port maximum Speed : High-Speed (Companion Port 1-19 is doing the SuperSpeed)
Device maximum Speed : High-Speed
Device Connection Speed : High-Speed
Self powered : no
Demanded Current : 496 mA
Used Endpoints : 4
As you can notice its a generic keyboard with rebranding, there is probably hundreds of the same exact board internals rebranded and sold under different names, I was able t
Nethereum Generated ERC721 Token Not Displaying the Image
24 December 2025 @ 3:25 pm
Using Nethereum as part of the C# Visual Studio project. Interacting with a smart contract that I've deployed on the Polygon Amoy testnet. My first minting of a token was successful, and it seems that the associated token's image is properly defined. At least based on what the TokenURI method returns back to me. As well as when I look out in IPFS. But the image doesn't display in my MetaMask wallet, nor does it appear in the Amoy testnet block explorer. It's a small JPG file.
Here is the token in the block explorer: https://amoy.polygonscan.com/nft/0x6e108092451e219a0faA9eb42B78fCAEc07467e5/1.
And here is where the IPFS contents are:
https://ipfs.io/ipfs/QmSKb6CFhoBrnvYKnbWQHi894JTFvHom3JSRH1x14jy2FF and
Is it worth to receive and return references to array instead arrays in perl for performance matters?
24 December 2025 @ 3:24 pm
When writing perl functions that operate on arrays I use the tail of @_ as the "array argument" and when returning I return them by value. This keep the api simple
When I write map like functions:
sub mymap (&@) { ... }
I receive the list @ as last argument. Assuming I know these functions will operate over big arrays (#>10000) is it worth to write it to receive a reference instead of the array?
The same question applies to returning arrays, if I return a big array, is it worth to return in a reference?
By "worth" here I means, are there any gains in performance and how much?
Or is perl smart enought to optimize these cases?
My current understanding is that when I do
foo(@bar)
Perl create an alias for each value in @bar in foo's stack, if I replace @bar with @bar a single alias is created. This should not matter for functions that receive like 10 arguments, b
I keep getting this styling error on my GluestackUI Expo app even though the app is fully wrapped in the Styled Provider
24 December 2025 @ 3:21 pm
I am building an Expo app using GluestackUI, and I've made sure to format my config file perfectly. Yet, when wrapping my page in the GluestackUIProvider, it keeps sending out this error:
Uncaught Error: You cannot use tokens without wrapping the component with StyledProvider. Please wrap the component with a StyledProvider and pass theme config.
at AppEntry.bundle?platform=web&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.routerRoot=app&unstable_transformProfile=hermes-stable:148086:19
at Array.map (<anonymous>)
at resolveStringToken (AppEntry.bundle?platform=web&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.routerRoot=app&unstable_transformProfile=hermes-stable:148063:38)
at getTokenFromConfig (AppEntry.bundle?platform=web&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.routerRoot=app&unstable_transformProfile=hermes-stable:1
Why is cin.ignore() needed before getline() in C++? [duplicate]
24 December 2025 @ 3:11 pm
I am learning C++ and working on a console-based application.
When I use cin >> followed by getline(), the getline() does not take input unless I use cin.ignore() before it.
Example:
int roomNumber;
string name;
cin >> roomNumber;
cin.ignore();
getline(cin, name);
Why is the cin.ignore() needed here?
Can't access <tr> in <table> with VBA
24 December 2025 @ 2:49 pm
I'm using VBA to import the table from Federal Fund Rates into Excel.
So far I've got:
Set HTMLDoc = CreateObject("HTMLFILE")
HTMLDoc.body.innerHTML = objHTTP.responseText�
��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������