function

order of functions in cpp file

is there a standard in order of functions in cpp file? there are: global functions constructors destructors getters setters algoritmic functions if qt, slots if a derived class, overrided functions static functions any function type that i can not name... in cpp file, is there any good way to order? i order them as i wrote in t...

Joomla include database functions

Hello. I'm using Joomla 1.5. I have created a custom component that pulls data out of the database perfectly. I initialize the database in my main component file like this: $db =& JFactory::getDBO(); The problem is that I have a jQuery autocomplete plugin on my component page that makes calls to a PHP file from my component folder. Th...

To make an own function in PHP

How can you make an own function in PHP such that I can bind to it different files according to the data in $_GET? I use the handler handler_login.php which only shows the login form if you are not logged in. However, I need to run specific operations if the user is logged_in or not_logged_in. My current hnadler however is not so flexi...

Is there an easy way to pickle a python function (or otherwise serialize its code)?

I'm trying to transfer a transfer a function across a network connection (using asyncore). Is there an easy way to serialize a python function (one that, in this case at least, will have no side affects) for transfer like this? I would ideally like to have a pair of functions similar to these: def transmit(func): obj = pickle.dumps...

Jquery function binding

Can I get a couple of good examples on how to bind 3 separate functions I've got going on? ...

Default argument promotions in C function calls

Setup I have a few questions about the default argument promotions when calling a function in C. Here's section 6.5.2.2 "Function calls" Paragraphs 6, 7, and 8 from the C99 standard (pdf) (emphasis added and broken into lists for ease of reading): Paragraph 6 If the expression that denotes the called function has a type that do...

_beginthreadex static member function

How do I create a thread routine of a static member function class Blah { static void WINAPI Start(); }; // .. // ... // .... hThread = (HANDLE)_beginthreadex(NULL, 0, CBlah::Start, NULL, NULL, NULL); This gives me the following error: ***error C2664: '_beginthreadex' : cannot convert parameter 3 from 'void (void)' to 'unsigne...

Howto allow any data type to be returned by a function in actionscript 3?

I have a static Settings class where my application can retrieve settings from. The problem is that some of these settings are strings, while others are ints or numbers. Example: package { public final class Settings { public static function retrieve(msg:String) { switch (msg) { case "register_link":...

trying to learn the syntax and structure of cakephp

I'm trying to write a cakephp app. I need to validate input based on availability. an example would be if someone is trying to take out a book from a library. I would reference the book to see if it's currently out, and if it is report that to the user. another example would be trying to book rooms at a hotel, the user would enter a dat...

Php Merging Arrays on Date

I have two arrays which I'm trying to merge based on the date of them. Here is what the arrays look like: $a[0][0] = '11/15/08'; $a[0][1] = '50'; $a[1][0] = '11/20/08'; $a[1][1] = '75'; $a[2][0] = '01/04/09'; $a[2][1] = '23'; $a[3][0] = '01/09/09'; $a[3][1] = '92'; and $b[0][0] = '01/04/09'; $b[0][1] = '30'; $b[1][0] = '01/05/09'; $...

Passing a constant array to a function in C/C++

If I have a prototype that looks like this: function(float,float,float,float) I can pass values like this: function(1,2,3,4); So if my prototype is this: function(float*); Is there any way I can achieve something like this? function( {1,2,3,4} ); Just looking for a lazy way to do this without creating a temporary variable, bu...

jquery functions within Fancybox

I'm using fancybox to load up some inline content on a web page. Fancybox loads up fine as do the images, the only problem is that I would like certain jquery functions to work within the modal window which will not load up. The jquery functions work fine when I load them outside of fancybox so was wondering if anyone knows how to call...

tsql user-defined functions

Is it possible to call a user-defined function in TSQL without the scoping qualifier. I want to call select myfunc(var) and not select dbo.myfunc(var) select myschema.myfunc(var) It's possible in every other DB that I've ever worked with (7 others) it has to be possible in tsql too. If I'm signed into my DB/schema I don't have to ...

Javascript, variable reference

In a situation like the code below how would you go about accessing a variable value that is in an anonymous function? I would like to return the bool value of filterData(xmlhttp.responseText, thisForm); which will be boolean to the main checkAvailable function. Thanks in advance. function checkAvailable(thisForm) { var xmlhttp = h...

Are there any functions for working with the contents of X.509 Certificates in Cocoa Touch?

I have a SecCertificateRef representing an X.509 certificate. Does Cocoa Touch have any libraries for working with the contents of the certificate (I couldn't find any), or will I need to parse the DER representation of the certificate myself? Parsing is not a problem, however I'd prefer to save some time if I overlooked some functionali...

Drupal - logic of the template.php file

Hi guys, I have spent a good proportion of time today looking into expanding a drupal site I inherited, convinced that the issues I face were down to my bespoke SQL query. I have since realised that the SQL is ok (checked it in PHPMYadmin and got it executing of sorts within the drupal website). So I am happy I am getting all the resul...

How can I pass my locals and access the variables directly from another function?

Let's say I have this : def a(dict): locals().update(dict) print size def b(): size = 20 f(locals()) What do I have to do to access the size variable directly from the a function? I know of : size = dict["size"] but I think there should be a more direct way. I tried using locals().update(dict) but it didn't work. Is ther...

SQL Efficiency with Function

Hello, So I've got this database that helps organize information for academic conferences, but we need to know sometimes whether an item is "incomplete" - the rules behind what could make something incomplete are a bit complex, so I built them into a scalar function that just returns true if the item is complete and 0 otherwise. The pr...

C++ Callbacks using Boost Functions and C++ Class Methods

Is there a non-hacky (i.e. no assembly, ...) way to use boost functions to create callbacks with non-static class methods? Currently for static methods: list<function<void (LuaState&)> > _callbacks; I was thinking something along the lines of list<tuple<function<void (void *, LuaState&)>, void*> _callbacks; but boost functions doe...

Close multiple DIV elements with a jQuery function

Hi. I need a small function for jQuery that would close multiple DIV elements, but I'm having trouble with JS syntax. I got this far: function closePanels{ $("#servicesPanel").hide("fast"); $("#portfolioPanel").hide("fast"); $("#contactPanel").hide("fast"); $("#aboutPanel").hide("fast"); }; Sounds logical to me: That...