Allocated Arrays Snippets

06 August, 2012   

Showing how to work with dynamically allocated arrays

02 March, 2013   

How to resize an array in Java

01 April, 2015   

PHP code example for using the array_walk function to format an array.

15 November, 2011   

Source code of C/C++ program, showing how to work with arrays.

Have you ever wanted to know how much memory one of your PHP scripts uses when it runs? You might want this information if your script has a memory leak or takes a long time to execute. If that's the case then there's a great built-in function called memory_get_usage, which will display the exact amount of memory being used by your script. This...

Example code for a short BubbleSort algoritm for Integer Arrays

12 August, 2012   

Simple but utilitarian function returns a numeric array of associative arrays containing an entire result set.

Convert a coordinate (x,y) into the index for a 1D array. For example, the coordinate (3,1) would be at array index 8 if there are 5 columns. Assumption: Arrays start at 0.

09 July, 2011   

How to sort array in smarty template? Create sort modifier file and save it in smarty / plugins with modifier.sortby.php name use this modifier in smarty template like... {foreach item=item key=key from=$users|@sortby:"firstname"} {$item.id}-{$item.firstname} {/foreach}

01 February, 2011   

Associative Array Syntax

When creating a new object, pass the initial variables as an array. Then use this code to quickly assign the array vars to the class vars. This will mean importing large arrays into the object in three lines of code.

07 May, 2012   

An example code to Copy data into dotNet array

C code example for useful macros, functions and tricks

13 November, 2012   

Creating and maintaining an effective JavaScript toolbox can greatly reduce development time. This script will show you how to include specific snippet modules on individual pages.