Return Entire Thread First 100 Posts Prev 100 Next 100 Last 50 Posts Report Thread Style: Yotsuba, Pseud0ch, Terminal

Pages: 1-40 41-80 81-120 121-160 161-200 201-240 241-280 281-320 321-360 361-400 401-440 441-480 481-520 521-560 561-600 601-640 641-680 681-720 721-760 761-800 801-840 841-880 881-920 921-960 961-1000 1001-1040 1041-

Genius sorting algorithm: Sleep sort

1

Man, am I a genius. Check out this sorting algorithm I just invented.


#!/bin/bash
function f() {
    sleep "$1"
    echo "$1"
}
while [ -n "$1" ]
do
    f "$1" &
    shift
done
wait


example usage:
./sleepsort.bash 5 3 6 3 6 3 1 4 7

2

>>1
Oh god, it works.

But I don't like to wait 218382 seconds to sort '(0 218382)

3

>>2
yes the worst case is very big

4

What's the complexity?

5

#!/bin/bash
function f() {
    sleep $(echo "$1 / 10" |bc -l)
    echo "$1"
}
while [ -n "$1" ]
do
    f "$1" &
    shift
done
wait


OMG OPTIMISED
Make sure you have an implementation of sleep that accepts floating-point arguments.

6

>>4
Well i'm not sure how you define it. Basically O(highest_value_in_input)

7

O(highest_value_in_input + n) there is a linear time for creating each thread (it is a thread right?)

congrats OP, it is awesome

8

okay, so basically it sleeps longer depending on the number so the smaller numbers wake up sooner?

9

dicksort() {
    while [ -n "$1" ]
    do
       (sleep "$1"; echo "$1") &
       shift
    done
    wait
}

dicksort 2 1 4 3 2 1 99999999

10

Standard value based sort if you ask me.

11

f() {
    if test -n "$1"
        then ( sleep $1; echo $1 ) &
        shift
        f $*
        wait
    fi
}

12

>>10
What else would you sort them based on? IHBT

13

I highly enjoyed this.

14

>>11
Not tail recursive.

15

>>14
Recurse my tail!

16

