Questions tagged [flush]

0

votes
0

answer
3

Views

Python 2.7 - redirect instantly output to log file

Python test.py script is collecting data non-stop. To exit script - ctrl/c is expected. File test.log is empty while script is running. Output to test.log is created only after script is finished. It is running on windows 2008 server. How to save ouput "on the fly", so I can check test.log and see t...
Tax Max
1

votes
1

answer
144

Views

Does Nim have output buffering?

Do I have to flush output when I'm using Nim's echo like I do with Python's print? If yes, how can I do that?
Adrien
1

votes
3

answer
238

Views

adding column to table in django [closed]

i'm fairly new to django. just ran through the tutorial and trying to play around with an app of my own now. I ran into the following situation: I realized after I started my project (after running syncdb) that I left out a column in one of my tables when I originally wrote the models.py file. i e...
Yin Li
1

votes
1

answer
201

Views

Does an explicit openmp flush lead to a cache line flush?

I have been trying to understand the openmp pragmas, does an openmp flush (#pragma omp flush) lead to a cache line flush? How does that change for an implicit flush?
user2887306
1

votes
1

answer
469

Views

persist in one controller and flush in another

EDIT for google searchers: It's impossible to persist in one controller and to flush in another one. I have two controllers, called by ajax. The first one is called when a change occurs in the twig, this is where I persist. The second one is called when the "save" button is clicked, and that's when...
Eagle1
1

votes
1

answer
566

Views

Implementation of Java OutputStream flush() method

I have a writing thread, using OutputStream, and I want to implement a flush() method. As mentioned in the API, The flush method of OutputStream does nothing and should be implemented if needed. I have the following thread, and I'm a little bit confused about how should I override flush() private...
Presen
1

votes
2

answer
524

Views

after alter system flush shared_pool low performance Oracle

We did refactoring and replaced 2 similar requests with parameterized request a.isGood = :1 after that request that used this parameter with parameter 'Y' was executed longer that usually (become almost the same with parameter 'N'). We used alter system flush shared_pool command and request for para...
Ivan Lapshov
1

votes
2

answer
474

Views

Python: why is this print automatically flushing to screen without flush()?

I was reading about std.flush() in python. And I found this example a lot. import sys,time for i in range(10): print i, #sys.stdout.flush() time.sleep(1) It is often said that it makes a difference with/without the "sys.stdout.flush()". However, when I called this script from command prompt, it did...
enchy
-1

votes
2

answer
61

Views

Why does this C program not print anything?

I have the following code: int main() { printf("hello world"); while(1); } Should hello world be printed. If yes, WHY ? If no, WHY ? I am using gcc on a linux machine to compile code.
Aashwin Gaur
1

votes
4

answer
4.2k

Views

How to force flushing in Grails GORM

I have a service that distributes tasks to operators. Inside a method I distribute many tasks in time inside a loop. I want to flush the task, the operator, and a DistributionLog. If I just had one domain to save I think I could do something like Operator.withTransaction{ //...some code } but I have...
user3155328
1

votes
1

answer
400

Views

Redis cache is flushed periodically without consent

I am having trouble with a redis cache set up to store serialized Java objects (average ~30k size) We just changed the implementation so that all the cached objects have no expiration (ttl == -1) I then changed the redis.conf like so set maxmemory-policy allkeys-lru (was volatile-ttl) set maxmemory-...
Jakob Ryden
1

votes
2

answer
141

Views

Speeding up puts operation to file in tcl

I have to puts large amounts of data to a file in TCL, and it takes very long. I tried increasing the buffer capacity from 4KB to 1MB using fconfigure, but noticed no improvement whatsoever. I am not sure if I could flush my buffer at intervals, as I was guessing some of my data would be lost if I d...
SulfoCyaNate
1

votes
2

answer
50

Views

How to create a simple userprompt in clojure

Consider this very simple function definition in clojure: (defn prompt [] (print ">>> ") (read-line)) My ambition is to let the user enter a string prepended by a prompt-prefix. However, it seems like read-line gets executed before the print statement. However, by flushing the output stream (defn pr...
lsund
0

votes
0

answer
10

Views

Safely unmount USB-OTG programmatically in Android

Is there a 'new' method to programmatically unmount an USB-OTG device on Android? I have an app that writes data into a usb flash stick and even though I 'flush()' all the data if the unmount process is not done, some data are lost.
Jonny Quest
2

votes
3

answer
1.5k

Views

PHP realtime output of content

I'm trying to display some content in real time to my visitors using a loop. Problem is that the content is added to the output instead of being replaced with the new one. Here's an example of code which counts from 10 to 0. The output shows the whole set of results instead of counting backwards. I...
Tim R.
3

votes
3

answer
3.4k

Views

Wildfly flush cache of security-domain

Im have a war project with JAX-RS interface deployed on wildfly and there is a security-domain configured, which loads user password and role from db. The security-domain uses cache-type=default. Updates of authenticated users are not recognized by the security-domain, because the old data are cache...
Helmosch
2

votes
1

answer
292

Views

How does java.util.prefs.Preferences work in Java?

I've recently faced to flush() method documentation and it said: Forces any changes in the contents of this preference node and its descendants to the persistent store. Aren't the changes are made immediately in Preferences? I mean the methods: preferences.node(String name)- node creation preferenc...
SeniorJD
2

votes
1

answer
708

Views

Why is Grails Searchable Plugin causing errors on Hibernate AutoFlush?

In the Grails 1.2.5 project that I am trying to troubleshoot, we use the Grails Searchable plugin .5.5.1. The problem is that whenever we attempt to index large sets domain classes, Grails keeps throwing: ERROR hibernate.AssertionFailure - an assertion failure occured (this may indicate a bug in Hi...
Mark Rogers
5

votes
1

answer
4.2k

Views

How to Lower MySQL Memory Usage without Restarting MySQLd

MySQL 5.1.63 takes a growing memory usage as time in the Debian Sqeeze OS. Here is my top output: At the moment MySQLd uses 732Mb resident memory (RES column), VIRT 855M. But it starts at about 330Mb of RAM two days before. Unfortunately some day it reaches at the peak of 1.2G by some unidentified b...
jacouh
16

votes
4

answer
6k

Views

How to flush a TFileStream?

TFileStream provides buffered output, which is great in most cases, but in some cases (especially during debugging) it's nice to flush the buffer immediately. Thing is, I don't know of any way to do that except calling Free, which is kind of counterproductive. Is there a better way to do it?
Mason Wheeler
17

votes
4

answer
20.4k

Views

PHP - Flushing While Loop Data with Ajax

Using PHP, I would like to make a while loop that reads a large file and sends the current line number when requested. Using Ajax, I'd like to get the current line count and print it out onto a page. Using html buttons, I'd like to be able to click and activate or terminate a javascript thread that...
ThreaT
17

votes
6

answer
14.6k

Views

How to ensure all data has been physically written to disk?

I understand that .NET FileStream's Flush method only writes the current buffer to disk, but dependent on Windows' disk driver and the hard disk firmware this is no guarantee that the data is actually physically written to disk. Is there a .NET or Win32 method that can give me this guarantee? So if...
Stefan Schultze
17

votes
1

answer
20.8k

Views

Log4Net RollingFileAppender not flushing IO buffer with low volume log

I'm pondering on the same issue as HENRI COOK did. It's been reported as a bug on Apache Jira as far as we can tell from the short description. My problem in essence is that events are only logged when the application is shut down (even weeks after the event). That happens when logging volume is ve...
Rbjz
17

votes
5

answer
13.1k

Views

When Hibernate flushes a Session, how does it decide which objects in the session are dirty?

My understanding of Hibernate is that as objects are loaded from the DB they are added to the Session. At various points, depending on your configuration, the session is flushed. At this point, modified objects are written to the database. How does Hibernate decide which objects are 'dirty' and need...
tgdavies
7

votes
2

answer
3.8k

Views

Will StreamWriter.Flush() also call FileStream.Flush()?

I have a StreamWriter which underlying stream is a FileStream. Will the following code guarantee that the FileStream also flushes its buffer into the actual file on the file system, or do I need to explicitly call Flush() on the FileStream? using (var fs = new FileStream("blabla", FileMode.Append))...
Erwin Mayer
18

votes
4

answer
10.6k

Views

How to prevent BrokenPipeError when doing a flush in Python?

Question: Is there a way to use flush=True for the print() function without getting the BrokenPipeError? I have a script pipe.py: for i in range(4000): print(i) I call it like this from a Unix command line: python3 pipe.py | head -n3000 And it returns: 0 1 2 So does this script: import sys for i in...
tommy.carstensen
6

votes
3

answer
4.3k

Views

What does std::ofstream::close() actually do?

This question: How to protect log from application crash? has lead me to another - what does std::ofstream::close() actually do? I know it calls flush() and that's one thing. But what else? What closing the file actually is? Edit: Let me rephrase my question - is anything physically done to the actu...
NPS
19

votes
2

answer
20.5k

Views

Django flush vs sqlclear & syncdb

Can anyone tell if there is a difference between >manage.py flush # or reset and >manage.py sqlclear appname | python manage.py dbshell >manage.py syncdb
Jibin
5

votes
2

answer
487

Views

Html head flushing with freemarker

I have a Spring MVC web application that uses freemarker as the template language. I am currently working on the changes to flush the html head section rather than buffering the whole html and flushing at the end. I tried setting the auto_flush freemarker setting to false and used freemarker's built...
soontobeared
19

votes
4

answer
12.5k

Views

How can I output data before I end the response?

Here is my snippet I tested it in Chrome 11, and Firefox 4: var http = require('http'); http.createServer(function(request, response){ // Write Headers response.writeHead(200); // Write Hello World! response.write("Hello World!"); // End Response after 5 seconds setTimeout(function(){ response.end(...
Adam
6

votes
4

answer
7.6k

Views

Exception propagates after already caught

I'm having the strangest thing happening and I can't figure out why. The best way to describe this is to provide a simplistic example: @Service @Transactional public class Foo{ public ModelAndView delete(@ModelAttribute("abc") Long id) { ModelAndView mav = new ModelAndView(); try { getDaoService()....
user973479
5

votes
1

answer
4.7k

Views

How to set up org.hibernate.org.hibernate.FlushMode for Spring Boot application?

How can I setup FlushMode.ALWAYS for all sessions in my Spring Boot app? It would be nice to have this setting in application.yml. UPDATE I tried with both in application.yml: spring.jpa.properties.org.hibernate.flushMode: ALWAYS spring.jpa.org.hibernate.flushMode: ALWAYS However next code: Session...
PaintedRed
6

votes
7

answer
36.2k

Views

No console output on cout

Good morning, I have a problem with Eclipse IDE for C/C++ Developers. I'm writting a smal tool for converting Strings. While testing on some point eclipse stopped to give console output. e.g.: cout
Beasly
6

votes
5

answer
4.7k

Views

NHibernate 3.0: TransactionScope and Auto-Flushing

In NHibernate 3.0, FlushMode.Auto does not work when running under an ambient transaction only (that is, without starting an NHibernate transaction). Should it? using (TransactionScope scope = new TransactionScope()) { ISession session = sessionFactory.OpenSession(); MappedEntity entity = new Mappe...
Jeff Sternal
5

votes
2

answer
307

Views

periodic save/flush/commit - is there a name to this pattern?

I find myself again and again faced with a similar problem: there's some piece of code that processes data as it arrives from the user/network/produces of some sort. For efficiency reasons, I don't want to call flush() or commit() on every piece of data that I receive, but only occasionally. I usual...
itsadok
5

votes
2

answer
466

Views

Firefox 4 doesn't render partial pages

I have an ASP.NET MVC page which contains a table, where every row takes some time to load. So I'm calling Response.Flush() after every row is rendered. IE9 behaves the way it should: displays rows one by one. FF4 on the other hand, displays the page only when it finished loading completely, even th...
svick
6

votes
5

answer
19k

Views

Flushing stdin after every input - which approach is not buggy?

After Mark Lakata pointed out that the garbage isn't properly defined in my question I came up with this. I'll keep this updated to avoid confusions. I am trying to get a function that I can call before a prompt for user input like printf("Enter your choice:); followed a scanf and be sure that only...
Aseem Bansal
2

votes
2

answer
3.6k

Views

Does PHP flush work with jQuerys ajax?

I have created a page in which I use the PHP function flush(), to output data to the browser the second the data is echoed. I'm also calling this page using jQuery's ajax function. It works, but jQuery doesn't output anything until the entire page has executed, which kind of removes the functionalit...
MrAwesome
4

votes
1

answer
1.5k

Views

How do I manually flush a pipe to a child process in node.js?

I am trying to run the a script on node.js which sequentially sends numbers to an executable a.out, which squares it and writes the result on its stdout. When that happens, the next number will be sent. Here's the code: var spawn = require('child_process').spawn; var p = spawn("./a.out",[],{"stdio":...
5

votes
2

answer
251

Views

Prevent flush of EntityManager when selecting a given data

I am developping a JPA application (with hibernate), and I am fighting with the AutoFlush feature. By default, whenever we process a query on any entity, the complete EntityManager is flushed. This is ok in most cases : We want JPA to process queries against an up-to-date DB. However, it happens tha...

View additional questions