parameters

Only one parameterization of an interface can be implemented—how to work around?

Here's an example of what I'd like to be able to do (in Java): interface MyInterface<E> { public void doSomething(E foo); } class MyClass implements MyInterface<ClassA>, MyInterface<ClassB> { public void doSomething(ClassA fooA) { ... } public void doSomething(ClassB fooB) { ... } } When I try to implement this, th...

using unions in function parameters

I recently discovered that something compiles(not sure that it's legal though). My need for such a thing comes from this: My project outputs machine code for a selected arch.(which may or may not be the same arch. as the one running the program). So, I would like to support up to 64bit architectures right now(while also supporting existi...

aspx with Ajax: How to send checkboxlist values to query string parameters?

I am using jQuery load function to load the HTML response of an aspx page. I call the page by appending querystring parameters to the end. I have a problem though. I have a checkbox list (multi selectable) and couldn't figure out how to send these selections. If it was server side, I would make a custom class carrying all the information...

Query string parameters do not seem to work with window.open

Hello everyone, I try to open multiple browser windows using javascript and the window.open() function. I want to pass a parameter through the query string to my new window like this: window.open('http://www.myfoo.com/foopage.aspx?fooparm=1', '_blank'); This opens a new window with the correct address in the address bar but the brow...

PHP - include a php file and also send query parameters

Hi I have to show a page from my php script based on certain conditions. I have an if condition and am doing an "include" if the condition is satisfied. if(condition here){ include "myFile.php?id='$someVar'"; } Now the problem is the server has a file "myFile.php" but I want to make a call to this file with an argument (id) and the ...

Is there a simple way to pass specific *named* powershell parameters through directly to a called function

I am sure I read somewhere that there is an easy way to pass named parameters from a calling function to a called function without explicitly naming and specifying each parameter. This is more than just reusing the position; I'm interested in the case where the name of the passed parameters is the same in some cases, but not in others. ...

Pass a parameter from one jsp to another using form.action

I have an ID that I need in the next jsp once the user click a button. I am trying to do the following: FirstJSP.jsp: function getSecond() { var frm = document.getElementById("frm"); frm.action = "**second.jsp?id=myId;"** frm.submit(); } ... form id="frm" ..... input type="button" v...

boolean parameters -- do they smell?

I just found a bug caused by a boolean parameter... the caller thought it was controlling one thing but it was really controlling something else. So do boolean parameters smell in general? Personally, I don't feel comfortable when I see them. I mean: DoSomething(false); What the heck am I supposed to think when I read something lik...

Is this an ASP.NET MVC 2 Preview 1 bug, and what's the work-around?

I'm using this code in ASP.NET MVC 2 preview 1: public ActionResult List(long id, [DefaultValue(0)] long? commentId) { var model = UserComment.ForRefId(id); PageTitle = string.Format("Comments for '{0}'", SetCommentThread(id).Subject); ViewData[MvcApplication.SAnchor] = ...

Sybase IQ and Encrypted Passwords

I have need to use the ENP (Encrypted Password) parameter with Sybase IQ. The documentation has a good reference on how to use it but not how to generate the password ... so how does one generate the encrypted password for use with the ENP connection parameter?? Thanks in advance ...

How do you pass parameters to Hibernate's subselect tag?

The example at the end of hibernate section 5.1.3 does not show an example on passing parameters. There is no difference between a view and a base table for a Hibernate mapping. This is transparent at the database level, although some DBMS do not support views properly, especially with updates. Sometimes you want to use ...

WCF object parameter loses values

I'm passing an object to a WCF service and wasn't getting anything back. I checked the variable as it gets passed to the method that actually does the work and noticed that none of the values are set on the object at that point. Here's the object: [DataContract] public class Section { [DataMember] public long SectionID { get;...

Setting C# Memory Parameters

While I am still new to C# I'm curious if there is a way to tell windows that it needs to set aside X memory to run this application. While debugging (F5) I occasionally get a random "error writing to protected memory" notice, and it's usually fine for a bit after I restart the version of Visual Studio. Once in a while it takes a win...

Is there a way to add something like the params option for generic types?

I have a function that looks similar to the following. I'd like to modify it so I can pass in multiple types to filter on instead of just one. I don't suppose there's a params/paramarray option for type parameters, is there? Public Shared Function Filter(Of T)() Dim results As New List(Of T) For Each item In GlobalCollection.Al...

passing \n into javascript

hi, I have a javascript function that takes in a parameter that is given by a php session. This works well except when the value is from a text area that contains a newline character. I guess it appears as if I'm passing in a parameter and then the newline indicates I have stopped or something like that. Please advise on how to fix this...

How to specify parameter for generic list type extension method in c#

Hi, I am trying to make an extension method that will shuffle the contents of a generic list collection regardless of its type however im not sure what to put in between the <..> as the parameter. do i put object? or Type? I would like to be able to use this on any List collection i have. Thanks! public static void Shuffle(this List<??...

.NET SqlCommand - finding Parameters in inline querys (Regex?)

I've got a method that uses sp_sproc_columns to find all parameters that need to be send for a stored procedure. My question is how can I do something similar for inline SQL querys? I want to get a list of the parameters the query is expecting. Would the only way achieving this will be to use Regular expression? Any examples? Exam...

Delphi: Program Execution and internal procedure/function calling from CMD or using Doubleclick on associated extension

So - recently I run on some problems determining from which way program was called, if in both times parameters is the same - like: /something /something. I associate icon with program at runetime and i can use cmd to call it, but, whenever i doubleclikc on associated file ( with the icon ), progam simply opens, but does not calls neede...

An inherited singleton class from a base class that takes parameters in its constructor?

public class BaseFoo { private string param; public BaseFoo(string param) { this.param = param; } } public sealed class SingletonFoo : BaseFoo { static readonly SingletonFoo instance = new SingletonFoo(); static SingletonFoo() { } public static SingletonFoo Instance { get ...

How do you declare a by-reference parameter variable for use in a Linq query?

I have a class MyClass with a method: public bool MyMethod(out DateTime? MyDate) { ... } I'd like to call this method in the following way: var q = from mc in MyClasses.AsEnumerable() from output in mc.MyMethod(out dt) // how to declare dt? select new { mc, output, dt }; Obviously this doesn't compile, coz I haven...