Questions tagged [output]

The externally observable consequences of calling a program on some input

The output of a program is the set of externally observable consequences of running a program on the given input.

A program's output can be manifested in several forms:

  1. What is printed to and/or
  2. What is written to an external file
  3. What changes are made to the inputs, which are then used in other functions or programs
9797 questions
12
votes
4 answers

Swift - Write an Array to a Text File

I read into myArray (native Swift) from a file containing a few thousand lines of plain text.. myData = String.stringWithContentsOfFile(myPath, encoding: NSUTF8StringEncoding, error: nil) var myArray = myData.componentsSeparatedByString("\n") I…
Kym
  • 123
  • 1
  • 1
  • 4
12
votes
1 answer

For three digit exponents Fortran drops the 'E' in the output

I'm just coming to Fortran90 from Python and, honestly, the hardest part so far has been getting used to the formatting codes for writing output. I've run across a formatting problem that I can't seem to google or fiddle my way out of, I have…
Dex
  • 345
  • 4
  • 13
12
votes
1 answer

R output without [1], how to nicely format?

I know stuff has been posted, but not as complete as what I am looking for. Take any help function (i.e. ?mean), and realise that it's output (or at least output should be able to be generated in the same manner). How do you get enters,…
PascalVKooten
  • 20,643
  • 17
  • 103
  • 160
11
votes
6 answers

Unexpected printf output

I just discovered very weird behavior from the C compiler. It's very simple code. I tried it in many online C compilers, but the result is always the same, which is driving me insane. #include int main() { char Buffer[10] =…
Vertinhol
  • 289
  • 1
  • 8
11
votes
2 answers

Writing a set to an output file in python

I usually use json for lists, but it doesn't work for sets. Is there a similar function to write a set into an output file,f? Something like this, but for sets: f=open('kos.txt','w') json.dump(list, f) f.close()
PolkaDot
  • 520
  • 1
  • 7
  • 18
11
votes
3 answers

Capturing output and exit codes in BASH / SHELL

I am having trouble capturing output and exit codes inside a shell. I need to compare exit codes from 2 scripts and if they don't match I want to echo the output of my 2 scripts. What I currently have: #!/bin/bash resultA=$(./a.out…
Flo
  • 171
  • 1
  • 1
  • 8
11
votes
3 answers

Xcode iOS testsuite NSLog output missing

I'm developing an iOS app using Xcode 6 and am trying to run a test suite in Xcode. I can run the test but I don't see where my NSLog statements output. They are not in the output panel. How do I find the output? @interface ISTest :…
user1165560
  • 331
  • 4
  • 21
11
votes
1 answer

bash storing the output of set -x to log file

I have a simple download script and I use set -x which works great; I can see each step it performs, and I can identify errors in the script or in the download: #!/bin/bash set -x #short_date=$(/bin/date +%m%d%y) short_date=$(/bin/date -d "8 day…
capser
  • 2,442
  • 5
  • 42
  • 74
11
votes
1 answer

Using sockets in Swift like in Java

If I wanted to connect to a server, in Java I would open a Socket and initialize it with port and host address, then retrieve the input/output streams and read/write whatever I want. In Swift I'm having hard time doing so since it's not built that…
johni
  • 5,342
  • 6
  • 42
  • 70
11
votes
3 answers

Python code output to a file and add timestamp to filename

"I would not even approach this from a python-fix perspective, but simply redirect the output of running your python script: python /path/to/script/myscript.py > /path/to/output/myfile.txt Nothing has to change in your script, and all print…
user3255477
  • 113
  • 1
  • 1
  • 4
11
votes
3 answers

How to pass output parameter to a Stored Procedure?

I have written a stored procedure with the following format: ALTER PROCEDURE usp_data_migration (@sourceDatabase varchar(50), @sourceTable varchar(50), @targetDatabase varchar(50), @targetTable varchar(50), @finaloutput…
Yousuf Sultan
  • 3,055
  • 8
  • 35
  • 63
11
votes
2 answers

C# creating XML output file without

I'm new to C# development so maybe a very simple question here. I'm trying to get an output which starts as this: But am getting this:
Giancarlo
  • 377
  • 2
  • 6
  • 16
11
votes
1 answer

Printing to a file in C

How do I print to an empty .txt file I already have created? I already print the results to the console, and now I want to print to a file named "Output.txt". I've tried a couple of things that haven't worked, but I think it was easier to create a…
Silent Phantom
  • 113
  • 1
  • 1
  • 6
11
votes
1 answer

set ipython's default scientific notation threshold

How can I modify the point at which python decides to print in scientific notation? E.g. I'd like everything > 1e4 or < 1e-4 to be printed in scientific notation. Good: In [11]: 5e20 Out[11]: 5e+20 Bad: In [12]: 5e10 Out[12]: 50000000000.0
DilithiumMatrix
  • 17,795
  • 22
  • 77
  • 119
11
votes
3 answers

How to ignore an output of a multi-output function in Python?

Suppose I have a function: def f(): ... ... ... return a,b,c and I want to get only b in output of the function. Which assignment I have to use? Thanks.
Cupitor
  • 11,007
  • 19
  • 65
  • 91