7,085 questions
Advice
0
votes
1
replies
74
views
buffer.alloc() uses internal Buffer pool or not
Will buffer.alloc() ever allocate memory from the Internal buffer pool under any circumstances ?
I read about it from diff docs and it is contradicting. you can see here..
https://www.thenodebook.com/...
Best practices
0
votes
0
replies
37
views
Buffering on top of kernel buffers
I have question regarding Nodejs and the buffering it uses (my question also applies to JVM and node like environments). Why does Nodejs use its own buffering and not directly use the kernel buffering ...
2
votes
1
answer
146
views
Buffer of readFileSync(aFile).buffer also contains JavaScript file running this line + aFile
I worked on parsing .npy files in TypeScript and somehow I stumbled into issues, resulting in this minimal example:
create a file textfile.txt (name it and fill it with any contents you want, in my ...
1
vote
1
answer
78
views
Dymola RealBufferSize
I am getting the following error in Dymola 2025x:
Error: The following error was detected at time: 0
Out of memory for reals
It could due to too large matrices, infinite recursion, or uninitialized ...
3
votes
3
answers
371
views
Trying to create Buffer overflow for an example for school in C++
I'm trying to do the very basics of a buffer overflow, nothing illegal at all. My understanding of the code below is that the overflowing buffer doesnt hold enough space for all the data being written,...
1
vote
1
answer
107
views
Using PSD.js, how to output png as buffer?
In a Nodejs project, I am using PSD.js to generate a png from a psd. I am using the .toPng() method. I would like to go from this png object to a buffer without saving to the file system. I have ...
3
votes
1
answer
149
views
Rasterio : ValueError('Input shapes do not overlap raster.') but input shape clearly overlaps raster
I encounter a very strange case when extracting value of a single point from a raster with rasterio:
from rasterio import open as rs_open
from rasterio.mask import mask as rs_mask
from shapely....
19
votes
7
answers
3k
views
How to reduce repetition in a large amount of if-else statements when reading from a buffer
I'm trying to read a package from a buffer, decode it, and then return a package that might contain a requested info or call a specific function depending on the package I received. I'd like to know ...
0
votes
3
answers
123
views
Is this way of getting a formated input from stdin better than default scanf?
#include <stdio.h>
#include <stdlib.h>
#define BUF_SIZE 1024
int main() {
char *buf = (char*)malloc(BUF_SIZE*sizeof(char));
fgets(buf, BUF_SIZE, stdin);
int a = 0;
sscanf(buf, ...
0
votes
1
answer
107
views
Is there a way to draw a dashed line on a MQL5 chart that contains two colors?
I have an indicator that draws dashed lines in red or blue as needed for support and resistance levels. However, I have a difficult time seeing the lines on the black background charts, so I would ...
3
votes
1
answer
174
views
Why fstream read and write functions expect char* and not unsigned char*?
The spec says the following for creating an object using an existing storage - [intro.object#3]:
If a complete object is created ([expr.new]) in storage associated with another object e of type “...
5
votes
1
answer
134
views
Buffer of chars, unsigned chars or a void* - do we have contradictions in the C++ standard?
This is a follow-up on:
Why is it UB to pass a char array as the argument of placement new?
The spec says the following for creating an object using an existing storage - [intro.object#3]:
If a ...
0
votes
0
answers
62
views
My .flush() is reducing a 28-character string to a 27-character string
For context, I'm working with .hdf files, which are used to model floods in HEC-RAS.
The code I'm working with is this:
def patch_mannings_n(class_hdf_path, material_ids, new_values, material_names):
...
1
vote
0
answers
156
views
Redis cache integration with Next.js v15.3 causing high CPU usage
I'm using Redis for caching in our Next.js application and recently upgraded from v14.2 to v15.3. Previously I've used @neshca/cache-handler for cache handling, but the latest version(1.9.0) of @...
1
vote
1
answer
97
views
C (Linux) setting a stack variable char test[-some large number] - causes segfault - kernel config setting?
I'm learning C.
I'm building a P2P content distribution system and as part of that system there is a section of code which reads the network. To receive the data I set a buffer:
char raw_buf[4096]...
