function

passing a string by reference to a function would speed things up? (php)

Possible Duplicate: In PHP (>= 5.0), is passing by reference faster? I wonder if by declaring the parameter pass by reference, the PHP interpreter will be faster for not having to copy the string to the function's local scope? The script turns XML files into CSVs, which have thousands of records, so little time optimizations cou...

How can I pass any number of arguments in User define function in C?

How can I pass any number of arguments in User define function in C?what is the prototype of that function?It is similar to printf which can accept any number of arguments. ...

What is the difference between a language construct and a "built-in" function in PHP?

Hi guys, I know that include, isset, require, print, echo, and some others are not functions but language constructs. Some of these language constructs need parentheses, others don't. require 'file.php'; isset($x); Some have a return value, others do not. print 'foo'; //1 echo 'foo'; //no return value So what is the internal dif...

JQuery hover() possibilities!?

I'm using hover() as suggested in the documentation: $("#div").hover( function(){$(this).addClass('cie_hover');}, function(){$(this).removeClass('cie_hover') ;} ); Is there a way I can use more functions on other objects? And if so what would be the syntax to introduce functions in array? What I would like...

Free Plug-in to show caller-functions in vb.net ?

Hello, very often i see code written from others, and when browsing over a function i want to see where this function is called from. Even when i debug my own code, i'd find it a useful feature:P In c++ this feature is default in visual studio(its called browse-something), but i havent found any such thing for VB.NET yet, any ideas? ...

What's faster/better to use MYSQL md5 FUNCTION or run md5 php function ?

i check password of users against the db. what is faster check it in mysql MD5 function ... pwd = MD5('.$pwd.') OR in PHP ... pwd = '.md5($pwd).' or what is The Right Way Between two options ? thanks ...

Extract group membership of computer object

Hi, this is probably a little bit off the standards. I'm using something calles Active Roles Server which is a web interface application where one can connect to AD through the web service. But you need to program alot of the features yourself and I'm in need of getting an extract of each group which are members of a certain computer ...

How to run a function in jquery

I'm a programming newbie and I can't figure out store a function in jquery and run in it multiple places. I have: $(function () { $("div.class").click(function(){ //Doo something }); $("div.secondclass").click(function(){ //Doo something }); }); Now the 2 //Doo somethings are the same, and I don't want to write th...

Show us your best obfuscated identity function

Rules are simple. Write an obfuscated function in any language that takes in an integer and returns the same integer. Try to use math tricks and not language tricks. IE. Try to make your function portable. ...

Postgresql Triggers: switch from after to before the trigger dont fire

Hi guys, i have this simple plpgsql function: CREATE FUNCTION "update_times" () RETURNS trigger AS ' BEGIN NEW.update_time = NOW(); RETURN NEW; END;' LANGUAGE "plpgsql"; --The trigger: CREATE TRIGGER test_update_time BEFORE UPDATE ON contact FOR EACH ROW EXECUTE PROCEDURE update_times(); and this works well, b...

Get array element after performing a function on it??

Hey all, I'm looking to see if there is some PHP syntax that I'm missing that will allow me to grab the contents of the array I just manipulated using a function.. Good example: $firstElement = sort($myArray)[0]; Where normally I would have to do this: $myArray = sort($myArray); $firstElement = $myArray[0]; Any clean way of doing...

Is it possible to create a Function that takes a table as a parameter and returns a table?

I need to create a function that takes a table (or table variable) as an input parameter and returns a table-value as a parameter. Is this possible with the following constraints: SQL Server 2005 CLR function is not an option (should be TSQL-only) Any example code as a starter would be helpful. ...

VB.NET Generic Function

What I want to do is, based on the type of T do different opperations. Below is a simple example of my problem. Public Shared Function Example(Of T)() As T Dim retval As T If TypeOf retval Is String Then Dim myString As String = "Hello" retval = myString ElseIf TypeOf retval Is Integer Then Dim myInt...

How can I determine what function called another function in ActionScript 2?

I have a function (FunctionA) that is being called by another function (FunctionB). The problem is, I'm not sure which function "FunctionB" is. I have this snippet of code: function FunctionA():void { trace("This function was called by " + ???); } I need to figure out what to put for "???" so FunctionA's trace statement looks like ...

How do I rename a bash function?

I am developing some convenience wrappers around another software package that defines a bash function. I would like to replace their bash function with an identically-named function of my own, while still being able to run their function from within mine. In other words, I need to either rename their function, or create some kind of per...

Is it good programming practice to have a return statement in all functions?

I have a basic programming question. I would like to know if every non-void function should have an "return" statement in PHP script. Take the following two example functions. Which one would be the better way to program? They both do the same thing (to my understanding) but which is the "better practice" and why? function displayAp...

Why does this C fuction not return an integer value?

When I try to execute my program, I get an error. I can't read the last value in "ch": int choi(char *Tvide[48])//permet de choisir la place selon les choix de l utilisateur { char fum, classe, pos; printf("\n S.V.P choisissez votre Classe (A:1 ere classe )/(B: 2 eme classe): "); classe = getche(); printf("\n Est ce q...

Stacking Algorithm - Stack 3d objects in smallest area possible

I'm trying to solve the problem of stacking objects into the most convenient size for postage. The size and shape of objects will be varied. Length, width and height of all objects is known. For example a customer may order a (length x width x height) 200x100x10cm object (wide, long and flat) along with 2 50x50x50cm objects (cubes). If ...

Checking all function parameter in all the functions

When I first moved from c to Java I thought that I've finished will all the annoying parameter checks in the begining of every function . (Blessed exceptions) Lately I've realized that I'm slowly moving back to that practice again , and I'm starting to get really annoyed with all the if (null == a || null == b || null == a.getValue() ...

jQuery pause function execution and do something else while paused

I have something like this: function doSomething() { var obj = $('somediv'); ... waitAndDoSomethingElse(obj); ... $('somediv').show(); ... } function waitAndDoSomethingElse(obj) { obj.fadeIn(); .... } I want doSomething() to pause... execute waitAndDoSomethingElse() and then continue... Any ideas? Thank ...