Can I pass additional parameters to a predicate function?
I need it in a sorting process actually.
public void Sort(
Comparison<T> comparison
)
where I would like to use Comparison predicate in this form:
public delegate int Comparison<T>(
T x,
T y,
object extraParameter
)
Is this possible?
Thanks,
...
Google Earth stores the points with a nice feature: you can double-click on a marker and will get placed directly behind the street view bubble. Another double click takes you to the street view.
I have a database of street view links. A kml file is generated from the Street View links.
I would like to add the "camera"/"look at" tags to...
From Oracle:
"When you declare a cursor variable as the formal parameter of a subprogram that fetches from the cursor variable, you must specify the IN or IN OUT mode. If the subprogram also opens the cursor variable, you must specify the IN OUT mode."
But, I can code that (only OUT parameter):
create or replace procedure mycur_out(mc ...
The more I see ref used in production code, the more misuse I encounter and the more pain it causes me. I have come to hate this keyword, because from a framework-building standpoint, it seems silly. When would it be a good idea to communicate to users of your code the notion of maybe changing an object reference/value out from beneath t...
In my header, I have a prototype declaration like this:
void move(int, int);
I can omit the parameter names, that's how I'm used to it from C. I do that so that I don't have to keep the parameter names in sync - it's extremely confusing if they differ between prototype and implementation.
Right now, I'm documenting all of my code wit...
I have the following URL
QString url = http://www.gigacooldomainname.com/" + setName + "/" + fileName + ".jpg"
where setName and fileName are QString variables.
I wish to have the following:
QString url = http://www.gigacooldomainname.com/" + QUrlParameter::encode(setName) + "/" + QUrlParameter::encode(fileName) + ".jpg"
Unfortuna...
Thank-you to all who have helped me over the last few days.. Unfortunately I was working so I couldn't get back to you. I have included some code into what I thought would work, but for some reason the below code will not update in my SQL Database. I will provide the code and it's output if someone could please copy the code and see wh...
Hello,
I have a relatively simple (I think) use-case but I can't find any examples where someone has done this. We are using Varnish as a cache and reverse proxy in front of two different applications and would like to make things a bit more unified across both as they both do similar things. I was hoping Varnish could help rewrite the U...
I want to know the way of passing multidimensional in URL with php.
I have an array like this
$number = $_SESSION["number"];
$number = $number+1;
$_SESSION["number"] = $number;
$_SESSION['count']$number]=array($_POST['buy_app_page'],$_POST['x'],$_POST['y'],$_POST['w'],$_POST['h'],$_POST['selected_values'],$number);
$pixels_detail...
let sub (a:float[]) (b:float[])=
[| for i = 0 to Array.length a - 1 do yield a.[i]-b.[i] |]
let fx t = [0..t]
let x=sub (fx t) (fx t)
Above compiles OK.
But the same causes an error when I replace the function call with a method invocation:
type type_f = delegate of float -> float[]
let mutable f =new type_f(fun t->[|0..t|])
l...
I need to create an aspect with a pointcut matching a method if:
it is annoted with MyAnnotationForMethod
One of its parameters (can have many) is annotated with @MyAnnotationForParam (but can have other annotations as well).
The aspect class look like this
@Pointcut("execution(@MyAnnotationForMethod * *(..,@aspects.MyAnnotationForP...
I know this question has come up many times in different ways. But it is still not clear to me. Is there a way to achieve the following.
def foo(a:Int, b:Int) = {}
foo(a,b) //right way to invoke foo
foo(getParams) // is there a way to get this working without explicitly unpacking the tuple??
def getParams = {
//Some calculations
...
Current function:
function SetPopup() {
x$('body').setStyle('overflow', 'hidden');
x$('#divOne').setStyle('height', document.body.offsetHeight + 'px');
x$('#divOne').setStyle('width', 100 + '%');
x$('#divOne').setStyle('display', 'block');
}
What I would like to do is change this function such that 'divOne' would be re...
I am developing a silverlight 4.0 application which communicates with a WCF service.
The WCF configuration (endpoint, ...) is contained in the ServiceReferences.ClientConfig file.
However, I would like the silverlight application to get this config from the web server as I don't want to recompile the application or fiddle with the XAP ...
Hi! :)
I have the following problem:
//A.h
class A
{
//...
// this is the important part, i have to call this in the proper way
// in A::SetNewValue(), but i don't know how to do that
protected:
void SetValue(const int* i);
//...
public:
// ??
void SetNewValue(const int* p);
}
the cpp:
//A.cpp
//??
A::SetNe...
I'm having issues passing on multiple $_GET variables with "next".
I'm redirecting users to the login page:
[email protected]&activate_key=1421sdxzcxz213xz
The problem is that the activation key is treated as a second $_GET parameter on the login page (along with "next"), instead of being part of the re...
Output([out, retval] long* Retval);
Length([in] long Len);
What is the significance of 'out', 'retval' and 'in' in this case ??
I know the significance of ref and out which is used usually, but not this.
Thanks.
...
When adding a method to a PSObject using Add-Member is it possible to use [switch] parameters?
If so how does the syntax work when calling these methods?
...
I saw this in a HTML template for a web app:
<img alt="mybutton" src="/img/button.png?123456789" />
What I didn't understand was why the ?123456789 would be passed to the image file? (in the actual app, the number that was actually passed seemed to be customized to the user's session or unique id perhaps)
...
I want to create a generalized helper method for LoadFromXML loading and validation. If the XML I'm loading from is incomplete, I do want it to fail completely without throwing an exception. Currently, my code looks like this (more or less)
public override bool Load(XElement source)
{
return new List<Func<XElement, bool>>
{
...