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
2 answers

Overwrite text file on first write, then append to it - Python

My first write to the file needs to overwrite it, then my next ones need to append to it. But There is no way to know what write will be first. My writes are in conditional statements. Here is what I have: class MyHTMLParser(HTMLParser): def…
user3164083
  • 1,053
  • 6
  • 18
  • 35
4
votes
2 answers

Preventing output from commands in Batch

How do you prevent output in the CMD window? I know how to do it for these @echo off timeout /t 3 /nobreak >nul MKDIR Files 2>nul But I was wondering what the general way is for all commands, or how to find out for each command that way I don't have…
user3717248
  • 41
  • 1
  • 2
4
votes
1 answer

View all estimates in plm output in R

I'm trying to run plm to see effects of classes positive, negative and neutral on stock prices. DATE <- c("1","2","3","4","5","6","7","1","2","3","4","5","6","7") COMP <- c("A", "A", "A", "A", "A", "A", "A", "B", "B", "B", "B", "B", "B", "B") RET…
cptn
  • 693
  • 2
  • 8
  • 28
4
votes
1 answer

Simplifying an array in PHP

I have the following Arrays which I need to define in PHP which I've done in a very basic way: $ch1 = array("A-MTP-1-1","A-MTP-1-2","A-MTP-1-3","A-MTP-1-4"); $ch2 = array("A-MTP-1-5","A-MTP-1-6","A-MTP-1-7","A-MTP-1-8"); $ch3 =…
Vince P
  • 1,781
  • 7
  • 29
  • 67
4
votes
3 answers

Store PHP Output To File?

I'm working on a cron php script which will run once a day. Because it runs this way, the output from the file can't be seen. I could literally write all the messages I want into a variable, appending constantly information I want to be written to…
Joseph Astrahan
  • 8,659
  • 12
  • 83
  • 154
4
votes
2 answers

OpenCV documentation says that "uchar" is "unsigned integer" datatype. How?

I got confused with the openCV documentation mentioned here. As per the documentation, if i create an image with "uchar", the pixels of that image can store unsigned integer values but if i create an image using the following code: Mat image; image…
user2756695
  • 676
  • 1
  • 7
  • 22
4
votes
4 answers

C-Language: How to get number from string via sscanf?

Recently I have need to extract a number from a string, but on really old C with means functions like strtok are not supported. I would prefer sscanf, but i can't understand it. Note that the integer is in random place (user-defined). In general…
Lively
  • 111
  • 1
  • 1
  • 10
4
votes
3 answers

Why does value of automatic object persist after lifetime ends?

I'm preparing for a job interview. My c program is : void foo(void) { int a; printf("%d\n",a); } void bar(void) { int a=42; } void main(void) { bar(); foo(); } I'm getting the output as : 42 But how? I thought it would be some…
HighBoots
  • 293
  • 1
  • 5
4
votes
1 answer

Output a array command tester symfony2

How to output an array in command tester? I have a function that returns a array but when the command console generate the output becomes string thanks
user2533808
  • 147
  • 1
  • 10
4
votes
3 answers

why the actual parameter is altered in the first code?

//reference from Herbert Schildt// This is the first code void change(char *); int main(void) { char target[80]="hello"; change(target); printf("%s",target);//printing aaaaa return 0; } void change(char *tar) { int i; …
user3180902
4
votes
1 answer

Why the first code work and second give wrong output?

This is the first code #include #include int main() { short int a; unsigned short int l; scanf("%d%u",&a,&l); printf("%d %u",a,l); return 0; } If I give the input(may be any other input) 5 9 The output is 0…
user3162531
4
votes
0 answers

pass dll stdout to java console

I use a dll, programmed in c++, which has some outputs via cout or printf. In my Java Application I load this dll via JNA. Now I have both a Java Applet and a Java Web Start Application. For debugging (java programme ends as dll ends) I want to read…
user3073364
  • 131
  • 1
  • 4
4
votes
0 answers

What is the purpose of for attribute in output element?

Besides adding semantics, I find the new HTML output element pretty pointless. From the specification, it says: The for content attribute allows an explicit relationship to be made between the result of a calculation and the elements that…
Question Overflow
  • 10,925
  • 18
  • 72
  • 110
4
votes
4 answers

Python - subprocess - getstatusoutput

I'm new to Python and Programming as well. I know from Google's python class how to run external command using: (status, output) = commands.getstatusoutput(cmd) if status: ## Error case, print the command's output to stderr and exit …
hans-t
  • 3,093
  • 8
  • 33
  • 39
4
votes
3 answers

Why and how does the following outputs involving the carriage return show up?

#include void main() { printf("ab"); printf("\bsi"); printf("\rha"); } this code gives the output of "ha" on GCC 4.8 compiler #include void main() { printf("ab"); printf("\bsi"); printf("\rha"); …
aroonav
  • 85
  • 7