Useful Macros Functions And Tricks Snippets


C code example for useful macros, functions and tricks

Print variables with file and line number for debugging source code

30 March, 2011   

Need to unzip a file? this function can do that for you. It is reccomended that the functions.php file and the file that exicutes the unzip function are NOT in the same directory as the zip files. unzip ( string $zipfile , string $newLocation ) zipfile gets the name of the current zip file. newLocation is where you want to store all the...

Javascript append function "DOM Append Text and Element Functions"

This example code showing how to use PHP Functions to clean User Input

In Delphi, procedural types (method pointers) allow you to treat procedures and functions as values that can be assigned to variables or passed to other procedures and functions. Here's how to call a function (or procedure) as a parameter of another function (or procedure) : Declare the function (or procedure) that will be used as a...

04 May, 2011   

Need to people out if they have been inactive for too long? Do it with this piece of code. Introduction ----------------------- This takes 3 functions to complete the inactive session task. 1. We need to check if the person is actually logged in using our isLogged function 2. We need the function to check the time the page loaded, and when...

PL/SQL functions returns a scalar value and PL/SQL procedures return nothing. Both can take zero or more number of parameters as input or output. The special feature about PL/SQL is that a procedure/function argument can be of input (indicating the argument is read-only), output (indicating the argument is write-only) or both (both readable and...

03 April, 2014   

JavaScript functions to add, fetch or delete browser's cookies

03 November, 2011   

Here are some simple examples of using the functions with your variables. Run these from any ".asp" page and watch what happens

This function is used to reverse an integer array. For example, if the array is {1,2,3,4,5}, these functions will return an array like {5,4,3,2,1}. The user needs to pass in a pointer to the array and the size of the array, and the function will return a pointer to an array in the reverse order.

30 March, 2011   

Need to people out if they have been inactive for too long? Do it with this piece of code. This takes 3 functions to complete the inactive session task. 1. We need to check if the person is actually logged in using our isLogged function 2. We need the function to check the time the page loaded, and when the last page was loaded 3. We need a...

11 July, 2011   

We have created our first function, but a function usually need one or more parameters, so let us have a look at that. The next function is a simple echo function which just print the text to screen.

10 June, 2017   

C++ source code useful string functions

23 February, 2015   

Some example useful C code of string functions

13 April, 2017   

From the v8 design of CSS-Tricks

18 June, 2013   

Define few variables with your MySQL database connection settings and connect to MySQL database using mysql_connect() and mysql_select_db() functions.

20 June, 2016   

How to find the next X day after a given Date time.

Fortran programmer should always write new code in Fortran 90 or Fortran 95, but for those of you stuck on a desert island with only a FORTRAN 77 compiler at your disposal, here's a way to write a recursive subroutine. FORTRAN 77 subroutines and functions are not allowed to call themselves directly. Attempting to do such will result in a compile...

Code example using PHP to add/ remove nodes from an XML file