parameters

batch file equivalent of unix parameter expansion with quotes

There have been a lot of questions asked and answered about batch file parameters with regards to the %* but I haven't found an answer for this. Is there an equivalent syntax in batch files that can perform the same behavior as "$@" in unix. Some context: @echo off set MYPATH=%~dp0 set PYTHON=%MYPATH%..\python\python set BASENAME=%~n0...

How do I filter using parameters but keep NULLs?

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. My problem is that the columns I'm filtering do accept NULLs, but if I use something like this, all the NULL fields are removed. WHERE column = Case WHEN NULL colu...

How to Pass a Late Bound Parameter

In VB6, I'm trying to pass a late bound object to another form. frmMain.vb Dim x Set x = CreateObject("MyOwn.Object") Dim f as frmDialog Set f = New frmDialog f.SetMyOwnObject x frmDialog Dim y Public Sub SetMyOwnObject(ByVal paramX As Variant) Set y = paramX End Sub The contents of y are a string containing the type name of the...

CodeContracts: How to fullfill Require in Ctor using this() call?

I'm playing around with Microsoft's CodeContracts and encountered a problem I was unable to solve. I've got a class with two constructors: public Foo (public float f) { Contracts.Require(f > 0); } public Foo (int i) : this ((float)i) {} The example is simplified. I don't know how to check the second constructor's f for being >...

How to pass a parameter to a WinForm Application?

Hello everybody; I have the next question. I have an application lets call it A and a B application, both C# FWK 2.0 and WINFORMS. In application A I want to open application B passing a parameter to it, but as you know... I cant change the static void main() { } Any suggestions???? Best Regards!!! ...

HttpClient request set Attribute question

Hi I play for a while (couple of weeks) with this HttpClient lib. I want somehow to set Attribute to the request. Not parameter but Attribute. In my servlet I want to use Integer inte = (Integer)request.getAttribute("obj"); I have no idea what i miss. i try this. NameValuePair[] pair = new NameValuePair[1]; pair[0] = new NameValuePair...

Passing expressions to functions in python?

I'm not quite sure what i mean here, so please bear with me.. In sqlalchemy, it appears i'm supposed to pass an expression? to filter() in certain cases. When i try to implement something like this myself, i end up with: >>> def someFunc(value): ... print(value) >>> someFunc(5 == 5) True How do i get the values passed to == from ...

Map ASP.NET MVC action parameter name to another name

Can I map an action's parameter to a different name? I want to use reserved words as parameters for an action, such as: search?q=someQuery&in=location&for=x So "in" and "for" can't be used as parameter names of the method. Is there a built in feature for that or should I create a model binder? Thanks. ...

WPF, passing variable to converter inside data template

Hi, I assume this is possible but not sure how to do it. I need to pass the value of a class level variable to a converter, from within side a data template. <DataTemplate x:Key="ResponseItemTemplate"> <StackPanel Orientation="Horizontal" > <StackPanel.Visibility> <MultiBinding Converter="{StaticReso...

How can I pass a parameter to a setTimeout() callback?

I have some JavaScript code that looks like: function statechangedPostQuestion() { //alert("statechangedPostQuestion"); if (xmlhttp.readyState==4) { var topicId = xmlhttp.responseText; setTimeout("postinsql(topicId)",4000); } } function postinsql(topicId) { //alert(topicId); } I get a error that topicId is not defin...

How to fail a Maven build on a missing parameter?

I have a environment variable or jvm parameter which must be present. How do I get Maven to fail if this parameter does not exist? ...

Java Webstart with parameters

Can I launch a Java WebStart application with a set of parameters just like an applet is configured with the <param> tags ? Thanks ...

Extra "_" parameter in POST request using Chrome.

When I use Google Chrome to make an AJAX POST request I get extra empty parameter "_" on server-side. Here's some background information: Web-server: Python Paste Back-end: Python 2.6/Pylons Browser: Google Chrome 3.0.195.1 JavaScript Library: Prototype 1.6.1 RC3 For example simple: >>print sorted(request.POST.keys()) ['_','my_para...

Violating the Rules of Web Development

Check out this page from the New York Times: http://homedelivery.nytimes.com/HDS/learnMorePopUp.do ?mode=common.learnMorePopUp &productId=NDS &prodRate=7.40 I was surprised to see that when I manually modified the prodRate parameter, the page updated: The introductory subscription rate. The regular subscription rate. Try ...

JQuery, Passing Parameters

Hi I'm working with some very basic jquery code and would like to condense what I've done into one function with passed parameters. I have a few of these: $(".about").hover(function() { $(this).attr("src","_img/nav/about_over.gif"); }, function() { $(this).attr("src","_img/nav/about_off.gif"); }); $(".artists").hover(f...

How do I determine if a PowerShell Cmdlet parameter value was specified?

In PowerShell 1.0, if I have a cmdlet parameter of an enum type, what is the recommended method for testing whether the user specified that parameter on the cmdlet command line? For example: MyEnum : int { No = 0, Yes = 1, MaybeSo = 2 } class DoSomethingCommand : PSCmdlet ... private MyEnum isEnabled; [Parameter(Mandatory = false)] p...

Checking all function parameter in all the functions

When I first moved from c to Java I thought that I've finished will all the annoying parameter checks in the begining of every function . (Blessed exceptions) Lately I've realized that I'm slowly moving back to that practice again , and I'm starting to get really annoyed with all the if (null == a || null == b || null == a.getValue() ...

Reporting Services Dynamic Parameter Contents Based on Other Parameter Settings

Is it possible in reporting services to populate a parameter based on a value selected in another parameter? We are looking at replacing a set of existing reports in a legacy reporting platform that does this a lot. ...

How to pass a type to a method - Type argument vs generics.

I have a method of an object which is something like a factory. You give it a type, it creates an instance and does a few other things. An elegant way to do it (in my opinion) is like this: public T MagicMethod<T>() where T: SomeBaseClass { // Magic goes here } But this upsets FxCop who says that this is a bad style - I get a "CA1...

Bash: Extract parameters before last parameter in "$@"

I'm trying to create a bash script that will extract the last parameter given from the command line into a variable to be used elsewhere. Here's the script I'm working on: #!/bin/bash # compact - archive and compact file/folder(s) eval LAST=\$$# FILES="$@" NAME=$LAST # Usage - display usage if no parameters are given if [[ -z $NAME ...