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

Powershell: A positional parameter cannot be found that accepts argument “test”

I'm trying to execute the following command via command line C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe Send-MailMessage -from "mail.me" -to "mail.me" -Subject "PS test !" -Body "Hi this is a power shell mail test" -SmtpServer…
mounaim
  • 1,132
  • 7
  • 29
  • 56
6
votes
3 answers

Change parameter values at time step in deSolve

I am trying to solve an ODE in R using deSolve. With the following code, I expected the parameter gamma0 takes the values 5 at time step 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 and 10, and 0 otherwise. However, the print(gamma0) shows that gamma0 stays at 0.…
Marine
  • 521
  • 1
  • 4
  • 23
6
votes
5 answers

Android, KSoap2 and .NET Web Service w/ parameters = NULL result

Apparently this is a fairly often experienced issue. I'm not sure entirely where the problem lies, or what needs to be adjusted, but for the life of me I cannot retrieve anything other than a NULL result to my SoapObject or SoapPrimitive from my…
Magua
  • 174
  • 1
  • 1
  • 7
6
votes
2 answers

Strong Params: params.permit returns Unpermitted parameters despite whitelist

UsersProfileController has strong params that looks like so: def user_profile_params params.permit(:age, :relations) # yes, I am not requiring user_profile. Just permitting attributes I need. end The create action builds…
Uzzar
  • 705
  • 1
  • 12
  • 24
6
votes
1 answer

perl6: how to specify multiple requirements for a parameter of a function?

I have a special function that takes a list, each member of the list must satisfy multiple requirements. How do I set this up in a perl6 function? sub specialFunc(List $x) {}; $x is a list # easy, List $x, but what about the following: each member…
lisprogtor
  • 5,677
  • 11
  • 17
6
votes
1 answer

adding parameter to python callback

I am a beginner in Python, and I would like to add a parameter to a callback, in addition to the self and the event. I have tried with lambda, but without success. My code at the moment looks like this : control = monitor(block, callback=self.model)…
user1654361
  • 359
  • 3
  • 11
6
votes
1 answer

What is the parameter "state_is_tuple" in TensorFlow used for?

I'm trying to figure out the structure of tensorflow code (r0.11) and have problems understanding the "state_is_tuple" parameter used in RNNs (currently looking at LSTMs). In this post How do I set TensorFlow RNN state when state_is_tuple=True? it…
Torben
  • 335
  • 3
  • 17
6
votes
1 answer

R - Pass element of list as argument to function call

Let's start with some simple code: require(randomForest) randomForest(mpg~.,mtcars,ntree=10) This builds a random forest of 10 trees. What I want is to store the parameter in a list in than make the function call. Something like…
Funkwecker
  • 766
  • 13
  • 22
6
votes
1 answer

Passing delegate as method parameter

I'm currently developing an EventManager class to ensure that no events are left wired to dead WCF duplex clients, and also to control prevent multiple wiring from the same client to the one event. Now basically, I'm what stuck with is trying to…
Guilherme Duarte
  • 3,371
  • 1
  • 28
  • 35
6
votes
1 answer

Teamcity - Make a Configuration parameter mandatory from Template

In Teamcity 9.* I have a Build Template with some Configuration parameters that will be different depending on the project that will be created from it. This parameter is important and must be entered during creation otherwise the build will not…
Tonino
  • 1,137
  • 10
  • 25
6
votes
1 answer

Are array parameters in rails guaranteed to be in the order in which they appear in the url?

Given the following url: http://example.com?arr[]=hello&arr[]=to&arr[]=you Am I able to bank on the fact that: params[:arr] == ['hello', 'to', 'you'] ? I ask because I have some additional data that will be sent with the request that needs to be…
Brad
  • 718
  • 4
  • 19
6
votes
5 answers

How can I return the same Collection type given as a parameter, but with a different element type?

I want to do this: public > C strings_to_files(C strings) { C files = new C(); for(String string : strings) { files.add(new File(string) } return files; } I just want…
user6243380
6
votes
6 answers

T-SQL Stored Procedure NULL input values cause select statement to fail

Below is a stored procedure to check if there is a duplicate entry in the database based upon checking all the fields individually (don't ask why I should do this, it just has to be this way). It sounds perfectly straightforward but the SP…
Steve W
6
votes
2 answers

Get the parameters.yml params in the AppKernel.php

Can anybody knows how can I get the parameters.yml (or _dev) in the AppKernel.php ? I want to change the getLogDir() variables('mylogsdir') dynamicly ? AppKernel.php…
fabrice
  • 1,399
  • 1
  • 15
  • 27
6
votes
2 answers

Groovy - reflection on a Java class - methods and parameters

How would you go about this reflection task in Groovy: (1) provide a class type to the Groovy function (2) loop over all the methods of this class (a) print out each parameter name and type from the method (b) print out the return…
BuddyJoe
  • 69,735
  • 114
  • 291
  • 466