Duct Tape some sorting Your job is to make a sorting algorithm. The catch, you must copy it from Stack Overflow.

Your program will take an input array (or equivalency), and output a sorted permutation of the array. 


Your program must consist solely of copy and pasted code blocks from Stack Overflow.
You may not take parts of a code block, nor may you rearrange one. A code block is everything within a single gray box.
The original question of the post may not have a tag, title, or question body containing the word "sort" in it.
You must cite the both the post and poster(s).
You may not use built in sorts.
The post must be older than this question.


Also, here are allowed modifications:


You may move import statements to the top
For any type of identifier type thing, you may replace all of its occurrences within the code block with a different name. Please list substitutions.


This is a popularity contest, so the correct answer with the most up-votes wins!
GolfScript

Straightforward bubble sort implementation. Can probably be golfed down further. Try it online.

~x {{ document.write man [
putc( 'c', stdout ) ;
\b {{ return 1 echo ${10}
return
true;
Convert.ToDouble(o)
datagrid1.ItemsSource = dataTable1.DefaultView;
echo $a:u
cat &gt; file {{ \b }} ~x
int* arr1[8];
}}
source ~/.bashrc
return
true;
] document.write
@echo off
IP=`curl ifconfig.me`
return
true;
~x return !0
return
true;
}} ~x
for {0..10..2}; do
  ..
done
set -x
\b
basename `pwd`
~x


Sources

https://stackoverflow.com/a/2513659 (https://stackoverflow.com/u/276101):

~x

https://stackoverflow.com/a/3773868  (https://stackoverflow.com/u/394167):

{{

https://stackoverflow.com/a/802894   (https://stackoverflow.com/u/8815):

document.write

https://stackoverflow.com/a/2188223 (https://stackoverflow.com/u/116908):

man [

https://stackoverflow.com/q/4563825 (https://stackoverflow.com/u/111307):

putc( 'c', stdout ) ;


https://stackoverflow.com/a/16876671 (https://stackoverflow.com/u/980550):

\b

https://stackoverflow.com/a/22604291 (https://stackoverflow.com/u/1622022):

return 1

https://stackoverflow.com/a/6146038 (https://stackoverflow.com/u/116908):

echo ${10}

https://stackoverflow.com/a/4054267 (https://stackoverflow.com/u/69083):

return
true;


https://stackoverflow.com/q/23657401 (https://stackoverflow.com/u/1171811):

Convert.ToDouble(o)

https://stackoverflow.com/q/6097907 (https://stackoverflow.com/u/517871):

datagrid1.ItemsSource = dataTable1.DefaultView;


https://stackoverflow.com/a/4813101 (https://stackoverflow.com/u/591720):

echo $a:u


https://stackoverflow.com/q/19114714 (https://stackoverflow.com/u/72436):

cat &gt; file

https://stackoverflow.com/a/3773868 (https://stackoverflow.com/u/394167):

}}

https://stackoverflow.com/a/859676 (https://stackoverflow.com/u/87234):

int* arr1[8];


https://stackoverflow.com/a/2518150 (https://stackoverflow.com/u/245602):

source ~/.bashrc


https://stackoverflow.com/a/5750751 (https://stackoverflow.com/u/187690):

]

https://stackoverflow.com/q/8823643 (https://stackoverflow.com/u/1059446):

@echo off


https://stackoverflow.com/a/9764597 (https://stackoverflow.com/u/167925):

IP=`curl ifconfig.me`


https://stackoverflow.com/a/8255667 (https://stackoverflow.com/u/179669):

return !0

https://stackoverflow.com/a/966110 (https://stackoverflow.com/u/104162):

for {0..10..2}; do
  ..
done


https://stackoverflow.com/a/6930980 (https://stackoverflow.com/u/705676):

set -x


https://stackoverflow.com/a/4641636 (https://stackoverflow.com/u/333698):

basename `pwd`