function

Jquery 1.4: Two functions not working together on same page

Hi, I've got two Jquery functions that I can get to work fine alone on the page, but not when I have them both in at the same time. I'm unable to see what I might be doing wrong as I've got similar code working well on other pages. First function: $(document).ready(function() { $("#add-questions").click(function() {$("#extra-questi...

Parsing variables in and out of functions jquery

Hi, i'm sure this is just a simple one, but its got me stumped on a few different projects now.. i have to keep declaring my variables, and i'm sure there is a better way to be doing things. in the example below, i'm finding at the "#gender" stage "gender" is printing out fine, but "#age" stage "gender" is no longer defined &/or is not...

Get details about function call

In PHP, I'd like to get the details about a function call inside the function itself. The behavior I want (without doing this) is to have debug_backtrace() passed as an argument to the function. I want that done automatically, for every call to a function. I need this so I can have pre-defined errors for a fairly sizable project I'm wo...

javascript call function in another file

Hello, I have a WSH javascript containing a function. I want to call that function form another javascriptfile . How can I do that ? Thanks, ...

Static keyword in function parameter

I've just found this function definition in some embedded code: float round_float_to_4(static float inputval); I'm familiar with other uses for static (global variables, functions and local variables), but this is the first time I see it as specifier for function parameter. I assume that this forces compiler to use fixed memory locati...

c#: Variable types in delegate

Hi, I'm trying to break down the problem to a more simple description. I'm using an external class library, which exposes 4 base classes, all very similar, sometimes derived from each other. During the execution I'm called back on several delegate functions, all carrying an "object Sender", which contains the initial object of one of t...

returning two created arrays in c++

Hi I have a text file containing two arrays and one value(all integers) like this 3 90 22 5 60 33 24 Where the first number stands for how many integers to read in. I can read in all this in one function. Do I need several functions to be able to use the different matrices and the first variable? ifstream in(SOMEFILE.dat); if...

PHP Function Definition, Null Arguments

What's the best way to structure a function, that has parameters that can be null? Eg function newDate($day, $time = null, $overRide) { Do something with the variables } # newDate('12', '', 'yes'); Would it be to simply restructure the function as follows: function newDate($day, $overRide, $time = null) { ...

Javascript function organization

I am not exactly sure the differences between saying "function x(){}" or "this.x=function(){}", but I had to make an object oriented JavaScript which is laid out like this: function PROJECT(){ ... ... ... this.main_call=function(...){ return this.recursive_call(...); } this.recursive_call=function(...){ ... var local,...

Visual Studio: Is it possible to define custom functions for use in one's own Code Snippets?

I want to write a Visual Studio snippet which allows me to quickly create a class of the form: public SomeClass { public SomeType SomeProperty { get; private set; } public SomeClass(SomeType someProperty) { SomeProperty = someProperty; } } I want the parameter on the constructor to have the same name as the property, but lower...

Good naming convention for functions and methods which may modify (write back to) a parameter.

Hello, everyone! I need to find a good and understandable naming-scheme for routines which deal with "value arrays" (I've written something similar to C++'s valarray in Java, with some optimizations for primitive types in mind). I know that the main categorization of routines is made between: functions (they may take parameters and m...

Cast the return value of a function that returns a floating point type

Hi, I have difficulty understanding the article Cast the return value of a function that returns a floating point type (1) In Conversion as if by assignment to the type of the function is required if the return expression has a different type than the function, but not if the return expression has a wider value only because of wid...

PHP SimpleXML DOM using between functions

Hi there, I have been trying to get my head around how simplexml and dom updates XML between functions. The reason i ask is that the code i have written seems to work, but without me having to declare anything as global, and im a little confused as to why it does this. For example, i have this (simplified) code: <? foreach ($filename...

How do I write a dry update_output() function for these stages in jQuery?

So I was offered help with this on another question, but I'm struggling to implement it when my app progresses in complexity... var gender; var age; $("#gender :radio").click(function() { gender = $(this).val(); update(); }); $("#age li").click(function() { age = $(this).text(); $('#children').show(); update(); }); function ...

Explain void (*signal(int signo, void *(func)(int)))(int)

Please explain this type signature. ...

What is the use of creating functions within functions?

I know that it is possible to create a function within another function. Why might one need to do that in real life? (PHP) function someFunction($var) { function anotherFunction() { return M_PI; } return anotherFunction(); } ...

What does apply_filters(...) actually do in WordPress?

Hello I'm trying to understand some of the function in WordPress, but I can't get my head around what apply_filters(...) actually does. Is someone able to clear this up for me with a few examples? Cheers Turgs ...

Exiting from C++ Console Program

I currently have a program which has the following basic structure main function -- displays menu options to user -- validates user input by passing it to a second function (input_validator) -- if user selects option 1, run function 1, etc function1,2,3,etc -- input is requested from user and then validated by input_validator ...

I want a generic function in VB Script which should help everyone where someone want use date in specific format.

My application server is in London so date format is freeze to format DD-MMM-YYYY (e.g. today’s date 16-Feb-2010) we have written VBScript code to enter the date in same format. But code fails in LN machine due to LN PC date format is dd/MM/yyyy whether NY and India PC format is MM/dd/yyyy where code works fine. Here I want one generic ...

USB function controller emulation in QEMU

Hi all, Does QEMU provide emulation for any target with USB device controller? Actually I am developing an embedded linux based device and was thinking about testing it on QEMU. BR, Mooni ...