function

what are the maximum length of PHP variable/function/class name ?

Please if you know, make a response. thanks ...

Function pointer doubt

Please tell me what will the call to given function return and how? The code: typedef struct { int size; ptrdiff_t index; void (*inlet) (); int argsize; ptrdiff_t argindex; } CilkProcInfo; /* * Returns a pointer to the slow version for a procedure * whose signature is p. */ /* the function definition is - */ st...

Function/Method Overloading C++: Data type confusion?

Hi, I'm having some trouble overloading methods in C++. As an example of the problem, I have a class with a number of methods being overloaded, and each method having one parameter with a different data type. My question: is there a particular order in the class these methods should appear in, to make sure the correct method is called d...

Make php date dropdown function 'sticky'

Out of coffee and brain's given up... ...can anyone help to make this form date dropdown function retain selected month on $_POST ['submit'] or isset($missing) in the case of there being an error/missing field etc function createMonths($id='month_select', $selected=null) { /*** array of months ***/ $months = array( ...

Select a function at compile time

Hi, in my C project I have five different function (with the same name) which implement one algorithm but in different ways. At compiler time I need to select only one of these functions. Can I implement this using a #define and a bunch of #ifndef? Are there better ways to do this? ...

How to call a function of a jQuery plugin (creating new plugin)?

I'm creating a jQuery plugin for one of my projects and I was wondering what's the best way to go about this. I need to be able to call a function on the plugin from outside the plugin, at any time. For example, an event outside the plugin happens, and I want to say "plugin, do this". I've played around a bit and this works, but doesn...

General programming question. When to use OOP?

My program needs to do 2 things. Extract stuff from a webpage. Do stuff with a webpage. However, there are many webpages, such as Twitter and Facebook. should I do this? def facebookExtract(): code here def twitterExtract(): code here def myspaceExtract(): code here def facebookProcess(): code here def twitterProce...

Calculating Length Based on Sensor Data

I've got an IR sensor which writes its current information to a token which I then interpret in a C# application. That's all good -- no problems there, heres my code: SetLabelText(tokens [1],label_sensorValue); sensorreading = Int32.Parse(tokens[0]); sensordistance = (mathfunctionhere); Great. So the further away the IR sensor is from...

jquery variable outside function

How can I update a variable outside of a function? For example I have this: var max_index = 0; //loop through the z-index's $(".widget_container").each(function(){ if($(this).attr("z-index") > max_index){ max_index = $(this).attr("z-index") + 1; } }); alert(max_index); The only problem with this is that max_index is ...

I need a function to check each pixel then return the x and y for that pixel

I want to test each pixel in an image and check it's color if it is white then I must display the corresponding (x,Y) for that pixel but I didn't find until now a function that help me do something like that. So please if you have such function tell me. thanks at all ...

Trimming a parameter in the function header

A function header looks like this function doit($theparam){ //$theparam is untrimmed $theparam = trim($theparam); //$theparam is now trimmed } Is it possible to do the trimming on the first line itself? I tried those 2 but neither worked. function doit( trim($theparam) ){ //access trimmed version } function doit( $thepara...

Deploy view or use function for lookup

I've two master tables Org & Item and then there's an OrgItem table.I have to fetch ItemCodes for a particular Org. TABLE STRUCTURE: Org ( Id, OrgCode, Name) - Org Master table Item ( Id, ItemCode, Name) - Item Master table OrgItem ( ItemId, OrgId, ItemCode) - Some Org specific ItemCodes Now only some Item's have Org specific Item...

Should new jQuery functions be placed within the jQuery namespace?

Context: HTML widgets generated using a Django ModelForm and template, jQuery 1.3.2, JavaScript on IE8, Firefox 3.5 or Safari 4. Procedures: An ordinary JavaScript function with some jQuery inside, or jQuery Enlightenment, Cody Lindley, "Adding new functions to the jQuery namespace," p. 116. I have a jQuery construct that is repeated se...

Are mysqli_multi_query php function connect 1 time to db or each query?

Hey Guys, Just wonder if the function mysqli_multi_query connect just 1 time to the database or each query? ...

Add to a javascript function

I have a function I can't modify: function addToMe() { doStuff(); } Can I add to this function? Obviously this syntax is terribly wrong but it's the general idea... function addToMe() { addToMe() + doOtherStuff(); } ...

VB - How do I test if optional arguments are supplied or not?

How do I test if optional arguments are supplied or not? -- in VB6 / VBA Function func (Optional ByRef arg As Variant = Nothing) If arg Is Nothing Then <----- run-time error 424 "object required" MsgBox "NOT SENT" End If End Function ...

C all type parameter

How can I write a function which accepts a parameter of a generic type in C? (such as an int, a char...) ...

Access an Array Returned by a Function

Is there anyway to directly access the data returned in an array without a temporary variable? Currently, my code is as follows: function getData($id) { // mysql query return mysql_fetch_array($result); } $data = getData($id); echo $data['name']; Is there a direct way to get the returned data without the temporary variable? ...

Cant figure out how to return the callback function - need alternative solution

Hi there. Im trying to return a callback value after the data is loaded, Im probably looking at this all wrong. var loadFromDatabase = function(callback){ if (!obj.data.myarray) { // the problem is here, the jquery obj returns the ajax request obj return $.getJSON('http://validjson',function(data){ obj.data.my...

Blur Effect - Flash CS4 (Replicate aperture settings)

Using Flash CS4 how can I create a function that will replicate the affects of different aperture settings on a camera. I want the user to be able to click on different 'focal points' of their picture and see how the aperture/depth of field would change depending on which focal point is in focus. In essence I want the blurring affect to ...