arguments

Command Line arguments - PHP

Am trying the following php script which finds out the maximum between 2 numbers, it accepts the arguments through command line. I check whether the input is provided right, based on the number of command line arguments. <?php function larger($arg1,$arg2) { return max($arg1,$arg2); } if($argc > 3 || $argc < 3) print 'Invalid Arg...

Mathematica: get number of arguments passed to a function?

How do I get the number of arguments passed to a function, such as Plus[2,3,4,5] has 4 arguments passed to it. I was thinking it may involve the use of the function Length and getting the arguments into a list. The intention is to iterate an operation based on the number of arguments for a function. There is probably a simple solution or...

Git: Get the HEAD of a repository with the .git directory

Possible Duplicate: How to do a git export (like svn export) I'm looking for a single command that effectively does the following: git clone git://github.com/rails/rails.git --depth=1 rm -rf rails/.git Is there a command that does this? ...

Passing Args to Clojure from Java

I would like to embed Clojure code into Java. This site was helpful in the basics of setting this up, but the only arg it ever passes is of type String. I have tried using ints as well, and those also work. My question is whether there is some formatted way to pass in structured data to Clojure. In particular, I have a list of points I ...

How do I bypass GUI in MFC app if command line options exist?

I've got an existing simple MFC app that the user specifies the input file, output file, and then a "Process" button. I'd like to just add the capability so that the input/output files are command line parameters. But, if they exist, I don't want the GUI to show up. I just want the "Process" to execute. I see where I can get the comm...

Pass arguments to a delayed function with Haxe

Hi everyone, do you know if there is an easy way to pass some arguments to a function called via haxe.Timer.delay(func, delay); By "easy" I mean without creating any custom timer. Thanks. ...

PHP code in Drupal 6

A very standard example of the problem that I am facing is that of a custom content say blog type. Now there is a view namely "My Blog Posts". In that view i take the argument as User:uid. Now, for the link part i simply write the code below: global $user; and send $user->uid as the argument to User:Uid. This give me link for "My Blog P...

JavaFX to Regular Java Class Parameter Problem

My aim is to create a small javafx application that makes use of javafx forms (handled by separate java classes) for example: Login.fx (GUI) calls methods from LoginFunc.java. to handle user interactions. My problem is that I need to pass the username and password entered by the user to LoginFunc. Usually in swing applications i use a ...

Can a PHP function accept an unlimited number of parameters?

In PHP there are functions like unset() that support any number of parameter we throw at them? So, I want to create a similar function that is capable of accepting any number of parameters and process them all. Any idea, how to do this? ...

Number of arguments in macro definition

Hello, I have some templated function which has different number of arguments due to the template-type. This function is wrapped with macro definition. #define SomeTemplate(TemplateType, Arguments) someFunc<TemplateType>(Arguments); Everything is okay until I'm using only 1 argument for function calling. But I need in more. I looked a...

Ref argument through a RealProxy

I need to call a method with ref-arguments through a RealProxy. I have isolated the problem down to the following code: using System; using System.Reflection; using System.Runtime.Remoting.Messaging; using System.Runtime.Remoting.Proxies; namespace ConsoleApplication1 { class Program { static void Main(string[] args) ...

function templates with class template typedef arguments

Hi, the following code is an example of something I'm trying to do in a large project: #include <iostream> #include <vector> // standard template typedef workaround template<typename T> struct myvar {typedef std::vector<T> Type;}; template<typename T> T max(typename myvar<T>::Type& x) // T max(std::vector<T>& x) { T y; y=*x.begin(...

How do I pass dates as arugments in views in drupal?

I have been trying for awhile now to get the my view to accept a date argument. This is my code: <?php function bookable_views_handlers(){ return array( 'info' => array( 'path' => drupal_get_path('module', 'bookable') . '/includes', ), 'handlers' => array( 'views_handler_field_date' ...

what does python.exe take as arguments?

does it take the filename of the .py and then what? ...

Python: Object assignment with variable argument list

Is there a method to pass a variable number of arguments to a function and have it change those arguments using the ( *args, **keywords ) style of argument passing? I've tried a few things but either see no change or have an error raised by the compiler: def foo( *args ): args[0] = 4 This gets me TypeError: object does not suppor...

Javascript: Forwarding function calls that take variable number of arguments

I think I need something like ruby's splat * here. function foo() { var result = ''; for (var i = 0; i < arguments.length; i++) { result += arguments[i]; } return result; } function bar() { return foo(arguments) // this line doesn't work as I expect } bar(1, 2, 3); I want this to return "123", but instead I get "[objec...

Pass on function arguments to a second function.

I have two functions, one which parses all the arguments sent to the function and another that actually does something with that information. So function1() can take in any number of parameters and then uses func_get_args() to get them all and process them to come up with a string. However, I have a function2() which I want to have a si...

Python VM arguments

OS:WinXP Python 2.6 A Python project in Eclipse, if you go to 'run configuration' arguments tab. There's a section for 'Python VM arguments (Python.exe)'. Does anyone know where to find a reference for what arguments does Python VM have? I tried keyword 'Python (VM or Virtual Machine) arguments' but couldn't find it. Thanks. ...

[python] Passing all arguments of a function to another function

I want to pass all the arguments passed to a function(func1) as arguments to another function(func2) inside func1 This can be done with *args, *kwargs in the called func1 and passing them down to func2, but is there another way, Orignially def func1(*args, **kwargs): func2(*args, **kwargs) but if my func1 signature is def func1...

C++ Default argument for vector<int>& ?

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 there's a warning "nonstandard extension used : 'default argument' : conversion from 'std::vector<_Ty>' to 'std::vector<_Ty> &'" Is there a better way to do this ? Instead...