parameters

Can I have a variable number of generic parameters?

In my project I have the following three interfaces, which are implemented by classes that manage merging of a variety of business objects that have different structures. public interface IMerger<TSource, TDestination> { TDestination Merge(TSource source, TDestination destination); } public interface ITwoWayMerger<TSource1, TSource...

Sending JSF parameters within Richfaces a4j:repeat

I'm attempting to put a few drop down menus inside of an a4j:repeat. The values for the second drop down are dependent on the value selected in the first. Below is the code I am attempting to use, but it passes a blank parameter: <a4j:repeat id="localRepeat" var="local" value="#{InstanceController.instance.locations}" rowKeyVar="row">...

Statically typed languages vs. dynamically typed languages

How is the association of type and parameter different in a dynamically typed language than a statically typed language? ...

mysql stored procedure with parameters problem

I had created following procedure. DELIMITER ;; DROP PROCEDURE IF EXISTS getAllPortfoliosDemo;; CREATE PROCEDURE getAllPortfoliosDemo( IN keyid INT(10)) BEGIN DECLARE whereString char(100); IF (keyid > 0 ) THEN SET whereString = CONCAT( ' WHERE pkid = ', keyid ); ELSE SET whereS...

How to pass a list of objects to a [Post]controller parameter, in ASP.Net MVC?

My view page has a Model which is represented by a List of Students. I want to pass that Model to a controller parameter: [AcceptVerbs(HttpVerbs.Post)] public ActionResult SendMail(List<Student> students) { ............. return View("Success",students) } I tried this with an Ajax.ActionLink: <%= Ajax.ActionLink("Send Mail to...

Parameters from observeValueForKeyPath:ofObject:change:context:

I was wondering what the parameters from this method would return. - (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context; In the documentation it says keyPath The key path, relative to ob...

Oracle Parameters with IN statement?

Hi Guys, Got a c#.net app which I need to modify. The query at the moment effectively does this: select * from contract where contractnum = :ContractNum (very simplified, just to show we're using an = and one parameter) That parameter is read in from the Settings.Settings file on the C# app and has one string in it. I need to modif...

How to receive binary data using ASP.NET MVC?

Hi, I'm using ASP.NET MVC controllers for providing RESTful web services. That works just fine for simple data types like string and int. Now I need to send some binary data (like images and video) to this web service. My question is - what data types do I have to use as Action parameters and what else should I be aware of? Thanks! ...

ASP.NET MVC Unbind Action Parameter

Is it possible to disable a certain action parameter from retaining its value across requests? [HttpPost] public ActionResult MyAction(string value1, string value2) { if(value1=="hi") ModelState.AddModelError("value1", "Can't have hi"); //do stuff if(ModelState.IsValid) return RedirectToAc...

Activator.GetObject - Using the state parameter.

In .NET Remoting, Activator.GetObject method has a state parameter. What is the purpose of this state param? Can I retrieve its value from server side? mdsn didn't help much. What I'd like to do: Client side: ChannelServices.RegisterChannel(new TcpChannel(0)); object obj = Activator.GetObject(typeof(MyObj), "tcp://serverName:1234/Remot...

Parameter selection for update

I am trying to convert one of our most simple reports to Reporting Services. The original excel report calls several stored procedures using the results of one to structure the next as it drills down through the data. I currently have 2 datasets both of which call stored procedures. The first is called GetGlobalCustomers. This populat...

Pass Url Parameter web flow

Hi.... I have this web application using Spring Web Flow framework. In my main page I have a default display of a list of employees. When I click a particular row I need to redirect to another page displaying a detailed view of the row. I was thinking of passing the "name" field in my row through URL parameter. Is this possible or can...

Parameter Count Mismatch

Having trouble with the following segment of code. I'm getting a parameter count mismatch. I've had to write this because of problems with multiple threads and unsafe updates. delegate void data_INPUTDelegate(object sender, System.IO.Ports.SerialDataReceivedEventArgs e); private void data_INPUT(object sender, System.IO.Por...

.NET MVC custom routing with empty parameters

Hi All, I have a .net mvc with the following routes: routes.Add(new Route( "Lookups/{searchtype}/{inputtype}/{firstname}/{middlename}/{lastname}/{city}/{state}/{address}", new RouteValueDictionary( new { controller = "Lookups", action = "Search", firstname = (string)null, middlename = (string)null, lastname = (...

Bad inputs for unit testing on a text parser

I would like to write the unit test for a text parser class but I am not sure about the Bad Inputs I need to give to the test method in order to be sure it work in all possible cases. The method uses some regular expression plus string manipulation, but if I understood well the Unit Testing approach I don't have to concentrate on the me...

RDLC, Dynamic Picture based on parameter, c#

Is it possible to add a dynamic picture to a paramter in rdlc? for example: =SWITCH(Parameters!picture.Value="1","picture1.jpg", Parameters!picture.Value="2","picture2.png") or something similar? or any other way to use the parameter's value to be the guide for the dynamic picture? ...

Select Last (first) rows of a table in Stored Procedure using parameter (SQL 2008)

I'm trying to create a stored procedure that uses SELECT TOP 20 * from tblRecords .... I want the number of rows returned to be sent to the procedure as a parameter. For some reason it says I have a syntax error near the parameter I use: SELECT TOP @PARAM from tblRecords .... Is there a straight way to do it or will I need to const...

Java: varargs and the '...' argument

Hello, Consider the method declaration: String.format(String, Object ...) The Object ... argument is just a reference to an array of Objects. Is there a way to use this method with a reference to an actual Object array? If I pass in an Object array to the ... argument - will the resultant argument value be a two-dimensional array - b...

How to configure defaults for a parameter with multiple values for a Maven plugin

I'm writing a Maven plugin and I am using default values for all parameters such as this: /** * The file with the site structure. * * @parameter expression="${generateSite.siteFile}" default-value="${basedir}/src/oda/site.xml" */ private File siteFile; Now I am adding a new parameter which is a collection. Is there a way to set d...

Using parameters from file into function.

I have a settings.php file with parametric variables and a functions.php with well, some functions. functions.php uses some parameters from settings.php and also, functions.php is required once inside index.php. Well, for some reason, when trying to execute index.php the functions can not read the parameters from settings.php in this me...