function

Redundant & inline functions

What is meant by redundant function? What is the difference between a redundant function & an inline function? ...

how to use array of function pointers?

how to use array of function pointers in c? how to initialize them? ...

strdup() - what does it do in C?

What is the purpose of the strdup() function in C? ...

PHP: Can a function know if it's being assigned as a value?

In other words, can fn() know that it is being used as $var = fn(); rather than as fn();? A use case would be to echo the return value in the latter case but to return it in the former. Can this be done without passing a parameter to the function to declare which way it is being used? ...

Classes: Public vars or public functions to change local vars?

Exactly what the topic title says, In which cases would you prefer using public functions to change local variables over just defining that variable as public and modifying it directly? ...

python, functions running from a list and adding to a list through functions

How do I run a function on a loop so all the results go straight into a list and is there a way to run a function which acts on all the values in a list? ...

what is the difference between re-entrant function and recursive function in C?

In C I know about the recursive function but I heard about the re-entrant function.What is that? And whats the difference between them? ...

Function parameters: Copy or pointer?

I'm kind of new to C++ and have some questions, this is one of them. Is there ANY reason when you are using a function that takes in one or several parameters, parameters of which you know will always be stored in a variable before the function call, to pass a copy of the variable, rather than a pointer to the variable? I'm talking in...

Why can I use a function before it's defined in Javascript?

This code always work, and across browsers. function fooCheck(){ alert(internalFoo()); return internalFoo(); function internalFoo(){ return true; } } fooCheck(); I could not find a single reference to why it should work, though. I first saw this in John Resig's presentation note, but it just mentioned it. There's no explanatio...

javascript problem

i have a php script and i'm using ajax with it . i have a textarea form connect with the ajax class the problem when i pass a text like ( &some text ) the function return an empty text ,i geuess that i have a problem with (&) , what is the problem here ? here the javascript function function sendFormData(idForm, dataSource, divID, if...

Is there a VB.NET function to format a number as an Ordinal

Hello, The title says it all really, is there a built in VB.NET function to format a number as an Ordinal? Or do I have to write my own? There isn't in C# so I'm thinking their isn't :( Thanks ...

how can I handle the warning of file_get_contents() function in php ?

I wrote a php code like this $site="http://www.google.com"; $content = file_get_content($site); echo $content; but when I remove "http://" from $site I get this warning Warning: file_get_contents(www.google.com) [function.file-get-contents]: failed to open stream: i try ( try and Catch ) but it didn't work . ...

What issues do you consider when designing a hash function?

I am not looking for links to information on hashing. I am not looking for the worlds greatest hash function. I am interested in mini-stories describing The problem domain you were working in The nature of the data you were working with What your thought process was in designing a hash function for your data. How happy were you with ...

Is the return type part of the function signature?

In C++, is the return type considered part of the function signature? and no overloading is allowed with just return type modified. ...

Finding Dll Function Parameters

How would one go about finding the parameters of an undocumented Dll function? I have searched all over the internet and have found one way involving decorated functions but I cannot find a way to get those. Any help would be appreciated. Thanks! ...

Elegant Object comparison

When comparing two objects (of the same type), it makes sense to have a compare function which takes another instance of the same class. If I implement this as a virtual function in the base class, then the signature of the function has to reference the base class in derived classes also. What is the elegant way to tackle this? Should th...

Why are Perl 5's function prototypes bad?

In another question a member asserted "I would advice you not to use prototypes. They have their uses, but not for most cases and definitely not in this one." Can anyone elaborate on why this might be true (or otherwise)? I almost always supply prototypes for my Perl functions, and I've never before seen anyone else say anything bad ab...

Exception Handling in classes and Code Behind with C#

Hi... I'm a little bit stuck with a asp.net project that i'm doing! I have got a class that is called from the code behind and many of its function have no return type ie, being void. How does one do exception handling then??? Also, if the function within the class does have a return type of, for instance, a dataset how would one then r...

What's wrong with this ASP recursive function?

When I call this function, everything works, as long as I don't try to recursively call the function again. In other words if I uncomment the line: GetChilds rsData("AcctID"), intLevel + 1 Then the function breaks. <% Function GetChilds(ParentID, intLevel) Set rsData= Server.CreateObject("ADODB.Recordset") sSQL = "SELE...

Update function in postgres help

Hi there... I have a question regarding an update function I created... CREATE OR REPLACE FUNCTION rm_category_update(icompany bpchar, iraw_mat_cat_code bpchar, iraw_mat_cat_desc bpchar) RETURNS character AS $BODY$ DECLARE loc_result CHAR(50); BEGIN UPDATE rm_category SET raw_mat_cat_code = iraw_mat_cat_code, r...