arguments

View with products linking to product pages with Taxonomy

Hi, I’m kind of in a jam with a website I’m trying to create for use in a technical department which will server as a information database for the repair engineers to find information about products they are working on. This will include testing procedures, product configuration pages, customer specific information per product, software ...

Views (Drupal): arguments don't filter content results

A follow-up to my previous question. I have a view (a page, not block) that gets fours arguments as part of the url, e.g. foo/bar/baz/arg1/arg2/arg3/arg4 where arg1 is nid and arg2-arg4 are text/taxonomy fields. The path of the page looks like this: foo/bar/baz/%/%/%/%`. Per my previously asked question, I've been able to prevent the ni...

Open multiple files using arguments

Hi, I'm using this code to load multiple files using windows context menu, but the problem is that the aplication is open many times as files the user has selected. For example: If I select 14 files, an open them with the application, the aplicacion is opened 14 times and load the form only one. But there is a way to send all argument...

Converting a ant fileset to a multiple arg

I have some files : dir/foo.txt dir/bar.txt dir/foobar.txt During a apply task, I want to pass the list of file as arguments: <target name="atask"> <apply executable="${cmd}" parallel="false" verbose="true"> <arg value="-in"/> <srcfile/> <arg value="dir/foo.txt"/> <arg value="dir/bar.txt"/> ...

Passing multiple arguments to C function within Python

Let's say I have a c library that manipulates a world somehow. I want to use this library with python. I want to be able to write simple python scripts that represent different scenarios of world management. I have functions that create and destroy a world: void* create(void); int destroy(void* world); Here is some python code: impor...

c++ publicly inherited class member cannot be used as default argument

A schematic of my problem... class A { public: // etc. protected: uint num; }; class B : public A { public: void foo(uint x = num); //bad }; gives this error: error: invalid use of non-static data member ‘A::num’ error: from this location Why does this happen, and what can I do to work around this? ...

How to pass Argument to an Undo handler in VBA

Hello! My first attempt at creating an Excel VBA. The macros below essentially change the background on the interior of a cell-range. GenerateMarkerOnSheet sets interior to black. ResetMarkerOnSheet is meant to roll-back the above change on Undo. Is it possible to pass the previous interior as an argument to the Undo hander (ResetMa...

How can I dynamically check the number of arguments expected of an anonymous function in PHP?

Is it possible to get the number of arguments expected of an anonymous function in PHP? I'm aware of ReflectionMethod, but that seems to only work if the method is defined on a class. In my case, the anonymous function is either going to have 1 or two arguments. I'd prefer to do the checking correctly, rather than wrapping the first call...

Misleading(?) TypeError when passing keyword arguments to function defined with positional arguments

In cPython 2.4: def f(a,b,c,d): pass >>> f(b=1,c=1,d=1) TypeError: f() takes exactly 4 non-keyword arguments (0 given) but: >>> f(a=1,b=1,c=1) TypeError: f() takes exactly 4 non-keyword arguments (3 given) Clearly, I don't really really understand Python's function-argument processing mechanism. Anyone care to share some ligh...

Identical Class Member Names and Function Argument Names in C++

I have a simple object that holds some [public] data. I want to keep my interface clean, so I don't want to pre-/post- fix anything to the names of the publically accessible variables nor to the names of my function arguments. That said, I ended up doing something like this: template<typename T> struct Foo { explicit Foo(T x) : x(x)...

eclipse cdt command line input

I'm new to eclipse cdt. I'm wondering how can i add command line argument (e.g.-lm) for compiling ...

Pass a variable number of arguments to an aliased function.

Take a function like printf that accepts a variable number of arguments what I would like to do is pass these variable number of functions to a sub function without changing their order. An example of this would be aliasing the printf function to a function called console ... #include <stdio.h> void console(const char *_sFormat, ...);...

Avoid specifying all arguments in a subclass

I have a class: class A(object): def __init__(self,a,b,c,d,e,f,g,...........,x,y,z) #do some init stuff And I have a subclass which needs one extra arg (the last W) class B(A): def __init__(self.a,b,c,d,e,f,g,...........,x,y,z,W) A.__init__(self,a,b,c,d,e,f,g,...........,x,y,z) self.__W=W It seems du...

Check for UNIX command line arguments, pipes and redirects from a C program.

Hi, I have some problem to figure out how I can maintain the pipe and redirect functionality of a shell once I find out that there are missing command line arguments. If I for example use a scanf call, that will work with a re-direct or a pipe from a shell, but in absence of this I get a prompt, which I don't want. I would like to ac...

PHP default function argument as a T_VARIABLE?

Got an error today that I thought was interesting. Must be a way to do this, perhaps I just have the wrong syntax. class test{ private $test = ''; __construct(){ $this->test = "whatever"; } function getTest($var = $this->test){ echo $var; } } This throws an error basically saying that $this->test as a function ar...

Java enumerations vs. static constants

I'm looking at some Java code that are maintained by other parts of the company, incidentally some former C and C++ devs. One thing that is ubiquitous is the use of static integer constants, such as class Engine { private static int ENGINE_IDLE = 0; private static int ENGINE_COLLECTING = 1; ... } Besides a lacking 'final' ...

Split executable path and arguments

Hi, I need to be able to to split the executable path and arguments in a command. Windows handles the following easily: "notepad.exe C:\testfile.txt" "notepad c:\testfolder\versioninfo.txt" "C:\Windows\notepad.exe" "C:\test folder\versioninfo.txt" rundll "C\Windows\somelibrary.dll" Anyone has a piece of code to parse such strings...

How to dynamically create arguments for a method?

Being still somewhat new to Ruby, I'm not sure how to do this... Let's say I have a method that takes a variable number of arguments: def mytest(*args) puts args.to_json end Obviously I can call it with whatever I like, such as: mytest('one', 'two', 'three') No problem. But what I need to do is call it with a dynamically-created se...

Is it possible to declare a function without arguments but then pass some arguments to that function without raising exception?

In python is it possible to have the above code without raising an exception ? def myfunc(): pass # TypeError myfunc() takes no arguments (1 given) myfunc('param') Usually in php in some circumstances I launch a function without parameters and then retrieve the parameters inside the function. In practice I don't want to declare ...

Overloading Java function with List<> parameter

I have 2 classes public class Customer{ ... public String getCustomerNumber(); ... } public class Applicant{ .... private Customer c; public Customer getCustomer(){ return c; } ... } When presented with a list of customers or applicants I want a function which iterates the list and does something with the CustomerNu...