arguments Questions
9
Solved
I have created a piece of code which takes an IP address (from main method in another class) and then loops through a range of IP addresses pinging each one as it goes. I have a GUI front end on th...
Cioffred asked 3/4, 2012 at 12:11
24
Solved
Is there a way to specify default arguments to a function in C?
Jerricajerrie asked 24/9, 2009 at 14:38
2
Solved
Hi I was wondering how to implement this in python. Lets say for example you have a function with two parameters and both print out to console
def myFunc(varA, varB):
print 'varA=', varA
print '...
Hoofbeat asked 15/7, 2012 at 19:42
10
Solved
Is it possible to create a function with a default argument?
fn add(a: int = 1, b: int = 2) { a + b }
Argybargy asked 4/6, 2014 at 21:13
14
I have some code like:
score = 100
name = 'Alice'
print('Total score for %s is %s', name, score)
I want it to print out Total score for Alice is 100, but instead I get Total score for %s is %s Ali...
Deedeeann asked 8/3, 2013 at 3:51
1
Solved
How can one choose a class template member function's argument type depending on the class template parameter value?
Here is an example:
#include <memory>
template <class T, bool plainPoin...
Phantom asked 16/11, 2023 at 20:32
5
I want to Pass multiple data from one screen to another screen with Get package.
Get.to(Second(), arguments: ["First data", "Second data"]);
Centreboard asked 19/11, 2020 at 6:43
4
Solved
How can I assign a function argument to a global variable with the exact same name?
Note:
I can't do self.myVariable = myVariable because my function is not inside of a class.
When write the foll...
9
Solved
I'm trying to make a function with declared argument types, to quickly check if they are in the right format, but when it returns a string I this error:
Catchable fatal error: Argument 2 passed t...
4
Solved
$args returns only optional arguments. How can I get all function parameters?
Khelat asked 23/4, 2009 at 12:22
7
Solved
I am trying to pass multiple file path arguments via command line to an Rscript which can then be processed using an arguments parser. Ultimately I would want something like this
Rscript test.R --...
Amelita asked 9/12, 2012 at 18:55
5
I'm learning python. I like to use help() or interinspect.getargspec to get information of functions in shell. But is there anyway I can get the argument/return type of function.
12
Solved
If I have a class ...
class MyClass:
def method(arg):
print(arg)
... which I use to create an object ...
my_object = MyClass()
... on which I call method("foo") like so ...
>>&...
5
The baseline of all my tests is that there will always be a taxi with at least one passenger in it. I can easily achieve this setup with some basic fixtures:
from blah import Passenger, Taxi
@pyt...
Butte asked 21/6, 2017 at 13:22
6
I have a method that looks like this:
def method(:name => nil, :color => nil, shoe_size => nil)
SomeOtherObject.some_other_method(THE HASH THAT THOSE KEYWORD ARGUMENTS WOULD MAKE)
end
...
8
Solved
I'm trying to use the following validation logic in a batch file but the "usage" block never executes even when no parameter is supplied to the batch file.
if ("%1"=="") goto usage
@echo This sho...
Deedeeann asked 6/5, 2009 at 16:45
7
Solved
I have 2 classes
public class Customer{
...
public String getCustomerNumber();
...
}
public class Applicant{
....
private Customer c;
public Customer getCustomer(){ return c; }
...
}
Whe...
2
Solved
I know this may sound stupid, but the pygame documentation on their website says that it is:
x = pygame.Rect(left,top,width,height)
However, in my program, I cannot figure out if that is true, o...
3
Solved
Background : In VBA, 'InStrRev' function can be called without or with named parameters.
'Call without named parameters
Call InStrRev("AB", "B") 'No compiler error
i = InStrRev("AB", "B") 'No...
Suspensory asked 30/1, 2016 at 9:43
10
Solved
I want my script to be able to take an optional input,
e.g. currently my script is
#!/bin/bash
somecommand foo
but I would like it to say:
#!/bin/bash
somecommand [ if $1 exists, $1, else, f...
Bubaline asked 17/2, 2012 at 17:32
13
Solved
Is there a way to allow "unlimited" vars for a function in JavaScript?
Example:
load(var1, var2, var3, var4, var5, etc...)
load(var1)
Brackett asked 26/1, 2010 at 18:6
41
Solved
I have a web server written in Node.js and I would like to launch with a specific folder. I'm not sure how to access arguments in JavaScript. I'm running node like this:
$ node server.js folder
...
Gnosticize asked 4/12, 2010 at 1:56
1
When parsing through argv, referring to
int main (int argc, char *argv[]) {}
I understand that argv[argc] == NULL according to the standard, but is it guaranteed that argv[i] != NULL where i < ...
Misbehavior asked 22/6, 2023 at 4:51
4
Solved
I have a batch file like this
@echo off
xcopy /e %1 %2
I have my C# code as follows:
string MyBatchFile = @"C:\Program Files (x86)\MybatchFile.bat";
string _sourcePath = @"C:\FolderToCopy";
str...
Hellion asked 24/1, 2013 at 9:44
8
For years, I have used the cmd/DOS/Windows shell and passed command-line arguments to batch files. For example, I have a file, zuzu.bat and in it, I access %1, %2, etc. Now, I want to do the same w...
Byte asked 18/8, 2009 at 13:37
© 2022 - 2024 — McMap. All rights reserved.