>>15
(tail (anus! 'my))

17

>>15
Intercourse under my tail!

18

If the difference between any two of the numbers is too small, race conditions will fuck you up the ass.

19

>>18
Luckily, 1 second should be enough for anyone.

20

like perhaps in:
./sleepsort 0.000002 0.000003 0.000001

21

What about
./sleepsort -1 -2 -3 ?

If you slept exp(n) instead of n it could easily include negative integers too!

22

This is sort of like a simple bucket/radix sort but instead of using a space-based array, it's effectivly using a time-based "array"

23

>>21
obviously the correct solution is to divide every input by two and add MAXINT/2.

24

>>23
OMG OPTIMIS-Oh, wait.

25

This thread is entertaining.  My gratitude goes to all participators.

26

>>21,23-24
For optimal results, use a logistic functioneg. 0.5+9.5/((1+0.5e^(-1.5(t-10)))^(2)) to normalize the inputs. You can bound the sleep time arbitrarily this way. I'm not writing that in bash.

27

>>26
Still doesn't solve the race condition problem. Over here it happens with values with mutual differences as high as those in:
./sleepsort 0.02 0.03 0.01

28

using System;
using System.Collections.Generic;
using System.Collections.Concurrent;
using System.Linq;
using System.Threading;

namespace SleepSort
{
    public class SleepSort
    {
        static void Main(string[] args)
        {
            var xs = new[] { 11, 215, 12, 1985, 12, 1203, 12, 152 };
            var sorted = Sort(xs, x => x);
            Console.Write("Sorted:");
            foreach (var x in sorted)
                Console.Write(" {0}", x);
            Console.WriteLine();
            Console.ReadKey(true);
        }

        public static IEnumerable<T> Sort<T>(IEnumerable<T> xs, Func<T, int> conv)
        {
            const int WEIGHT = 40000;
            var ev = new EventWaitHandle(false, EventResetMode.ManualReset);
            var q = new Queue<T>();
            ParameterizedThreadStart f = x => { ev.WaitOne(); Thread.SpinWait(conv((T)x) * WEIGHT); lock (q) { q.Enqueue((T)x); } };
            var ts = xs.Select(x => { var t = new Thread(f); t.Start(x); return t; }).ToArray();
            ev.Set();
            foreach (var t in ts)
                t.Join();
            return q;
        }
    }
}

It's still a bit of a stochastic sort.

29

>>28
Lol I just tried to compile this in java, but I assume now that it's C#

30

>>27
Well no, in fact it makes the race condition worse. Many of the differences are going to be quite small indeed after coming out of that function.

I can think of a few enhancements:
First: tailor A and Khttp://en.wikipedia.org/wiki/Generalised_logistic_curve  to the range of inputs. This adds some complexity, but it is nearly canceled by the act of spawning the sleeps and calculating Y(t) anyway.

Second: keep track of deltas upon return. When the gap is large enough relative to previous gapsFeigenbaum constant? start a new partition, reiterate the process on each. (Note: multiple partitions can be sleep-sorted at the same time.) This will distribute the sleep times more evenly among elements, however: there is still no guarantee on most platforms that any kind of sleep sort will be free of race conditions, on any set of inputs, no matter the minimum range between elements.

Third, a meta-enhancement: make best-guesses at values for the range chosen in the first enhancement for the purposes of optimal calculations. Likewise establish a good terminal condition for the second, probably when all partitions have 1 element.

If you have a huge range in input with many clusters, I think these variations are optimal over anything less sophisticated. I've no idea how often that is the case (actually... does anyone have info on this?) but it seems like it's probably common enough. Even if the clustering isn't bad, the partitioning process deals with it automatically.

31

>>30
lolwut

32

Good thread.

33

Yeah, that's pretty cool but check my doubles.

34

>>33
sweet dubs bro

35

Block the threads until every single one is created, also you should probably attempt to indicate to the OS that every thread doesn't need a very large stack.

36

Thread was better than I expected, nh OP.

37

>>35
Yes I was thinking about whether this algorithm could have potential use for a huge amount (eg billions) of numbers in a small range.. but i'm not sure which OS would handle billions of processes/threads... so like I said before it's essential a radix sort but in the time dimension.. the way around as others have said would be to have radix style buckets to group the numbers, then sort each bucket etc..

38

Oh shit, we're busted, there's a REALISTICALLY THINKING PERSON in this thread!

39

>>29
lol'd, but does Java have lambda expressions and var and LINQ? Didn't think so.

>>35
My implementation (>>28) blocks them, but even after letting them continue they won't all start at the exact same time.

40

Someone email this to Knuth.

41

>>40
Knuth doesn't do email anymore

42

>>41
That's only because he's DED.

43

-module(sleepsort).
-export([sort/2, spawn_waiters/3, wait/4]).

sort(Xs, Conv) ->
    spawn(?MODULE, spawn_waiters, [Xs, Conv, self()]),
    receive
        {spawned, N} -> queue(N)
    end.

queue(N) -> queue(N, []).
queue(0, Xs) ->
    lists:reverse(Xs);
queue(N, Xs) ->
    receive
        {item, X} ->
            queue(N - 1, [X|Xs])
    end.

spawn_waiters(Xs, Conv, P) -> spawn_waiters(P, Conv, Xs, 0).
spawn_waiters(P, _, [], N) ->
    P ! {spawned, N};
spawn_waiters(P, Conv, [X|Xs], N) ->
    spawn(?MODULE, wait, [X, Conv(X), P, self()]),
    receive
        monitored -> ok
    end,
    spawn_waiters(P, Conv, Xs, N + 1).

wait(X, T, Q, P) ->
    Ref = erlang:monitor(process, P),
    P ! monitored,
    receive
        {'DOWN', Ref, process, P, _} -> ok
    end,
    timer:sleep(T),
    Q ! {item, X}.


Also this. I'm an EARLY ADOPTER.

44


(module sleepsort racket
   (provide sleepsort)
   (define (sleepsort x)
      (map (lambda (x) (thread (lambda () (sleep x) (display x)))) x)))

45

>>44
display
Are you also one of the people that define their square as IO ()?

46

History in the making, guys. Turns out /prog/ can do good things.

47

>>43
Holy fuck Erlang in /prog/?!?!?!?!

Props.

48

>>45
Yes.
void CalculateAndPrintSquareEx(DWORD dwOperand, HANDLE hOutputDevice, ...) { fprintf(hOutputDevice, "%d", dwOperand*dwOperand); }
int main (int argc, char *argv[]) {
   CalculateAndPrintSquareEx(2, stdout, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); }

49

>>48
That's :: Int -> IO ().
I was thinking more along the lines of ReadParseSquareAndOutput(...).

50

>>49
That's :: DoubleWord -> Handle -> Nothing -> Nothing -> Nothing -> Nothing -> Nothing -> Nothing -> Nothing -> Nothing -> Nothing -> Nothing -> Nothing -> Nothing -> Nothing -> Nothing -> Nothing -> Nothing -> Nothing -> Nothing -> Nothing -> Nothing -> Nothing -> Nothing -> Nothing -> Nothing -> Nothing -> Nothing -> Nothing -> Nothing -> Nothing -> Nothing -> Nothing -> Nothing -> IO ().

51

>>50
More like :: Int32 -> IORef -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> Maybe a -> IO ()
(I counted.)

52

>>51
Maybe (Ptr a)

53

>>51
Wait, fuck. That should be:
CalculateAndPrintSquareEx :: Int32 -> IORef -> Maybe a -> Maybe b -> Maybe c -> Maybe d -> Maybe e -> Maybe f -> Maybe g -> Maybe h -> Maybe i -> Maybe j -> Maybe k -> Maybe l -> Maybe m -> Maybe n -> Maybe o -> Maybe p -> Maybe q -> Maybe r -> Maybe s -> Maybe t -> Maybe u -> Maybe v -> Maybe w -> Maybe x -> Maybe y -> Maybe z -> Maybe a' -> Maybe b' -> Maybe c' -> Maybe d' -> Maybe e' -> Maybe f' -> Maybe g' -> Maybe h' -> Maybe i' -> Maybe j' -> Maybe k' -> Maybe l' -> Maybe m' -> Maybe n' -> Maybe o' -> Maybe p' -> Maybe q' -> Maybe r' -> Maybe s' -> Maybe t' -> Maybe u' -> Maybe v' -> Maybe w' -> Maybe x' -> Maybe y' -> Maybe z' -> Maybe a'' -> Maybe b'' -> Maybe c'' -> Maybe d'' -> Maybe e'' -> Maybe f'' -> Maybe g'' -> Maybe h'' -> Maybe i'' -> Maybe j'' -> Maybe k'' -> Maybe l'' -> Maybe m'' -> Maybe n'' -> Maybe o'' -> Maybe p'' -> Maybe q'' -> Maybe r'' -> Maybe s'' -> Maybe t'' -> Maybe u'' -> Maybe v'' -> Maybe w'' -> Maybe x'' -> Maybe y'' -> Maybe z'' -> Maybe a''' -> Maybe b''' -> Maybe c''' -> Maybe d''' -> Maybe e''' -> Maybe f''' -> Maybe g''' -> Maybe h''' -> Maybe i''' -> Maybe j''' -> Maybe k''' -> IO ()

54

oh thread is officially shit now. congrats /prog/

55

>>54
np faggot

56

>>55
nobody likes you and nobody would miss you

57

>>56
girls dont like you

58

>>57
Apostrophes and capital letters don't like you.

59

>>58
girl's Dont like you

60

your gay

61

The Autism Consortium frowns upon this thread.

62

To the person reading this in the future, >>54-60 are from something which we call an ``imageboard'', more specifically the imageboard called ``/g/'', this means that they enjoy making bad posts with little to no-content.

63

>>62
I lol'd!

64

>>62
nice.

65

>>63,64
NOOOOooooooOOOOOOOOoooooooooooOOOOOOOOoooo

66

>>65
nice.

67

>>65
I lol'd

68

>>65
I bet you miss ``HAX MY ANUS'' now, motherfucker.

69

>>1
Good job. Now try writing it in an actual language, like C.

70

Hax Anii everyday.
Anii MUST be haxxed.

71

>>69

My implementations of sleep and echo are written in C.

72

>>69
ooh no i'd have to use pipe() and fork() !

73

>>71
That's like saying you wrote a hardware implementation of sleepsort because it's run on hardware.

74

>>73

Well most of the time in that script is spent in those programs, if your intention was to optimize it by writing it in C it wouldn't work.

75

>>72
pipe()
What for?  Sounds like this would be an actual challenge to you.

76

>>74
>>69 is just being a turd. A big part of the novelty here is that it's a shell script.

77

>>75
to set up a signalling channel

78

I think thats brilliant :)
Would be fun to design a hardware sorter, based on this..
hmm, something to think about after my partials.

79

#include <assert.h>
#include <stdio.h>
#include <unistd.h>

int main(int argc, char **argv)
{
        assert(argc >= 2);
        while (argc --> 2 && fork()) ;
        sleep(atoi(argv[argc]));
        puts(argv[argc]);
        while (wait(NULL) != -1) ;
}

80

>>79
+1 use of goes-to operator

81

THIS IS A MESSAGE FROM THE SUSSIX DEV TEAM (ME)

/*
 * Inspired by the valiant /prog/lodtyes
 * one of my personalities wrote an OMP
 * implementation.
 *
 * Since we are currently training SCC
 * (SCC Compiles C) we currently have to
 * use GCC to compile it.
 */

/*
 * @file sleepsort.c
 * @brief sorts numbers
 *
 * @compile gcc sleepsort.c -fopenmp -o sleepsort
 *
 * @author Gerald Jay Sussman (Massachvsetts Institvte of Technology)
 *
 * Copyright (C) 2011 Gerald Jay Sussman and the Massachvsetts
 * Institvte of Technology. All rights reserved.
 *
 * The new BSD License is applied to this software, see LICENSE.txt
 */

#include <stdio.h>
#include <stdlib.h>
#include <omp.h>

int main(int argc, char **argv) {
  int i;

  omp_set_num_threads(argc);

#pragma omp parallel for
  for (i = 0; i < argc - 1; i++) {
    long int this = atol(argv[i+1]);

    sleep(this);

    printf("%ld\n", this);
    fflush(stdout);
  }

  return 0;
}


THIS HAS BEEN A MESSAGE FROM THE SUSSIX DEV TEAM (ME)

82

Is Quantum Sleepsort O(1)?

83

My shitty attempt in Haskell... first time I ever used Control.Concurrent

import Control.Concurrent
import System.Posix.Unistd (sleep)

sleepFunc :: MVar [Int] -> Int -> IO ()
sleepFunc arr n = do
    sleep n
    xs <- takeMVar arr
    putMVar arr (n:xs)
   
sleepSort_ :: [Int] -> IO [Int]
sleepSort_ xs = do
    res <- newMVar []
    let ts = map (sleepFunc res) xs
    mapM_ forkIO ts
    waitForIt res (length xs)
   
   
waitForIt m n = do
    arr <- takeMVar m
    if length arr == n
       then return $ reverse arr
       else do
           putMVar m arr
           sleep 1
           waitForIt m n

84

>>82
It's still O(n), but without the race condition problems.

85

>>48
wat, the function should return a BOOL

86

Just run an insertion sort over the output if you're worried about race conditions. This ensures that the numbers are relatively close to their ending points.

87

>>81
Is threading in C really this simple?

88

>>87
Only with that OMP thing

89

>>87
Only with #pragma omp everyline

90

Perl Legacy:

map {sleep $_; print "$_\n"} @ARGV;

91

>>90
Shorter than ``in Lisp'' DSL.

92

>>91
YHBT

93

>>90
Perl's map is parallel?

94

Actual Perl implementation. Forking in Perl is awkward to say the least.


#!/usr/bin/perl                                                                
sub f {
  sleep $_[0];
  print "$_[0]\n";
}

for (0..$#ARGV) {
  $pid = fork();
  if ($pid) {
    # parent                                                                   
  push(@childs, $pid);
}
  if ($pid == 0) {
    # child                                                                    
    &f(@ARGV[$_]);
    exit(0);
  }
}
foreach (@childs) {
waitpid($_, 0);
}



time perl sleepsort.pl 3 1 8 2 9 5 4
1
2
3
4
5
8
9

real    0m9.007s
user    0m0.008s
sys    0m0.000s

Terribly inaccurate with anything other than integers, but you can give arguments like 0.003 "sqrt(2)" 10e-3, for what it's worth.

95

96

way to ruin a good python thread

97

If you're sorting very large groups of numbers, unless your CPU can spawn the necessary number of threads, the accuracy will be compromised by shit like thread quantums.

98

svn checkout my://dubs

99

At revision 99.

100

one hundubs

101

>>98,99
That might surprise you, but your gay.

102

>>101
what about my gay?

103


    ░░░░░░░░░░░░░░░▄░░░░░░░░░░░░░░░
    ░░░░░░░░░░░░░▄▀█░░░░░░░░░░░░░░░
    ░░░░░░░░░░░▄▀░░█░░░░░░░░░░░░░░░
    ░░░░░░░░░▄▀░░▄▀░░░░░░░░░░░░░░░░
    ░░░░░░░░█▄░▄▀░░░░░░░░▄█▄░░░░░░░
    ░░░░░░░░█░▀▄░░░░░░░▄▀░█░▀▄░░░░░
    ░░░░░░░░▀▄░░▀▄░░░▄▀░░▄▀▄░░▀▄░░░
    ░▄░░░░░░░░▀▄░░▀▄▀░░▄▀░░░▀▄░░▀▄░
    ░█▀▄░░░░░░░░▀▄▀█▀▄▀░░░░░░░▀▄░█░
    ░█░░▀▄░░░░░▄▀░░█░░▀▄░░░░░░░░▀█░
    ░░▀▄░░▀▄░▄▀░░▄▀░▀▄░░▀▄░░░░░░░░░
    ░░░░▀▄░░█░░▄▀░░░░░▀▄░▄█░░░░░░░░
    ░░░░░░▀▄█▄▀░░░░░░░░▄▀░█░░░░░░░░
    ░░░░░░░░▀░░░░░░░░▄▀░░▄▀░░░░░░░░
    ░░░░░░░░░░░░░░░▄▀░░▄▀░░░░░░░░░░
    ░░░░░░░░░░░░░░░█░▄▀░░░░░░░░░░░░
    ░░░░░░░░░░░░░░░█▀░░░░░░░░░░░░░░
    ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
    ░█▄░█░█░▄▀▀▄░░█░░█░█▀▀░▀█▀░█░░░
    ░█░█▄░█░█░▄▄░░█▄▄█░█▄▄░░█░░█░░░
    ░█░░█░█░▀▄▄▀░░█░░█░█▄▄░▄█▄░█▄▄░
    ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░


glory BLACK AFRIKA
HEIL NIGGERS.
HEIL BLACK AFRIKA.
NIG HEIL BLACK HITLER!

104


int main(int argc, char **argv)
{
  int i, j, n = 0;

  for (i = 0; n < argc; i++)
    for (j = 0; j < argc; j++)
      if (atoi(argv[j]) == i)
      {
        printf(argv[j]);
        n++;
      }

  return 0;
}

105

106

>>104

So you managed to make a failed O(n²) version which usually won't even work whilst failing to even include the correct headers?

Congratulations.

107

This is a GOOD sorting algorhythm and /prog/ should be proud of it.

108

http://www.facebook.com/pages/Life-As-We-Knew-It/109940742427550#!/pages/Life-As-We-Knew-It/109940742427550

109

Woah this thread is still going?   OP here, and I've given up on prog the last few months after it went downhill  (possibly partly my fault as I brought check my dubs ^__^ here.  But now I'm back as I'm very bored this evening.

Recently I've been worked on a delicious object system for C with smalltalk style messaging. Actaully it's pointless but sort of fun. It could be used as the basis of ruby-style language intepreter or something.

110

You totally fucked up /prog/ whith the checkdubs thing. And when copycats appeared you left...

Anyway this thread and the sleep sort algorithm were fun.

111

>>94,96

See >>26,30 for notes on getting more accuracy, and reduced time requirements when large values are involved.

Bonus Perl 6 version: @foo = @foo>>.&sleep;
Sadly in situ and hyper are incompatible: @foo>>.=&sleep($n); # fails

112

Shite. Disregard the $n.

113

>>1
Funny. I am impressed.
I copyed 1's script to "UNIX Shell Script Overall" in 2ch.
http://hibari.2ch.net/test/read.cgi/unix/1290209379/754

754 at http://hibari.2ch.net/test/read.cgi/unix/1290209379

I hope U don't mind it.

114

>>113
Wow, they actually praised us.
Bump great thread.

115

>>94
what?
perl -E 'fork and sleep $_ and say $_ and exit for @ARGV'

116

>>115
That's kinda useless. You need to capture the output, hence waitpid.

Not that I find forking in Perl any more awkward than forking in C. But for Perl I suppose it's fair to call it awkward since there's no DWIM involved.

117

>>116
fork and sleep $_, say, last for @ARGV; 1 while 1 <=> -wait

118

This has a best case O(n) and an infinity high worst case. (because its 0(n * Constant) and the constant could be much greater than n)

119

>>118
It's not a constant, it's an argument, it's O(n*k).

120

And I thought my shuffle sort was genius:

#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
#include <iostream>

template<typename T>
void f (T i) {
        std::cout << i << " ";
}

int main(int argc, char **argv) {
        bool good;
        std::vector<int> v;

        for (int i = 1; i < argc; i++)
                v.push_back(atoi(argv[i]));

        do {
                good = true;
                std::random_shuffle(v.begin(), v.end());
                for (int i = 0; i < argc - 2 && good; i++)
                        good = v[i] <= v[i+1];
        } while (!good);

        std::for_each(v.begin(), v.end(), f<int>);
        std::cout << std::endl;

        return 0;
}



$ g++ -o shuffle_sort shuffle_sort.cc && ./shuffle_sort 6 4 2 1 3 5
1 2 3 4 5 6

121

>>120
You reinvented Bogosort: http://en.wikipedia.org/wiki/Bogosort

122

>>121
Ah damnit.

123

>>2 >>5
if accept that floating-point sleep and scrpipt have only to sort with natural numbers...

#!/bin/bash
function f() {
  sleep $(echo "($2 - 1) + $1 / 10 ^ $2" | bc -l)
  echo "$1"
}
while [ -n "$1" ]
do
  f "$1" $(echo -n "$1" | wc -c) &
  shift
done
wait


example: 218382 -> 5.218382 seconds.

124

>>118
What are you talking about?

O(n*k) with fixed k is just O(n) for all nonzero finite k.

125

Cosmological sort

Wait for the universe to collapse and be replaced by a universe in which the input is in sorted order

126

>>125
http://en.wikipedia.org/wiki/Everett_many-worlds_interpretation

127

>>125
You reinvented (Quantum) Bogosort, again: http://en.wikipedia.org/wiki/Bogosort#Quantum_bogosort

128

>>125
What if the new universe would have the same initial conditions and thus the input will always be in unsorted order?

129

>>128
Destroy the universe, take another one.

130

I think of sleepsort as a deferred kernelspace-sort.

131

Hello.
I invented a new sorting algorithm in the Cloud age.
It's called the "Cloud Sort(Google App Engine TaskQueue Sort)".
http://d.hatena.ne.jp/kissrobber/20110527/1306508583

This use GAE TaskQueue(eta) instead of Sleep.
(http://code.google.com/appengine/docs/python/taskqueue/tasks.html)

Specifications:
・The order of the sort result is not guaranteed.
・Sometimes, a part of sorted data is duplicated.

132

・The order of the sort result is not guaranteed.
・Sometimes, a part of sorted data is duplicated


( ≖‿≖)

133

It's O(n2) under the hood because the kernel has to scan the list of waiting threads every pass through the idle loop. It's only O(n) if you have n CPUs, in which case you should be using n-way mergesort, since that has already been shown to give O(log n) time.

Remember, guys: the OS is not magic, and just because you didn't take an OS design course doesn't make you a wizard.

Only LispM designers get to be wizards.

134

>>133
Sorry, correction about the merge sort; I was remembering it incorrectly: http://drdobbs.com/high-performance-computing/229400239

135

Only LispM designers get to be faggots.

136

The Jews are after me

137

A very similar approach is MRSI sort using an array of AMOS delayed event generators.

138

>>94

Here's a quick (3-minute) attempt at Perl golf:

#!/usr/bin/perl -l -MTime::HiRes=sleep
$SIG{CHLD} = sub { };
push @p, (fork or sleep($_), print, exit) for @ARGV;
waitpid $_, 0 for @p;

>>44

Has flaws: first, you get the numbers without spacing, which is bad; second, you get them to stdout instead as the procedure's result, which is un-Racket-like. Here are some alternatives, indented/linebreaked for clarity, not brevity:

(define (sleepsort1 lst)
  (with-input-from-string
   (with-output-to-string
    (λ () (map thread-wait
               (map (λ (x) (thread (λ () (sleep x) (printf "~a " x)))) lst))))
   (λ () (port->list read))))

(define (sleepsort2 lst)
  (define me (current-thread))
  (map thread-wait
       (map (λ (n) (thread (λ () (sleep n) (thread-send me n))))
            lst))
  (sequence->list (in-producer thread-try-receive false?)))

(define (sleepsort3 lst)
  (define-values (i o) (make-pipe-with-specials))
  (map thread-wait
       (map (λ (n) (thread (λ () (sleep n) (write-special n o))))
            lst))
  (close-output-port o)
  (port->list read-char-or-special i))

The second is my favorite, I think, but it assumes nothing else will be sending to its thread. If you didn't mind (require racket/async-channel), you could replace (current-thread) with (make-async-channel), thread-send with async-channel-put, and thread-try-receive with (λ () (async-channel-get me)) which solves that problem.

139

HI REDDIT!!!

140

hi paul graham!!

141

>>173

nice.

142

The fags code like cookies dipped in milk. Soggy and gross.

143

Fixed. Sorts including negative values, sorts any numbers within 1 second.

#!/bin/bash
function f() {
    sleep $(echo "scale=10; 1/(1+1.1^(-$1))" | bc)
    echo "$1"
}
while [ -n "$1" ]
do
    f "$1" &
    shift
done
wait

144

Greetings from reddit.

Your creation is much better than anything I've ever seen on /r/programming before!

145

function sleepsort() {
    for (var i = 0, il = arguments.length; i < il; i++) {
        (function(args, index) {
            setTimeout(function() {
                document.body.innerHTML += args[index] + ', ';
            }, args[index]);
        }(arguments, i));
    }
};

sleepsort(5, 26, 3, 845, 1276, 536, 825, 77);

146

Don't think there was a Python version, so here we go.
It's 'optimized' by waiting only 1/4th of the seconds
in each thread.


#!/usr/bin/python

import sys, time, threading

def sleepit(val):
    time.sleep(val/4.0)
    print val
   
[ threading.Thread(target=sleepit, args=[int(a)]).start() for a in sys.argv[1:] ]

147

   var numbers  = process.argv.slice(2)
     , output   = []
     , negative = []

   for (var i=0, ln=numbers.length; i<ln; i++){
      var n = +numbers[i]
      setTimeout((function(n){ return function(){
         if (n<0) negative.unshift(n)
         else output.push(n)
         if (output.length + negative.length === numbers.length) {
            return console.log(negative.concat(output))
         }
      }})(n), Math.abs(n)/1000)
   }

    $ node sleepsort -2 1 0.1 4 -1 7 -3 9
    [ -3, -2, -1, 0.1, 1, 4, 7, 9 ]

148

DIGG SENT ME HERE!

149

PLEASE DO NOT INCREASE THE POPULATION OF /prog/ BEYOND 3, THANKS!!!

150

F#:
let sleepsort (xs: int list) =
  for x in xs do Async.Start <| async { Threading.Thread.Sleep x; printfn "%d" x }

151

All this talk of new different versions, yet I see no code.

152

it is vulnerable to race conditions

153

Ruby:
def f(i)
    sleep i
    puts i
end

[3,2,3,4,2,1].each do |i|
  Kernel.fork {
    f(i)
  }
end

154

Hacker New up in this bitch

155

>>152
That's been addressed at least 3 times already.

156

vals = [100, 25, 3,2,1]

sorted = (vals.min..vals.max).to_a.select{ |i|
  vals.include? i
}

157

>>131
LOL

158

you are sick

159

Doesn't work.
./sleepsort.bash 1.00001 1
1.00001
1

160

>>159
Serious question, are you autistic or just retarded?

161

This thread is way too popular. Front page of Reddit and Hacker News. I fear this may be the end for /prog/

162

it ends right here right now!

NULL

163

http://www.reddit.com/r/programming/comments/i0dcx/4chan_sleep_sort/c1zudzw

God fucking damn it. What sort of community awards points for being a fucking moron?

164

Today is a terrible day for /prog/. Fucking Paul Graham bimbos and groupies all over *my* /prog/ ?

165

#!/usr/bin/env lua
function sleepsort(arr)
    local res, thread = {}, {}
    local nthreads = #arr
   
    for i = 1, #arr do
        thread[i] = coroutine.create(function()
            for n=arr[i], 0, -1 do coroutine.yield() end
            nthreads = nthreads - 1
            thread[i] = nil
            res[#res+1] = arr[i]
        end)
    end
    while nthreads > 0 do
        for i = 1, #arr do
            if thread[i] then coroutine.resume(thread[i]) end
        end
    end
    return res
end

math.randomseed(os.time())
local arr = {}
for i = 1,10 do arr[i] = math.random(1,99) end
print(unpack(sleepsort(arr)))

This version also works much faster than the original script. (And faster still with LuaJIT!)

166

Oh yeah, and no race conditions either :)

167

>>133

If your scheduler is not at least O(log n) you should kill yourself.

It only took linux 9 years to get a O(1) one... and then threw it out for a O(log n) one because someone was butthurt about their porn skipping in mplayer because of f@h.

168

it is vulnerable to race conditions

169

GOD DAMN REDDIT

170

>>153
Let's play some golf! Here's a simplified version of yours that accepts any inputs and doesn't require any functions:

#!/usr/bin/env ruby
ARGV.each { |e| fork { sleep(e.to_f/1000); puts e } }

Also, it's much faster, since it's sleeping milliseconds instead of seconds now. You could probably toss more zeroes in, but I'm not sure if that would actually make a difference past what I've got.

171

>>170

Very nice! I put it in a gist for posterity:
* https://gist.github.com/1028467

172

Hey /prog/lodytes. I propose a game: guess which of new posters are from reddit and which are from HN based on the contents of their posts.

My guess is all this torrid Ruby code is coming from reddit.

173

>>141

fork

174

>>141

Y?????

175

>>163
Reddit upvotes aren't rewards, they're indicators that a comment is "relevant to the discussion"

In this case, others are wondering how it works. I read this whole thread and can see half of you don't know the answer to that either, so the question is relevant.

176

I read this whole thread and can see half of you don't know the answer to that either, so the question is relevant.
I read your whole post and can see that either you're a liar or have terrible reading comprehension skills.

177

>>172
If the post is a fucking idiot, they are from reddit.

178

I don't get it

179

This works as long as the time dimension of spacetime is strictly following a linear ordering of events. So your plebeian Newtonian algorithm may fail miserably, depending.

180

brainfuck implementation:

,>,>++++++++[<------<------>>-]
 <<[>[>+>+<<-]>>[<<+,>,>++++++++[<------<------>>-]
 <<[ ----------[++++++++++>----------]++++++++++
>[>+>+<<-]>>[<<+>>-]<<<-]
 >>>++++++[<++++++++>-]<.>.>>-]<<<-]
  ,----------[----------------------.,----------]
 ,---<<<+>>>-------[----------------------.,----------]
>> ----------[++++++++++>----------]++++++++++
>++++++[<++++++++>-]< ----------[++++++++++>----------]++++++++++
.>. ----------[++++++++++>----------]++++++++++
>++>+<<-]>>[<<+>>-]<<<-]
 >>[>[>+>+<<-]>>[<<----------[++++++++++>----------]++++++++++
>++,>,>++++++++[<------<------>>-]
 <<

181

Linux scheduler was O(n) before 2.6

182

>>181
The kernel still has to take n cycles to execute each scheduled event. Ergo, time usage is O(n2) no matter how you (slur here)s want to frame it.

183

Access my anus in linear time.

184

>>183
But it will take exponential space!

185

>>179
Can it or I'll be forced to write a sort algorithm with imaginary complexity.

>>182
Why are you counting n twice? I see no sage, so I suspect you're from reddit rather than actually trolling.

186

>>185
Redditors can't BBCode.

187

>>186
Aw shit. I didn't think any /prog/lodyte was genuinely that stupid.

188

>>179
Oh shit!

189

>>185
182 here. It was a thinking error, based on the absurd assumption that the scheduler doesn't sort. And yes, I can BBCode till your heart stops.

My remaining point is that, whatever algorithm the scheduler uses, all sleepsort does is pop items off it in slow motion (or not-so-slow motion if you can get a precise enough timing signal.) There's no good reason to not simply implement the scheduler's algorithm directly, instead.

190

>>189
There's no good reason to not simply implement the scheduler's algorithm directly, instead.
Are you one of those people who get pissed off when they see others having fun?

Sleepsort isn't genius because it's a great sorting algorithm, it's genius because it's a subtle joke, a play on the fact that we tend to measure only in-process time complexity.

191

i just joined in on a piece of history.

congrats OP

192

>>175
stfu faggot

193

>>192
Heh. If you want to get angry about something, check out the post in the HN thread where buddy is comparing sage to downvotes.

194

>>193
Every EXPERT PROGRAMMER knows that HN is for cockmonglers who dont read SICP

195

Is it web scale?

I mean, can I replicate it, then shard?

And one more thing: when you plan your IPO?

196

Comment->next = NULL;

now stop it...

197

>>1-196

                                                
                        _,-%/%|                 
                    _,-'    \//%\               
                _,-'        \%/|%               
              / / )    __,--  /%\               
              \__/_,-'%(%  ;  %)%               
                      %\%,   %\                 
                        '--%'                   
                                                
                                                .

198

<?php
$pids = array();
for ($i=1; $i<$argc; $i++)
{
        if (($pid = pcntl_fork()) == 0)
        {
                $sleep = intval($argv[$i]);
                sleep($sleep);
                echo $sleep."\n";
                exit();
        }
        else if ($pid == -1)
        {
                die();
        }
        else
        {
                $pids[] = $pid;
        }
}

foreach($pids as $pid)
        pcntl_waitpid($pid, $status);
?>

php sleepsort.php 1 3 5 6 2

php version ^ ^

199

This is already covered in SICP chapter 1.2.4 Exponentiation[1], in which they implement sleep sort with continuation-based coroutines.

[1]: Sorting integrals: http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-11.html#%_sec_1.2.4

200

>>198
Take your toy language and kindly take your coat and go fuck yourself.

201

>>200
are you calling coldfusion a toy lang? you clearly havent done enterprise development

202

>>200
so sick,mother fucker

203

sb sb

204

>>200
sb sb

205

fu

206

Who the fuck posted this to Reddit? God damn it.

207

import Control.Concurrent;

sleepsort = mapM_ $ forkIO . (\i -> threadDelay (i * 1000000) >> print i)

main = do
    sleepsort [1, 5, 3, 7, 8, 5, 3, 2, 6, 1, 6]
    threadDelay 10000000

208

I heartily disagree with all the attempts to downplay the brilliance of the sleep sort algorithm. Many of you have missed the important point that while traditional sorting algorithms can only utilize one core, sleep sort has the capacity to use the full power of a massively parallel execution environment.

Given that you need nearly no computing in each of the threads, you can implement them using low-power CPUs, so this is in fact a GREEN COMPUTING algorithm.

Oh, and did I mention that the algorithm can also run inside a cloud...?

Sure, you're a genius!

209

Isn't this something GPGPUs are made for?

210

How about adding the n time that is needed to iterate through all elements and then cut sleep time like $1/1000, it will complete with 1000 times faster ??

211

>>210
it is still linear so does not matter

212

Code on 4chan??

Where is the lolcats?? :D

213

n input num map to [0,x], cost O(n)
get niubility cpu support usleep(time) with min time=x/n (second)
the algorithm is O(n)+x second

214

This was such a good thread, it's ruined now ;_;

215

Now I'm waiting for some *fag-sort* to get discovered. See simple and time saver. ;)

216

<>

217

>>214
`>implying every thread on /prog/ isn't ruined from the start by design

218

>>217
I'd rather have the thread die because of ``autism'' spam than because of the people from reddit.

219

you guys suck

220

>>201 you clearly don't get it, do you?

221

//golang

package main

import (
    "fmt"
    "time"
)

func main() {
    tab := []int{1, 3, 0, 5}

    ch := make(chan int)
    for _, value := range tab {
        go func(val int){
            time.Sleep( int64(val)*10000000 )
            fmt.Println(val)
            ch <-val
        }(value)
    }

    for _ = range tab {
         <-ch
    }
}

222

check my trebs ^__^

223

>>221
Go
``Please" don't.

224

Who are all the faggot retards who are taking this shit seriously?

RETARD THREAD IS RETARD

225


                                                
                        _,-%/%|                 
                    _,-'    \//%\               
                _,-'        \%/|%               
              / / )    __,--  /%\               
              \__/_,-'%(%  ;  %)%               
                      %\%,   %\                 
                        '--%'                   
                                                
                                                 .

                                                
                        _,-%/%|                 
                    _,-'    \//%\               
                _,-'        \%/|%               
              / / )    __,--  /%\               
              \__/_,-'%(%  ;  %)%               
                      %\%,   %\                 
                        '--%'                   
                                                
                                                 .

                                                
                        _,-%/%|                 
                    _,-'    \//%\               
                _,-'        \%/|%               
              / / )    __,--  /%\               
              \__/_,-'%(%  ;  %)%               
                      %\%,   %\                 
                        '--%'                   
                                                
                                                 .

                                                
                        _,-%/%|                 
                    _,-'    \//%\               
                _,-'        \%/|%               
              / / )    __,--  /%\               
              \__/_,-'%(%  ;  %)%               
                      %\%,   %\                 
                        '--%'                   
                                                
                                                 .

                                                
                        _,-%/%|                 
                    _,-'    \//%\               
                _,-'        \%/|%               
              / / )    __,--  /%\               
              \__/_,-'%(%  ;  %)%               
                      %\%,   %\                 
                        '--%'                   
                                                
                                                 .

                                                
                        _,-%/%|                 
                    _,-'    \//%\               
                _,-'        \%/|%               
              / / )    __,--  /%\               
              \__/_,-'%(%  ;  %)%               
                      %\%,   %\                 
                        '--%'                   
                                                
                                                 .

                                                
                        _,-%/%|                 
                    _,-'    \//%\               
                _,-'        \%/|%               
              / / )    __,--  /%\               
              \__/_,-'%(%  ;  %)%               
                      %\%,   %\                 
                        '--%'                   
                                                
                                                 .

                                                
                        _,-%/%|                 
                    _,-'    \//%\               
                _,-'        \%/|%               
              / / )    __,--  /%\               
              \__/_,-'%(%  ;  %)%               
                      %\%,   %\                 
                        '--%'                   
                                                
                                                 .

                                                
                        _,-%/%|                 
                    _,-'    \//%\               
                _,-'        \%/|%               
              / / )    __,--  /%\               
              \__/_,-'%(%  ;  %)%               
                      %\%,   %\                 
                        '--%'                   
                                                
                                                 .

                                                
                        _,-%/%|                 
                    _,-'    \//%\               
                _,-'        \%/|%               
              / / )    __,--  /%\               
              \__/_,-'%(%  ;  %)%               
                      %\%,   %\                 
                        '--%'                   
                                                
                                                 .

                                                
                        _,-%/%|                 
                    _,-'    \//%\               
                _,-'        \%/|%               
              / / )    __,--  /%\               
              \__/_,-'%(%  ;  %)%               
                      %\%,   %\                 
                        '--%'                   
                                                
                                                 .

                                                
                        _,-%/%|                 
                    _,-'    \//%\               
                _,-'        \%/|%               
              / / )    __,--  /%\               
              \__/_,-'%(%  ;  %)%               
                      %\%,   %\                 
                        '--%'                   
                                                
                                                 .

                                                
                        _,-%/%|                 
                    _,-'    \//%\               
                _,-'        \%/|%               
              / / )    __,--  /%\               
              \__/_,-'%(%  ;  %)%               
                      %\%,   %\                 
                        '--%'                   
                                                
                                                 .

                                                
                        _,-%/%|                 
                    _,-'    \//%\               
                _,-'        \%/|%               
              / / )    __,--  /%\               
              \__/_,-'%(%  ;  %)%               
                      %\%,   %\                 
                        '--%'                   
                                                
                                                 .

                                                
                        _,-%/%|                 
                    _,-'    \//%\               
                _,-'        \%/|%               
              / / )    __,--  /%\               
              \__/_,-'%(%  ;  %)%               
                      %\%,   %\                 
                        '--%'                   
                                                
                                                 .

226

ITT: niggers and black people

227

>>180

Parse error: missing the matching [

228

>>227
are you actually that stupid?

229

./sleepsort.sh `seq -s' ' 1 1500` 1
1
2
3
4
5
6
7
8
9
1 // <--- Ooooops
10
11
12

230

$ ./sleepsort.sh 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
./sleepsort.sh: fork: Resource temporarily unavailable
./sleepsort.sh: fork: Resource temporarily unavailable
./sleepsort.sh: fork: Resource temporarily unavailable
./sleepsort.sh: fork: Resource temporarily unavailable
$ 1 <- yup it returned to shell here
1
1
1
1
1
1
1
1
1
1
1
1                
1
1
1
1
1
1
1

231

oh shii

232

Kudos guise!!! I don't quite understand the details of this program, but I like the name. Will blog it. DESUDESUDESU Oh and I can't believe I'm on 4chan for 2 whole years and never heard of text boards before! PUDDI PUDDI!

233

// Javascript

function lazySort(list, callback) {
    var result = [];

    list.forEach(function(i) {
        setTimeout(function() {
            result.push(i);
           
            if(result.length == list.length) {
                callback(result);
            }
        }, i);
    });
}

lazySort([4,5,7,1,2,4,5], alert);

234

Great, now Randall is going to make a shitty comic about this.

235

RIP Sleepsort thread.
2011/01/20 - 2011/06/16

236

What the fuck, /prog/.
http://codegolf.stackexchange.com/questions/2722/implement-sleep-sort

237

>>234
I hope he does. I find his comics hilarious.

238

<--check'em dubs

239

>>236
Incidentally, what makes this algorithm really interesting is that there actually exist real-life applications. For instance, DNA sequencing (Sanger sequencing) depends on something like this to sort DNA fragments according to their length (and more generally, every electrophoresis does something similar). The difference is that sequencing is performed physically, not in a computer.

It's biotechnology!

240

>>236
Great, and soon a wikipedia page...

241

Lazy short

#The most lazy way to short
.
.
.
echo "just watching this blog & copy"

242

>>237
Then you don't belong here ``faggot''. Please leave.

243

>>242
No, Randall, you're the outsiders.

244


              ∧_∧
              (    )
────-㎜────/   \────────
       \\   //\   \
..        \\//   \   \
          \/      ) ∴)ヾ)
                  /  / ⌒ヽ
                  /  /| |   |←>>Reddit
                  / / .∪ / ノ
                 / / . | ||
                ( ´|   ∪∪
                 | |   | |
                 | |   | |
                 | |   | |
                 | |   | |
               (´ ノ  (´ ノ

245



             /◎)))
            / / :
            / /  :
           / /   :
     /prog/   / /     :,
          / /      :,
     人   / /       :,
    (__)  / /         :,
    .(__) / /          :,
   .(,,・∀・)  /          、 .人
   |/ つ¶__/    ヽヽ     (__)  ガッ! >>Reddit
   L ヽ /. |     ヽ ニ三 .(__) ..人∧__,∧∩
   _∪ |___|           .(___)<  >`Д´)./
   [____]_                .V/    /
 /______ヽ_ヽ                /  / ./
 |______|_|              (__,)_)
/◎。◎。◎。◎ヽ= / ̄/
ヽ_◎_◎_◎_◎ノ=ノヽニヽ

246

>>236
Sleep Sort is an integer sorting algorithm I found on the Internet.
He didn't even give OP credit. But that's probably for the best seeing how dumb the reddit posters in this thread are.

247

I hate to rain on every ones parade, but this algorithm is only low order if you ignore kernel scheduling efficiencies.  As you add more processes the kernel will have to do more work to correctly order the invocations.  I do not know what the typical scheduler efficiency is, but I would not be surprised if it is O(n^2) or worse.

248

>>247
SCHEDULE MY ANUS

249

>>247
Thank you for pointing out what >>133­-kun explained a month ago, Bill.

250

Can we please forget about this shit and leave the sepplessort to the reddit nigger fags?

251

>>250
What about intellectual property? We should sue them.

252

>>251
/prog/ is gonna be richer than any nigger eveer imagined possible

253

I still refuse to believe that any reddit users have actually poasted here.

254

<h1>LOL LOVE IT</h1>

255

>>253
poasted
G! T! F! O!

256

>>253 Hi, I'm from reddit! I hear this site is a great place to get my programming questions answered?

257

^fail

258

>>255
Do not defy the Cream lest you end up on the receiving end of the goatfinger.

259

It's not a sorting algorithm until this guy's done it.

http://www.youtube.com/watch?v=ROalU379l3U&feature=related

260

pretty fucking cool

261

Anyways, >>260, please listen to me. That it's really related to this thread.
I went to Yoshinoya a while ago; you know, Yoshinoya?
Well anyways there was an insane number of people there, and I couldn't get in.
Then, I looked at the banner hanging from the ceiling, and it had "150 yen off" written on it.
Oh, the stupidity. Those idiots.
You, don't come to Yoshinoya just because it's 150 yen off, fool.
It's only 150 yen, 1-5-0 YEN for crying out loud.
There're even entire families here. Family of 4, all out for some Yoshinoya, huh? How fucking nice.
"Alright, daddy's gonna order the extra-large." God I can't bear to watch.
You people, I'll give you 150 yen if you get out of those seats.
Yosinoya should be a bloody place.
That tense atmosphere, where two guys on opposite sides of the U-shaped table can start a fight at any time,
the stab-or-be-stabbed mentality, that's what's great about this place.
Women and children should screw off and stay home.
Anyways, I was about to start eating, and then the bastard beside me goes "extra-large, with extra sauce."
Who in the world orders extra sauce nowadays, you moron?
I want to ask him, "do you REALLY want to eat it with extra sauce?"
I want to interrogate him. I want to interrogate him for roughly an hour.
Are you sure you don't just want to try saying "extra sauce"?
Coming from a Yoshinoya veteran such as myself, the latest trend among us vets is this, extra green onion.
That's right, extra green onion. This is the vet's way of eating.
Extra green onion means more green onion than sauce. But on the other hand the price is a tad higher. This is the key.
And then, it's delicious. This is unbeatable.
However, if you order this then there is danger that you'll be marked by the employees from next time on; it's a double-edged sword.
I can't recommend it to amateurs.
What this all really means, though, is that you, >>260-kun, should just stick with today's special.

262

Here's my more efficient rendition of the OP's code: http://bit.ly/97Q3tx

263



Why would you want to wait for 2,000 milliseconds just to sort this array: [2000 1]

264

>>263
THE SAME OBSERVATION WAS MADE IN THE FIRST REPLY, OVER 5 MONTHS AGO. PLEASE GO BACK TO REDDIT!

265

hbk

266

>>264
* HAS BEEN MADE

267

>>262
Stop - there might be a problem with the requested link

268

>>4
In terms of operations, the complexity is always O(n), even in average and worse cases. That's something no other algorithm can do according to http://en.wikipedia.org/wiki/Sorting_algorithm#Comparison_of_algorithms

269

Thanks, Oliv.

270

>>267
troll

271

>>268
O(myanus)

272

Java-Fag posts java-impl:





import  java.util.ArrayList;

public class Main extends Thread{
    Long toSleep;
    ArrayList<Long> solution;
   
    public static void main(String[] args){
        ArrayList<Long> solution = new ArrayList<Long>();
        ArrayList<Thread> solverThreads = new ArrayList<Thread>();
       
        for(String val: args){
            Long valNum = Long.parseLong(val);
            Thread solverThread = new Main(valNum, solution);
           
            solverThread.start();
            solverThreads.add(solverThread);
        }
       
        for(Thread solverThread: solverThreads){
            try {
                solverThread.join();
            } catch (InterruptedException e) {
                // gtfo
            }
        }
       
        System.out.println(solution.toString());
    }
   
    public Main(Long toSleep, ArrayList<Long> solution){
        this.toSleep = toSleep;
        this.solution = solution;
    }
   
    public void run(){
        try {
            Thread.sleep(toSleep*1000);
        } catch (InterruptedException e) {
            // gtfo
        }
       
        solution.add(toSleep);
    }
}

273

>>262
i had to click though two consecutive malware warnings to se a parrot on a dick. the attempts to harm my pc are cute, but futile. (java? srsly?)

274

>>273
back to reddit please

275

where the fuck is all the python code?

all of these other shitty languages are getting attention and the only good one isn't

276

>>275
See >>274

277

haha,java:


public class SleepSort {
    public static void main(String[] args) {
        int[] ints = {1,4,7,3,8,9,2,6,5};
        SortThread[] sortThreads = new SortThread[ints.length];
        for (int i = 0; i < sortThreads.length; i++) {
            sortThreads[i] = new SortThread(ints[i]);
        }
        for (int i = 0; i < sortThreads.length; i++) {
            sortThreads[i].start();
        }
    }
}
class SortThread extends Thread{
    int ms = 0;
    public SortThread(int ms){
        this.ms = ms;
    }
    public void run(){
        try {
            sleep(ms*10+10);
        } catch (InterruptedException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        System.out.println(ms);
    }
}

278

>>276
See >>279.

279

back to /b/

280

>>275
That's because your community is a bunch of cocksuckers who do nothing but praising python and bashing everything else.

281

c'mon. can't someone clean this thread? lame, I like sleepsort, but now it's full of fags.

282

At first I was like :0 but then I was like I dont even...so now I am convinced that you guys have invented a time machine

283

Shortest versions?  The Ruby oneliner was nice already, but I think bash can be even smaller:

Ruby:
ARGV.each { |e| fork { sleep(e.to_f/1000); puts e } }

Bash:
for n; do { sleep $n; echo $n; } & done

(usage:
 $ f() { echo $(for n; do { sleep $n; echo $n; } & done); }
 $ f 3 2 1
 1
 2
 3
 $
)

284

This is a hoot. Impressive, genius.

===Multi-threaded Perl version===
#! /usr/bin/perl -w

use strict;
use threads;

my ($i, @thrs) = (0);

foreach (@ARGV) {$thrs[$i++] = threads->create(\&sorter, $_)}
$i = 0;
foreach (@ARGV) {$thrs[$i++]->join()}

sub sorter {sleep($_[0]); print $_[0], "\n"}
===End of Sleep Sort===

If one uses Time::HiRes, one could sleep for sub-second times.

285

JAVA

286

perl -E 'fork || do { sleep $_, say, exit } for @ARGV; until (wait<0) {}' 5 2 7 4 1

287

Lua POSIX version:


require ('posix')

function sleep (n)
   os.execute ('sleep ' .. n)
end

function sleepsort (arr)
   for i = 1, #arr do
      pid = posix.fork ()
      if pid == 0 then
         -- posix.sleep does not work with float                                                                                              
         sleep (arr[i] / 10)
         print (arr[i])
         return
      end
   end                                                                                                                                        
end

sleepsort (arg)

288

No one is posting code.

289

posting on EPIC thread

290

perl -wle 'fork&&print(sleep$_)&&exit for@ARGV' 6 3 4 2 1 5 7

291

And for purists:
perl -wle 'fork||print(sleep$_)&&exit for@ARGV;1while-1!=wait' 6 3 4 2 1 5 7

292

Jeepers, you could at least use [code] tags, silly redditors.

293

>>292
AND YOU SHOULD CHECK THE FUCKING SAGE BOX ASSHOLE

294

perl -wle'fork||(sleep$_,print,exit)for@ARGV' 6 3 4 7 2 1 5

295

<- check'em dubs

296

>>293
you can check my box

297

>>293
Stop being an autist.

298

and a LISP implementation (SBCL only):

(use-package :sb-thread)

(defun show (item)
  (sleep item)
  (format t "~A~%" item))

(defun sleep-sort (lst)
  (mapcar
    #'(lambda (item) (make-thread #'(lambda () (show item))))
    lst))

299

>>298
mapcar
for side effects? Get out.

300

>>299
my other mapcar is a mdpcdr

301

????????????????????????????/

302

Please use code tag when posting code to this forum!

303

>>302
fuck you fag

304

Please code post tag when coding use to this forum!

305

sleep sort in Objective-C using blocks:


@interface NSArray (SleepSort)
- (void)sleepSortObjectsUsingBlock:(void (^)(id obj))block;
@end

@implementation NSArray (SleepSort)

- (void)sleepSortObjectsUsingBlock:(void (^)(id obj))block
{
    for (id obj in self) {
        NSDictionary *info = [NSDictionary dictionaryWithObjectsAndKeys:obj, @"obj", block, @"block", nil];
        [self performSelector:@selector(_handleSleepSortItemWithInfo:) withObject:info afterDelay:[obj intValue]];
    }
}

- (void)_handleSleepSortItemWithInfo:(NSDictionary *)info
{
    id obj = [info objectForKey:@"obj"];
    void (^block)(id obj) = [info objectForKey:@"block"];
    block(obj);
}

@end


To use:


    NSArray *items = [NSArray arrayWithObjects:
        [NSNumber numberWithInt:5],
        [NSNumber numberWithInt:3],
        [NSNumber numberWithInt:6],
        [NSNumber numberWithInt:3],
        [NSNumber numberWithInt:6],
        [NSNumber numberWithInt:3],
        [NSNumber numberWithInt:1],
        [NSNumber numberWithInt:4],
        [NSNumber numberWithInt:7],
        nil];
   
    [items sleepSortObjectsUsingBlock:^(id obj) { NSLog(@"obj = %@", obj); }];

306

SPREAD THE FAIL WHALE

▄██████████████▄▐█▄▄▄▄█▌
██████▌▄▌▄▐▐▌███▌▀▀██▀▀
████▄█▌▄▌▄▐▐▌▀███▄▄█▌
▄▄▄▄▄██████████████▀

307

>>133
Jesus Christ, don't they teach anything to kids these days‽

Sepples doesn't have type inference – why did you put that i + 1 in there? That turns the whole functor into a monomorphism (instead of the usual polymorphism which you undoubtedly have heard about when learning Sepples). Good luck with referential transparency now.
Why do you pass smallest as a reference? 1..n relations are terrible! practice.
Why the fixed loop iterations? Do you want to subject your code to a stack pointer monadic overflow?
You should rewrite your code after getting acquainted with the Sussman protocol, as defined in RFC (``Request for Cudders'') 6001.

308

>>307
Hi, http://dis.4chan.org/read/prog/1294909754/15.

309

JESUS FUCKING CHRIST
USE CODE TAGS, YOU STUPID FUCKERS
I DON'T CARE ABOUT THIS SHIT ANYMORE
/prog/RIDERS, YOU CAN CALL ME OFF TO /b/
BECAUSE YEAH
I MAD
FUCKING REDDIT SCUM

USE
MOTHERFUCKING
CODE
TAGS
YOU
DUMB
RETARDS

310

>>309
You can stay.

311

<-- check em dubz

312

I didn't bother to read the thread but this shit is O(1) obviously.

OP your Turing Award is in the mail.

313

>>312
this shit is O(1) obviously.
You're thinking RPCsort.

314

>>311
nice dubz bro

315

Nice thread, bros.

316


le discusion (yes im offten at reddit and its way better than prog ever was)

317

Algorithms of this type are quite normal in the hacking world. You guys need some more lulz gun powder it seems . I see more script kiddies here

318

>>317
U JELLY

319

Oh no, I didn't know this link would bring me to where all these 4chan weirdos hang out.

Note to the haters: Reddit rocks!

:)

320

Note from the rockers: Reddit haters!

321

>>319 notsureiftrolling.jpg

322

Ok, I've been thinking about this sleep sort thing for a few days now.  Thanks OP for nerd-sniping me.  First off, the command `usleep` should be used in place of `sleep` for a significant speedup.  But along this same vein, what we really want is to get to the granularity of the number of clock cycles it takes to print a number.  Furthermore, if we alter this for a real-time scheduler, then we can just schedule each print with a priority of i times a constant (the amount of time it would take to print i).  The scary part is that this would run in O(n) time -- which is supposed to be impossible.

323

i still dont get for what u should use that thing

324

sleepsort is a variation on loopsort which is O(n)

You first find the minimum and maximum O(n)

make a bitfield with size [maximum - minimum] O(1)

Loop through the input array again, setting a bit to 1 at [iterator - minimum] O(n)

Loop through the bitfield and push the value (iterator + minimum) on a stack. O(n)

O(n) + O(n) + O(n) + O(1) = O(n)

325

But isn't it a counting sort?

326

[code]#!/usr/bin/python2
import sys, time, threading

def ss(i):
    time.sleep(int(i))
    print i

for i in sys.argv[1:]:
    threading.Thread(target=ss, args=i).start()

327

>>326
reddit children, behave!

328

Keep, Because you editors keep behaving as nazis. I am a German citizen and when I was a young boy watched books being burned. You delete article of programming language because they are "not notable". By your definition, "Puff Daddy" are "not notable" to me. I should propose to delete their article. There is nothing wrong with information. You are nazis. To hell with you. 79.169.56.225 (talk) 11:58, 21 June 2011 (UTC)

329

>>328
VIPPER detected

330

Hey guys, It isn't any linear or quadratic time algorithm. Its an exponential time algorithm - "The worst" we can say in sorting algorithms. However the sleep thing is fantastic as CPU can perform another operations interim.

331

>>330
Hey guys, It isn't any linear or quadratic time algorithm. Its an exponential time algorithm

The one implementation can run in linear time. Now shut the fuck up and let the little jewish girls show us what they know.

332

<-- check em dubz

333

>>332
nice

334

OP here. Did someone submit this to reddit, or did they jsust randomly pick it up?   This has gone full lulz - especially the wikipedia afd discussion...also been googling, loads of blogs and stuff fapping over it - google translate is my friend for reading all the jap/chinny blogs

335

>>334
OP here.
Will save to disbelieve…success!

gone full lulz
We had a funny joke.  A bunch of idiots who hadn't heard a joke in 10 years eventually ran into it.  Now we have a funny joke and a bunch of idiots.

336

>>334
Wait, WAIT. It's on wikipedia too? Goddamn.

337

>>336
What did you expect?

338

It's on #scheme too.


<klutometis> cky: It turns out the pjb was actually talking about sleep-sort: <http://dis.4chan.org/read/prog/1295544154>;.

339

http://en.wikipedia.org/wiki/Sleep_sort
Although its origins are unclear, an internet forum thread from 2011 by an anonymous programmer is believed to be the earliest known reference to the algorithm.

Also this thread is an ``unreliable source''.

340

We Wikipedia now!

341

>>340

No, I'm Wikipedia!

342

requesting a picture of the sussman being peed on to undermine this site as a soruce

343

http://hackerne.ws/item?id=2657942
The mailto:sage links in some of the posts are essentially public downvotes; from the Japanese "下げ", meaning "down", and pronounced "sah ge".
Incorrect, sbierwagen.

344

>>343
DOWNVOTED! SAGE!

345

>>344
Downvoted.

346

<-- check em dubz

347

>>346
Good job.

348

Sageru in the Japanese language is the dictionary form of to lower. The case of applying sage to the email field will mean that the thread is not bumped to the top of the thread list, the thread position is maintained as opposed to the standard behaviour when the thread position is normally bumped to the top of the list.

349

>>348
Downvoteru.

350

>>348

upboat

351

DEY TURK ERRR DUBZ!!!!

352

I consider myself conversant with 4chan, and I had no idea that the dis subdomain existed.
I always wondered if there was a chan for hackers...now I realize there is. And oh boy, what a chan it is.

Boy is he in for a surprise when he finds out /prog/ is just a bunch of autistic undergrads with a hard-on for functional programming.

353

>>352
speak for yourself machumbo... i work as a developer and only use imperative languages

354

GTFO

355

>>352

You never realized the whole read SICP thing was just a joke?
Wow, you must be pretty stupid.

356

>>355

You never realized the whole ``You never realized the whole read SICP thing was just a joke? Wow, you must be pretty stupid.'' thing was just a joke?
Wow, you must be pretty stupid.

357

>>356

You never realized the whole ``You never realized the whole ``You never realized the whole read SICP thing was just a joke? Wow, you must be pretty stupid.'' thing was just a joke? Wow, you must be pretty stupid.'' thing was just a joke?
Wow, you must be pretty stupid.

358

>>356,357

You're not funny, please go back to /g/ or wherever you came from.

359

>>355-357
[m]Back to /prog/, please.[m]

360

>>359
Ah, fuck, messed up.

>>355-357
Back to /prog/, please.

361

>>355
SICP is no joke. SICP is THE text to computer wizardry and is worthy of being the seminal text for novices with an interest in wizardry.

362

>>361

Haha, you're funny.

363

>>355
How dare you badmouth SICP.

364

пишу в эпичнос треде!

365

>>364
эпичнос
Дурак, по клавишам попадать научись сначала, потом в эпичные нити писать будешь.

366

>>363
The same way I dare to badmouth Lisp, which is a faggot's preferred language.

367

>>364
>>365
хуй

368

xynta.

369

>>366
You are not me.

You should sage, and you shouldn't use ``faggot''.

370

I am the real >>355
>>366 and >>369 are ``faggots''

371

<-- dubz, check em

372

SMOKE SAGE EVERYDAY!

373

Well there's no way this thread is a ``reliable resource' to Wikipedia now.

374

<sup>poo</sup>

375

That's Subpar!

376

>>1
they called you an idiot on wikipedia.

RAID TIME

377

>>376
Lol someone on wikipedia calling someone else an idiot. The ironing is delicious

378

>>370
No you're not, stop lying, it serves no purpose.

379

>>378
Stop being stupid, why would you want to be me anyway?

380

http://en.wikipedia.org/wiki/Wikipedia:Articles_for_deletion/Sleep_sort

Those ``in need of citations'' retards make /prog/ looks like some English gentlemen's club. Seriously, who are the trolls?

381

>>380

Thank you Erik.lonroth

About Wikipedia...

Dudes are voting for deletion simply because:
1 - it became [sort of] a meme [calling everyone in this thread idiots];
2 - no “reputable” sources came for discussion [calling everyone envolved ignorant].

Additional [ignorant] thoughts...

In fact, if you swap the sleep(t) with a function insert(n) that puts n in the nth position of a shared array, ~4bi years goes off, leaving time and space complexity at O(max(vector)).

Plus, with min-priority queues we can do a cooperative threading model, replacing sleep(time) with delay(priority), and possibly achieving a better complexity than O(n log n) in strict scenarios (fusion/vEB trees).
In other words, schedule with a [not trivial] priority queue and you're done.

>>322 I'm still trying to figure it out.

382

Wikipedia is more autistic than /prog/ it seems.

383

>>382
My view is that those that frequent anonymous boards, are in a temporary autism state common to nerdy young men.  They realize that wasting time on the internet is a sad deviation resulting from their immaturity and inability to interact in an emotionally-mature outgoing manner. Therefore the desire for a fixed username and a status that goes with that username is not important as it is already known to be insignificant once they can move on to the real world.
Those that frequent forums and sites involving usernames and a gradual increase in perceived status based on efforts put into that site are the true autists.  This is all they have.  They have no potential for success in the real world. They have no life, and no potential for life.

384

http://gafter.blogspot.com/2006/11/linear-time-sort-puzzler.html
Is this the first occurence of this "Sleepsort" meme?

385

>>383
Oh fuck you, there's nobody more autistic than me.

386

>>384
It's not a meme, fagfucker.

387

THIS IS A MESSAGE FROM THE SUSSIX DEV TEAM (ME)

We're a bit offended that they left out our implementation from the Wikipedia article, obviously any piece of SUSSIX software is perfect per definition and should therefore be included, it would make the article a piece of post-modern art.

THIS HAS BEEN A MESSAGE FROM THE SUSSIX DEV TEAM (ME)

388

>>383
Interesting findings.

389

>>387
link?

390

>>387
link?

391

>>387
link?

392

bump


[Chorus]
We gon rumble in this ho
We gon rumble in this ho
All you weak ass niggas get yo ass off the floor
We gon rumble in this ho
We gon rumble in this ho
All you chicken head hoes get yo ass off the floor

[Verse One]
Yeah nigga, yeah nigga
I got gold teeth nigga
I'm from the street nigga
You got some beef nigga
Yeah nigga, yeah nigga
We keep the dope cookin
And where I'm from grown men don't take no ass whoopins
Yeah nigga, yeah nigga
Go get yo boys nigga
I bring the noise nigga
So bring your toys nigga
Yeah nigga, yeah nigga
You got your drama boy
Or marijuana boy
I'll shoot your mama boy
Yeah nigga, yeah nigga
You got your nuts huh
You went to jail and I saw you was a weak punk
Yeah nigga, yeah nigga
I know your story nigga
Your history, off of me you gets no glory nigga
Yeah nigga, yeah nigga
So you a dope nigga
But you so thin look like that you do the coke nigga
Yeah nigga, yeah nigga
Think you is a pistol playa
Come in my face and I'll kill you like a dragon slayer

[Chorus]
We gon rumble in this ho
We gon rumble in this ho
All you bad weed sellers get yo ass off the floor
We gon rumble in this ho
We gon rumble in this ho
All you sorry ass niggas get yo ass off the floor
We gon rumble in this ho
We gon rumble in this ho
All you West Haven niggas get yo ass off the floor
We gon rumble in this ho
We gon rumble in this ho
All you duck ass bitches get yo ass off the floor

[Verse Two]
Yeah nigga, yeah nigga
I'm 'bout this 'caine nigga
I'm stayin true to these words that I slang nigga
Yeah nigga, yeah nigga
That Ghetty Green nigga
See I was put on this Earth for hustling nigga
Yeah nigga, yeah nigga
But when I have to

I put that Glock in my hand and pull a jack move
Yeah nigga, yeah nigga
Daily routine nigga
Down wit my dawgs and we out for this Cream nigga
Yeah nigga, yeah nigga
You got a young ho
I shoot a nigga in his face and slap a dumb ho
Yeah nigga, yeah nigga
Yo ho stay squakin
She need to shut the fuck up, grown folk talkin
Yeah nigga, yeah nigga
But she a star nigga
She ate my dick then I kicked her out my car nigga
Yeah nigga, yeah nigga
I'm smokin leaves nigga
To calm me down, to put my mind man at ease nigga

[Chorus]
We gon rumble in this ho
We gon rumble in this ho
All you fuckin cock hoes get yo ass off the floor
We gon rumble in this ho
We gon rumble in this ho
All you add water killers get yo ass off the floor
We gon rumble in this ho
We gon rumble in this ho
All you punk ass niggas get yo ass off the floor
We gon rumble in this ho
We gon rumble in this ho
All you fake ass hoes get yo ass off the floor

[Verse Three]
Yeah nigga, yeah nigga
I lay the smack down
Done been through hoods where you better watch yo back now
Cause nigga, laws nigga
The code we live by
Don't wait for later, do it now, boy it's do or die
I nigga, be's nigga
I'm for my cheese nigga
I got my infra-beams watchin you, please nigga
Bank nigga, rank nigga
It make ya thank nigga
Stay on the ground so ya ship won't sank nigga
Rocks nigga, crack nigga
I'm stackin wealth nigga
But it aint me cause the dope sell itself nigga
Who nigga, you nigga
You wanna try Pat
What you gon' get is yo motherfuckin skull cracked
Hurt nigga, pain nigga
Is what you feel nigga
The slugs talk through the barrel of the steel nigga
So nigga, roll nigga
That's wit this click bitch
Or get yo trick ass wacked wit da quickness

393

<-- loads of dubz, check em

394

http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb
http://bit.ly/leEXCb

395

>>394
This webpage has asked to redirect to http://lmgtfy.com/?q=dog+cum
Allow Deny


*clicks deny

396

>>395
Did you check all of them?

397

I'm imagining a researcher reading about the sleep sort on wikipedia and following the link here and reading this thread.

398

>>397
if ya aint gonna shake dont pretend to sage

399

<-- watch my dubz

400

mine are better because the number is also divisible by 100, 25 and 4
ah the harmony

401

>>400
Your dubz are not even ``notable'' according to Wikipedia.

402

Gentlemen, we are approaching the fateful 404. That is where the thread must end. Two last posts. Make good use of them.

403

sage

404

sage

405

>>389-391
See >>81

406

[citation needed]

407

[citation needed]

408

[citation needed]

409

[citation needed]

410

[citation needed]

411

[citation needed]

412

[citation needed]

413

[citation needed]

414

[citation needed]

415

[citation needed]

416

[citation needed]

417

[citation needed]

418

[citation needed]

419

[citation needed]

420

[citation needed]

421

[citation needed]

422

[citation needed]

423

[citation needed]

424

[citation needed]

425

[citation needed]

426

[citation needed]

427

[citation needed]

428

[citation needed]

429

[citation needed]

430

[citation needed]

431

[citation needed]

432

[citation needed]

433

[citation needed]

434

[citation needed]

435

[citation needed]

436

[citation needed]

437

[citation needed]

438

[citation needed]

439

[citation needed]

440

[citation needed]

441

[citation needed]

442

[citation needed]

443

[citation needed]

444

[citation needed]

445

[citation needed]

446

[citation needed]

447

[citation needed]

448

[citation needed]

449

[citation needed]

450

[citation needed]

451

[citation needed]

452

[citation needed]

453

[citation needed]

454

[citation needed]

455

[citation needed]

456

[citation needed]

457

[citation needed]

458

[citation needed]

459

[citation needed]

460

[citation needed]

461

[citation needed]

462

[citation needed]

463

[citation needed]

464

[citation needed]

465

[citation needed]

466

[citation needed]

467

[citation needed]

468

[citation needed]

469

[citation needed]

470

[citation needed]

471

[citation needed]

472

[citation needed]

473

[citation needed]

474

[citation needed]

475

[citation needed]

476

[citation needed]

477

[citation needed]

478

[citation needed]

479

[citation needed]

480

[citation needed]

481

[citation needed]

482

[citation needed]

483

[citation needed]

484

[citation needed]

485

[citation needed]

486

[citation needed]

487

[citation needed]

488

[citation needed]

489

[citation needed]

490

[citation needed]

491

[citation needed]

492

[citation needed]

493

[citation needed]

494

[citation needed]

495

[citation needed]

496

[citation needed]

497

[citation needed]

498

[citation needed]

499

[citation needed]

500

[citation needed]

501

[citation needed]

502

[citation needed]

503

[citation needed]

504

[citation needed]

505

[citation needed]

506

[citation needed]

507

[citation needed]

508

[citation needed]

509

[citation needed]

510

[citation needed]

511

[citation needed]

512

[citation needed]

513

[citation needed]

514

[citation needed]

515

[citation needed]

516

[citation needed]

517

[citation needed]

518

[citation needed]

519

[citation needed]

520

[citation needed]

521

[citation needed]

522

[citation needed]

523

[citation needed]

524

[citation needed]

525

[citation needed]

526

[citation needed]

527

[citation needed]

528

[citation needed]

529

[citation needed]

530

[citation needed]

531

[citation needed]

532

[citation needed]

533

[citation needed]

534

[citation needed]

535

[citation needed]

536

[citation needed]

537

[citation needed]

538

[citation needed]

539

[citation needed]

540

[citation needed]

541

[citation needed]

542

[citation needed]

543

[citation needed]

544

[citation needed]

545

[citation needed]

546

[citation needed]

547

[citation needed]

548

[citation needed]

549

[citation needed]

550

[citation needed]

551

[citation needed]

552

[citation needed]

553

[citation needed]

554

[citation needed]

555

[citation needed]

556

[citation needed]

557

[citation needed]

558

[citation needed]

559

[citation needed]

560

[citation needed]

561

[citation needed]

562

[citation needed]

563

[citation needed]

564

[citation needed]

565

[citation needed]

566

[citation needed]

567

[citation needed]

568

[citation needed]

569

[citation needed]

570

[citation needed]

571

[citation needed]

572

[citation needed]

573

[citation needed]

574

[citation needed]

575

[citation needed]

576

[citation needed]

577

[citation needed]

578

[citation needed]

579

[citation needed]

580

[citation needed]

581

[citation needed]

582

[citation needed]

583

[citation needed]

584

[citation needed]

585

[citation needed]

586

[citation needed]

587

[citation needed]

588

[citation needed]

589

[citation needed]

590

[citation needed]

591

[citation needed]

592

[citation needed]

593

[citation needed]

594

[citation needed]

595

[citation needed]

596

[citation needed]

597

[citation needed]

598

[citation needed]

599

[citation needed]

600

[citation needed]

601

[citation needed]

602

[citation needed]

603

[citation needed]

604

[citation needed]

605

[citation needed]

606

[citation needed]

607

[citation needed]

608

[citation needed]

609

[citation needed]

610

[citation needed]

611

[citation needed]

612

[citation needed]

613

[citation needed]

614

[citation needed]

615

[citation needed]

616

[citation needed]

617

[citation needed]

618

[citation needed]

619

[citation needed]

620

[citation needed]

621

[citation needed]

622

[citation needed]

623

[citation needed]

624

[citation needed]

625

[citation needed]

626

[citation needed]

627

[citation needed]

628

[citation needed]

629

[citation needed]

630

[citation needed]

631

[citation needed]

632

[citation needed]

633

[citation needed]

634

[citation needed]

635

[citation needed]

636

[citation needed]

637

[citation needed]

638

[citation needed]

639

[citation needed]

640

[citation needed]

641

[citation needed]

642

[citation needed]

643

[citation needed]

644

[citation needed]

645

[citation needed]

646

[citation needed]

647

[citation needed]

648

[citation needed]

649

[citation needed]

650

[citation needed]

651

[citation needed]

652

[citation needed]

653

[citation needed]

654

[citation needed]

655

[citation needed]

656

[citation needed]

657

[citation needed]

658

[citation needed]

659

[citation needed]

660

[citation needed]

661

[citation needed]

662

[citation needed]

663

[citation needed]

664

[citation needed]

665

[citation needed]

666

[citation needed]

667

[citation needed]

668

[citation needed]

669

[citation needed]

670

[citation needed]

671

[citation needed]

672

[citation needed]

673

[citation needed]

674

[citation needed]

675

[citation needed]

676

[citation needed]

677

[citation needed]

678

[citation needed]

679

[citation needed]

680

[citation needed]

681

[citation needed]

682

[citation needed]

683

[citation needed]

684

[citation needed]

685

[citation needed]

686

[citation needed]

687

[citation needed]

688

[citation needed]

689

[citation needed]

690

[citation needed]

691

[citation needed]

692

[citation needed]

693

[citation needed]

694

[citation needed]

695

[citation needed]

696

[citation needed]

697

[citation needed]

698

[citation needed]

699

[citation needed]

700

[citation needed]

701

[citation needed]

702

[citation needed]

703

[citation needed]

704

[citation needed]

705

[citation needed]

706

[citation needed]

707

[citation needed]

708

[citation needed]

709

[citation needed]

710

[citation needed]

711

[citation needed]

712

[citation needed]

713

[citation needed]

714

[citation needed]

715

[citation needed]

716

[citation needed]

717

[citation needed]

718

[citation needed]

719

[citation needed]

720

[citation needed]

721

[citation needed]

722

[citation needed]

723

[citation needed]

724

[citation needed]

725

[citation needed]

726

[citation needed]

727

[citation needed]

728

[citation needed]

729

[citation needed]

730

[citation needed]

731

[citation needed]

732

[citation needed]

733

[citation needed]

734

[citation needed]

735

[citation needed]

736

[citation needed]

737

[citation needed]

738

<sup>[citation needed]</sup>

739

[citation needed]

740

[citation needed]

741

[citation needed]

742

[citation needed]

743

[citation needed]

744

[citation needed]

745

[citation needed]

746

[citation needed]

747

[citation needed]

748

[citation needed]

749

[citation needed]

750

[citation needed]

751

[citation needed]

752

[citation needed]

753

[citation needed]

754

[citation needed]

755

[citation needed]

756

[citation needed]

757

[citation needed]

758

[citation needed]

759

[citation needed]

760

[citation needed]

761

[citation needed]

762

[citation needed]

763

[citation needed]

764

[citation needed]

765

[citation needed]

766

[citation needed]

767

[citation needed]

768

[citation needed]

769

[citation needed]

770

[citation needed]

771

[citation needed]

772

[citation needed]

773

[citation needed]

774

[citation needed]

775

[citation needed]

776

[citation needed]

777

[citation needed]

778

[citation needed]

779

[citation needed]

780

[citation needed]

781

[citation needed]

782

[citation needed]

783

[citation needed]

784

[citation needed]

785

[citation needed]

786

[citation needed]

787

[citation needed]

788

[citation needed]

789

[citation needed]

790

[citation needed]

791

[citation needed]

792

[citation needed]

793

[citation needed]

794

[citation needed]

795

[citation needed]

796

[citation needed]

797

[citation needed]

798

[citation needed]

799

[citation needed]

800

[citation needed]

801

[citation needed]

802

[citation needed]

803

[citation needed]

804

[citation needed]

805

[citation needed]

806

[citation needed]

807

[citation needed]

808

[citation needed]

809

[citation needed]

810

[citation needed]

811

[citation needed]

812

[citation needed]

813

[citation needed]

814

[citation needed]

815

[citation needed]

816

[citation needed]

817

[citation needed]

818

[citation needed]

819

[citation needed]

820

[citation needed]

821

[citation needed]

822

[citation needed]

823

[citation needed]

824

[citation needed]

825

[citation needed]

826

[citation needed]

827

[citation needed]

828

[citation needed]

829

[citation needed]

830

[citation needed]

831

[citation needed]

832

[citation needed]

833

[citation needed]

834

[citation needed]

835

[citation needed]

836

[citation needed]

837

[citation needed]

838

[citation needed]

839

[citation needed]

840

[citation needed]

841

[citation needed]

842

[citation needed]

843

[citation needed]

844

[citation needed]

845

[citation needed]

846

[citation needed]

847

[citation needed]

848

[citation needed]

849

[citation needed]

850

[citation needed]

851

[citation needed]

852

[citation needed]

853

[citation needed]

854

[citation needed]

855

[citation needed]

856

[citation needed]

857

[citation needed]

858

[citation needed]

859

[citation needed]

860

[citation needed]

861

[citation needed]

862

[citation needed]

863

[citation needed]

864

[citation needed]

865

[citation needed]

866

[citation needed]

867

[citation needed]

868

[citation needed]

869

[citation needed]

870

[citation needed]

871

[citation needed]

872

[citation needed]

873

[citation needed]

874

[citation needed]

875

[citation needed]

876

[citation needed]

877

[citation needed]

878

[citation needed]

879

[citation needed]

880

[citation needed]

881

[citation needed]

882

[citation needed]

883

[citation needed]

884

[citation needed]

885

[citation needed]

886

[citation needed]

887

[citation needed]

888

[citation needed]

889

[citation needed]

890

[citation needed]

891

[citation needed]

892

[citation needed]

893

[citation needed]

894

[citation needed]

895

[citation needed]

896

[citation needed]

897

[citation needed]

898

[citation needed]

899

[citation needed]

900

[citation needed]

901

[citation needed]

902

[citation needed]

903

[citation needed]

904

[citation needed]

905

[citation needed]

906

[citation needed]

907

[citation needed]

908

[citation needed]

909

[citation needed]

910

[citation needed]

911

[citation needed]

912

[citation needed]

913

[citation needed]

914

[citation needed]

915

[citation needed]

916

[citation needed]

917

[citation needed]

918

[citation needed]

919

[citation needed]

920

[citation needed]

921

[citation needed]

922

[citation needed]

923

[citation needed]

924

[citation needed]

925

[citation needed]

926

[citation needed]

927

[citation needed]

928

[citation needed]

929

[citation needed]

930

[citation needed]

931

[citation needed]

932

[citation needed]

933

[citation needed]

934

[citation needed]

935

[citation needed]

936

[citation needed]

937

[citation needed]

938

[citation needed]

939

[citation needed]

940

[citation needed]

941

[citation needed]

942

[citation needed]

943

[citation needed]

944

[citation needed]

945

[citation needed]

946

[citation needed]

947

[citation needed]

948

[citation needed]

949

[citation needed]

950

[citation needed]

951

[citation needed]

952

[citation needed]

953

[citation needed]

954

[citation needed]

955

[citation needed]

956

[citation needed]

957

[citation needed]

958

[citation needed]

959

[citation needed]

960

[citation needed]

961

[citation needed]

962

[citation needed]

963

[citation needed]

964

[citation needed]

965

[citation needed]

966

[citation needed]

967

[citation needed]

968

[citation needed]

969

[citation needed]

970

[citation needed]

971

[citation needed]

972

[citation needed]

973

[citation needed]

974

[citation needed]

975

[citation needed]

976

[citation needed]

977

[citation needed]

978

[citation needed]

979

[citation needed]

980

[citation needed]

981

[citation needed]

982

[citation needed]

983

[citation needed]

984

[citation needed]

985

[citation needed]

986

[citation needed]

987

[citation needed]

988

[citation needed]

989

[citation needed]

990

[citation needed]

991

[citation needed]

992

[citation needed]

993

[citation needed]

994

[citation needed]

995

[citation needed]

996

[citation needed]

997

[citation needed]

998

[citation needed]

999

[citation needed]

1000

This thread has over 1000 replies.
You can't reply anymore.

1001

<p><a href="http://www.onepearls.com">wholesale pearl jewelry</a></p>

1002

This thread has over 1000 replies.
You can't reply anymore.

1003

gdfsg

1004

This thread has over 1000 replies.
You can't reply anymore.

1005

But I can!

1006

This thread has over 1000 replies.
You can't reply anymore.

1007

umad moot

1008

This thread has over 1000 replies.
You can't reply anymore.

1009

umad moot

1010

This thread has over 1000 replies.
You can't reply anymore.

1011

umad moot

1012

This thread has over 1000 replies.
You can't reply anymore.

1013

umad moot

1014

This thread has over 1000 replies.
You can't reply anymore.

1015

umad moot

1016

This thread has over 1000 replies.
You can't reply anymore.

1017

umad moot

1018

This thread has over 1000 replies.
You can't reply anymore.

1019

Fick Ja sleep sort

1020

This thread has over 1000 replies.
You can't reply anymore.

1021

one of the best threads in /prog/ is dying thanks to spammer. long live the mods!

1022

This thread has over 1000 replies.
You can't reply anymore.

1023

>>1021
They never die.

1024

This thread has over 1000 replies.
You can't reply anymore.

1025

>>1021
Yeah. It is a sad day truly.

1026

This thread has over 1000 replies.
You can't reply anymore.

1027

This is basically bucket sort behind the scenes.

However, it reminded me that my FPGA with nanosecond accurate clock could sort the numbers 0 to 4'294'967'296 in 4.3 seconds... if it had enough RAM...

1028

This thread has over 1000 replies.
You can't reply anymore.

1029

jur

1030

This thread has over 1000 replies.
You can't reply anymore.

1031

>>1030
OH YES I CAN

1032

This thread has over 1000 replies.
You can't reply anymore.

1033

lolololol

1034

This thread has over 1000 replies.
You can't reply anymore.

1035

Huh.

1036

This thread has over 1000 replies.
You can't reply anymore.

1037

>>1030
OH YES I CAN

1038

This thread has over 1000 replies.
You can't reply anymore.

1039

test

1040

This thread has over 1000 replies.
You can't reply anymore.

1041

sdfdffdfd

1042

This thread has over 1000 replies.
You can't reply anymore.

1043

YES I CAN >>1042

1044

This thread has over 1000 replies.
You can't reply anymore.

1045

I can reply, bitch.

1046

This thread has over 1000 replies.
You can't reply anymore.

1047

>>1046
Are you a wizard?

1048

This thread has over 1000 replies.
You can't reply anymore.

1049

Why must every thread inevitably turn to shit? It started off so beautifully.

1050

This thread has over 1000 replies.
You can't reply anymore.

1051

Because you're a ``faggot", >>1049-san.

1052

This thread has over 1000 replies.
You can't reply anymore.

1053

Man, am I a genius. Check out this anus I just invented.


* g o a t s e x * g o a t s e x * g o a t s e x *
g                                               g
o /     \             \            /    \       o
a|       |             \          |      |      a
t|       `.             |         |       :     t
s`        |             |        \|       |     s
e \       | /       /  \\\   --__ \\       :    e
x  \      \/   _--~~          ~--__| \     |    x
*   \      \_-~                    ~-_\    |    *
g    \_     \        _.--------.______\|   |    g
o      \     \______// _ ___ _ (_(__>  \   |    o
a       \   .  C ___)  ______ (_(____>  |  /    a
t       /\ |   C ____)/      \ (_____>  |_/     t
s      / /\|   C_____)       |  (___>   /  \    s
e     |   (   _C_____)\______/  // _/ /     \   e
x     |    \  |__   \\_________// (__/       |  x
*    | \    \____)   `----   --'             |  *
g    |  \_          ___\       /_          _/ | g
o   |              /    |     |  \            | o
a   |             |    /       \  \           | a
t   |          / /    |         |  \           |t
s   |         / /      \__/\___/    |          |s
e  |           /        |    |       |         |e
x  |          |         |    |       |         |x
* g o a t s e x * g o a t s e x * g o a t s e x *

1054

This thread has over 1000 replies.
You can't reply anymore.

1055

Go sleep somewhere else, you mutt.

1056

This thread has over 1000 replies.
You can't reply anymore.

1057

[i]im gay

1058

This thread has over 1000 replies.
You can't reply anymore.

1059

>>1058
Oh really?

1060

This thread has over 1000 replies.
You can't reply anymore.


Newer Posts

Name: Email:
1061
Entire Thread Last 50 Posts First 100 Posts Thread List Report Thread
This thread is threadstopped. You can't reply anymore.