output

Printing debug output to console in Codeception

青春壹個敷衍的年華 提交于 2019-11-30 02:44:32
Very thick question, but is there any way to print your own debug messages to the console in Codeception? I mean messages that have nothing to do with assertions, purely for debugging the tests themselves (e.g. like you would var_dump() a variable in any regular PHP website) I have already tried var_dump() , echo and print but to no avail. Using WebDebug 's makeAResponseDump() doesn't produce the required results neither, I just want to be able to see my variable's content without having to run a debugger like xdebug . See Debugging which says You may print any information inside a test using

Is this undefined behaviour in C ? If not predict the output logically

廉价感情. 提交于 2019-11-30 01:27:25
Code 1 #include <stdio.h> int f(int *a, int b) { b = b - 1; if(b == 0) return 1; else { *a = *a+1; return *a + f(a, b); } } int main() { int X = 5; printf("%d\n",f(&X, X)); } Consider this C code. The question here is to predict the output. Logically, I get 31 as ouput. ( Output on machine ) When I change the return statement to return f(a, b) + *a; I logically get 37. ( Output on machine ) One of my friends said that while computing the return statement in return *a + f(a, b); we compute the value of a while going depth of the tree, i.e. *a first computed then f(a, b) is called, whereas in

Angular 2 - How to trigger a method on a child from the parent

隐身守侯 提交于 2019-11-30 00:18:49
It's possible to send data from the parent to a child through @Input, or to call a method on the parent from the child with @Output, but I'd like to do exactly the other way around, which is calling a method on the child from the parent. Basically something like that: @Component({ selector: 'parent', directives: [Child], template: ` <child [fn]="parentFn" ></child> ` }) class Parent { constructor() { this.parentFn() } parentFn() { console.log('Parent triggering') } } and the child: @Component({ selector: 'child', template: `...` }) class Child { @Input() fn() { console.log('triggered from the

Using sockets in Swift like in Java

爱⌒轻易说出口 提交于 2019-11-29 21:57:05
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 way and I would really like to see a simple example of how to connect to a server, retrieve the streams and use them. EDIT1: This is the tested code after what @Grimxn referenced. var host = "http://google.com" var readStream :CFReadStreamRef var writeStream :CFWriteSteamRef var socket = CFStreamCreatePairWithSocketToHost(nil, host, 80, readStream,

list output truncated - How to expand listed variables with str() in R

雨燕双飞 提交于 2019-11-29 21:21:22
I have a data.frame df with 600+ variables. I'm writing a function that automates the creation of columns and need to visually check them once. The str function provides a good summary: str(df) 'data.frame': 29 obs. of 602 variables: $ uniqueSessionsIni: POSIXct, format: "2015-01-05 15:00:00" "2015-01-05 16:00:00" "2015-01-05 17:00:00" ... $ uniqueSessionsEnd: POSIXct, format: "2015-01-05 15:59:00" "2015-01-05 16:59:00" "2015-01-05 17:59:00" ... $ m0p0 : POSIXct, format: "2015-01-05 15:00:00" "2015-01-05 15:00:00" "2015-01-05 15:00:00" ... $ m1p0 : POSIXct, format: "2015-01-05 15:01:00" "2015

Execute any bash command, get the results of stdout/stderr immediatly and use stdin

那年仲夏 提交于 2019-11-29 17:45:38
I would like to execute any bash command. I found Command::new but I'm unable to execute "complex" commands such as ls ; sleep 1; ls . Moreover, even if I put this in a bash script, and execute it, I will only have the result at the end of the script (as it is explain in the process doc). I would like to get the result as soon as the command prints it (and to be able to read input as well) the same way we can do it in bash. Command::new is indeed the way to go, but it is meant to execute a program. ls ; sleep 1; ls is not a program, it's instructions for some shell. If you want to execute

Mercurial Hg No changes found - can't Hg push out

假装没事ソ 提交于 2019-11-29 16:41:20
Can someone pls advise why I'm getting NO CHANGES found at the end. Also, I'm getting an annoying message, " Username not specified in .hg/hgrc. Keyring will not be used. " Version tool: Hg latest version Server: Linux Workspace: ~/2012WS LinuxServer123:~/2012WS # hg clone http://LinuxServer123/hg/GigaTest/ Username not specified in .hg/hgrc. Keyring will not be used. http authorization required realm: Mercurial Repositories user: u123456 password: destination directory: GigaTest requesting all changes adding changesets adding manifests adding file changes added 14 changesets with 585 changes

redirecting cout into file c++

不打扰是莪最后的温柔 提交于 2019-11-29 16:34:51
my problem is I have a couple of cout's in various files in the project. I would like all of them to be redirected and saved in .txt file, and what I achieved by now is that only one cout is saved in the file. I don't want to create separate .txt for each cout , for the sake of reading them at once. My code looks now like this: #include <fstream> #include <string> #include <iostream> int main() { std::ofstream out("out.txt"); std::cout.rdbuf(out.rdbuf()); std::cout << "get it3"; std::cout << "get it4"; } Both cout are in one file, but assuming they are in two different, how to redirect and

Freeze when programmatically launching a batch file (with output redirection), when the batch file simply calls “start some.exe”

╄→尐↘猪︶ㄣ 提交于 2019-11-29 15:25:28
EDIT: Found some duplicates with no answers: Issue with output redirection in batch How do I use the "start" command without inheriting handles in the child process? I have some C# code that tries to be a generic process launcher, within a larger long-running program. This code needs to capture the output from the processes it launches, and also wait for them to finish. We typically launch batch files with this code, and everything works fine, except when we want to start another child process from inside the batch file, such that it will outlive the batch file process. As an example, let's

C++ Update console output

旧街凉风 提交于 2019-11-29 13:03:31
I'm trying to make a program to print out a grid and given x and y co-ordinates change a value in the grid. For example, if the user entered X:0 and Y:0 it would change the value '9' in the image below to a predefined value (in this case I want to change the value 9 to 0). My question is, is it possible to update the output of the console so that the '0' would override the '9' without printing out the entire grid again. I want to be able to do this multiple times. If that is not possible, how can I print out the updated grid the way I have implemented this? If I were to put the display grid