parameters

Java parameter passing question

Hey everyone, I am relatively new to Java and while trying out some code came across something that surprised me. Hopefully some one can shed some light on this. Here's some code snippets relevant to my question. Those who've read the practice of programming might find this familiar. This function is defined for the List datatype, and...

Use Maps application in my Android application.

Hello. I am currently developing an application which has a maps feature. My map is working, but I still need to create a Directions option. In previous versions of the Android SDK there used to be a class called DrivingDirections, which did exactly what I want. Now it's gone and I don't know how to add this feature to my current map. I ...

Why does a parameter of a JavaScript function return 'undefined'?

I'm trying to write a simple a JS function which randomly rotates the background-image of a CSS block per 1 second. I want to add the name of the block and the number of images from paramaters, so the function can be as flexible as possible and a I can call multiple instances of it on one page. The problem is that I get 'nameofparamter u...

Is there a way to use a DataTemplate with a parameter?

I need to dynamically add/remove GridView columns, each displaying information from a different element stored in a KeyedCollection (indexed with tn 'int'). The basic technique works, but requires an index, as follows: <GridViewColumn Header="bid"> <GridViewColumn.CellTemplate> <DataTemplate> <TextBlock Width="60...

C# multiple arguments in one to DRY out parameter-passing

I don't know if this is possible, but in some of my unit tests, I end up initializing different objects with the same arguments. I would like to be able to store those arguments in some variable and just initialize the multi-parameter object constructor with that variable so instead of doing: Thing thing1 = new Thing(arg1, arg2, arg3, ...

URL matrix parameters vs. request parameters

I'm wondering whether to use matrix or query parameters in my URLs. I found an older discussion to that topic not satisfying. Examples URL with query params: http://some.where/thing?paramA=1&amp;paramB=6542 URL with matrix params: http://some.where/thing;paramA=1;paramB=6542 At first sight matrix params seem to have only advantages:...

How can I get ErrorDocument in .htaccess to output wrong uri parameter?

Hi, I've worked-around the solution to transform all uri to one page via ErrorDocument. The reason behind this is to send Files AND folders (nice urls) to one page. However, I need the URI string to be sent to index.php?uri=string . Is this possible via ErrorDocument, or how do I do this? So I need to rewrite the http://www.some...

SqlClient Xml Output parameter "was not supplied"

I receive an SqlException when running the following code. "Procedure or function 'usp_Search' expects parameter '@pxmlSearchOutput', which was not supplied." My parameters + request. using (var connection = new SqlConnection(_connectionString)) { using (var command = new SqlCommand("Search.usp_Search", con)) {...

JQuery and parameters

Hi All, I am creating Accordion menu using JQuery. I want to hide links according to the user status. How to pass values from code behind to jquery during pageload? Eg: UserA: Menu header: headerA and HeaderB UserB: Menu header: headerB and HeaderC I want to pass header names to jquery to hide it. Geetha ...

Must PowerShell scripts be called using only a single line?

I have some PowerShell scripts that accept many long parameters, like, myScript.ps1 -completePathToFile "C:\...\...\...\file.txt" -completePathForOutput "C:\...\...\...\output.log" -recipients ("[email protected]") -etc. I can't seem to make PowerShell run such scripts unless all the parameters are on a single line. Is there a way to invoke ...

VBScript Class/Object Problem

I would like an object that is used on many pages to contain its own connection and recordset variables so that they do not need to be declared on each page that wants to directly access the recordset, rather than interact with the functions of the object that normally handle this. However, the recordset is apparently not becoming an ob...

PostMessage unable to pass a string C#

Here is my prototype: [DllImport("user32.dll", CharSet = CharSet.Auto)] public static extern bool PostMessage(int hhwnd, uint msg, IntPtr wparam, IntPtr lparam); And here is how I'm using it: PostMessage(HWND_BROADCAST, msg, Marshal.StringToHGlobalAuto("bob"), IntPtr.Zero); In a different thread I can intercept this message...

pass < or > operator into function as parameter?

Inside my function there is an if() statement like this: if(passedValue < staticValue) But I need to be able to pass a parameter dictating whether the if expression is like above or is: if(passedValue > staticValue) But I cant really pass < or > operator in has a parameter, so I was wondering what is the best way to do this? Also ...

mod_rewrite convert certain folders to parameters

Hi I have a site where I'd like to convert the first subfolder into a parameter (from a set list of subfolders), so http://localhost/mysite/folder1/dosomething.php is displayed as shown above, but to PHP it looks like: ... localhost/mysite/dosomething.php?organisation=folder1 I only need to do this on certain folders (i.e. not ... l...

Send XML String With HTTP Post In Actionscript 3

Hello, I am having a little trouble sending an xml string to an HTTPService an Actionscript3 (see code below). Basically, I am trying to send a georss xml string for conversion into another format. I am getting an ioError and suspect the xml is causing havoc with the services parser. I know this approach is probably not the best, but...

Can't read asp user control parameters

I'm driving myself nuts with this particular problem, i really hope someone can help! In the below example i cant get the value of "4" to appear in the rendered page. The output from below compiles and executes just fine but all three of the values shown are "0". Here's a short snippet: (hopefully I'm formatting this correctly) (from ...

Should a method parameter name specify its unit in its name?

Of the following two options for method parameter names that have a unit as well as a value, which do you prefer and why? (I've used Java syntax, but my question would apply to most languages.) public void move(int length) or public void move(int lengthInMetres) Option (1) would seem to be sufficient, but I find that when I'm codin...

How do I pass 2 arguments using a simple form?

I have a very simple cart which displays the item quantity in a text_field, and the item name. I can fetch the proper data, I can't pass both of my arguments into my method (inventory ID and quantity). I'm receiving an argument error in my cart_update method of the inventories controller. add_to_cart.html.erb <% for item in @cart.items...

Can a delegate carry parameters?

Hi. Let's say I have a function public void SendMessage(Message message) { // perform send message action } Can I create a delegate for this kind of function? If so, how can I pass a message when I use the delegate? In my case, the function is used by Thread. Whenever there is an event, I need to send a message to the server, to k...

Using object in the jQuery post parameter

I'm thinking this is not possible but I would like some insight as to why. I want to do something like this: var pVals = { ob1: "postvar1", ob2: "postvar2", ob3: "postvar2" }; $.post("php/dosomething.php",{pVals.ob1:"object 1", pVals.ob2:"object 2", pVals.ob3:"object 3"}); I get an error along the lines of: missing : ...