parameters

May a compiler optimize a reference to constant parameter to constant value ?

Consider following function: void func(const char & input){ //do something } Apparently it makes sense for the parameter to be constant value not reference to constant regarding size of the char type, Now may a compiler optimize that to constant value so that it'll be the same as following ? void func(const char input){ //do someth...

How do I determine the number of bits in a template non-type integral constant parameter?

I would assume that this is covered in the C++ Standard, but I've not been able to find it. I am writing some templates that are going to do arithmetic on their non-type integral parameters, and I find I need the equivalent of MAX_INT for the parameter 'x' in a template like template <int x> Foo. Ideally someone could point me to the pa...

Error parsing parameters in ASP.Net

I'm having a problem parsing my parameters in ASP.Net Here's what i'm doing Sub ItemCommand(ByVal Sender as Object, ByVal e as RepeaterCommandEventArgs) If e.CommandName = "EditDetails" Then EditDetails() <---- This is where it's dying Else If e.CommandName = "SubmitDetails" Then SubmitDetails() End If ...

Passing delegate as method parameter

Hello, I'm currently developing an EventManager class to ensure that no events are left wired to dead WCF duplex clients, and also to control prevent multiple wiring from the same client to the one event. Now basically, I'm what stuck with is trying to pass the event delegate to a function that will control the assignment like this. va...

Function overloading in powershell

Can you overload functions in powershell ? What I want to do is that my functin could accept string, array or some switch. Example what I want: Backup-UsersData singleUser Backup-UsersData @('Alice', 'Bob', 'Joe') Backup-UsersData -all Best regards. ...

ReportViewer in WPF behaving differently on similar machines

I have a reportviewer control in a pop up window inside my WPF application. When the report is to be printed, on some client machines it gives the following message "Some parameters or credentials have not been specified". This error does not come on every client machine even though the machines are identical in every respect. I have t...

Which one of these two ways of writing this code would be more suited?

I've got a code that as you can see I can write in either of two following ways, the matter is the only difference is since in second function the parameter is declared as non-constant I can use that instead of declaring a new variable(num1 in first function) but I' curious which one would be more suited if there would be any difference ...

Mutable method parameters in Scala

Simple problem: I am subclassing a FilterInputStream in Scala, which has a read method: public void read(byte [] b,int offset,int len) The data being read will be put in b, but as parameters are "vals" in Scala methods, I see no way to properly subclass this. How do I set b to the data being read? The Java *InputStream really leaves m...

How i can pass a parameter to an activity that i am creating from other activity?

Hi i have a main activity that is creating another activity (with googlemap) i have to pass my googlemaps activity a parameter, but i dont know how i created a constructor in my googlemaps activity with the parameter but... how i can call that constructor? i dont know how to do that because i only know one way to call an activity and...

How to pass variable arguments from bash script to python script

Hi All... I've been trying to solve this issue for sometime now with no luck. The crust of the situation is that I'm using a bash script to send parameters to a a python script: Example: foo.sh calls bar.py....the call looks like: bar.py $var1 $var2 ... $varn The python script then prints all the arguments using the sys.argv array. T...

Filter expression issues

Hi, I am using a GridView and I require the user to be able to filter using 2 controls. One simply filters the type of row - there is a column called action, and the user selects one of the distinct values from the database in a dropdown box, and the gridview only displays the rows with that value in the action column. On it's own this w...

What is the best way to parameterize a LIKE query?

I'm trying to implement a simple search, using LIKE in my SQL statement: Using cmd As New OracleCommand cmd.Connection = conn cmd.CommandType = CommandType.Text cmd.CommandText = "select * from TABLE where FIELD like '%:text%'" cmd.Parameters.AddWithValue("text", searchValue) ...

DataKeyNames coming up as undesired Update parameters in ASP.NET GridView

Hi all, I have defined the following in my gridview markup (simplified): <asp:GridView ID="grvReport" runat="server" DataSourceID="odsReport" AutoGenerateColumns="False" DataKeyNames="EntryDate,EmployeeNumber"> Then I define my datasource's update parameters as such: <UpdateParameters> ...

array of objects,c++

i have two classes namely Flight and Runway. Now i am trying to pass an array of these objects as parameter to a function. void fun(Flight ptr1[],Runway ptr2[]) { ... ... } ptr1 should point to an array of Flight objects and ptr2 should point to an array of Runway objects. Now inside this function fun() how do i access members of the...

How can I create this Func?

Hi There... Inspired by: NServiceBus.Configure.With().Log4Net(a => a.YourProperty = "value"); I want to use something similar as configuration, suggestions are welcome. My biggest problem is that I can't quite figure out how to use the parameter input... What exactly is going on here? NServiceBus uses Log4Net, as instance? set wi...

Attaching parameters with javascript closures to default parameters in anonymous functions

I want to add some extra parameters to the Google geocoder API call as I'm running it in a loop, but am not sure how to append closure parameters to their anonymous function that already has default parameters that are passed in by the call to the API. For example: for(var i = 0; i < 5; i++) { geocoder.geocode({'address': address}...

SSRS 2005: Get default menu selection from a query or other parameter

I built a report with one parameter being a menu of names, and the default value being <ALL> Clients wanted the default to be the person logged in. I can easily get User!UserID the default for a text box, but if I change the menu from names to IDs, it will not pre-select it on the menu. Instead, it adds the "" thing to the top of the ...

Multiple HTTP GET parameters with the same identifier

Let's say I am getting requests such as: http://www.example.com/index.php?id=123&amp;version=3&amp;id=234&amp;version=4 Is it possible to extract these in a simple way inside my php code? I realize I could get the entire querystring with javascript using window.location.href and handle it manually but I'm looking for something more ele...

Gridview Update changing my update parameter?

Hi all, I have a Gridview where I can modify the Time portion of a DateTime field. The update method is working well, except for one thing: The field should only allow the time portion, e.g 08:23:09 but on the Database it saves it as a full DateTime, e.g 10/18/2010 08:23:09 AM. The problem is that upon editing, instead of adding the ex...

got "cannot appear in a constant-expression" when using template

Hi , template < int > class CAT {}; int main() { int i=10; CAT<(const int)i> cat; return 0; //here I got error: ‘i’ cannot appear in a constant-expression } even int i=10; const int j=i; CAT<j> cat; //this still can not work but I have convert i to const int ,why compiler...