Questions tagged [buffer]

A buffer is an area of memory set aside for temporary storage of data while it is being moved from one place to another. This is typically done to speed up processes with significant latency, such as writing to a disk, printer or other physical device. The output is ready to be sent to the device before the device is ready to accept it, so it is moved to the buffer so that the sending program does not have to continue waiting.

A may be used when moving data between processes within a computer. This is comparable to buffers in telecommunication. Buffers can be implemented in a fixed memory location in hardware—or by using a virtual data buffer in software, pointing at a location in the physical memory. In all cases, the data stored in a data buffer are stored on a physical storage medium. A majority of buffers are implemented in software, which typically use the faster RAM to store temporary data, due to the much faster access time compared with hard disk drives. Buffers are typically used when there is a difference between the rate at which data is received and the rate at which it can be processed, or in the case that these rates are variable, for example in a printer spooler or in online video streaming.


References

7035 questions
2
votes
1 answer

Matplotlib - export figure to png in memory buffer

Is it possible to export a matplotlib figure as a png to a bytes type? Here is the code I currently have: def import_chart(df, x_label, y_label, title): fig, ax = plt.subplots() ax.plot(data[x_label], data[y_label]) …
RMRiver
  • 625
  • 1
  • 5
  • 19
2
votes
1 answer

Save audio stream / Uint8List data in file flutter

I am getting Uint8List from recorder plugin for Android and iOS both. I want to write the data in a local playable audio file whenever I am getting the data in my stream subscription of a mic. Is there any possible way to write the data? Currently,…
Dhalloo
  • 155
  • 3
  • 14
2
votes
2 answers

c++ OpenGL Multithreading with buffer resource

I have an OpenGL program that needs to periodically update the textures. But at the same time I want the program to be responsive (specifically, to continue running the draw/display code) while it's updating these textures. But this seems…
max
  • 19
  • 2
2
votes
4 answers

Reading text into a buffer in c. (leaves out the last line of data when there is no newline on the textfile)

I'm trying to read lines on a text file into a buffer by giving a function a line number as a parameter. This function then copies the text contained on that particular line of the file into the variable retreiveString for use. The problem I'm…
silent
  • 2,836
  • 10
  • 47
  • 73
2
votes
1 answer

Accessing a buffer always returns 0, although the actual value is visible in Atmel Studio Debugger

this is a really specific question which might not have a direct answer, so any idea is appreciated. Background: I am developing an application for a SAME70Q21 Microprocessor using C in Atmel Studio. The application exchanges data via USB with a…
Sabulanis
  • 31
  • 7
2
votes
1 answer

Buffer mutex and condition variables in C

I only just started writing multithreading in C and don't have a full understanding of how to implement it. I'm writing a code that reads an input file and puts into a buffer struct array. When the buffer has no more available space, request_t is…
Redsam121
  • 129
  • 8
2
votes
1 answer

Creating buffer object from fetch response Javascript/Nodejs

I am sending an API request using fetch and returning back JSON response. I am having a hard time at creating a buffer object so I can manipulate/parse through the JSON response like I would if it was a local file or variable containing JSON…
Seth0080
  • 147
  • 3
  • 10
2
votes
0 answers

Outputing analog voltage continuously to NI DAQ modules with nidaqmx-python

This is about working with the nidaqmx-python package, maintained by National Instruments for the purpose of interfacing their acquisition modules. Specs: NI cDAQ-9178 with NI 9264 output card plugged into it. Package nidaqmx-python in a conda…
2
votes
0 answers

How to extract a TTF from a font collection (TTC, DFONT) using fontKit in Node

trying to programmatically extract a single TTF font from a true-type Mac font collection (TTC or DFONT) and save it (much like online sites like https://transfonter.org/ttc-unpack allow). fonts[0] is the first font in the collection (Book) and i am…
SBS
  • 31
  • 6
2
votes
0 answers

loop doesn't use buffer correctly

i'm building an app that show your weight every week and if what the difference is with last week. I have a buffer to store the weight of last week, but ervery time it goes throug the loop it makes buffer[$week] 1 again. So it returns an array with…
2
votes
2 answers

How to create string from uint8[] in Vala?

I am doing async reads from a DataInputStream filling a buffer with bytes. uint8[] buffer = new uint8[4096]; size_t bytes = 0; bool success = false; do { success = yield process.get_stdout_pipe().read_all_async( buffer, GLib.Priority.LOW,…
aggsol
  • 2,343
  • 1
  • 32
  • 49
2
votes
1 answer

Can a vector::iterator also function as a vector

So I am trying to load a binary file into a Vector, so I can use it like a Buffer. ifstream binaryFile; vector fileBuffer(istreambuf_iterator(binaryFile), {}); vector::iterator fileIter = fileBuffer.begin(); Now…
youngtrashbag
  • 46
  • 1
  • 9
2
votes
0 answers

Getting Swagger API response error StatusCode 404, when called from code

While making an API call from swagger-ui, with content type "application/json", it is working fine. But when the same API is being called from below specified code, shows 404 StatusCode . What could be the possible reasons for it? Also, few other…
2
votes
1 answer

System Error:An Overrun of a stack-based buffer in windows system file explorer.exe

I'm having an issue with windows. when I opened it, the screen is getting black every time and refreshes it. I opened it in safe mode and the error is showing that An Overrun of a stack-based buffer in Explorer.exe. Please Help me to fix it. The…
Ayman Amjad
  • 264
  • 2
  • 10
2
votes
3 answers

How to create several buffers around points of a simple feature in a loop?

I have sample data representing 2 points (sf). I want to create buffers with the width 2, 1 and 0.5. My approach is the below. Is there any way to do this in more efficient way? How can I wrap this process up in a loop? library(sf) g =…
ilex
  • 103
  • 7