function

Passing Value to Javascript from Php

Dear all , I have php code of the following <?php echo "<SCRIPT LANGUAGE='javascript'>add dd_Employee('".$id1."','".$fname1."',".$sal1.");</SCRIPT>"; echo "<SCRIPT LANGUAGE='javascript'>add dd_Employee('".$id2."','".$fname2."',".$sal2.");</SCRIPT>"; .... ?> ... And My javascript Code Contains var details=new Array(); function...

Add date without exceeding a month.

Hello. I hope someone could help me on this. I want to add a month to a database date, but I want to prevent two jumping over month on those days at the end. For instance I may have: Jan 31 2009 And I want to get Feb 28 2009 and not March 2 2009 Next date would be March 28 2009 Jun 28 2009 etc. Is there a function that...

Help--Function Pointers in Python

My idea of program: I have a dictionary: options = { 'string' : select_fun(function pointer), 'float' : select_fun(function pointer), 'double' : select_fun(function pointer) } whatever type comes single function select_fun(function pointer) gets called. Inside select_fun(function pointer),I will have diff functions for float, double ...

Passing function Pointers in C++

i want to do this simple piece of code work. #include <iostream> #include <windows.h> void printSome (int i) { std::cout << i << std::endl; } void spawnThread (void (*threadName)(int i)) { CreateThread ( 0, // default security attributes 0, // use default stack s...

Returning multiple values

I have a function that identify coordinates on a page, and I am returning them as a Dictionary<int, Collection<Rectangle>> GetDocumentCoordinates(int DocumentId) However, later I need information about each page - if it was validated, what is the page resolution, color/bw, etc. I could create another function and run through pretty mu...

Making a another script function call from javascript

D ear All, I have Designed the Javascript function My.js it contains following code My.js function display(){ //Call to another Javascript function defined as ShowUser() in selectUser.js showUser(str); } SelectUser.js has function showUser(Str) { //Do the display } Now My Question is I want to make call showUse...

Best method of testing for a function in JavaScript?

I've done quite a bit of research into this but it seems that the methods used are inconsistent and varied. Here are some methods I have used in the past: /* 1: */ typeof myFunc === 'function' /* 2: */ myFunc.constructor === Function /* 3: */ myFunc instanceof Function As part of my research I had a look at how some well-known lib...

Ideas on making a javascript object name unique in ASP.Net?

I've created an ASP.Net user control that will get placed more than once inside of web page. In this control I've defined a javascript object such as: function MyObject( options ) { this.x = options.x; } MyObject.prototype.someFunction=function someFunctionF() { return this.x + 1; } In the code behind I've created MyObject in a s...

Calling a const function from a non-const object

Hi, I need to call a const function from a non-const object. See example struct IProcess { virtual bool doSomeWork() const = 0L; }; class Foo : public IProcess { virtual bool doSomeWork() const { ... } }; class Bar { public: const IProcess& getProcess() const {return ...;} IProcess& getProcess() {return ...;} ...

(g)Vim 7.x :: Possible to trick Vim into allowing lower-case user-defined commands

Not that it is seriously burdensome to type :My_custom_foobar() instead of just :my_custom_foobar() but it just feels odd considering how virtually every other aspect of Vim is so extensible. Some searching for an answer has not turned up much, but I know it's got to be possible without having to recompile Vim from source. Does a...

Loop function parameters for sanity check

I have a Python function in which I am doing some sanitisation of the input parameters: def func(param1, param2, param3): param1 = param1 or '' param2 = param2 or '' param3 = param3 or '' This caters for the arguments being passed as None rather than empty strings. Is there an easier/more concise way to loop round the func...

Function with same name but different signature in derived class

I have a function with the same name, but with different signature in a base and derived classes. When I am trying to use the base class's function in another class that inherits from the derived, I receive an error. See the following code: class A { public: void foo(string s){}; }; class B : public A { public: int foo(...

On writing win32 api wrapper with C++, how to pass this pointer to static function

I want to convert function object to function. I wrote this code, but it doesn't work. #include <iostream> typedef int (*int_to_int)(int); struct adder { int n_; adder (int n) : n_(n) {} int operator() (int x) { return x + n_; } operator int_to_int () { return this->*&adder::operator(); } }; int main(void...

Haskell: How to compose `not` with a function of arbitrary arity?

When I have some function of type like f :: (Ord a) => a -> a -> Bool f a b = a > b I should like make function which wrap this function with not. e.g. make function like this g :: (Ord a) => a -> a -> Bool g a b = not $ f a b I can make combinator like n f = (\a -> \b -> not $ f a b) But I don't know how. *Main> let n f = (\a...

What are php nested functions for?

In javascript nested functions are very useful: closures, private methods and what have you.. What are nested php functions for? Does anyone use them and what for? Here's a small investigation I did <?php function outer( $msg ) { function inner( $msg ) { echo 'inner: '.$msg.' '; } echo 'outer: '.$msg.' '; inner( $...

Assignment inside function that is passed as pointer?

ClassA* pa = NULL; ClassA* pb = NULL; assignObject(ClassA* pa,ClassB* pb) { pa = new ClassA; pb = new ClassB; } what will be the value of pa,pb after executing the function EDIT how to pass as pointer is the return if pa,pb is NULL ...

JavaScript: parameters for unnamed functions

In the following jQuery JavaScript code, what value does the parameter "e" take on within the function? I'm having difficulty understanding this because this function cannot be passed an argument elsewhere in the code so how would having a parameter work? And how would I use parameters in such functions that are not named and not called ...

How to get javascript function data into Php variable

Dear all I am using PHP and Javascript, My Javascript conatains function get_data() function get_Data(){ var name; var job; ..... return buffer; } Now I have PHP with following <?php $i=0; $buffer_data; /*here I need to get the Value from Javascript get_data() of buff...

Is this' type variableofType()' function or object?

#include<iostream> class name { public: int a; name():a(0){}; }; void add(name * pname) { pname = NULL; } int main() { name varName(); name * pName = new name(); add(pName); add(&varName);//error C2664: 'add' : cannot convert parameter 1 from 'name __cdecl *)(void)' to 'name *' } ...

return more than one value from a function in Python

How to return more than one variable from a function in Python??? ...