parameters

How can I pass additional parameters to predicate functions?

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, ...

Regenerate Google Earth View from Street View link?

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...

Difference between "IN" and "IN OUT" CURSOR parameter in Oracle

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 ...

When is using the C# ref keyword ever a good idea?

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...

Prototype parameter names

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...

How to encode URL parameters in QT?

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...

Update MySQL Value Through Img Src Variable Including jQuery

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...

Can I reformat my URL parameters with Varnish

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...

How to pass multidimensional in URL with php

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...

Should functions not be the parameter?

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...

Pointcut matching methods with annotated parameters

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...

scala tuple unpacking

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 ...

Javascript passing string parameter - then using setStyle

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...

Is it possible to have the web site supply the WCF config to a silverlight app?

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 ...

What to pass to this function?

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...

Passing on multiple GET variables with the "next" parameter in the URL

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...

Significance of 'in' 'out' and 'retval' inside parameters in C#

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. ...

Is it possible to handle switch parameters with Add-Member methods?

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? ...

Why pass a query parameter to an image file (/img/button.png?123456789) from inside a HTML page?

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) ...

Passing properties as parameters

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>> { ...