parameters

C# out parameter performance

Do out parameters in C# have any performance implications I should know about? (Like exceptions) I mean, is it a good idea to have a method with an out parameter in a loop that will run a couple of million times a second? I know it's ugly but I am using it the same way as Int32.TryParse is using them - returning a bool to tell if some ...

How to use params with slashes with Sinatra ?

Playing with sinatra, I'm stuck on a little problem : when I use params with slashes, it confuses the router engine. So is there a nice way to handle this kind of param without having to encode it ? The code looks like get 'add/:url' do #.... end And I intend to get something like /add/http://sctackoverflow.com/ working ...

Ignoring a NULL parameter in T-SQL

I want to be able to pass in a list of parameters, and ignore the ones which are NULL. So that the query is in effect pretending that the filter isn't there and ignoring it. I was doing it like this: (@thing IS NULL or Thing=@thing) Is this right, and if so, would it perform badly? It's seems to be a lot slower than constructing the...

Sql statement using parameters is slow, fast without them.

Hello. I'm having a bit of trouble with the performance of a parameterized sql statement. The table i'm working with has ~150,000 records with each record having ~30 columns. This statement executes in 3.5 seconds. Dim selectstring As String selectstring = "SELECT * FROM LineInfo WHERE jobNum=@jobnum and revision_number=@revnu...

Parameters passed to cometd.subscribe()

Hopefully this isn't too specific/small a question, but I was wondering if anyone knew what the possible arguments are for the dojo cometd subscribe() function? The few examples I've seen indicate two parameters cometd.subscribe(channel, call_back); but a few implementations I've seen include a boolean and a possible object to the pa...

Passing arrays and matrices to functions as pointers and pointers to pointers in C

Given the following code: void foo( int* array ) { // ... } void bar( int** matrix ) { // ... } int main( void ) { int array[ 10 ]; int matrix[ 10 ][ 10 ]; foo( array ); bar( matrix ); return 0; } I don't understand why I get this warning: warning: passing argument 1 of ‘bar’ from incompatible poi...

parameter in sql query :SSRS

Hi, i am using oracleclient peovider. i was wondering how do i use a parameter in the query. select * from table A where A.a in ( parameter). parameter should be a multivalues parameter. how do i create a data set. Thanks. Susan ...

Merge properties into a ResourceBundle from System.getProperties()

Hello honorable forum, I'm building a ResourceBundle from a file, this bundle holds < String, String> values. InputStream in = getClass().getResourceAsStream("SQL.properties"); properties = new PropertyResourceBundle(in); in.close(); I would like to add/replace on this bundle some properties that I'm passing from the command line usi...

Coding stored procedure for search screen with multiple, optional criteria

I've got a search screen on which the user can specify any combination of first name, last name, semester, or course. I'm not sure how to optimally code the SQL Server 2005 stored procedure to handle these potentially optional parameters. What's the most efficient way? Separate procedures for each combination? Taking the items in as null...

API naming for limiting results?

At our office, we are having heated discussions regarding naming some arguments in our public API. Everywhere we are providing getters to lists of some kind, we want to be able to limit results (for pagination). Ie: getPosts/getNews/getUsers/.../ should be able to return items 0 to 25, 50 to 100 etc. So, we need two parameters. First ...

Escaping Double Quotes in Batch Script

How would I go about replacing all of the double quotes in my batch file's parameters with escaped double quotes? This is my current batch file, which expands all of its command line parameters inside the string: @echo off call bash --verbose -c "g++-linux-4.1 %*" It then uses that string to make a call to Cygwin's bash, executing a L...

How can I stop asp.net encoding & in Get params?

I am using the following code to add a series of calls to the body parameter of a page in asp.net: uxBodyTag.Attributes["onbeforeunload"] += "ajaxRequest('UnlockQuery.ashx?QueryID=" + queryId.ToString() + "&UserID=" + Session["UserID"].ToString() + "');"; This is being rendered as: <body id="uxBodyTag" onbeforeunload= "ajax...

mod_rewrite - old parameter name to new name

Hi all I need a bit of getting a redirect working in mod_rewrite. I need to redirect the following http://mysite.com/dictionary/find?word=test to http://mysite.com/dictionary/find?w=test I'm sure the solution is trivial enough but my knowledge of mod_rewrite and regular expressions is quite limited and I haven't been able to work ...

Stored Procedure parameter inserting wrong value

Good afternoon everyone, I am having an issue with a stored procedure inserting an incorrect value. Below is a summarization of my stored procedure ... set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go CREATE PROCEDURE [dbo].[InsertDifferential] @differential int = null AS BEGIN TRY BEGIN TRANSACTION UPDATE Dif...

Arbitrary number of parameters in AS3

Does ActionScript 3.0 offer any means to accept an arbitrary number of parameters? I usually use .NET, but I'm being forced to use AS3 for a project and something along the lines of function blah(params double[] x) would be awesome for a helper library. Thanks; ...

Getting list of parameters inside python function

Is there an easy way to be inside a python function and get a list of the parameter names? For example: def func(a,b,c): print magic_that_does_what_I_want() >>> func() ['a','b','c'] Thanks ...

How do I handle optional parameters in Moose?

I'm currently starting with Perl OOP using the "Moose" package. The compiler complains that it "Can't modify non-lvalue subroutine call at Parser.pm line 16." I don't quite understand why I can't just assign a new object. I guess there is a better or more valid way to do optional parameters with Moose? #!/usr/bin/perl -w package ...

Default value to a data parameter , SSRS

In my SSRS report I wanted to default the date parameter with the execution date. I default the date patameter with =DateValue(Globals!ExecutionTime) or =today. I do have 5 other parameters in my report. In reporting manager, it makes the page refresh each time when I select another parameter value. Why is that? How do I solve this? ...

C# out parameters trickery?

Hi I have C# code that is similar to this: int someNumber; Thing someThing; doStuff(out someNumber); someThing = new Thing(someNumber); What I would like to know is if there is any way to remove the someNumber and instantiate someThing directly within the parameter arguments. Edit the actaul code gives me back 8 out parameters but I...

How to Use 'Like' with a parameter

I want to search for a number embedded in a string in a field in our log table using a parameter. select * from vwLogs where log_time >'02/24/2009' and message like ('%2009022508241446%') I know how to use parameters when the where clause is an equals sign but not sure how to do it with 'Like' this doesn't seem right WHERE message l...