arguments

Variable Argument Lists in C++/CLI

How do I create a function which accepts a variable argument list in C++/CLI? I am looking to create a function which forwards most of it's arguments to String::Format. ...

How do I append all files in current and subdirs as command arguments?

I have a directory like this: dir dir/somefile.txt dir/subdir/subsub/somefile2.txt dir/subdir2/somefile.txt and I want to open all the files in all the subdirectories in a single instance of a command. I was trying find with -exec, or xargs, but these open each file with a separate instance of a command. Basically, I want something t...

Difference between modifying a structure by reference versus other pointers

I am wondering why a structure pointer seems to be behave differently than a char pointer. typedef struct person_struct { char *name; } person; changeStructName(person * name1) { name1->name = "Robert"; } changeCharName(char * name2) { name2 = "Jose"; } int main() { person * name1; ...

Windows Shell Scripting: Check for batch options containing double quotes...

Greetings, dear Experts! I want to check the existense of parameter (or argument) sting at all in my batch script: if "%*"=="" findstr "^::" "%~f0"&goto :eof This works fine if none of parameters is enclosed in double quotes. For example: test.bat par1 par2 ... --- works but test.bat "par 1" par2 ... --- fails My question are: ...

Getting the last argument passed to a shell script

$1 is the first argument. $@ is all of them. How can I find the last argument passed to a shell script? ...

Printing sub strings from command line arguments, in C.

Why doesn't this work. printf("%s\n", argv[1][3]); When this works? printf("%c\n", argv[1][3]); ...

How to pass items as args lists in map?

This is a piece of my code. Lambda accepts 3 parameters, and I wanted to pass them as a tuple of positional arguments, but apparently map supplies them as a single argument. How can I supply those tuples in the bottom as lists of arguments? (I know I can rewrite the lambda, but it will become not well readable) adds = map((lambda j, f...

C/C++ default argument set as a previous argument

I was unable to find a clear answer to this although that might be because I was not using the proper search terms so please redirect me if that is the case. Is it possible to use previous arguments in a functions parameter list as the default value for later arguments in the parameter list? For instance, void f( int a, int b = a, int...

Checking whether an `object[] args` satisfies a Delegate instance?

I have the following method signature: public static void InvokeInFuture(Delegate method, params object[] args) { // ... } The delegate and the arguments are saved to a collection for future invoking. Is there any way i can check whether the arguments array satisfies the delegate requirements without invoking it? Thanks. EDIT: ...

Accept multiple arguments in an AS3 method

How do I accept multiple arguments in a custom method? Like: Proxy(101, 2.02, "303"); function Proxy(args:Arguments){ Task(args); } function Task(var1:int, var2:Number, var3:String){ // work with vars } ...

C# System.Diagnostics.Process.Start() parameters

Anyone know where a computer keeps what parameters it can accept through this function? For example, I'd like to know what I can send to Winword.exe (Microsoft Word). Or is there an online list of what programs work here? ...

Linux: How do I delegate exotic commandline arguments using a script?

Hello! I want to write a wrapper bash script, and to pass all arguments to a called program. I was very sure, that this works correctly: #!/bin/sh someProgam $@ But when passing exotic arguments (empty, unescaped, in quotes, ...) this fails. For example: without the wrapper script, someProgram "1 2" 3 results in the arguments [1 2] ...

Argument type for Qt signal and slot, does const reference qualifiers matters?

For signal and slot of below type signals: void textChanged(const QString &); public slots: void setText(const QString & text) the type of argument of textChanged and setText seems to work invarable of const and &. Does the constant and reference qualification make any difference compared to just using QString ? QObject::co...

Passing arguments to constructors using CreateObject in Coldfusion

Hi there, I'm trying to use a Java object in Coldfusion using the CreateObject function. This works fine when the constructor in the Java class doesn't take any arguments e.g.: MyObject myObject = new MyObject(); Goes to myObject = CreateObject("java", "com.something.MyObject"); But I'm not sure how to pass arguments to the cons...

Are 'by ref' arguments in WCF bad or good?

I've recently seen a WCF service declaring operation contracts with by ref arguments. I don't know why this design decision was taken (operations are void), but furthermore, I'm not able - from my WCF knowledge - to say if this is a good practice or not. Or if this is not relevant. What do you think? ...

In python is there any way I can obtain the arguments passed to a function as object ?

I don't want to use *args or **kwargs since I can't change function declaration. For example: def foo( a, b, c ) """Lets say values passed to a, b and c are 1,2 and 3 respectively""" ... ... """ I would like to generate an object preferably a dictionary such as {'a':1, 'b':2, 'c':3} """ ... ... Can anyone suggest a way...

Measure time of a function with arguments in Python

I am trying to measure the time of raw_queries(...), unsuccessfully so far. I found that I should use the timeit module. The problem is that I can't (= I don't know how) pass the arguments to the function from the environment. Important note: Before calling raw_queries, we have to execute phase2() (environment initialization). Side not...

How do I pass a string as a function argument in MATLAB?

Basically, I have 10 data files and I wrote a MATLAB function to process these data. The code is like this: function Z = fitdata(file_path) A = importdata(file_path,','); ... end Since I don't want to input the same command 10 times (for different file names), I wrote another script to automate this processing. The code looks li...

Variable argument lists in C functions - How to properly iterate through the arg list?

In the following C program i get the warning: warning #2030: '=' used in a conditional expression. What exactly is the problem and how do i avoid this? What is the correct way to iterate through the variable arguments? #include <stdio.h> #include <stdarg.h> int Sum(int a, int b, ...) { int arg; int Sum = a + b; va_list...

Drupal Views Arguments

I know how to successfully use arguments in drupal's views module, but when it "filters" based on those arguments it uses "=" in the where clause of the SQL statement. However, I would like to use "like" instead of "=" in the where clause of the SQL statement so I can pass in, say the title of a node, as an argument and then show all nod...