Questions tagged [arguments]

An argument is a value passed to a function, procedure, or command line program. This also refers to the Array-like `arguments` object in JavaScript.

An argument is a value passed to a function, procedure, or program. It is often used interchangeably with the word "parameter", which also has more specific definitions. Usually "argument", or "actual parameter" (as opposed to "formal parameter") is the value of the parameter used within the called routine.

In other words, parameters are used in procedure definitions, and arguments are used in procedure calls.

arguments can also refer to the Array-like object in JavaScript that is available inside functions, this object can be used to access all of the function's arguments regardless of the function's signature.

11091 questions
3
votes
1 answer

graphql where filter - "Unknown argument \"where\"

I tried to use where: filter on graphql query but unfortunately I got some error. What am I doing wrong? shoeposts { data { attributes(where: {slug: "NikeDunkLow"}) { title slug } } }} "error": { "errors": [ …
damian-lw
  • 51
  • 7
3
votes
2 answers

Rails new - wrong number of arguments (0 for 1)

I have the following inside a new method of an orders_controller @order = Order.new Rails gives me the following error: wrong number of arguments (0 for 1) app/models/order.rb:2:in `' app/models/order.rb:1:in `
joshim5
  • 2,292
  • 4
  • 28
  • 40
3
votes
2 answers

Try to pass argument to C function in Nasm elf64 but it return SIGFPE error

I try to implement the C sqrt function in Nasm elf64, it works correctly without argument (with the value of "a" define in the function), but when I try to pass an argument to this function ,the code return an error "Stopped reason: SIGFPE". Here's…
BerretMan
  • 95
  • 6
3
votes
1 answer

How to put a function as an argument in C?

I would like to execute a function given in the paramater of a function. Let me explain with an example. #include #include #include int object() { printf("Hello, World!"); return 0; } int run_func( int…
user19211708
3
votes
2 answers

ruby 3.0.4, redmine 5.0.0, rails 6.1.4, test install start with webrick fails, "wrong number of arguments"

New ubuntu-20 system with the following: ruby 3.0.4 rails 6.1.4 redmine 5.0.0 After install, trying to start webrick test server: bundle exec rails server webrick -e redmine_test fails…
Gary Aitken
  • 233
  • 2
  • 12
3
votes
2 answers

How to pass in multiple arguments to an APL function

I'm trying to write a few different functions, such as standard deviation and linear regression in APL. I need to pass in a list of (x, y) points, but I can't figure out how to do that because I know the syntax of an APL function only allows for 0,…
Lisa
  • 33
  • 1
  • 4
3
votes
2 answers

javascript first argument path last argument callback

I'm trying to write a wrapper function around expressjs's app.get The get (and other methods) accept as arguments, the path, some options, then the callback. But sometimes you can leave the options out and still work. I used to do: app.get(path,…
Harry
  • 52,711
  • 71
  • 177
  • 261
3
votes
1 answer

Creating dictionary with dynamic number of values as arguments

I'm running in a bit of trouble trying to get a script to work as a function. The code below basically zips but for more than one list of values. So I can keep on adding list4, list5, etc. list1 = ['USA', 'France', 'China'] list2 = [30, 39,…
3
votes
7 answers

Should all my arguments be in the constructor?

I have a class StreamCopyOperation which provides me such things like the average speed of the copy operation and other informations. Now I have a constructor which looks like public StreamCopyOperation(Stream source, Stream target, int bufferSize,…
Flagbug
  • 2,093
  • 3
  • 24
  • 47
3
votes
2 answers

Array section with vector subscript as procedure argument

Here is an example of my problem (in my real program, A would be much larger and random) : MODULE MOD_TST contains subroutine function_tst(A,B) real,intent(in) :: A(:) real,intent(out) :: B(:) …
3
votes
1 answer

Kotlin send function arguments using a data class

Let's say I have class: class Foo { fun doSomething(param1: Int, param2: String, param3: String) } and a data class data class Params( val param1: Int, val param2: String, val param3: String) Now I want to use the data class arguments…
htafoya
  • 18,261
  • 11
  • 80
  • 104
3
votes
2 answers

Python command line argument for an existing process

I am trying to write a script for controling cpu usage of a VM n KVM using cpulimit. With cpulimit i can limit the cpu usage of a VM with pid say 2112 by : ./cpulimit -p 2112 -l 50. I want to write a script which can open an interface setcpu…
sethu
  • 1,691
  • 4
  • 22
  • 34
3
votes
3 answers

Having arbitrary number of arguments with a named default in python

I want to write a function in python that can take an arbitrary number of unnamed arguments in addition to one named argument (with a default). For example, I want to write something like this def myFunc(*args, optDefault=1): But this just gives a…
highBandWidth
  • 16,751
  • 20
  • 84
  • 131
3
votes
1 answer

Forward reference extends over definition of value problem

i have some problem in scala to resolve implicit values, and i have the cryptic error message in netbeans : "error : Forward reference extends over definition of value ..." or in the scala console i have an other error message "type mistmatch…
reyman64
  • 523
  • 4
  • 34
  • 73
3
votes
1 answer

Execve with argument in x64 with gnu asm

I am trying to write a shellcode in GNU asm for linux and i'm unable to call execve with arguments. What i'm trying to do : execve("/bin/ls", ["/bin/ls", "-la", NULL], NULL); this is my code : .section .text .globl _start _start: push $0x3b …
Ewen Brune
  • 33
  • 4
1 2 3
99
100