output

vbscript output to console

為{幸葍}努か 提交于 2019-11-27 05:09:11
问题 This question was migrated from Server Fault because it can be answered on Stack Overflow. Migrated 8 years ago . What is the command or the quickest way to output results to console using vbscript? 回答1: You mean: Wscript.Echo "Like this?" If you run that under wscript.exe (the default handler for the .vbs extension, so what you'll get if you double-click the script) you'll get a "MessageBox" dialog with your text in it. If you run that under cscript.exe you'll get output in your console

How to print variable inside quotation marks? [closed]

夙愿已清 提交于 2019-11-27 04:39:17
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 4 years ago . I would like to print a variable within quotation marks. I want to print out "variable" I have tried a lot, what worked was: '"', variable", '"' – but then I have two spaces in the output -> " variable " When I do print '"'variable'"' without the comma I get a syntax error. How can I print

How to display progress of scipy.optimize function?

那年仲夏 提交于 2019-11-27 04:11:13
I use scipy.optimize to minimize a function of 12 arguments. I started the optimization a while ago and still waiting for results. Is there a way to force scipy.optimize to display its progress (like how much is already done, what are the current best point)? As mg007 suggested, some of the scipy.optimize routines allow for a callback function (unfortunately leastsq does not permit this at the moment). Below is an example using the "fmin_bfgs" routine where I use a callback function to display the current value of the arguments and the value of the objective function at each iteration. import

Send a text string containing double quotes to function

血红的双手。 提交于 2019-11-27 03:36:27
问题 I'm having a problem with using double quotes while formatting text strings being sent to functions in R. Consider an example function code: foo <- function( numarg = 5, textarg = "** Default text **" ){ print (textarg) val <- numarg^2 + numarg return(val) } when running with the following input: foo( 4, "Learning R is fun!" ) The output is: [1] "Learning R is fun!" [1] 20 But when I try (in various ways, as suggested here) to write "R" instead of R, I get the following outputs: > foo( 4,

h:outputText does not break \\r\\n characters into new lines

让人想犯罪 __ 提交于 2019-11-27 03:19:38
I've some text in a String variable which contains carriage returns and new lines \r\n . text = "Text1\r\nText2\r\nText3"; I'm presenting it using a <h:outputtext> . <h:outputText value="#{bean.text}" /> But it doesn't recognize the new line characters and shows as below in webbrowser. Text1 Text2 Text3 Why does the <h:outputText> not break \n into new lines? What should I do? Do I have to replace \n with <br /> ? Linebreaks in HTML are represented by <br /> element, not by the \n character. Even more, open the average HTML source code by rightclick, View Source in browser and you'll "see" \n

How to determine if an output of a function-call is unused?

安稳与你 提交于 2019-11-27 03:09:50
问题 Say I have a function foo that can return three values given an input: function [a,b,c] = foo(input) The calculations of variables b and c take a long time, so sometimes I may wish to ignore their calculation within foo . If I want to ignore both calculations, I simply call the function like this: output1 = foo(input); and then include nargout within foo : if nargout == 1 % Code to calculate "a" only else % Code to calculate other variables The problem occurs if I want to calculate the last

Java: println with char array gives gibberish

你说的曾经没有我的故事 提交于 2019-11-27 03:04:41
问题 Here's the problem. This code: String a = "0000"; System.out.println(a); char[] b = a.toCharArray(); System.out.println(b); returns 0000 0000 But this code: String a = "0000"; System.out.println("String a: " + a); char[] b = a.toCharArray(); System.out.println("char[] b: " + b); returns String a: 0000 char[] b: [C@56e5b723 What in the world is going on? Seems there should be a simple enough solution, but I can't seem to figure it out. 回答1: When you say System.out.println(b); It results in a

Cyrillic encoding output in R

做~自己de王妃 提交于 2019-11-27 02:58:22
问题 Encoding is always a pain for me, and again it's impossible to write file with russian text. What should I do for this? >test = c("привет","пока") >test [1] "\320\277\321\200\320\270\320\262\320\265\321\202" "\320\277\320\276\320\272\320\260" >Encoding(test) [1] "unknown" "unknown" > f = file("test.txt", encoding = "UTF-8") > write(t,f) Error in cat(list(...), file, sep, fill, labels, append) : argument 1 (type 'closure') cannot be handled by 'cat' > Encoding(test) = "UTF-8" > test [1] "<U

CMake: setting an environmental variable for ctest (or otherwise getting failed test output from ctest/make test automatically)

拟墨画扇 提交于 2019-11-27 01:45:38
问题 I want ctest to show me the failed tests output by default. That is, I want to run: $ make all test and see any output of failed tests without having to cat Testing/Temporary/LastTest.log . It appears that there are two ways of doing this: (1) Setting the CTEST_OUTPUT_ON_FAILURE environmental variable: $ CTEST_OUTPUT_ON_FAILURE=1 make all test $ # or CTEST_OUTPUT_ON_FAILURE=1 ctest (2) Specifying the --output-on-failure flag to the ctest invocation: $ ctest --output-on-failure Is there a way

How to position the input text cursor in C?

两盒软妹~` 提交于 2019-11-27 01:41:42
问题 Here I have a very simple program: printf("Enter your number in the box below\n"); scanf("%d",&number); Now, I would like the output to look like this: Enter your number in the box below +-----------------+ | |*| | +-----------------+ Where, |*| is the blinking cursor where the user types their value. Since C is a linear code, it won't print the box art, then ask for the output, it will print the top row and the left column, then after the input print the bottom row and right column. So, my