arguments Questions

0

There are many explanations of the difference between positional and keyword arguments for Python functions on StackOverflow and the difference in utility is clear to me. However, I was unable to f...
Aton asked 10/5, 2021 at 22:58

2

Solved

I have a dictionary of function arguments that I want to pass to a function. For example: function test_function(foo::Int, bar::String) #... end params = Dict( "foo" => 1, "ba...

5

Solved

I would like to write a function that (amongst other things) accepts a variable number of arguments and then passes them to sprintf(). For example: <?php function some_func($var) { // ... $s...
Edgell asked 22/10, 2009 at 12:15

6

Solved

I have a function, void test( vector<int>& vec ); How can I set the default argument for vec ? I have tried void test( vector<int>& vec = vector<int>() ); But ther...
Vertebral asked 30/6, 2010 at 7:39

2

Solved

I need to pass multiple arguments to maven command line to run a spring boot application. This is how I was passing command line arguments in spring boot. I am using spring boot 2.2.6 Release mv...
Ricardo asked 23/4, 2020 at 13:31

2

I am new to flask and started following this video tutorial... I completed it yesterday and came back to it today wherein, the EXACT SAME code which worked nicely till then, started displaying the ...
Cioffi asked 29/9, 2020 at 16:15

1

First of all, thanks ! it has been 1 year without asking question as I always found an answer. You're a tremendous help. Today, I do have a question I cannot sort out myself. Please, I hope you wo...
Dewie asked 15/4, 2020 at 10:29

2

I have a script (script1.py) of the following form: #!/bin/python import sys def main(): print("number of command line options: {numberOfOptions}".format(numberOfOptions = len(sys.argv))) prin...
Vanadinite asked 11/6, 2014 at 18:23

4

I'm using argparse to parse command line arguments. However at this time, I have an unusual request: I want to suppress the error message. For example: # !/usr/bin/env python try: parser = argp...
Cabretta asked 6/3, 2016 at 18:41

11

Solved

I was trying to slice an object using Array.prototype, but it returns an empty array, is there any method to slice objects besides passing arguments or is just my code that has something wrong? Thx...
Vharat asked 5/9, 2016 at 19:23

2

Solved

I'd like to pass a character as an argument to a function in MIPS. Do I do this by storing the character into register $a0, use jal to move to the function, then extract what's in $a0 into a separa...
Piss asked 13/2, 2014 at 0:49

2

Solved

I created the following function with six args: nDone <- function(under,strike,ttoe,vol,rf,dy) { pnorm(((log(under/strike)+ (rf-dy+(vol^2)/2)*ttoe)/(vol*(ttoe^0.5)))) } nDone(90,100,3,0.17,0....
Exophthalmos asked 10/2, 2012 at 22:35

4

Solved

Assume that I have a script that can be run in either of the following ways. ./foo arg1 arg2 ./foo Is there a generally accepted way to denote that arg1 and arg2 aren't mandatory arguments when ...
Potentiality asked 1/2, 2014 at 21:24

1

I have an issue with VS Code which I recently installed in my MacOS BigSur. I tried out the Jupyter Notebook extension and in their documentation it says that they have full intellisense support fo...

1

when I try to run flutter projects it throw these errors and other errors as well can anyone help me out
Carmarthenshire asked 9/2, 2021 at 19:25

2

Solved

Is there a way in C++ to pass arguments by name like in python? For example I have a function: void foo(int a, int b = 1, int c = 3, int d = 5); Can I somehow call it like: foo(5 /* a */, c ...
Dauntless asked 7/2, 2021 at 21:59

8

Solved

Given the following function: def foo(a, b, c): pass How would one obtain a list/tuple/dict/etc of the arguments passed in, without having to build the structure myself? Specifically, I'm look...
Nucleonics asked 26/3, 2010 at 8:30

1

Solved

Is there an equivalent in Python to match.arg() as you have in R? Basically limiting the user the choice of inputs one can make for an input function parameter.
Cryo asked 22/11, 2019 at 13:58

1

Solved

I have a general question that I couldn't find a satisfactory answer for. I'm building a set of visualization functions, and I want to let the user have flexibility when using them. For example, I'...
Hurtle asked 14/1, 2021 at 15:42

3

Solved

I am writing a parser in Go for Go, and to test it I downloaded a bunch of files from github projects. In https://github.com/andlabs/ui I bumped into a file containing this piece of code: func move...
Australorp asked 3/12, 2016 at 18:6

1

Solved

I have started learning Haskell and I have read that every function in haskell takes only one argument and I can't understand what magic happens under the hood of Haskell that makes it possible and...
Napper asked 7/1, 2021 at 20:37

4

Solved

In ActionScript I can use ... in a function declaration so it accepts arbitrary arguments: function foo(... args):void { trace(args.length); } I can then call the function passing an array: foo...
Tarkany asked 7/2, 2015 at 19:50

2

Solved

I have the Python script that works well when executing it via command line. What I'm trying to do is to import this script to another python file and run it from there. The problem is that the ini...
Heall asked 4/7, 2018 at 11:0

3

Solved

I would like to iterate over a list of items, and run an assertion on each of them. One example might be checking whether each number in a list is odd. TestCase: class TestOdd(unittest.TestCase...
Femi asked 23/6, 2013 at 11:50

4

Solved

I’ve learned that it’s common practice to use optional arguments in function and check them with missing() (e.g. as discussed in SO 22024082) In this example round0 is the optional argument (I kno...
Chronometry asked 22/7, 2015 at 8:27

© 2022 - 2024 — McMap. All rights reserved.