Questions tagged [flush]

Flush means clearing all the buffers for a stream. This will cause any buffered data to be written to the underlying device.

Flush means clearing all the buffers for a stream. This will cause any buffered data to be written to the underlying device.

1132 questions
-1
votes
1 answer

How uses helper callbacks to generate a PDF from the contents with TCPDF?

Hi i am trying create a helper to convert a entire html from a CTP to PDF using tcpdf->writeHTML(); I have tried: function beforeLayout(){ ob_clean(); ob_start(); $pageOrientation = 'P'; $this->setup($pageOrientation); …
celsowm
  • 846
  • 9
  • 34
  • 59
-1
votes
1 answer

Can i fflush multiline output?

Is there any way that I can fflush() a multi-line output? For example, if I wanted to print a 5x5 array in 5 separate lines and shuffling it multiple times every 1 second, how am I supposed to use fflush()? #include #include int…
-1
votes
1 answer

C++ - How to make application-logs written to disk even in case of a sudden power down

A short background: I'm developing an embedded Linux application on a drone. In the last field test we had, the battery juice ran out without any warning during the flight. The drone had a rough landing. When I restarted it in the lab, out of 20 log…
Yaniv G
  • 307
  • 4
  • 11
-1
votes
1 answer

Persist entity after catching Doctrine exception

I'm trying to create a log system on my website running Symfony 4. Everytime an exception is thrown, I catch it into a listener, and then create a Log entity containing the exception values and also send it to me by email. But the fact is when the…
Pete_Gore
  • 594
  • 1
  • 5
  • 20
-1
votes
1 answer

Should you flush after the course of each user input of loop in C?

#include #include int main(void) { char text[256]; while (1) { puts("Text?"); fgets(text, sizeof(text), stdin); fflush(stdout); // should you flush everytime? } return 0; } For…
Jack Murrow
  • 396
  • 3
  • 11
-1
votes
3 answers

How can I show only the last print in Python 3?

There is too much print and I want some of the temporary prints be erased. For example, I have: import time for shard in range(3): for i in range(100): print("image_{} in shard_{}".format(i, shard)) time.sleep(1) Instead of a…
zheyuanWang
  • 1,158
  • 2
  • 16
  • 30
-1
votes
1 answer

What is flush in print function?

What is flush in the print function in python? What happens if it is set True? In what cases setting it True helps? Please provide good examples to understand. print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)
Niraj Raut
  • 205
  • 2
  • 7
-1
votes
1 answer

Why XmlHttpRequest wait until complete PHP response (proc_open) even with flush?

I 'm trying to execute commands (wp cli) with xhr. My problem is when i call my file deploy.php with the javascript. Without JS call the script works, the flush is immediate. When i call deploy.php in a XmlHttpRequest, the response wait until the…
Christmas
  • 13
  • 3
-1
votes
1 answer

Can't clear line in Python with \r

So I'm trying to make kind of a progress bar in Python, and in a for-loop I wrote this: print(i, end='\r', flush=True) sleep(0.1) so it's supposed to write 0 then 1, etc. But instead I get something…
s-jevtic
  • 51
  • 1
  • 6
-1
votes
1 answer

bash tty input drain (or flush?)

As per triplee, samuel suggestion, I edited my question here, replaced the previous one that was confusing, hoping this new round will be more understable. The question could be how to drain any type ahead on the stdin before issuing a Query/Reply…
Phi
  • 735
  • 7
  • 22
-1
votes
2 answers

Switch-case uses same case repeatedly after first choice, how do I reset or flush it before use to work correctly?

Switch-case runs properly the first time but continues using the same initial choice over and over again. I need it to reset before this block of code runs so it chooses a different (or same) case when needed. This is for a school project where a…
-1
votes
1 answer

What does it mean to flush the output in competitive programming?

I am currently giving codechef long challenge and there they are asking to flush the output after printing each line. How to use flush in cpp and how does this affect the time limit if I am not using flush? Currently I am using this code- cout<
-1
votes
2 answers

Can anyone explain netty ChannelHandlerContext flush()?

Could someone explain what exactly netty method ChannelHandlerContext flush() does? Will it immediately send all messages through the network stopping any defined processing effectively bypassing any handlers in the pipeline?
J.Doe
  • 287
  • 1
  • 5
  • 16
-1
votes
1 answer

Erase print output python 3

I'm writing a simple game. The user is given information about a crime and has to guess who the culprit is. I have long pieces of information: "This is the story of Catherine Claythorne. When she was in college, she was a beauty and her best…
-1
votes
2 answers

ob_start() and ob_implicit_flush(true) using at the same time cause an issue

I need to echo some output while executing php file ,beacuse execution takes 10 sec and end of 10sec page should be directed via header("Location:test.php) However If I use ob_start and ob_implicit_flush(true) at the same time , we cannot direct…