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
4
votes
1 answer

Get class of returned object by PowerShell command - determine a cmdlet's output data type

In PowerShell, if a command returns an array of one or more objects, I can find out the class of the object by the following method: $ab = SampleCommand $ab[0].getType() But, how can I find out the default return type of a command if the command…
Jay Joshi
  • 1,402
  • 1
  • 13
  • 32
4
votes
2 answers

How can I print numbers in python with thin space characters as the thousands separators?

I know for example "{:,}".format(123456789) will print '123,456,789' as output in python. However, instead of the commas I would like the thin space character as the thousands separator. According to here, the python source encoding for the thin…
redwood_gm
  • 343
  • 2
  • 11
4
votes
1 answer

Why does dput(object) in j in data.table also print(object)?

Not high priority, but this is an operation I carry out frequently. So, I'd like to know if there's any way to suppress the output of the expression inside dput. library(data.table) mtcars <- setDT(copy(mtcars)) mtcars[, dput(unique(gear))] # c(4,…
Ameya
  • 1,712
  • 1
  • 14
  • 29
4
votes
4 answers

Why does the program only give an output if defined in main (and how can I change this)?

I tried to run this int array( void ) { char text[12] = { 112, 114, 111, 103, 112, 0 }; int i; for(i = 0; text[i]; i = i +1) printf("%c", text[i]); printf("\n"); return 0; } int main( void ) { int array(void); …
Gottaquest
  • 111
  • 6
4
votes
1 answer

Why is snprintf consistently 2x faster than ostringstream for printing a single number?

I was testing various approaches at formatting doubles in C++, and here's some code I came up with: #include #include #include #include #include #include inline long double currentTime() { …
Ruslan
  • 18,162
  • 8
  • 67
  • 136
4
votes
2 answers

Bad Word Catcher Javascript

I am trying to create an application that takes input from a user using a text field. Split the string into the spaces and look for bad words in the string. If the bad word is found output results on the DOM. I have been looking on for a form and…
king_coney
  • 83
  • 2
  • 9
4
votes
2 answers

Sequentially print data output as a formatted table in Python

I'm looking at Python packages that provide an easy way to make formatted 'pretty' tables as text output. This answer provides a few suggestions. The catch is, I want to print my table sequentially (one row at a time) similar to a logger. To…
Bill
  • 10,323
  • 10
  • 62
  • 85
4
votes
1 answer

Ansible: get specific attribute value from json output

I have the following Ansible task: tasks: - name: ensure instances are running ec2: aws_access_key: "{{aws_access_key}}" aws_secret_key: "{{aws_secret_key}}" ... user_data: "{{ lookup('template', 'userdata.txt.j2') }}" …
dom_weissb03
  • 415
  • 2
  • 5
  • 8
4
votes
4 answers

Python - Format a list so elements are not split between lines

I wrote a program to list all the prime numbers less than a number the user inputs. When I run the program in PyCharm, the output is very nice: each number is properly situated on the line and no numbers are spread across two lines. However, when I…
Jeff Moorhead
  • 181
  • 1
  • 15
4
votes
2 answers

C++ output 2D Vector

I wrote two for loops and expected to see if they would output every value in a vector called data, but it doesn't work. There is an error relating to data[i].at(j) that I don't quite understand. vector data; //it is filled with some integers…
rrc
  • 275
  • 1
  • 3
  • 7
4
votes
0 answers

Getting output and full command history for R when using the Windows Command Prompt

I am a professor at a small college, and I am working with a blind student in a statistics course. We have found that R is by far the most accessible system to use, and for the screen reader to work (i.e. for it to read the output), we need to run…
Sam J
  • 41
  • 1
4
votes
5 answers

How to not print a space after a comma

This is my current code. The print will put a space prior to the "!" and I've searched the forums for an hour, but everything is way too complicated for me right now. It's a stupid question, but I have to know why it's adding this random space after…
4
votes
2 answers

Could not get unknown property 'outputFile' for task ':app:packageDebug'

I try to execute from my terminal the command : ./gradlew testfairyDebug. This return the next error: FAILURE: Build failed with an exception. What went wrong: Execution failed for task ':app:testfairyDebug'. Could not get unknown property…
PAx
  • 63
  • 1
  • 5
4
votes
1 answer

How to save table output in an exportable manner in Sage

I am a sage novice trying to export a table output to some image format (so that it might be shared). I tried using the .save() function as so: my_table1 = table(my inputs) result = my_table1.transpose() result.save('here') My table outputs properly…
4
votes
1 answer

Angular - two output-events in one component, but only one works

I want the child component to emit two different events in it`s parent Component, depending on which button the user clicks. The first one (onSelectedKat) works fine. But the second one (onAllClick) doesn´t work. It has the same structure like the…
Tobsi
  • 51
  • 1
  • 5