parameters

Why can't I get parameters to work with apply-templates in XSL?

Hello. I am finding it impossible to get with-param to work with apply-templates. As an example, I've hacked the examples given in w3schools. xsl <xsl:template match="/"> <xsl:apply-templates> <xsl:with-param name="test" select="'has this parameter been passed?'"/> </xsl:apply-templates> </xsl:template> <xsl:template match="cd...

POSTing to a URI with GET query params?

I stumbled upon some code the other day that was making use of query params specified in the URI while at the same time being an HTTP POST. I was just wondering, is the interpretation of these fields vendor specific? Do the RFCs say anything specific about it? And if a parameter exists in both, which one wins out? To illustrate bette...

How to use procedure parameters in merge statement

Hi, i'm creating a procedure to update/insert a table using merge statement(upsert).now i have a problem: using procedure parameters i have to do this upsert. procedure xyz( a in table.a%type,b in table.b%type,....) is some local variables; begin merge into target_table using source_table --instead of the source table, i have to use p...

PHP - '&' before the parameter name

Hey Just a quick and no doubt easy question. I'm pretty new to PHP and am looking through some existing code. I have tried to find the answer to my question on google, but to no avail. Can somebody please let me know what the '&' sign before the parameter $var does?? function setdefault(&$var, $default="") { if (! isset($var)) { ...

How to open multiple files with Delphi program invoked via shell open

I am currently using: if ParamStr(1)<>'%1' then begin address.Text:=ParamStr(1); autoconfigfile; end; to pick up the name of the file that was used to open the file with via file association. I now want to develop the ability to operate on multiple files. I.e. if I select 5 files and right click and select open with "EncryptionS...

WIX: How to Select Features depending on properties

I want to select features based on certain properties' values. Similar to this question: http://stackoverflow.com/questions/246329/wix-how-to-select-features-from-command-line It seems that setting the ADDLOCAL property value is one way to do it, but is this the right way? Microsoft seems to warn against doing it in this article: htt...

Passing a Function (with parameters) as a parameter?

I want to create a generic to which I can pass a function as a parameter, however this function may include parameters itself so... int foo = GetCachedValue("LastFoo", methodToGetFoo) Such that: protected int methodToGetFoo(DateTime today) { return 2; // example only } Essentially I want to have a method that will check the cache f...

Rails 'params' variable

In reference to this I've created a question in a webform like this: <div class="form_row"> <label for="features[]">Features:</label> <% [ 'scenarios', 'role_profiles', 'private_messages', 'polls' ].each do |feature| %> <br><%= check_box_tag 'features[]', feature, (params[:features] || {}).in...

Throw/do-not-throw an exception based on a parameter - why is this not a good idea?

I was digging around in MSDN and found this article which had one interesting bit of advice: Do not have public members that can either throw or not throw exceptions based on some option. For example: Uri ParseUri(string uriValue, bool throwOnError) Now of course I can see that in 99% of cases this would be horrible, but is its occas...

PHP pass function as param then call the function?

I need to pass a function as a parameter to another function and then call the passed function from withing the function...This is probably easier for me to explain in code..I basically want to do something like this: function ($functionToBeCalled) { call($functionToBeCalled,additional_params); } Is there a way to do that.. I am us...

Common Lisp: Working with &rest parameters

Can anyone tell me how to work with the parameters stored in the value specified by &rest. I've read around a lot and it seems as if authors only know how to list all the parameters as so. (defun test (a &rest b) b) This is nice to see, but not really that useful. The best I've found so far is to use first, second, and so on to get ...

Passing parameters in MVC

Thare is two forms in a page first one for searching and another for deleting.... <table><tr><td> <% using(Html.BeginForm("ViewList","ControllerName", [values],FormMethod.Post,new{id="viewListForm"})) { %> Name: <%=Html.TextBox("Name", "[value]", new { maxlength = "250" })%> Location: <%=Html.TextBox("Location", "[Value]", ne...

best way make default param = a variable?

I have a variable, and a function for brevity lets consider it looks like this: private function applyDiscount (value:Number):Number { return value*_discount; //_discount defined somewhere else } OK thats all fine and dandy but say I want to be able to call that function and be able to pass my own discount, but still use the _discount...

VB.net Sub Procedure using Parameters. Beginner Question.

I am trying to create a DisplayAverage sub procedure that accepts 3 integer numbers as parameters. This procedure should find the average of these 3 numbers and display the numbers along with their average in the list box. I know im doing something wrong here I just cant figure out what. Thanks in advanced. Private Sub btnAverage_Click(...

What are the requirements for C++ template parameters?

If you are using a template in C++ that takes an integer value as a parameter, are there any requirements on an integer variable used as the parameter that are different than if the variable was used as a parameter in a function call? This is a follow-up to question here . I specifically want to address if there is a difference WRT v...

How can i pass a null value for date in vb.net to sql stored procedure?

Hi guys, My application is asp.net with vb. In my page I have a textbox for passing date. If I didn't enter date and on clicking submit, I have to pass null value to the stored procedure. I tried following codes such as DBNull.Value and DateTime.MinValue. In that case instead of null ,"#12:00:00#" is passing. I have to pass Null. So can...

Using an abstract class in C++

I'm trying to use an abstract class when passing an extended object as an parameter to a function, but my attempts so far have led to some compiler errors. I have a few clues as to what the problem is, I'm obviously not allowed to instantiate an abstract class, and I believe some of the code in MyClass is trying to do this, even though ...

Is there any way to deal with ParamArray values as byRef so they can be updated?

Sounds simple enough, but its not working. In this example, I want to set the values of 3 fields to equal a 4th. I could do something like this.... Dim str1 As String = "1" Dim str2 As String = "2" Dim str3 As String = "3" Dim str4 As String = "4" str2 = str1 str3 = str1 str4 = str1 ... but that's kind of wordy (yeah, I know, vb is w...

C# Parameterized Query MySQL with `in` clause

I am in the process of converting several queries which were hard-coded into the application and built on the fly to parameterized queries. I'm having trouble with one particular query, which has an in clause: UPDATE TABLE_1 SET STATUS = 4 WHERE ID IN (1, 14, 145, 43); The first parameter is easy, as it's just a normal parameter: MyS...

SQL 2000 Table Name as variable in stored procedure.

Table Name : RM_master Fields : cust_no acct_no acct_code Question is, I want to make the table RM_master as a variable in the parameters in the stored procedure? This has no syntax error but when I execute this in the query analyzer by right clicking on the stored procedure name the variable table name (RM_master) ...