4337 links
  • Arnaud's links
  • Home
  • Login
  • RSS Feed
  • ATOM Feed
  • Tag cloud
  • Picture wall
  • Daily
Links per page: 20 50 100
page 1 / 1
6 results tagged sort x
  • Quick sort algo
    from random import randrange

    input = [10, 5, 2, 3, 7, 0, 9, 12]

    def quicksort(arr):
        if len(arr) < 2:
            return arr
        else:
            rand = randrange(0, len(arr))  # grab a random index
            pivot = arr.pop(rand)
            less = [i for i in arr if i <= pivot]
            greater = [i for i in arr if i > pivot]
            return quicksort(less) + [pivot] + quicksort(greater)

    print("sorted:  ", quicksort(input))
    February 6, 2022 at 4:05:26 PM GMT+1 - permalink - archive.org - https://www.integralist.co.uk/posts/algorithmic-complexity-in-python/
    algo recursiv sort
  • Note: python natural sort

    def atoi(text):
    return int(text) if text.isdigit() else text

    def natural_keys(text):
    return [ atoi(c) for c in re.split(r'(\d+)', text) ]

    my_list.sort(key=natural_keys)

    October 9, 2020 at 3:01:43 PM GMT+2 - permalink - archive.org - https://links.infomee.fr/?6OC8rw
    python sort
  • thumbnail
    GitHub - lostutils/uq
    February 9, 2020 at 10:20:03 AM GMT+1 - permalink - archive.org - https://github.com/lostutils/uq
    sort uniq
  • Note: jq sort example

    |jq -r '.ApplicationVersions|sort_by(.DateCreated)|.[]|.VersionLabel'|tail -1

    April 12, 2017 at 9:26:21 AM GMT+2 - permalink - archive.org - https://links.infomee.fr/?9B1NEQ
    jq sort
  • thumbnail
    Javascript only - sort a bunch of DIVs - Stack Overflow
    December 23, 2016 at 11:15:40 AM GMT+1 - permalink - archive.org - http://stackoverflow.com/questions/5066925/javascript-only-sort-a-bunch-of-divs
    div js sort
  • thumbnail
    Sort lines | Vim Tips Wiki | Fandom powered by Wikia

    vim <3

    :sort u

    November 21, 2016 at 5:35:31 PM GMT+1 - permalink - archive.org - http://vim.wikia.com/wiki/Sort_lines
    sort vim
Links per page: 20 50 100
page 1 / 1
Shaarli - The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community - Help/documentation