Questions tagged [parameters]

Parameters are a type of variable used in a subroutine to refer to the data provided as input to the subroutine.

A parameter is an intrinsic property of a procedure, included in its definition. For example, in many languages, a minimal procedure to add two supplied integers together and calculate the sum total would need two parameters, one for each integer. In general, a procedure may be defined with any number of parameters, or no parameters at all. If a procedure has parameters, the part of its definition that specifies the parameters is called its parameter list.

There are two ways of passing parameters to a procedure (both of them may not be available in every programming language):

  • by value: the value of a variable (or constant, etc.) is passed to the procedure and the original variable cannot be affected by the code in the procedure.
  • by reference: the reference to a variable is passed to a procedure and the variable's value can be changed in the procedure.
22681 questions
72
votes
15 answers

Dynamically Fill Jenkins Choice Parameter With Git Branches In a Specified Repo

I have a parameterized Jenkins job which requires the input of a specific Git branch in a specific Git repo. Currently this parameter is a string parameter. Is there any way to make this parameter a choice parameter and dynamically fill the drop…
mkez00
  • 982
  • 1
  • 8
  • 17
71
votes
21 answers

Passing multiple values for a single parameter in Reporting Services

I have several Multi-Select parameters in my report. I am trying to find a way to pass in multiple values for a single parameter in the web query string? If I pass in a single value, it works fine. The report runs fine selecting multiple choices for…
Scott and the Dev Team
  • 2,403
  • 5
  • 28
  • 40
71
votes
2 answers

What does "[*]" (star modifier) mean in C?

While trying to implement a C11 parser (for educational purposes), I found that in C11 (p. 470) but also in C99 (p. 412) (thanks Johannes!), the direct declarator is defined as: (6.7.6) direct-declarator: direct-declarator […
cutsoy
  • 10,127
  • 4
  • 40
  • 57
71
votes
4 answers

pass parameter by link_to ruby on rails

I have this line of code: <%= link_to "Add to cart", :controller => "car", :action => "add_to_cart", :car => car %> when im in the add_to_cart method...how can i call the :car please? @car = Car.new(params[:car]) That doesn't work because it says…
Lilz
  • 4,013
  • 13
  • 61
  • 95
70
votes
16 answers

Stripe, is it possible to search a customer by their email?

Update: Since around January 2018, it is now possible to search using the email parameter on Stripe. See the accepted answer. I was wondering if it was possible to search a customer only by their email address when using the Stripe API. The…
Cyril N.
  • 38,875
  • 36
  • 142
  • 243
69
votes
7 answers

Python-like list comprehension in Java

Since Java doesn't allow passing methods as parameters, what trick do you use to implement Python like list comprehension in Java ? I have a list (ArrayList) of Strings. I need to transform each element by using a function so that I get another…
euphoria83
  • 14,768
  • 17
  • 63
  • 73
69
votes
3 answers

C# 4.0, optional parameters and params do not work together

How can i create a method that has optional parameters and params together? static void Main(string[] args) { TestOptional("A",C: "D", "E");//this will not build TestOptional("A",C: "D"); //this does work , but i can only set 1 param …
MichaelD
  • 8,377
  • 10
  • 42
  • 47
68
votes
5 answers

Mockito: Verifying with generic parameters

With Mockito I can do the following: verify(someService).process(any(Person.class)); But how do I write this if process takes a Collection instead? Can't figure out how to write it correctly. Just getting syntax errors...
Svish
  • 152,914
  • 173
  • 462
  • 620
67
votes
2 answers

is link / href with just parameters (starting with question mark) valid?

Is this link valid? eng I know the browsers treat it as expected and I know the empty link would be ok too - but is it ok to specify just the parameters? I am curious because question mark ("?") is only a convention by most…
johndodo
  • 17,247
  • 15
  • 96
  • 113
67
votes
8 answers

Django - Where are the params stored on a PUT/DELETE request?

I'd like to follow the RESTful pattern for my new django project, and I'd like to know where the parameters are when a PUT/DELETE request is made. As far as I know, I only see GET & POST QueryDict in the request, no others. Is Django adding a new…
Cyril N.
  • 38,875
  • 36
  • 142
  • 243
66
votes
4 answers

Writing stringstream contents into ofstream

I'm currently using std::ofstream as follows: std::ofstream outFile; outFile.open(output_file); Then I attempt to pass a std::stringstream object to outFile as follows: GetHolesResults(..., std::ofstream &outFile){ float x = 1234; …
Eric
  • 19,525
  • 19
  • 84
  • 147
66
votes
7 answers

In a C function declaration, what does "..." as the last parameter do?

Often I see a function declared like this: void Feeder(char *buff, ...) what does "..." mean?
alaamh
  • 963
  • 2
  • 9
  • 14
66
votes
2 answers

How do I call New-Object for a constructor which takes a single array parameter?

In PowerShell, I want to use New-Object to call a single-argument .Net constructor new X509Certificate2(byte[] byteArray). The problem is when I do this with a byte array from powershell, I get New-Object : Cannot find an overload for…
Tim Lovell-Smith
  • 15,310
  • 14
  • 76
  • 93
65
votes
6 answers

Rails Unable to convert unpermitted parameters to hash

I am trying to implement a simple search and sort for my webapp. I am following the railscast and this railscast. My application helper for sortable function which I am using as link is: def sortable(column, title = nil) title ||=…
Saurav Prakash
  • 1,177
  • 1
  • 11
  • 25
65
votes
7 answers

How to use an output parameter in Java?

Could someone please give me some sample code that uses an output parameter in function? I've tried to Google it but just found it just in functions. I'd like to use this output value in another function. The code I am developing intended to be run…
soclose
  • 2,773
  • 12
  • 51
  • 60