parameters

How to pass parameters in function that not limit the number of parameters ?

It come across to me that function like printf() have not limited the number of parameters. But when debugging program on Solaris, I noticed it will push at most 5 parameters into stack, common register will be used if there are more than 5 parameters. So what will happen if even common register is not enough in function like printf ?...

How can I parse parameters in subclass before calling constructor of the superclass?

public Subclass(String[] parameters) throws IllegalArgumentException { super("Rectangle", Double.parseDouble(parameters[0]), Double.parseDouble(parameters[1]), 90, Double.parseDouble(parameters[2]), Double.parseDouble(parameters[3])); if(parameters.length != ...

C++: How do I prevent a function from accepting a pointer that is allocated in-line?

Couldn't figure out how to word the question accurately, so here's an example: Given this function prototype: void Foo(myClass* bar); I want to prevent this usage: Foo(new myClass()); and instead require a previously created object: myClass* bar = NULL; bar = new myClass(); Foo(bar); or myClass bar; Foo(&bar); Thanks. EDI...

setting html parameter option dropdown value via url

Hi, I would like to set the default of a drop-down menu of a webpage by passing the default value in the url. Id like to put a link on a another webpage to this site where the: "I would like my contribution to go to:" option is set to Pakistan: moonsoon floods e.g. by doing something like: http://donate.ifrc.org/?desc=Pakistan: mon...

Web Service: Single String Parameter Or Complex Type Parameters

Is it more or less acceptable (i.e. standard) to create a publicly-exposed web service with these method signatures: ThisMethodDoesSomething(ComplexType param) ThisMethodDoesSomethingElse(AnotherComplexType param) Or this: ThisMethodDoesSomethingAndSomethingElse(string xml) Where the operation being performed depends upon the XML ...

Pass parameter from view to controller via jquery in MVC 2

I need to pass a url string from the view to the controller, a url that is retrieved via jquery. I tried just using the id parameter in the default routing, but that didn't work. It didn't accept a url string. Calling the Controller through jquery works fine, like this: $('#result').load('Home/Files/' + url); This calls the correct a...

assignment operator (=) within a function's parameter list?

I'm using the following code from PHPBuilder.com to handle user privileges on my site: /** * Correct the variables stored in array. * @param integer $mask Integer of the bit * @return array */ function bitMask($mask = 0) { if(!is_numeric($mask)) { return array(); } $return = array(); while ($mask > 0...

C#/Oracle10g - Wrong number or types of arguments in call

I'm trying to do something which should be fairly simple, but in my experience with Oracle, nothing ever is...! I'm trying to call an oracle procedure in C# using MS provider for Oracle. As far as I can tell, there are the correct number of parameters, and the type of each parameter is correct. More importantly, if I run the procedure ...

SSRS Report Parameter Custom DataTypes

Hi, Our ASP.Net application connects to the a SSRS 2008 web service. The categories and reports are listed in a tree view in our application populated from a call to retrieve the list of reports from the web service. When a user selects a report the parameters of the report are retrieved and we render the appropriate control for the p...

Interoperable way to send XML data in WCF?

Hi, I'm using System.Xml.XmlElement as a parameter for sending XML data in WCF. Is this generally the interoperable way to send XML data in WCF, so that, for example, a PHP or Java Web Service will understand it if I'll send it from a WCF Client? I've read that I should never send XML directly as string in WCF. In WSDL generated by W...

Joomla: How to show menu-specific parameters for a non-MVC component

Hi, I built a Joomla 1.5 component, non-MVC, and it's working fine, so I'd rather not change it to MVC. I need to have some menu items point to my component, each menu item passing different parameters to the component. The 'Menu item specific parameters' section in http://docs.joomla.org/Component_parameters is pretty clear, except tha...

Make Django Admin remember my parameters after posting

Hi! I have a problems thats been bugging me for a while. I want to use dates in django admin to view entries between certain dates. To do this I have customized my changelist.html for this model and put a form in there. When posted I override the queryset method like this def queryset(self, request): qs = super(ModelAdmin, self).q...

Passing values between View and Controller in MVC 2

I'm constantly confused about how to pass values between Views and Controllers in MVC. I know I can set ViewData in the Controller and use that in the View, but what about the other way around? What I have found is I can use a hidden field and then access it through Request.Form["name"] like this: <% using (Html.BeginForm("Upload", "Cu...

Setting camera image size in Android.

At the moment I am attempting to set my camera on my Motorola Droid phone to take an image that matches the size of my screen (854 x 480 pixels), and I am attempting to accomplish via the parameters for the camera as such: Camera.Parameters parameters = this.mCamera.getParameters(); Log.i(TAG, "CAMERA SIZE: (" + this.mCameraView.getWidt...

C# Action and Func parameter overloads

I need a method that takes an Action (or a Func), but the Action has a mixed number of parameters. What is the most straight forward and compact way to implement these overloads: public void Execute<T>(Action<T> action, T param) { // TODO: Implement something like: // Execute(action, param, null); } public void Execute<T1,T2>(A...

Auto-generate variable *name* to match parameter you're providing?

R# 4.5 (answers to 5 are welcome) VS2008 (answers to VS2010 are welcome) C# (FWIW) I'm using a constructor (the question applies for methods, too), and there's Intellisense: I don't yet have a value to specify for this first parameter, "firstName". Today, I type "firstName", then let the IDE create that variable for me (which I init...

Zend newbie - logic based on URL

url is: http://mySite.com/adminusers/listusers/ my controller is called public function listusersAction() http://mySite.com/adminusers/listusers/regular http://mySite.com/adminusers/listusers/premium http://mySite.com/adminusers/listusers/excecutive How can I capture last piece of the URL as a paremter in controller file listu...

Want to use Excel2010 cell column as driver for SQL Server 2008 query

Tough to believe I'm the only one but..I want to use the Connection functionality in Excel to connect to a SQL Server database and populate column X based upon using a value in Excel column A as the primary key, but unable to find out how. I have tried (typing in the command text window) select name from pbaTable where pbaid = (and ...

HttpSession changes inbetween calls to Servlet and GWT RPC Servlet (RemoteServiceServlet)

Hey guys, I have a GWT application which I would like to run from within a Joomla layout. The concept seems to work fine and the application loads up correctly. Joomla uses an iFrame to achieve this and just sends off the url which will kick start the GWT application. The issue I am having is that I require certain information from Joo...

Get current url including parameters of Jqgrid

I am looking to get the full url of the last request to my ajax service made by JqGridincluding page, records per page, search params etc. Is there any method or collection of methods within the JqGrid api I can use to achieve this? ...