Bubble sort in pure CSS
11–20 of 73 posts
Re: Bubble sort in pure CSS
#12> Editor’s Note: This article ends on a cliffhanger. The next part goes out in a week I stopped reading there. Let us know when the second part is out. Why write half an article?
Re: Bubble sort in pure CSS
#13It seems to only work for a fixed size. Wouldn’t that be called a sorting network?
It is a sorting network corresponding to bubble sort on 5-element input. It is actually pretty good - the code uses 10 comparisons, while the optimal sorting network for 5 elements uses 9: https://bertdobbelaere.github.io/sorting_networks.html#N5L9D...
Re: Bubble sort in pure CSS
#14> (oneIsGreater * origArray[0]) + (twoIsGreater * origArray[1]) There is a reason why conjunction (AND) is also called logical multiplication, and disjunction (OR) logical addition. There is not much difference between this and: (oneIsGreater ? origArray[0] : 0) | (twoIsGreater ? origArray[1] : 0) This is often useful to think about when working on bitset or SIMD algorithms.
Really? The connection between AND and multiplication is obvious, but disjunction doesn't behave like addition. (For one thing, just like AND, it destroys information, which multiplication does do and addition doesn't.) Addition would usually be XOR.
In fact, AND and XOR are what you get when you apply multiplication and addition to the integers (mod 2).
Re: Bubble sort in pure CSS
#15Re: Bubble sort in pure CSS
#16> (oneIsGreater * origArray[0]) + (twoIsGreater * origArray[1]) There is a reason why conjunction (AND) is also called logical multiplication, and disjunction (OR) logical addition. There is not much difference between this and: (oneIsGreater ? origArray[0] : 0) | (twoIsGreater ? origArray[1] : 0) This is often useful to think about when working on bitset or SIMD algorithms.
> There is a reason why conjunction (AND) is also called logical multiplication, and disjunction (OR) logical addition. Really? The connection between AND and multiplication is obvious, but disjunction doesn't behave like addition. (For one thing, just like AND, it destroys information, which multiplication does do and addition doesn't.) Addition would usually be XOR. In fact, AND and XOR are what you get when you ap…
A ⊢ ((A ∨ B) ∨ C) ... ∨ nRe: Bubble sort in pure CSS
#17This is scary good. Well done. If your product have any frontend and you have the power to decide ensure at least one of your hires can write CSS at this level.
Re: Bubble sort in pure CSS
#18Earlier quoted context omitted.
> There is a reason why conjunction (AND) is also called logical multiplication, and disjunction (OR) logical addition. Really? The connection between AND and multiplication is obvious, but disjunction doesn't behave like addition. (For one thing, just like AND, it destroys information, which multiplication does do and addition doesn't.) Addition would usually be XOR. In fact, AND and XOR are what you get when you ap…
It's called logical addition which is different than arithmetic addition, so it's best to not conflate the two. It's called "addition" because you "add" another propostion, creating a disjunction. And by the rules of logic, as long as the original proposition was true, the truth value is preserved no matter how many propositions you introduce (or "add"). A ⊢ ((A ∨ B) ∨ C) ... ∨ n
By that argument, conjunction is also called "addition". Perhaps there's a different reason?
The choice of terminology, contrasting "logical addition" with "logical multiplication", obviously indicates that logical addition is supposed to be analogous to addition. What is the analogy?
Re: Bubble sort in pure CSS
#19> Editor’s Note: This article ends on a cliffhanger. The next part goes out in a week I stopped reading there. Let us know when the second part is out. Why write half an article?
Where does that text appear in the article? I learned from the article and found the subject interesting, but the breathlessly excited tone and forced cuteness were offputting.
Re: Bubble sort in pure CSS
#20> Editor’s Note: This article ends on a cliffhanger. The next part goes out in a week I stopped reading there. Let us know when the second part is out. Why write half an article?
Where does that text appear in the article? I learned from the article and found the subject interesting, but the breathlessly excited tone and forced cuteness were offputting.