Questions tagged [fifo]
Any structure in which the First object In is the First object Out. Synonyms include queue, and pipe.
1,093
questions
0
votes
1
answer
23
views
Is this FIFO Ordering or Causal Ordering?
I'm trying to understand an exercise about message ordering and where I need to know if the messages sent from a frontend to the Replica Manager are using FIFO ordering or Causal ordering.
I've read a ...
2
votes
5
answers
99
views
bash: a simple FIFO (first-in first-out) queue
I am looking for a portable bash solution for a simple FIFO queue. My queue input will always be a single line of text.I came up with a simple solution, which works well.
fifo_queue="fifo.txt&...
0
votes
1
answer
10
views
How to use read() to get the adress of a pointer?
I have 2 programs communicating with each other through a fifo, one's the writer the other's the reader.
The writer sends a pointer to a struct containing information.
The reader should receive the ...
0
votes
1
answer
82
views
Streaming data to/from file in browser
Is there an API in the browser (outside of websockets) which allows us to stream data from a file to the browser? something like this:
const reader = new FileReader();
reader.readAsText(file, "...
1
vote
1
answer
45
views
Why the memory elements are not initialized?
I am designing a fifo. While writing data in to memory, the elements in the memory are not updating and showing output as below.
Design:
Designing an 8*8 memory, want to write the data into the ...
0
votes
1
answer
91
views
Row pairing according to FIFO logic in SQL Server 2018
I need to pair sales orders with purchase orders using FIFO (first in, first out) logic.
In the first table, I have sales orders arranged in ascending order (the SO_RowId and SO_CreationDate columns ...
0
votes
1
answer
17
views
Why use the circular buffer in "overriding" mode at all?
I have been trying to wrap my head around the modes of operations for the circular buffer data structure. It seems trivial that it works for a consumer-producer architecture where a consumer reads ...
0
votes
1
answer
45
views
How to passing message using message queue in C?
I try to write my program in C with FIFO process communications.
I have two child process, Scanner and Analyzer.
The process who name is Scanner does scan of dir and send the name content dir to ...
0
votes
0
answers
41
views
How to convert LIFO stack to FIFO queue
A queue is a data storage device much like a stack. The difference is that in a stack the last data item stored is the first one retrieved, while in a queue the first data item stored is the first one ...
-3
votes
1
answer
42
views
C++ Client-server (FIFOs, pipes, forks) [closed]
I' ll attach here the code I wrote, it doesn't work the way it should, it doesn't read properly from fifo. It was sending the username correctly before adding more code, it makes me think I wrote the ...
0
votes
1
answer
31
views
FIFO function - manual approach
Python novice here. I am working on an assignment that has me a bit stumped.
The goal is set up a simple FIFO system, without using any imported libraries.
My attempt so far is incorrect and I am ...
0
votes
0
answers
10
views
Publish FIFO message via old AWS SDK
I am using a Node JS based package, which is using a very old version of AWS SDK. It's so much old, that the SNS publish doesn't recognize MessageGroupId as a valid parameter.
Which means that it ...
0
votes
0
answers
50
views
MSSQL Calculate Running Balance by Partition
id
trade_date
quantity
tran_type
1
2019-06-01
10
Buy
2
2019-09-30
4
Sell
3
2019-12-01
10
Buy
4
2022-03-31
8
Sell
Since it is required to calculate principal quantity with corresponding and ...
0
votes
0
answers
13
views
fifo plot signal python with time-series data
I have a problem with the xmgrace visualization. I have created the fifo which will store the data to be able to do real time series. The problem is that the fifo archive contains all 3 signals and as ...
0
votes
0
answers
84
views
Fortran OpenMP - process things in parallel as they are released
I'm trying to speed up an existing Fortran program with OpenMP.
A fixed number of things are to be processed in parallel, some of which may be processed immediately, while others can only be processed ...
0
votes
0
answers
30
views
FIFO in Excel Quantity Distribution
enter image description here
Hi, I need the help in getting the above output in the form FIFO Method in Excel
There will be 2 input screen given, one is for Purchase Side (Qty and Exp. Goods Receipt ...
0
votes
1
answer
18
views
Storing up to the most recent N elements in a Postgres jsonb field
I have a Postgres table with a JSONB column in which I want to store an array. The array starts off having 0 elements but will grow to hold up to N elements.
With every update I need to append one ...
-1
votes
1
answer
56
views
Applying FIFO using Median Function in Excel
Good Day Everyone. I have an Excel Formula problem which I could solve partially and want your help to make it robust.
Please see screenshot of the data below
In the sample data, Column B to Column H ...
2
votes
0
answers
66
views
Socket Programing TCP: The "knock knock Server"
THE CONCEPT:
I am programming a (simple) server-client application, using TCP sockets. The server is meant to answer back to the client appropriately, depending on the message it initially received, ...
0
votes
1
answer
172
views
Implementation of FIFO pnl in kdb/q
Consider the table below:
Id
Verb
Qty
Price
1
Buy
6
10.0
2
Sell
5
11.0
3
Buy
4
10.0
4
Sell
3
12.0
5
Sell
8
9.0
6
Buy
7
8.0
I would like to compute the PnL in a FIFO way. For example for Id=1, ...
1
vote
1
answer
210
views
Error "write(stdout): Broken pipe" when using GNU netcat with named pipe
I have a simple shell script sv that responds to HTTP requests with a short message:
#!/bin/sh
echo_crlf() {
printf '%s\r\n' "$@"
}
respond() {
body='Hello world!'
...
7
votes
1
answer
264
views
Need mysql query FIFO
please help me how to create mysql query for reporting in fifo method,
table persediaan_source
id
id_barang
jumlah
harga
tanggal
id_jenis_transaksi
89
26
12
1050000
2022-07-15 05:55:23
1
90
26
8
0
...
0
votes
0
answers
117
views
Streaming ffmpeg from fifo file starts only when i close the fifo file
Im starting an ffmpeg process, where the input is a FIFO file i created.
Im writing some data in a loop to the FIFO file, but the ffmpeg process doesn't start streaming until one of the two happens:
...
0
votes
0
answers
181
views
How to set milliseconds of delivery delay on an AWS SQS FIFO queue?
I would like to set 85 milliseconds of delivery delay for each message on an AWS SQS FIFO queue.
After I set delivery delay field as 0.085, when I try to save queue settings, AWS shows a blank page ...
0
votes
0
answers
64
views
SQL Server: earliest batch in group where quantity > 0 (FIFO)
Let's say I have the following table. It's a list of transactions by part and batch numbers. I have added some columns that I think I may need. For each row, how can I determine the earliest available ...
-1
votes
2
answers
602
views
FIFO implementation in C
I am analysing an Internet guide, where I fond code like that. Can somebody explain me the usage of ~ and & operators?
Thanks in advance
uint8_t tx_fifo_put(tx_dataType data)
{
/*Check if FIFO is ...
0
votes
1
answer
56
views
How can I pass a string value from one proccess to another?
I have this two programs in C and I need to find a string value that I pass from the first one to the second and if the string value is in users.txt file, return value 1 or 0 (if the file does not ...
0
votes
1
answer
132
views
Is there a neat way to handle pipe (FIFO) locking in C?
Hi!
I have a C assignment where I need to make a named pipe (FIFO), and let 2 child processes write lines into it while the parent process reads those lines (and processes the received data). I'm new ...
1
vote
2
answers
100
views
Which Data Structure would be more suitable for the following task in Java?
Every 5 minutes, within the 20th minute cycle, I need to retrieve the data. Currently, I'm using the map data structure.
Is there a better data structure? Every time I read and set the data, I have to ...
0
votes
1
answer
28
views
How to keep program unclosed after ctr+c in named pipe?
I have 2 programs.
One is server one is client. The Client sending string to the server, the server is swapping the string and return to the client.
the problems I have is when I pressing ctr+c the ...
0
votes
1
answer
53
views
Is dumping to FIFO has more overhead than to /dev/null?
I'm trying to solve a simple problem.
I wish to start a long-running program in verbose mode, but I want to trash all of its output by default, and when some misbehavior occurs I wish to reattach the ...
0
votes
1
answer
325
views
Dual clock FIFO in vivado (verilog)
I want to use a FIFO in a project where a state machine buffers as much data as possible to a FIFO, which will then be processed by a DSP block. To maximize data throughput I want to use multiple QSPI ...
0
votes
0
answers
45
views
Linux read dilemma
I need to read from a fifo. Using ssize_t read(int fd, void *buf, size_t count);, I faced the following situation.
When a large set of data must be read from fifo, I get the Returned (i.e. ssize_t) -1,...
0
votes
0
answers
295
views
calc FIFO based inventory valuation with MySQL 8.0
nice day for all.
I spent more than three days of searching and testing but nothing helped me.
let us assume I have many way to enter items of product to storages, So I created 'view' to show me the ...
0
votes
2
answers
154
views
Do I have to free the malloc memory in std::queue?
I have a doubt.
Let's say I have a buffer allocated with malloc as the following:
uint16_t buffer_length = 200; // !size is dynamic!, never static
uint8_t* buffer = (uint8_t*) malloc(200*sizeof(...
0
votes
2
answers
54
views
shell read seems to be getting newlines from file (fifo or regular)
What I want to achieve is to have a shell script hooked up onto a fifo and react to certain commands that would read out (with the usual read command). Now this seems trivial but , by my surprise, the ...
0
votes
1
answer
94
views
Reading the input stream of another process in C
I want to view the input stream of a C program using a secondary program to access it.
I tried passing the STDIN from one process to the other using a FIFO (I'm on Linux) and viewing the size of the ...
1
vote
2
answers
69
views
Efficient reverse order comparison of huge growing list in Python
In Python, my goal is to maintain a unique list of points (complex scalars, rounded), while steadily creating new ones with a function, like in this pseudo code
list_of_points = []
while True
# ...
0
votes
1
answer
151
views
Using a fifo as stdin to a process
How can I use a fifo to redirect stdin for a process?
Using systemd, I am starting a service that will infrequently require commands to be sent via stdin. To overcome this, I have tried the following:
...
-1
votes
1
answer
179
views
FIFO queue for Producer Consumer Problem Not Working
I currently am trying to implement FIFO for the producer consumer problem. However when I run the code it seems that the first item is not being removed from the buffer as the output shows that every ...
0
votes
1
answer
683
views
Calculating Cost of Sales in SQL using FIFO method
From a stock transaction table I've created following sorted view table to be ready for FIFO:
rowN
date_
stockCode
sign_
amount
unitPrice
1
'2022-01-20'
ABC
in
5
29.20
2
'2022-01-22'
ABC
in
3
32.50
...
0
votes
1
answer
674
views
How can I write a Postgres (SQL) query for FIFO 'closing stock' inventory valuation?
Background
I need to implement inventory valuation / costing using the FIFO (first-in, first-out) method.
I'm running Postgres 11 running on CentOS 7.
I've looked at, and tried, a fair number of ...
0
votes
0
answers
64
views
Python FIFO and subtract by group and operation type
I have a table with different customers and two types of operations : cash-in and cash-out. Everytime a customer cashes-out, we need to subtract that amount from his balance. However, the subtraction ...
1
vote
2
answers
159
views
Capture latest write to file/FIFO buffer and then flush the file/FIFO buffer
Consider the following bash example:
#!/bin/bash
ping -i 0.1 1.1.1.1 | while read ping_line
do
echo $ping_line
sleep 1
done
The processing on the right-hand side of the pipe ...
0
votes
1
answer
31
views
CircularFifoBuffer .avg() calculation fails
I have the following dummy code which saves a list of doubles in a hasmap to a specific key, I want to be able to use this buffer to calculate average values over each key.
final int bufferSize = ...
0
votes
0
answers
18
views
Is there a way to tell when kernel has completed writing to a fifo?
On Linux, I have a program that creates two FIFOs, and forks. Child loads "gdb" and waits for command from parent. Parent does the writing. In response to a write, "gdb" in child ...
0
votes
1
answer
208
views
Python how to build a LIFO stack using only FIFO queues
I have a very tough question here:
how to build a LIFO stack using only FIFO queues ?
So I already have most of the code,but as you can see below ,I don't know how to code the
pop function
import ...
1
vote
1
answer
456
views
how do i redirect fifo to stdin using python either with subprocess or with pwntools?
As an example I am trying to "imitate" the behaviour of the following sets of commands is bash:
mkfifo named_pipe
/challenge/embryoio_level103 < named_pipe &
cat > named_pipe
In ...
0
votes
0
answers
199
views
FIFO (First in, First out) with Sell price and Profit/Lose
Hey everyone am trying to adapt this FIFO (First in, First out) Inventory I need to realize FIFO algorithm by adding a row for price of the Sold Item, The total Value of the Sell and if a Profit/Lose ...
0
votes
1
answer
60
views
MySQL FIFO policy based on table size
I have a table in MySQL where arrive continuously data (these data have a timestamp).
I'd like to create a FIFO Queue based on the size of the table.
I mean, if I set for example 1GB as threshold and ...