function

VBScript: Passing Object to Function?

The below example generates an error: VBScript compilation error: Cannot use parentheses when calling a Sub This error does not occur if all parameters are not objects. Is there a special way to pass object parameters to VBScript functions? Option Explicit Dim obj Function TestFunc(obj) WScript.Echo "Why doesn't this work?" End Fu...

Is it possible to create a link that acts like a button and can carry out a function when clicked?

In PHP, I want to execute a function when a hyperlink is clicked. The only way I can think of doing this is by having the link attach a get parameter to the url when clicked and by doing an if statement that checks to see if that parameter exists and if so then have the function executed. But is there a way to do this like: <a href='#'...

Function in c++ for finding if a word is prefix

Let say i have some words AB, AAB, AA. AB is not a prefix to AAB but AA is a prefix to AAB because if i just add B at the end of AA it will become AAB, which is not possible with AB. So, is there any function in c++ (STL) so that i can determine of two words if one is prefix to the another ? Thanks. ...

cakephp function calling

whats the use of calling a cakephp function http://localhost/project/controller/method.hello so whats hello? but it requires views/method/hello/method.ctp... ...

function binding and the clone() function - Jquery

Hi I have problems with my keyup binding when cloning an element. Here's the scenario: I have an html markup like this: <tr class="rijbasis"> <td> <input type="text" class="count" /> </td> <td> <span class="cost">10</span> </td> <td> <span class="total">10</span> </td> </tr> I'm binding an keyup...

Whats the scope of a c function defined within objective-c class?

I was reading up about bypassing objective-c's messaging to gain performance (irrelevant to this specific question) when i found an interesting bit of code: #import <Cocoa/Cocoa.h> @interface Fib : NSObject { } - (long long) cFib: (NSUInteger) number; @end @implementation Fib // c implementation of fib long long cFibIMP(NSUInteger ...

called function A(args) calls a function B() which then calls a function A(args), How to do that?

See example: <!DOCTYPE html> <html> <head> <title>language</title> <script type="text/javascript" src="http://www.google.com/jsapi"&gt; </script> </head> <body> <div id="language"></div> <script type="text/javascript"> var loaded = false; function load_api...

In PHP: How to call a $variable inside one function that was defined previously inside another function?

I'm just starting with Object Oriented PHP and I have the following issue: I have a class that contains a function that contains a certain script. I need to call a variable located in that script within another function further down the same class. For example: class helloWorld { function sayHello() { echo "Hello"; $var = "...

C++ return double pointer from function.... what's wrong?

I can't seem to figure out what's wrong with my function.... I need to ask the user for a price and then return it as a double pointer, but I get tons and tons of errors: double* getPrice() { double* price; cout << "Enter Price of CD: " << endl; cin >> &price; return price; } ...

Equivalent to window.setTimeout() for C++

In javascript there's this sweet, sweet function window.setTimeout( func, 1000 ) ; which will asynchronously invoke func after 1000 ms. I want to do something similar in C++ (without multithreading), so I put together a sample loop like: #include <stdio.h> struct Callback { // The _time_ this function will be execut...

Which PHP version is required for str_split?

I relogin to my server in dreamhost and test some scripts.And I found I couldn't use str_split. Message of Undefined function was given.I checked the version in the server and its PHP Version is 5.2.12.And I just wonder which version is required?Thanks. Testcode: <?php $arr = str_split("lsdjflsdjflsdjflsdjfl"); print_r($arr); ?> Mes...

A PHP regex to extract php functions from code files

I'm trying to make a PHP regex to extract functions from php source code. Until now i used a recursive regex to extract everything between {} but then it also matches stuff like if statements. When i use something like: preg_match_all("/(function .(.))({([^{}]+|(?R))*})/",$this->data,$matches2); It doesn't work when there is more than 1...

Getting mysql syntax error and cant find source

I have function that updates log table. function wslog($userID, $log, $where) { safe_query("INSERT INTO ".PREFIX."log ( time, userID, log, where ) values( '".time()."', '".$userID."', '".$log."', '".$where."' ) "); } And I have this php code: wslog($userID, 'server|'.mysql_insert_id().'', 'servers'); But I keep getting syntax e...

My method is being recognized within my own program. Newbie mistake probably.

Here's my code: sentenceToTranslate = raw_input("Please write in the sentence you want to translate: ") words = sentenceToTranslate.split(" ") for word in words: if isVowel(word[0]): print "TEST" def isVowel(letter): if letter.lower() == "a" or letter.lower() == "e" or letter.lower() == "i" or letter.lower() == "o" or...

Function parameter types in Python

Unless I'm mistaken, creating a function in Python works like this def my_func(param1, param2): # stuff However, you don't actually give the types of those parameters. Also, if I remember, python is a strongly typed language, as such, it sesms like Python shouldn't let you pass in a parameter of a different type then the function ...

[NAnt] About "nant::get-base-directory()"

As in http://nant.sourceforge.net/release/latest/help/functions/nant.get-base-directory.html, they explaint the meaning of this function is: The base directory of the appdomain in which NAnt is running. I don't know what does appdomain mean! Someone please explain it for me. Thank you. ...

How to use unnamed function arguments in C or C++

How do I use function arguments declared like void f(double) { /**/ } if it is possible? ...

Match returning a string instead of object

This simple regex matching returns a string instead of an object on every browser but the latest firefox... text = "language. Filename: My Old School Yard.avi. File description: File size: 701.54 MB. View on Megavideo. Enter this, here:" name = text.match(/(Filename:)(.*) File /); alert(typeof(name)); as far as i know ...

Pass array of data to jQuery function

Here's the story... I have a jQuery function that does something, this function is referenced very regularly. One of the input parameters is an array, this array data is hard coded and thus I want to pass the data like this: (this is how I would do it using PHP) myFunction(Array("url"=>"abc.com","example"=>"hello_world")); Instead of ...

Does Os X have ways to load functions in a dylib by something other than the name (like loading by ordinal on windows).

Or in other words, does the order of functions in the function name list matter? It does on windows, for loading by ordinal. I don't think such a thing exists on OsX. Using Google I don't find anything, but Google will only find things that do exist, and not prove that they don't exist ;) I might just not be using the right search terms....