function

Fatal error: Cannot redeclare mss() (previously declared in *

I don't understand, the function doesn't exist, and even if I change it to some absurd names, it still doesn't work. Can anyone find the problem? function mss($value){ $data = mysql_real_escape_string(trim(strip_tags($value))); return $data; } EDIT: I forgot to mention, its XAMPP ...

Merge duplicate records into 1 records with the same table and table fields.

I have a database table that contains a list of demographic records, some of those participant might have multiple/duplicate records, e.g. NOTE: Gender: 119 = Male 118 = Female Race: 255 = white 253 = Asian UrbanRural: 331 = Urban 332 = Rural participantid, gender, race, urbanrural, moduletypeid, hibernateid, and more fields 1, 11...

non-const actual param to a const formal param

The const modifier in C++ before star means that using this pointer the value pointed at cannot be changed, while the pointer itself can be made to point something else. In the below void justloadme(const int **ptr) { *ptr = new int[5]; } int main() { int *ptr = NULL; justloadme(&ptr); } justloadme function should not be...

Class in header file

I'm having a bit of trouble with a C++ program I'm working on. I've created an abstract class with a single pure virtual method. Since the class has no variables or implemented methods, I've stored the class in a header file without an .cpp implementation file (there isn't any need for one). The method is: virtual void handleEvent() = ...

TSQL how do you insert rows from a table returned by function for each values in another table?

Hello, sorry for the poorish description it is really hard to explain what I am trying to do. But this is some pseudo: foreach (row in Table1) insert Table2 select * from getValuesTable('text', row.Column1) I'm not too sure how to get that initial join together because it will not allow me to alias the returned table from getValue...

[jquery.pajinate.js] Calling goto() externally/manually

Hello, This question is specific to jquery.pajinate.js. Basically it's a pagination plugin for jQuery that works great! I'm actually trying to add in some Unique URL functionality so that after jquery.pajinate() builds my pagination links, I can link to a specific page. This seems logical especially if someone wants to share a specif...

Leading underscore not showing up in CREATE FUNCTION?

I inherited a database application that includes several SQL functions. We recently migrated to another server, and while I thought the move had gone smoothly, I'm getting error reports from users when they call a handful of functions. The functions were there, and looked correct, but eventually I noticed that there is a method paramet...

Parameters assigment with default values for a function

Hi, I have thread spawning function which accepts many parameters which have default values in the declaration. int spawn( funcptr func, void *arg = 0,int grp_id = 1,const char*threadname); I want to initialize first parameter func and the last parameter thread name and remaining variables assigned their default values. spawn( myfunc...

Console.ReadLine() function is not working

See the program below: using System; using System.Collections.Generic; using System.Text; using System.IO; namespace FileOperation1 { class FileMain { static void Main(string[] args) { FileMain fm = new FileMain(); char ch = fm.Menu(); while (ch != '0') { ...

What is the simplest way to get a ratio in PHP of multiple numbers?

I've adapted this from an example that I found on the 'net... function ratio($a, $b) { $_a = $a; $_b = $b; while ($_b != 0) { $remainder = $_a % $_b; $_a = $_b; $_b = $remainder; } $gcd = abs($_a); return ($a / $gcd) . ':' . ($b / $gcd); } echo ratio(9, 3); // 3:1 Now I want it...

Does the order of PHP public functions in a class affect its execution?

I've been following this Symfony tutorial. In some sections it just tells me to add a public function inside a class but it doesn't say if I should add it at the beginning or at the end of the class. For instance: /** * JobeetCategory * * This class has been auto-generated by the Doctrine ORM Framework * * @package jobeet * @s...

jquery call for a remote php function

Hi, I have a selectbox that needs to be updated dynamically. I am using jquery to perform that using .load($url), where $url is the location of the php file to call. I am wondering if there is a way to call a specific function within that php file instead of calling the entire php file. ...

How do Objective-C function declarations work?

Hey, I was wondering how Objective-C function declarations worked, and why I would want to declare another function besides main. For example, I now that, at least from most programs I have been exposed to, Objective-C programs begin execution at the function named main, and the name main is therefore reserved. Now, the reason we usual...

PHP, passing each element in array into function without knowing how many elements in arrray?

This is stumping me.. I am writing components / library functions where it would be used for calling a lot of different functions, so I want it to make an array print out each variable to be passed into the function as an argument, like below but I am pretty sure that this isn't proper syntax.. thanks for any advice $myfunction = functi...

Magic functions __call() for functions?

The magic function __call() in php are used in classes. Are there any similar magic function but for functions instead? Like __autoload() is for functions. For example something like this function __call($name, $arguments) { echo "Function $name says {$arguments[0]} "; } random_func("hello"); ...

Idiomatic way to pass a method name for evaluation in Clojure?

I'm passing the name of a function for use in another method. (defn mapper [m function] (cond (= '() m) '() true (cons (function (first m)) (mapper (rest m) function)))) (println (map_ '((blue red)(green red)(white red)) #'first)) Is there a more idiomatic way to do this in clojure? ...

Adding a new file and calling functions from that file yields undefined function add_action()...

Hi, I am adding a new file called subtypes.php to my theme /library/includes in order to allow for a dynamic dropdown list. This file uses functions from /library/functions/custom_functions.php. The problem: whenever I call any function from custom_functions.php, I get fatal errors: Call to undefined function add_action(), other times...

Is it possible to make Python functions behave like instances?

I understand that functions can have attributes. So I can do the following: def myfunc(): myfunc.attribute += 1 print(myfunc.attribute) myfunc.attribute = 1 Is it possible by any means to make such a function behave as if it were an instance? For example, I'd like to be able to do something like this: x = clever_wrapper(myfu...

low level Hooker

I want to make a hook that will act like "event" (and not with agly GetAsyncKeyState) in C# (I want to do it in C++). so, I've made a dll with this content: http://pastebin.com/yEHJKSS7 . well, it doesn't call to Handler Function. by the way, here's how I used the dll: void KeysHandler(int vkKey, int flags) { if(vkKey == VK_ESCAP...

jQuery, passing success data from AJAX to another function?

I'm trying to get the success data from a jquery Ajax call so I can use it elsewhere but for some reason its only accessible within the actual success call, so immeditaly below works but the other doesnt'.. any advice is appreciated success: function(data) { alert (data) } this doesn't work when I try to pass "data...