parameter-passing

Passing arrays to functions in Perl

不羁的心 提交于 2019-12-03 23:24:51
I think I have misunderstood some aspects of argument passing to functions in Perl. What's the difference between func(\@array) and func(@array) ? AFAIK, in both functions, arguments are passed by reference and in both functions we can change the elements of @array in the main program. So what's the difference? When should we use which? @array = (1,2,3); func(@array); func(\@array); sub func { ... } Also, how do I imitate pass-by-value in Perl? Is using @_ the only way? ysth AFAIK, in both functions, arguments are passed by reference and in both functions we can change the elements of @array

Pass a parameter value to a Dataset Parameter in SSRS 2008

非 Y 不嫁゛ 提交于 2019-12-03 16:35:26
I have a dataset with a parameter as which is passed to a query as shown below. The issue here is DataSet parameter queryOptions does not accept the value from the Report Parameter Date . If i hardcode any value e.g <CalendarDate> 08/11/2012 </CalendarDate> instead of <CalendarDate> = Parameters!Date.Value </CalendarDate> the report works fine. What wrong am i doing while passing parameter. I even created another Dataset Parameter named Date and assigned Parameter Value [@Date] even that did not work. Note : Parameter Date is of type DateTime You can try the dynamic expression under your

Multiple projects sharing a jenkinsfile

穿精又带淫゛_ 提交于 2019-12-03 16:32:17
I have multiple projects with similar build steps and I am looking into reusing a Jenkinsfile pipeline across these projects. I am having a hard time to find documentation on how to implement such an standard (to my opinion) setup. Here are my requirements : 1) a Jenkinsfile is stored in repo, shared across multiple projects 2) Each project has its own parameter : the project location in the repo. 3) Each project should be independent in Jenkins from a user perspective at least, meaning for example the executions and logs are available in each project's entry in Jenkins How can I achieve this?

Datatables - how to pass search parameter in a url

ぐ巨炮叔叔 提交于 2019-12-03 14:57:47
I would like to be able to make a link to a page with a datatable which would pass a search parameter value in the url. The goal is to have the page with the datatable open pre-filtered with the search value parameter. I've set up a jsfiddle to work in with some sample data. http://jsfiddle.net/lbriquet/9CxYT/10/ The idea would be to add a parameter to the jsfiddle url so that the page would display with the search input value set to "firefox", for example, and the table filtered to show only the search matches. Any help would be really appreciated!! You could simply have a function that reads

Python: What is the difference between Call-by-Value and Call-by-Object?

我怕爱的太早我们不能终老 提交于 2019-12-03 14:57:33
Many people say that in Python arguments to functions are passed using a call-by-value model. As I understand it, it is not actually a call-by-value language, but a call-by-object or call-by-sharing model. What are the differences between a call-by-value model and a call-by-object model? What is an example in Python that shows how these models are different? Saying that it is not pass-by-value is not correct. Semantically, it is pass-by-value, and one can demonstrate the semantic equivalence between it and other pass-by-value languages. However, it belongs to a particular subcategory of pass

Passing large JSON object to another page in a new window.

坚强是说给别人听的谎言 提交于 2019-12-03 14:03:47
I apologize in advance if this has already been answered. I've Googled around for a few hours now, and I still haven't found anything that seems to answer my exact question. Essentially, I have a very complex/highly styled view which is displaying user-specific data pulled from the database. I've captured the data as a JSON object, attached it to the body my page using .data(). I've added a button that retrieves the JSON object and opens my printer friendly page in a new window. I want to be able to access/manipulate the user-specific JSON object from within this new window. (This would all be

How to pass parameters to Hudson job's shell commands

情到浓时终转凉″ 提交于 2019-12-03 11:09:17
I have a Hudson job that execute shell script on a remote server. Its shell command is: /usr/bin/deployWar.sh ${warfileName} I marked this build as parameterized, and added a string parameter: name: warFileName default value: none description: name of war file When I run it, the parameter gets assigned, but it get passed into the shell script. Parameterized Build Jenkins plugin documentation states that all the environment variables added by parameters are in upper case In your case this should work: /usr/bin/deployWar.sh ${WARFILENAME} There is nothing wrong in your approach. How do you know

how to assign the returned value of a promise to a variable? [duplicate]

喜你入骨 提交于 2019-12-03 10:18:17
This question already has answers here : How do I return the response from an asynchronous call? (36 answers) EDITED as comment to duplicate I quote from: [ How do I return the response from an asynchronous call? Promises are containers for future values. When the promise receives the value (it is resolved) or when it is cancelled (rejected), it notifies all of its "listeners" who want to access this value. This question is about how to return the value contained in the promise. The answer was useful to me, because it clarified that it is not possible to return the value, rather to access the

bash: passing paths with spaces as parameters?

我怕爱的太早我们不能终老 提交于 2019-12-03 10:15:14
I have a bash script that recieves a set of files from the user. These files are sometimes under directories with spaces in their names. Unfortunately unlike this question all the filenames are passed via the command line interface. Let's assume the paths are correctly quoted as they are passed in by the user, so spaces (save for quoted spaces) are delimiters between paths. How would I forward these parameters to a subroutine within my bash script in a way that preserves the quoted spaces? #! /bin/bash for fname in "$@"; do process-one-file-at-a-time "$fname" done Note the excessive use of

When would I pass const& std::string instead of std::string_view?

自闭症网瘾萝莉.ら 提交于 2019-12-03 09:57:09
I understand the motivation for using std::string_view ; it can help avoid unecessary allocations in function arguments. For example: The following program will create a std::string from a string literal. This causes an undesired dynamic allocation, as we are only interested observing the characters. #include <iostream> void* operator new(std::size_t n) { std::cout << "[allocating " << n << " bytes]\n"; return malloc(n); } void observe_string(std::string const& str){} int main(){ observe_string("hello world"); //prints [allocating 36 bytes] } Using string_view will solve the problem: #include