parameters

Python Newbie: Returning Multiple Int/String Results in Python

Hello, I have a function that has several outputs, all of which "native", i.e. integers and strings. For example, let's say I have a function that analyzes a string, and finds both the number of words and the average length of a word. In C/C++ I would use @ to pass 2 parameters to the function. In Python I'm not sure what's the right ...

Function Parameters in Powershell

Is there any reason to use the "Param( ... )" construction inside a function definition? My understanding is that you should use this for specifying parameters to scripts (and scriptblocks). I see a lot of examples on the web with parameters listed this way instead of just listing the parameters after the function name. Example: f...

Reporting Services 2008: Using user!userid in Parameters

I have a report with a parameter that is populated by a list of sales representatives returned by a query. I want to filter that list based on security rights of the user running the report. In order to make the query work I need to pass the user!userID to the db. I tried something like this: ...where UserName = user!UserID... But it...

SSIS 2008 Execute SQL output parameter mapping datetime2 problem

Hi, I'm trying to use an Execute SQL Task in SSIS 2008 to map a store procedure output parameter to a package variable. The package variable is SSIS type DateTime and the store procedure parameter is SQL type DATETIME. The SQL Statement is EXEC GetCurrentDate @CurrentDate=? and in the parameter mapping screen, the parameter is mapped t...

Parameter is not valid GetEncoderParameterList when saving an image

hello, am am trying to crop an image that is a jpeg image on the hard disk(imgOld) and save it at the same quality as the image it was cropped from Image imgCropped = cropImage(imgOld, new Rectangle(iDiskCropX, iDiskCropY, iDiskCropWidth, iDiskCropHeight)); ImageCodecInfo codecJpeg = this.getEncoderInfo("image/jpeg"); ...

Dynamic "Not" by parameter in LINQ (Or any other code for that matter)

Okay, This may be really simple or it may not even be possible, or I am just having a brain freeze :) Here is an example of what I am trying to do: public void SomeMethod(bool include) { using (AccountDataContext db = AccountContextFactory.CreateContext()) { if (include) ...

How do I determine if a PL/SQL parameter value was defaulted?

Suppose I have a PL/SQL stored procedure as follows: PROCEDURE do_something(foo VARCHAR2 DEFAULT NULL) IS BEGIN /* Do something */ END; Now, suppose do_something is invoked two different ways: /* Scenario 1: The 'foo' parameter defaults to NULL */ do_something(); /* Scenario 2: The 'foo' parameter is explicitly set to NULL */ do...

Unable to refer to a parameter in Bash

I want to put TextA to the beginning of TextB by cat TextA A TextB The problem is that I do not know how to refer to the first and second parameters, that is TextA and TextB in the following script called A: #!/bin/bash cat TextA > m1 cat TextB > m2 cat m1 m2 > TextB where m1 and m2 are temporary files. How can you refer ...

ReportViewer Web Control and Dynamic Connection Strings

So I have a report in Reporting Services 2005. In it is one parameter (ConnectionString) which determines which data source the report will use. It also has several other parameters which are dropdown lists derived from the data source chosen in the ConnectionString parameter. In Report Manager, this works great. All of the dropdowns ar...

Unable to add a parameter to your command in Bash

I have the following code which I call google #!/bin/bash q=$1 open "http://www.google.com/search?q=$q" It opens Firefox with the keyword. For example, by google cabal I want to have specific keywoards added to the command when I put a parameter after the command. The following is an example google -x cabal It searches the sequ...

Html.BeginForm loses routeValues with FormMethod.GET

I have noticed what Html.BeginForm() method encodes supplied routeValues into action attribute of FORM tag. This works well with POST method. But if method is GET all parameters in action URL are stripped by browser (tested on IE8 and Firefox 3.0.7). For example, this code in view <% using (Html.BeginForm("TestAction", "TestControl...

understanding Jasper Reports and Hibernate and parameters

Hello, I'm sorry this is a little bit of a bad question since my problem is that I just don't understand which approach to take for this. I've got this hibernate database that works great and I want to use jasper reports to create reports based on the data from it. I have iReport working and connecting to the hibernate configuration an...

passing boolean parameters to named routes in rails

I want to explicitly pass a boolean false to params[:closed] and I've got something like this: = link_to 'appointments', appointments_path(:closed => false) But this is not working as rails is treating a false boolean as I don't want anything set for this params, is there any way to get around this? update: the false I'm passing in i...

A general short guideline for passing method parameters by ref or by value ( C#) ?

Something like: if the value of the variable after the method call has to be returned : if can be instantiated before the method call use ref if does not need to be instantiated before the call use out if the value of the variable is used for returning , deciding or calculating other values from the method call do not use ref neither...

Reference to pointers and C++ polymorphism

Hi, does anyone know why this gives a compiler error ? I tried VS 2005 and Codewarrior: class Parent { protected: int m_Var; public: Parent() : m_Var(0) {} virtual ~Parent() {} void PubFunc(); }; class Child : public Parent { protected: bool m_Bool; public: Child() : m_Bool(false) {} ...

Python-like list comprehension in Java

Since Java doesn't allow passing methods as parameters, what trick do you use to implement Python like list comprehension in Java ? I have a list (ArrayList) of Strings. I need to transform each element by using a function so that I get another list. I have several functions which take a String as input and return another String as outp...

ASP.NET Buttons not showing Paramaters

I seem to be having a problem with my local machine. When loading a page that has a Button on it, and the button has been set with the parameters from the header, on my local machine the parameters disappear, but on our development box they are still there. This is hard to explain, so I will show with an image. This is what the button...

Default sizes for SQL parameters in ADO.NET

There are multiple overloads for sqlcommand.Parameters.Add(...) function. Some of them do not take size, and some do. What sizes are set by default? Is it safe not to set parameter sizes? Does it affect performance? ...

Is there a URL builder that supports request paramater concatenation as well?

I want to achieve something like the following: UrlBuilder ub = new UrlBuilder("http://www.google.com/search"); ub.Parameters.Add("q","request"); ub.Parameters.Add("sourceid","ie8"); string uri = ub.ToString(); //http://www.google.com/search?q=request&amp;sourceid=ie8 Is there anything in .NET, or I will have to create my own? ...

Template class expression parameter overloading

Hey, I'm trying to figure out if it's possible to "overload" a template class deffinition with expression parameters. Kind of like the following snippet of code. template<class T> class Test { public: T testvar; Test() { testvar = 5; cout << "Testvar: " << testvar << endl; } }; template<class T> class Test<T,...