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.
11,104
questions
0
votes
0
answers
19
views
Java method arguments: type declaration in parentheses?
I'm implementing a LinkedListDeque data structure. I've written an equals method and a helper that:
Checks if object o is an instance of class LinkedListDeque. If true,
Checks if each node in o is ...
0
votes
0
answers
33
views
how to pass parameters to an external program in bash
I am trying to automate an external program that asks two inputs from user. I have the values in variables, but I m not able pass them to the program. What I do currently is to show the parameters on ...
1
vote
2
answers
35
views
How to solve the problem with erlang badarg?
I ran the code below in Eclipse. The code is compiled and the .txt file is created in the scr folder in the workspace in Eclipse with the header of the data passed to the first io:format, but the ...
0
votes
1
answer
37
views
Pass a Previous Value to function MATLAB
I have the following function:
y(t) = alpha*y(t-1) + beta*y(t-1) + delta
where alpha,beta, and delta are constants.
I am assuming that y(0) = 0. I'm trying to create a MATLAB function to represent y(...
0
votes
1
answer
22
views
How to schedule python script that accepts arguments via input()
I have a python 3.11 script that prompts for input() and stores the responses as vars. I have been running the script interactively within my IDE.
Something like:
[I click run for script.py]
Enter a ...
0
votes
1
answer
20
views
How to write Pyspark function that can accept an argument with a variable number of parameters?
I wrote a function I'd like to modify to have an argument that can take one or multiple parameters but I'm having trouble making it work correctly.
def get_recent_date(input_df, *partion_col, ...
-2
votes
0
answers
28
views
How to separate first name and last name as stings from one strings with ordered pair stings
Python
I have a list of names/full names:
Fullname = [['Daniel', 'Hans'], ['Mc. David', 'Adam'], ['Sara', 'Hansen Oliver'], ['Anna Mari', 'Christiansen'], ['Olivia', 'Per Fredrik']]
I want to ...
0
votes
1
answer
27
views
Syntax error for function arguments in Python [duplicate]
I am working on homework gave out by my teacher, he wants me to write a function in Python that takes for arguments two pairs of floats, and not four floats seperated by commas. A function that should ...
0
votes
1
answer
24
views
How to pass args to application from Eclipse Maven Run configurations
I have a Java / Maven project in Eclipse 2023-06. If I want to run the application, I am using a run configuration based on Maven, as depicted in below picture. I can't figure out how to pass an ...
-2
votes
0
answers
15
views
Create an image from sourceSnapshot
import functions_framework
import googleapiclient.discovery
# CloudEvent function to be triggered by an Eventarc Cloud Audit Logging trigger
# Note: this is NOT designed for second-party (Cloud Audit ...
0
votes
1
answer
71
views
Why does the result come out like this when I use a function? [duplicate]
#include <stdio.h>
int apple(int total, int ate);
int main(void) {
printf("If you eat %d out of %d apples, there will be %d left.\n",
4, 10, apple(10, 4));
...
0
votes
1
answer
25
views
type-graphql doesn't work when passing argument
I'm developing an API using apollo-server and type-graphql, but when I try to send an Input througth a Query or a Mutation arguments I don't know what is happenning but I cannot get the data
...
0
votes
1
answer
22
views
I cannot pass variables from Slurm script to Bash script
Somehow I fail to pass variables from a Slurm job script to Bash. I thought it had worked previously and I cannot find the error.
The Slurm script runs is as follows:
#!/bin/bash
#
#SBATCH -A node
... ...
1
vote
0
answers
99
views
Don't understand how Python calls this C function
please be patient , I am just trying to learn Python, but trying to figure out how some software works ( https://github.com/LBC-LNBio/pyKVFinder/tree/master ) .
Here in https://github.com/LBC-LNBio/...
1
vote
0
answers
62
views
How to pass a python object from a robot framework test case to a keyword?
I'm kind of new in Python and robot framework. So I might miss something obvious. I have experience in .NET programming and used to work with entities/object, which we used for database filling and ...
1
vote
1
answer
29
views
PowerShell: execute a command line with input (arguments) from the caller
I'm trying to write a powershell script, when it's executing, it takes 2 variables and pass it to a function. That function runs a command line with the input variables.
code:
function ...
1
vote
1
answer
39
views
Pass list of arguments to ggstatsplot function
I am using ggstatsplot to make lots of similar plots but the exact data or variable plotted will be different between each plot. I want to assign most of the (constant) arguments to a variable that I ...
1
vote
0
answers
62
views
Type hints for the last argument [variable number of arguments] (python)
I have the following function
def c(*cargs):
def composed(*args,**kwargs):
res = cargs[-1](*args,**kwargs)
for a in cargs[:-1][::-1]:
res = a(res)
return res
...
-3
votes
1
answer
23
views
Write a function named WeekDay() making use of select case, the function will receive a single argument containing a STRING (days Monday - Sunday)
Use Scilab answer the following questions:
Paste both your function code, and console output demonstrating the features of the function.
Write a function named WeekDay() making use of select case, the ...
-6
votes
1
answer
47
views
Error: implode(): Argument #1 ($pieces) must be of type array
Error:
implode(): Argument #1 ($pieces) must be of type array, string given
Here is my code and have been receiving same errors. What can I do?
$userLogin->longitude = @implode(',',$info['...
0
votes
0
answers
13
views
How properly pass to gtk4 arguments value?
I am trying pass argv value to label of buttons, but it's working unpredictable way
in the following program, use gtk_init(); for argv and argc, but incrementing working wrong way, address doesn't ...
-1
votes
1
answer
24
views
Send property as argument in function
I have a bootstrap alert that is being called a few different times so I want write a function to reuse. I want the alert to disappear after 3 seconds and also do something. So in my setTimeout I want ...
0
votes
2
answers
26
views
Defining Function Arguments and List Iteration
I am EXTREMELY new to Python but have experience in javascript. Below is a portion of my program that is not running as the argument "data" in "remove_comment_lines" is not defined....
0
votes
1
answer
18
views
Conditional TTY Allocation in Docker Compose, Interactive Mode Issue
I'm currently working on a Docker Compose setup where I want to conditionally allocate a TTY (terminal) to a container based on the value of an ARG variable called CONTINUOUS_RUN. Specifically, if ...
0
votes
0
answers
12
views
Conditional Docker Volumes Created Even When ARG is Empty [duplicate]
I'm encountering an issue with my Docker project where it seems that Docker volumes are being created even when the SRC_VOLUME argument in my Dockerfile is empty. Here's my simplified Dockerfile:
# ...
0
votes
2
answers
29
views
How can I pass key word arguments into the function `_extract_celery_task_args(*args: tuple, **kwargs: dict)`?
So I have the following function which I am trying to unit test:
def _extract_celery_task_args(*args: tuple, **kwargs: dict):
....
I tried something like:
def ...
0
votes
1
answer
72
views
Passing function as an argument in goroutine
import (
"fmt"
"time"
)
func WithRecover(r func()) {
r()
}
func printRewardAmount(rewardAmount int) {
fmt.Println(rewardAmount)
}
func main() {
var ...
0
votes
0
answers
25
views
Starting Container in Detached and Interactive Mode Based on ARG Value
I'm working on a project where I have a Docker Compose file with a service definition like this:
my-service:
image: my-image
command: sh -c 'if [ "$CONTINUOUS_RUN" = "true" ]; ...
-1
votes
1
answer
35
views
Does arr.filter call callbackFn twice?
First time asker.
I came across this code from the page below:
function inBetween(a, b) {
return function(x) {
return x >= a && x <= b;
};
}
let arr = [1, 2, 3, 4, 5, 6, 7];
...
-1
votes
1
answer
25
views
How do I pass a while loop index to append to file name to operate on?
I need to operate on list of files in dir. Using a while loop to loop through all files and need to append to file name "i". <file suffix>. How do I do this in Python3.x?
I put the ...
0
votes
1
answer
64
views
Specifying Package Installation Version in Dockerfile
I'm facing an issue while trying to specify the Poetry version directly in my Dockerfile. I want to declare the Poetry version in the Dockerfile itself without passing it as a build argument. Here's ...
-2
votes
0
answers
30
views
How can I raise an Exception if more than three POSITIONAL arguments are passed into a function? (function is called with (*args, **kwargs))?
So I have the following function:
def run_task(*args, **kwargs):
jobserve_task_name = args[0]
parser_code, group_name, real_execution_intdate = _extract_celery_task_args(*args, **kwargs)
And ...
0
votes
3
answers
124
views
How can I raise an Exception if more than three arguments are passed into a function, function is called with *args, **kwargs?
So I have the following function:
def run_task(*args, **kwargs):
jobserve_task_name = args[0]
parser_code, group_name, real_execution_intdate = _extract_celery_task_args(*args, **kwargs)
And ...
1
vote
0
answers
48
views
How can I define multiple names for a parameter in JavaScript?
In Chrome DevTools' Console, you can see that some function parameters have multiple different names.
This is an intuitive and simple signifier that a parameter accepts multiple different types of ...
0
votes
0
answers
14
views
Predictive prefix disappeared on Input of negative double in argument of dynamically allocated memory
I have an allocated variable e3 from class Employee that accepts 2 strings (firstname, lastname), and a double. The challenge I have encountered is that I am inserting a '-' minus sign into the double ...
0
votes
1
answer
16
views
rolling logs and specific arguments in python
I would like to be able to implement some rolling logs (once a week rolling). Arguments such as the log name and log path should be passed through in my batch file. I would need to be able to leave ...
0
votes
0
answers
23
views
Order by custom post type navigation by ACF date picker
I am trying to do post navigation for a custom post type called 'prime-ministers', order by an Advanced custom fields date picker.
On the actual archive page it works fine (which uses FacetWP), but ...
0
votes
0
answers
12
views
pass arguments to gnome-terminal from find -exec command
i a file call "runAllBestScripts.sh". That file has this command:
find ~ -maxdepth 1 -type f \( -name 'best*' -a -not -name 'buns*.sh' \) -exec gnome-terminal --tab --title="Build {}&...
0
votes
1
answer
17
views
Increment !:1 value in csh alias
I'm trying to create a shortcut to find the n'th most recently updated folder at a location in a cshell terminal. Currently I have one to find the latest one.
alias latest 'cd `ls -dt1 -- */ | head ...
0
votes
1
answer
55
views
Ansible and scp_extra_args in config file
So I did an upgrade to OpenSSH 9.4p1 and that broke (kinda) my ansible.
Made it work but it's not using neither scp neither sftp, it's falling back to tunneled ssh.
So I tried with
scp_extra_args = &...
0
votes
1
answer
54
views
How to get my error message (In C, using switch) to show if failed to give arguments correctly?
Warning, I'm super new with C language (and coding) so please explain to me like I'm simple :)
So, I'm trying to get my case 'A' and case 'B' to give this message "printf("A(or B) should be ...
0
votes
0
answers
16
views
Update data from a streambuilder passed by argument in getx
Currently I have 3 screens, a home which has a streambuilder, a widget which receives the information by parameter and when clicked, I send the data to another screen called detail but which are sent ...
1
vote
0
answers
25
views
self.__dict__.update(Solver.DEFAULTS, **config) How to provide custom arguments?
I am referring to the code form this repo- https://github.com/thuml/Anomaly-Transformer/blob/main/solver.py
In line no. 70, what is __dict__.update?
class Solver(object):
DEFAULTS = {}
def ...
0
votes
0
answers
29
views
How can i find length property of arguments? [duplicate]
const add = function(a, b) {
return a + b;
}
add(1, 2, 3, 4, 5);
console.log(Object.getOwnPropertyDescriptors(add));
In this code, why can't I find length property of arguments object?
-1
votes
3
answers
70
views
C/C++ overwriting function argument that is a text pointer
I found this construct which I'm not sure if it's valid.
#include <iostream>
#define DEFAULT_TEXT "hello world"
void print_text(const char* custom_text) {
if(!custom_text) {
...
0
votes
2
answers
26
views
I want to make one of the parameters of my "Widget defaultFormField" a function
Here is a screenshot of the code
Screen shot of my code
I want my defaultFormField to take two optional parameters,
Function() onSubmit, to be used as an argument for the "onFieldSubmitted" ...
0
votes
2
answers
54
views
How can I expand a Bash array as arguments to `fswatch`?
Here are the details of my setup. I have the following files:
config.json
{
"paths": ["/Users/First Folder", "/Users/Second Folder"]
}
test.sh
#!/bin/zsh
...
0
votes
1
answer
42
views
Unable to use powershell's sshArgs to invoke a simple ssh command on remote linux host
Below is my github playbook that should invoke an ssh command hostname on remote linux host using windows runner's powershell.
name: Check Disk Space on Remote Hosts
on:
push:
branches:
- ...
0
votes
1
answer
29
views
Inserting kmstr when function argument is missing
I need to modify this function in a way that kmstr is inserted when systr is missing as an argument.
(defun imprint (imprint kmstr systr)
(if (equal imprint "Command")
(insert kmstr)...
1
vote
0
answers
23
views
Is it Possible to extract the name of an Argument in TypeScript? [duplicate]
Using Parameters I can get the argument types, even as named tuple, but how can I access the name of the argument (or the tuple for that matter), is it possible in the latest TypeScript Version (5.1.6)...