7,095 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
3
votes
3
answers
342
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
83
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
107
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
118
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
81
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
150
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
128
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
59
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
143
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
94
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]...
2
votes
2
answers
163
views
How to flush cin including all occurrences of newline
My app first takes some input, then it 'thinks' showing a progress bar, then throws an exit code and waits with getchar() for ENTER to be clicked before exiting.
The problem is that if I click ENTER ...
0
votes
0
answers
92
views
Mapping buffer from kernel space to user space in windows
I'm currently working with windows kernel driver that allocate memory which should be shared with a program.
Afaik an application can ask the driver to create a memory buffer of max 4G size for ...
0
votes
1
answer
55
views
Send and receive Buffers via nodejs net Socket is very slow
I try so send nodejs Buffers via node:net Server and Socket.
That works fine in principle.
But when I re-create the Buffer on the receiver side using Buffer.concat(), this is really slow.
Expected: ...
-1
votes
1
answer
69
views
Converting png bytes to pdf bytes
I'm trying to write a method in my Azure Function using PdfSharp that will download a png from a url, convert it to a pdf and upload it to the blob store.
However, I keep running into an issue with ...