Welcome To Snipplr


Everyone's Recent Snippets Tagged array



« Prev 1 2 3 4 5 ... 13
  1. FAV

    PHP Random Spin

    A quick snippet to rotate a series of words on page load using PHP.
    PHP 145 views posted 4 months ago by danparks
  2. FAV

    [vbnet] [directory] lister les fichiers d'un répertoire et d'un sous-répertoire dans un tableau

    list files from directory and subdirectory into a table 'On déclare une arraylist qui contiendra tous les fichiers
    VB.NET 56 views posted 6 months ago by martinbrait
  3. FAV

    [vba-basic] retrouver une valeur dans un tableau

    rechercher une valeur dans une variable tableau (Array) en VBA Find some value into an array
    Visual Basic 11 views posted 6 months ago by martinbrait
  4. FAV

    Lister tous fichiers contenus dans un dossier

    php list all files of a given directory
    PHP 10 views posted 6 months ago by martinbrait
  5. FAV

    [vba-access] Peupler un tableau avec le retour d'un recordset

    How to populate an array with recordset data
    Visual Basic 9 views posted 6 months ago by martinbrait
  6. FAV

    Python Reverse Array

    arr[::-1] does a list slice to reverse the array str(x) for x in arr[::-1] casts the ints in the array as strings map(str, arr[::-1]) does the same thing by using map to cast the ints " ".join() joins the resulting strings with a space
    Python saved by 2 people 15 views posted 3 years ago by denisemauldin
  7. FAV

    Convert XML to Array in PHP

    Convert easily XML File or String to Associative Array in PHP
    PHP 21 views posted 4 years ago by kavikms
  8. FAV

    forEach. How to break?

    Array.prototype.forEach You can't break forEach. So use "some" or "every". Array.prototype.some some is pretty much the same as forEach but it break when the callback returns true. Array.prototype.every every is almost identical to some except i...
    JavaScript 11 views posted 4 years ago by Waltem
  9. FAV

    Remove an item from array using UnderscoreJS

    Using underscore.js, you could combine .findWhere with .without Although, since you are creating a new array in this case anyway, you could simply use _.filter or the native Array.prototype.filter function (just like shown in the other question)....
    JavaScript 34 views posted 4 years ago by Balamir
  10. FAV

    delete Operator don’t impact the length of Array in JavaScript

    delete Operator don’t impact the length of Array in JavaScript
    JavaScript saved by 3 people 10 views posted 4 years ago by ursdeep
  11. FAV

    Format that Crap to an Array

    I am tired of having to go through text and adding quotation marks and commas to strings or just commas after numbers... f-that. Fixed.
    Python 13 views posted 4 years ago by joshuaherman
  12. FAV

    Java Arrays.sort() Example

    An example of the Arrays.sort() function. Taken from: http://www.tutorialspoint.com/java/util/arrays_sort_int.htm
    Java 30 views posted 5 years ago by nulldev
  13. FAV

    Reverse String Array

    Reverses a Java string array, taken from: http://www.java-examples.com/java-reverse-string-array-example
    Java 22 views posted 5 years ago by nulldev
  14. FAV

    Sort & query multi-dimensional arrays by properties

    Sort & query arrays in PHP. Sort multi dimensional arrays by object properties and filter the array by specific criteria. Documentation: https://github.com/mattnicholson/DataList
    PHP saved by 4 people 15 views posted 5 years ago by mattnicholson
  15. FAV

    ADT Binary tree - array implementation header

    An C++ header using templates. Array implementation of binary tree.
    C++ 7 views posted 5 years ago by elvis_popovic
  16. FAV

    bstablo_glavni.cpp

    Glavni program koji služi za izvedbu binarnoga stabla te rad sa funkcijama binarnoga stabla.
    C++ 10 views posted 5 years ago by ivan_uzarevic
  17. FAV

    bstablo_polje.h

    Zaglavlje sa funkcijama, izvedenih pomoću polja, za rad sa binarnim stablom
    C++ 8 views posted 5 years ago by ivan_uzarevic
  18. FAV

    opcenito_stablo

    Program za izvođenje općenitog stabla (prvo dijete - sljedeći brat) za 4. zadatak iz kolegija Strukture podataka
    C++ 8 views posted 5 years ago by ivan_uzarevic
  19. FAV

    binarno_stablo_polje.h

    Implementacija binarnog stabla pomoću polja.
    C++ 5 views posted 5 years ago by igotepava
  20. FAV

    opcenito_stablo.h

    Implementacija općenitog stabla pomoću polja.
    C++ 8 views posted 5 years ago by igotepava
  21. FAV

    Remove duplicates from multi-dimensional array 2

    Works with any array
    PHP 13 views posted 5 years ago by a1ias
  22. FAV

    Add the first k elements in an array with Matlab

    A simple function in Matlat to add the first k elements in an array
    MatLab 19 views posted 5 years ago by eiger_824
  23. FAV

    array_map usage

    shows how to use array_map to mine data from nested arrays.
    PHP 13 views posted 5 years ago by ryantxr
  24. FAV

    Read and write data to textfile

    I created this code for practice, and I looking for better and clear solution for the last instance where I can write or delete the data, but after I want to get back the content as array or the key as string. I want to use this write-read back with...
    PHP 17 views posted 5 years ago by gitarfogas
  25. FAV

    store all files as array

    This snippet stores all files in the current directory to an array.
    Bash 12 views posted 5 years ago by jlmarks
  26. FAV

    Turn CSV With Headers Into Array Of Hashes

    To be improved to work with fasterCSV
    Ruby 15 views posted 6 years ago by legrandkay
  27. FAV

    Creating a nested array from items with parent IDs

    Creating a nested array from items with parent IDs. This is useful for when you have a website working with multiple categories with parent categories. But it can be applied anywhere, really!
    PHP 17 views posted 6 years ago by CreativePunch
  28. FAV

    Method to determine if all values in an array are the same.

    Usage: var a = ['a','a','a']; var b = a.AllValuesSame(): //true var a ['1','1','2']; var b = a.AllValuesSame(); //false
    JavaScript 30 views posted 6 years ago by uberdragon
  29. FAV

    Recursive multidimensional array traversing

    Traverses a multidimensional array and returns an array with the results. It also echoes the result as a string just for demonstration.
    PHP 9 views posted 6 years ago by gummiost
  30. FAV

    in_array_r($needle, $haystack, $strict = true);

    Search recursive in array
    PHP saved by 1 person 9 views posted 6 years ago by bigmichiel
« Prev 1 2 3 4 5 ... 13