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...
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...
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...
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...
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 ...
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.
...
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...
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...
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] = ...
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
...
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 ...
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;...
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...
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...
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...
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<??...
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...
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...
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
...
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...