output

php output with sleep()

I'm trying to run a loop every second for 25 seconds basically. for($i = 0; $i <= 25; $i += 1){ echo $i; sleep(1) } The thing is it doesn't output until it's fully done, so after the loop continues 25 times. Is there a way to do this so it will output before each sleep? and not wait until the full loop is complete? Thanks...

python + Semicolon written to file is written on the next line

Hi everyone, I have this simple python expression: fscript.write (("update %s va set %s = %s where %s = %s;") % (argv[1],argv[2],vl[0],argv[3],vl[1])) And I would expect to receive output like this update some_table va set active_id = 1 where id = 5; update some_table va set active_id = 1 where id = 3; ...more lines... However, i'...

To print output of a program Simultaneously as it runs

Guys, In the following code, am executing a java program Newsworthy_CA. The program prints the output of the Newsworthy_CA program but the difficulty I face is it prints the whole output only after the complete execution of Newsworthy_CA program. But I need the output to be printed simultaneously as the program is being executed. Also,...

Netlogo: line break in output file?? Not so simple.

Dear reader, I tried all options to create a new line in my output file, but still I get a txt-file with everything behind the previous information. Even with this supersimple code: globals [file] to setup clear-all set file "results\GA1.txt" if is-string? file [while [file-exists? file] [set file replace-item (lengt...

Visual studio 2008 creates a additional bin\debug folder although I have no pre/post build events defined?

I have this structure: Projects |-bin |-Project1 |-Project2 .....|-crapBin When I build my solution from project1+2 all the built binaries goes into the bin. But additionally some binaries are also put into the crapBin folder although I have not set this path as output path of any project. Furthermore I have not defined any pre/post b...

Objective c: NSString NSData reading from file problem

I'm using: NSData *output1 = [NSData dataWithContentsOfFile:@"~/centralUtilOut.tmp"]; NSString *output = [[NSString alloc]initWithData:output1 encoding:NSUTF8StringEncoding]; NSLog(@"%@", output); [output release]; But nothing is in the debug window. This is in objective C. Note: centralUtilOut.tmp is a normal text file ...

dputting an S4 object

How would a person dput() an S4 object? I tried this require(sp) require(splancs) plot(0, 0, xlim = c(-100, 100), ylim = c(-100, 100)) poly.d <- getpoly() #draw a pretty polygon - PRETTY! poly.d <- rbind(poly.d, poly.d[1,]) # close the polygon because of Polygons() and its kin poly.d <- SpatialPolygons(list(Polygons(list(Polygon(poly.d)...

Problems executing Perl scripts from PHP

Trying to figure this out. I am trying to execute a perl script within php, using shell_exec() like so: <?php $output=shell_exec("./tst.pl > test.txt"); //$output=shell_exec("./tst.pl"); echo $output; ?> It will not write output to a file using ">" filename.txt. It will work if I execute without directing it to a filename as I can con...

Eclipse output to WAMP webserver www folder

I have an eclipse workspace folder. I want to store all the different projects I am working on over here. Now I am working on a PHP project and have WAMP installed. Is there some way to configure eclipse such that it outputs my project files to the server's www folder. I don't want to create my workspace in the server's www folder, for ...

PHP flushing output as soon as you call echo

I thought flush(); would work, at least from what Google/Stackoverflow tell me, but on my Windows WAMP (Windows, Apache, MySQL, PHP) system it doesn't work. Is there some PHP setting I have to set to make flush() work? Here's my code: <?php echo "Fun"; flush(); sleep(5); echo "<br>Mo"; ?> The code just outputs all together when t...

Java program output - concurrent

It might be a silly question but, can the output of this program ( the way it is) be zero? public class Test2{ int a = 0; AtomicInteger b = new AtomicInteger(); public static Test2 c = new Test2(); public static void main(String[] args){ Thread t1 = new Thread(new MyTest1()); Thread t2 = new Thread (n...

Change current working directory C

Hello, I'm trying to figure out a way where I can change my current output directory using C++ code - and also need that method to be platform agnostic. I found the direct.h header file which is Windows compatible, and the unistd.h which is UNIX/POSIX compatible. Any solutions? Cheers. ...

Structured JSON layout

I'm working with JSON by PHP at the moment, when I encode it, it would output as: {"username":"ND","email":"[email protected]","regdate":"8th June 2010","other":{"alternative":"ND"},"level":"6"} When I would like it to output like this: { "username": "ND", "email": "[email protected]", "regdate": "8th June 2010", "other": ...

UI Prototyping Tool which generates html as output

I'm looking for a UI prototyping tool which generates HTML output. I checked SO for Web UI prototyping tools, but none of them generates html as output. Please could you suggest a tool for the same... ...

java code to display a floating point value in specified format in jasper report

The value 13.10 is printed as 13.1 in my jasper report , I want to print it as 13.10 itself , How to do it .The corresponding JRXML statement is <textFieldExpression class="java.lang.Float"><![CDATA[$F{temp_bill_tax}]]> </textFieldExpression> ...

Which format should I save my python script output?

I have an executable (converted to exe from python using py2exe) that outputs lists of numbers that could be from 0-50K lines long or a little bit more. While developing, I just saved them to a TXT file using simple f.write. The person wants to print this output on paper! (don't ask why lol) So, I'm wondering if I can output it to some...

Can Solr return the actual final query that was used when synonyms and stemming are used?

Hello, I would like to be able to show in my UI what the query terms were that solr used to run the final query. For example, I might type the query "run" but behind the scenes solr will use stemming to also query "ran" and "running", I may also have a synonym defined which has "run = sprint". I would like to show the user that although...

disable NOTICES in psql output

How do I stop psql (postgres?) from outputting 'useless' notices? e.g. psql:schema/auth.sql:20: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "users_pkey" for table "users" yes psql I know, now be a good tool and stop telling me that you're doing things I want you to do. IMO a program should be silent unless it has an...

Why does all browsers do not set all output perfectely ?!!?

This is an html page : <html> <head> <title> Frame Set </title> <script type="text/javascript" src="jquery-1.4.2.min.js"></script> <!--<script type="text/javascript" src="frame.js"></script>--> <link rel="stylesheet" href="frame.css" type="text/css" media="screen" /> <script language="JavaScript" type="text/javascript"> $(document).rea...

Parsing blockbased program output using Python

I am trying to parse the output of a statistical program (Mplus) using Python. The format of the output (example here) is structured in blocks, sub-blocks, columns, etc. where the whitespace and breaks are very important. Depending on the eg. options requested you get an addional (sub)block or column here or there. Approaching this us...