« first day (3779 days earlier)      last day (1063 days later) » 

4:00 PM
you don't need to know the size of either half beforehand if you just build your sub-arrays from either end of the array
this reverses one half though, so if you want stability, you either run a second array to hold these values in an intermediate step
or do an O(N) scan each time to count and determine where your second pointer needs to start
which is total n log n extra steps
 
My conclusion is that quicksort is sometimes a bit faster, but mergesort is way more elegant
 
clearly stalin sort is the best
 
I would like to disagree.
 
Wait...I have a stupid idea
What if you stalin sort a list, and put the ones that are removed into a new list
 
@user that's good
 
4:05 PM
Then, use this sort on the new one
Recurse until all of the lists are sorted
 
because the only stats I'm throwing away are defence
 
Then, merge the last two, and recursively merge down to the first
 
@RedwolfPrograms what's stalin sort
 
Remove all of the items that aren't in order
It's a joke sorting algo :p
 
4:06 PM
Hey, why'd you kick me?
 
You got kicked?
 
@RedwolfPrograms I thought you just shot anyone who disagreed that the list wasn't sorted already
 
@user ... is this intended as a joke, or did you actually get kick-muted
 
@RedwolfPrograms It was a joke (I said "I would like to disagree" before and pretended HN pulled a Stalin)
 
4:07 PM
Oh ok :p
 
ROs get notified of kick-mutes btw. so joke doesn't work well :P
 
I have one task for you: implement BogoBogoSort
 
@hyper-neutrino Other people don't, and they're a wider audience :P
 
bogobogosort?
 
@pxeger Instead of shuffling the elements' indexes, we shuffle their values until they're in order
 
4:08 PM
Does my sorting algo idea exist already?
 
@pxeger Randomly generate a list of all permutations of the list, and check if that list of permutations is sorted maybe?
 
that sounds... exactly like bogosort
 
Bogosort just generates one list
 
I'm sure it does, but if not I'll call it butter sort
 
4:11 PM
@user bruh n!^n! is weak sauce
we gotta go higher
in fact, I need to go to the sandbox
 
@RedwolfPrograms that actually sounds like a cool sorting algo, I can implement it and see what the complexity is like
 
Already working on it :p
 
not if I can beat you to it
 
@user can confirm, y'all are just a part of our experiment
 
@RedwolfPrograms oh actually, it might not be guaranteed to terminate
nvm I'm dumb
 
4:22 PM
It should, if you stop when the out of order array is empty
 
I was going to say if the list was strictly decreasing, then it would remove all values, but then I realized that the last element will always stay
 
The first item is always in order (at least in my implementation)
 
For anyone interested, Cardano, Vi and Vim, Science Fiction & Fantasy, Ethereum, Iota, Ebooks, Quantum Computing, Islam, Arduino, and ExpressionEngine® Answers have upcoming elections.
 
ah, I was going to do it checking if a[n + 1] > a[n]
 
Got a working implementation
I wonder if it's stable
 
4:26 PM
maybe
what did you write yours in?
 
JS
I think it's stable :o
Reminds me a lot of merge sort
 
@hyper-neutrino Wait, but our society's invented guns already...is this experiment going to be terminated now? :o
 
why does python have a recursion depth
 
@user well, it's slightly different. there's a different end goal but I can't tell you what it is
 
does it serve an actual purpose or is it just to annoy?
 
4:30 PM
It's not TCO
 
@Underslash So the stack doesn't blow up
 
well it's just so you don't segfault
you can do import sys; sys.setrecursionlimit(1000000) to make it higher
but eventually you'll just segfault
 
yeah but you would have to do that for every program
 
@hyper-neutrino You can also use trampolines instead
 
4:31 PM
the defaults in other languages are not as high
and 1000 is not uncommon to reach tbh
 
Power's out here :/
 
@RedwolfPrograms Too much recursion? :P
@Underslash Is it really?
 
yes
consider using python for its large number types: anything you do with recursion is going to break if you're doing large numbers
 
lol I really need to do some real coding :P
 
ex: a recursive factorial implementation
 
4:33 PM
ok but like
i don't think that's particularly common
 
@Underslash just set the recursion limit to 99**99
 
Why do a recursive factorial?
 
unless you're golfing
you shouldn't be doing factorial recursively
 
and then after that 99**99*99
 
well, the point is just that I encounter it more than I think is necessary
 
4:34 PM
@StackMeter Not sure Python can calculate that :P (or maybe it can, idk)
 
you're not reaching that unless you've fallen into an infinite loo[
 
@Underslash It's probably your fault, not Python's. Have you tried using jQuery? :P
 
I usually blow the stack from doing something wrong and not having an appropriate end condition
 
^
 
in java, you get a stack overflow really only if you ever have an infinite loop
@user I would never stoop that low
:D
 
4:35 PM
(but seriously, changing your design might help)
 
@user jQuery is the thing you see when you enter hell
 
true, but still 1000 is kinda bad
 
In some cases, you can also make your own stack object to help yourself
 
like make it at least 10000 imo
 
Just in case power doesn't come back on in the next 40m, does anyone here have access to a server with node installed? If it's still out in about a half hour it'd be nice to be able to move the bots over rather than restart the feeds.
 
4:36 PM
i do
 
@Underslash Makes sense. I think JS's is 10000
 
it's a VPS on racknerd
 
@user It varies by implementation
 
@RedwolfPrograms no
give me access to one though and I can tell you yes, I do have access to one
 
@RedwolfPrograms Oh right, didn't read the rest of that
 
4:38 PM
@RedwolfPrograms what version of node
 
I'm on 14.12, but anything with ES6 should work
Looks like 12 and up are fine
 
okay, i have 12.18.3
 
hello everyone
well what is the current ecma standard of JS?
wow record 26 users here now
 
@user nope i meant ECMAscript, BTW, nice to meet you after long time
 
4:44 PM
toddlers are irritating
 
how would one ultilize a second stack
 
@Wezl adults can be more irritating
 
s/toddlers/humans, ftfy
 
my personal toddler set a new record for screaming after I stopped it slapping the keyboard
@rak1507 touché
 
4:48 PM
@hyper-neutrino all animals really... our dog is just as annoying as a toddler and it won't even grow up into something useful
 
@rak1507 same for my toddler too
:P
 
s/toddlers are/everything is :p
 
@Wezl why
 
2 mins ago, by Wezl
my personal toddler set a new record for screaming after I stopped it slapping the keyboard
 
oh I see why
 
sorry missed the message i was out for while
i am now hunting languages for the ascii line challenge
 
0
Q: Sum of square roots

l4m2Program the sequence \$R_k\$: all numbers that are sum of square roots of some(maybe one) natural numbers \$\left\{\sum_{i\in A}\sqrt i\middle|A\subset \mathbb{N}\right\}\$, in ascending order without duplication. Outputting zero is optional. You should do one of: Take an index k and output \$R_...

 
this seems like it'd be really good for husk
 
mmm...tasty challenge
 
@NewPosts how is that not just square root?
 
4:56 PM
CMC: Given a positive integer, return the sum of all its square roots :D
 
@hyper-neutrino why isn't it jusf plain sqrt
 
2.414213562373095 is not the square root of an integer
but it is the sum of sqrt(1) and sqrt(2)
 
@Wezl python int(input())**0.5
 
@Wezl _=>0?
 
@Wasif invalid
@hyper-neutrino :D
 
4:58 PM
lol
 
@hyper-neutrino What's you GH username?
 
@RedwolfPrograms hyper-neutrino
 
Invited you to a repo with NP/SP
No need to do anything with it yet
 
@Wezl [runs to TIO to search for a language where the empty program outputs 0 even with input]
 
But if there's under 5m of power left on my UPS or I go offline, all you should need to do is put that in a folder somewhere, run chmod +x install, ./install, and run the startup command it'll print
 
5:01 PM
@DLosc jelly, if you put the input in STDIN :D
 
It runs in a screen session, so you'd use screen -r nmp to go to it, and ctrl + a then d to detach from it
 
@Wezl why an integer has only one no no how did i missed that integers have two square roots
crying
 
ooh, screen. okay nice (i am semi familiar with screens)
 
@hyper-neutrino :P
 
5:03 PM
oh, I do now
 
@rak1507 sequence of all real numbers that are the sum of zero/one or more square roots of integers
 
Okay, 5m estimated run time.
If possible, getting NP/SP moved over is probably a good idea now.
o/
Okay apparently killing my server increased the run time by about a half hour, so I can still talk for a little while
 
Of course the one time power goes out happens to be a few weeks after I start actually needing my server for something :p
 
@Wezl Please elaborate
 
5:07 PM
what details do you need
 
What do you mean by "personal toddler"? What exactly did you do to it?
 
bots are running successfully
 
How is this not a duplicate? I'm certain I've seen that exact challenge before--in fact, I was searching for it a couple weeks ago (but admittedly couldn't find it).
 
Oh nvm, I misread that as "I stopped it by slapping it with the keyboard"
 
@RedwolfPrograms buttersort looks to be quadratic in time complexity
 
5:08 PM
(This is not normal, power almost never goes out here. I think someone hit a power line with some sort of object not meant to hit power lines)
 
> not normal
Um, remember winter?
 
That wasn't normal either. 0_o
 
A week without power or water is definitely not normal here lol
 
oh, an accept within 2h. that's... interesting
 
@hyper-neutrino well is anyone going to beat it? :P
 
5:10 PM
with my new language metagolfscript-235346235, i will
 
vyxal conveniently introduces a new flag
 
Vyxal `\`, 0 bytes

```
```
[Try it online!](tio.run/#safdfasdfasdfjiuhygtfgvhbnjkoi98u765432qwsedcfvgbhnjkoi98u)
The empty program just happens to do exactly what this challenge asks for.
 
It's a bit extreme for Vyxal though (or any language)
 
Gonna try unplugging some stuff from my UPS for a few more minutes of wifi lol
 
5:14 PM
@hyper-neutrino looks like now i have provided a valid answer pls delete your comment
 
TIL sqrt 2 + sqrt 8 == sqrt 18, that's pretty interesting
Does sqrt x + sqrt y == sqrt (x + xy/2 + y)?
No, it seems
 
It's because if you divide 2 and 8 by their common factor, you're left with 1 and 4 which are both perfect squares.
 
Oh yeah
 
So sqrt(2) + sqrt(8) = 1*sqrt(2) + 2*sqrt(2) = 3*sqrt(2) = sqrt(2*3^2)
 
sqrt x + sqrt y = (sqrt x)(1 + sqrt y/x) i guess, lol
not that that's helpful
 
5:28 PM
Hm, that does generalize the idea a bit because y/x could be a ratio of two perfect squares.
x = 18, y = 50 for example
 
@RedwolfPrograms sqrt 8 = (sqrt 4) * (sqrt 2) = 2 sqrt 2 and sqrt 18 = (sqrt 9) * (sqrt 2) = 3 sqrt 2
 
Oh, that's smart
 
sqrt(18) + sqrt(50) = (8/3) * sqrt(18)
 
@cairdcoinheringaahing I'd disallow floating error issue on such small cases, some solutions taking forever isn't a reason as expection — l4m2 3 mins ago
@hyper-neutrino your answer may be wrong due to ^
 
5:32 PM
hm. wish that were there earlier so i wouldn't waste my time
i'm not sure M supports enough built-ins to use this solution then
 
I've already posted an M solution :P
Only 1 byte longer (Ḷ -> R’)
 
I just realized my answer basically just copies HN's (and caird's) :/
 
lol, everyone's porting me, and my answer itself is gone
I guide others to a treasure I cannot possess
 
What happened to it?
 
invalid to floating point error
 
5:37 PM
Uh-oh, I might have the same problem then
 
pyth very likely does too
since jelly and pyth are both subject to python's precision issues
 
@hyper-neutrino Behold the power of M :P
 
@hyper-neutrino "It must often be so, Sam, when things are in danger: some one has to give them up, lose them, so that others may keep them." - Frodo Baggins
 
5:39 PM
lol
anyway, I am going to work on a fast python solution to output the infinite sequence without libraries
 
Starting up my server
 
because porting myself into another language with infinite precision is really boring
 
@hyper-neutrino It's probably also human trafficking
 
implying I am a human
 
Oh right. Just plain smuggling then
 
5:42 PM
I don't know what Dennis did to speed up á¹— between Jelly and M, but its crazy slow in M
 
yeah I noticed that lol
 
Dunno why I'm SSHing when I'm ten feet from my server lol
@hyper-neutrino You can shut down your copy now if you want
 
can someone flag this comment as no longer needed?
hm. didn't work
what about unfriendly or unkind
my copy of NMP is shut down
@RedwolfPrograms can you swap your flag to "unfriendly/unkind" if that's possible?
 
Thanks!
Swapped
 
hm, okay. maybe this doesn't work on mod comments
there are apparently words that when used in comments allow "unfriendly/unkind" flags to immediately delete them, but idk what the conditions exactly are
and i doubt i can share the list of conditions even if i knew :P
 
5:47 PM
I think I've seen an MM post that listed some
42
Q: What is the SE version of Seven Dirty Words?

user259867Caution: R-rated language Some words, when present in a comment, make it eligible for instant, automatic one-flag deletion. Out of the seven words you can never say on television, only appear to work this way. But then there are other, Stack Exchange-specific dirty phrases: accept rate or ...

 
6:00 PM
ah, cool.
 
^^ Also, I think some of the points on LMGTFY links made there would be good to keep in mind here
Linking to a wiki page takes the same amount of time, but is much more helpful (and less passive-aggressive/rude)
 
imo the only time you should link to lmgtfy is if you are being passive aggressive about "look it up yourself", which is only acceptable if intended as and taken by the receiving party as a joke
 
6:55 PM
Opinions on these proposed input and output methods for cellular automata?
Currently both +1/-2, but no discussion on the pros/cons
 
I think for the input that would be a fine way of doing it, but should have to be included not in the source code, but in the answer so as to make sure it doesn't have anything that would help the challenge
 
I think it's sort of like having print(f(/* input */)) in a TIO footer; you couldn't do anything that actually does part of the challenge, but you don't count it as part of your answer
These I/O methods would be more like "protocols" for implementing other I/O methods, like a number or string of bytes.
 
yeah I agree, or having certain languages take in the input in maybe slightly different ways as to not make the program impractical
 
I'd really like it if cellular automata were viable in ordinary challenges, and I think I/O is currently one of the bigger problems.
 
I'd like to do more desmos answers honestly
they're pretty fun
 
7:58 PM
It's interesting that a large amount of the off-topic questions on MM are either code (typically from people off SO) and statistical problems
 
0
A: Sandbox for Proposed Challenges

StackMeterBreaking BogoBogoSort (In Badness) code-golfmatharray-manipulationcombinatoricsrandom The title says it all - make a sorting algorithm with a time complexity of \$O(n!^{n!})\$ or higher in the fewest bytes possible - as far as I can tell, that will require you to make a double exponentiatial form...

 
@SandboxPosts I believe applies here, but in the other direction than normal?
 
note that bogo sort doesn't have a complexity of O(n!)
i think
 
It has a worst case of O(n!)
 
wait is it "go through all permutations"?
i thought it was to continually shuffle and test
giving it no guarantee to terminate
 
8:09 PM
@cairdcoinheringaahing Sorry, O((n+1)!)
 
it is posted here
 
@hyper-neutrino Yes, but IIRC it's asymptotic complexity has a worse case
 
@cairdcoinheringaahing average
 
@cairdcoinheringaahing I just looked at your answer to the sum-of-square-roots challenge. how did you get this upper bound there?
 
well it has a 1/n! chance each time to terminate, right
 
8:10 PM
yeah
 
@flawr I copied HN's answer
 
so based on the standard formula, its expected number of runs before terminating is log(0.5)/log(1-1/n!)
 
@hyper-neutrino which is?
 
@StackMeter log(0.5)/log(1-1/n!)
well ok technically you can simplify it down to log_{1-1/n!}(0.5)
via change in base formula
if your list has size two, expected value is 1 run
 
@hyper-neutrino ok, what is log(0.5)
 
8:14 PM
with 3, it's 3.8; with 4, it's 16.3; with 5, it's 82.8; with 10, it's already 2.5 million; with 15 values in your list you have an average of almost 1 trillion
@StackMeter -log(2)
 
@hyper-neutrino ok - what is -log(2)
 
@StackMeter -0.693 approximately but like why do you care so much
 
@flawr The code generates all such numbers between 0 and \$n\sqrt n\$, and there should, I believe, always be at least \$n\$ of these numbers in that bound, as \$n < n\sqrt n\$
 
approximations are totally unnecsesary when you can have exact values
also depends what log base you use
 
@StackMeter -1 if you use base 2
 
8:16 PM
since i am using log ratio the base i use doesn't matter but if you're asking what log(0.5) is it matters if you're base e or 10 or some other one
^^
 
I'm assuming base 10 here, and base e has it's own special log - ln
 
@cairdcoinheringaahing ah that makes sense. I was lazier and used n^2 as an upper bound
 
@StackMeter math.log is base e and IMO base e is better
also you could just look up log 0.5 lol
 
@flawr I'm not sure how yours works, but mine only generates up to \$n\sqrt n\$ because I take the \$n\$th Cartesian power of the first \$n\$ square roots (starting from 0). Just in case that impacts anything :)
 
@cairdcoinheringaahing I think it works exactly the same
 
8:22 PM
@hyper-neutrino why base E
just use LN
 
That is base e
 
because e is cooler
ln is required base e but log is not required base not e
 
ln is base e, log is either e or 10 (typically, can be other bases)
I think lg is base 2
 
the nice thing is you can always set e=2
 
*eye twitches*
 
8:24 PM
e=pi
better?
I mean in astronomy this is pretty much an axiom
 
∧/2=/(⌈*1) (⌊○1) 3
 
*11s flawr out of existence*
 
@hyper-neutrino e=pi=11
 
@flawr Just golfed mine by a byte using Dlosc's powerset observation :D
Because M has a powerset builtin that auto-casts to range, but doesn't have a lowered range builtin ¯\_(ツ)_/¯
 
lol
is powerset faster too?
wait of course it is
 
8:28 PM
Much :P
 
2^n grows way slower than n^n
 
ah mine does use a power set too
 
It can definitely handle k = 10, just testing on higher bounds
 
wait are you sure powerset is valid
wait yes of course it is because 2sqrt(x) is just sqrt(4x). nvm i'm dumb LOL
i convinced myself powerset was invalid
othewrise i would've had that in my initial approach
 
mine craps out at about k=2k
 
8:32 PM
Should be. Powerset of range(n), then sums goes up to \$\frac {n(n+1)} 2\$, so the max square root it goes to is \$\sqrt \frac {n(n+1)} 2 \ge n, n \ge 1\$
 
i just thought it would miss things because like
the question never says you cannot sum sqrt(2) with itself
but sqrt(2) + sqrt(2) just equals sqrt(8) so it wouldn't even be missed
 
it could miss something like 2*sqrt(2) + sqrt(3) though
 
No, cause that's sqrt(8) + sqrt(3)
 
oh right yea fair point
 
oh wait, I'm not using the power set, I'm using the cartesian product - I confused the two
 
8:35 PM
lol
 
You can always express n*sqrt(k) as sqrt(x) for some integers n, k, x
@Ausername Bronie points are only redeemable in the form of an upvote, sorry :) — caird coinheringaahing 10 hours ago
I don't know what a 'Bronie' is, but it doesn't sound good. — A username 10 hours ago
This has to be the worst typo I've ever made :/
 
lmao
idk why this just occurred to me, but pressing the thumb mouse buttons (the navigate forward/backward buttons) over top of a window i don't currently have focused will focus it and click on that window
it's a mouse click event so this is exactly what should happen but... intuitively it felt like it should nav forward/backward on the window i'm currently focusing
@cairdcoinheringaahing did you just rotate your three messages in-place xD
 
I did :P
> Too long by 10 characters
Damn TIO links in comments
 
okay i looked away and i thought i was losing my sanity again or something like that :P
yeah it's rather annoying
 
@hyper-neutrino I'm assuming the diamond comes with a button to automatically do that :P
 
8:40 PM
i don't like using url shorteners either so :(
@Wezl yes it's the most important mod tool we have
 
:O you were supposed to keep it secret what are you going to have to do to me O:
 
@Wezl Yeah, moderators are actually just stacks, and they have a "rotate last three things" builtin
 
it is called stack exchange after all
our flag queue is actually closer to a queue than a stack though, lol. some things get prioritized but outside of that older flags will show up first (as they should)
 
For this, does allowing the output to be a flat list with a separator that won't be in the input (e.g. -1) break the challenge?
 
I thought about posting this challenge, does anyone see anything wrong with it?
 
8:43 PM
idts, and it makes it easier for regex for example
 
Oh hey, I have that exact cube, but I forgot how to put it back together again — Jo King ♦ Dec 14 '19 at 2:44
Same :/
 
snek posting challenge about snek \o/
 
@flawr Looks good, could maybe do with an explanation of how the example is doable, but I'm not sure how's best to do that
def is_sorted(data) -> bool:
    """Determine whether the data is sorted."""
    return all(data[i] <= data[i + 1] for i in range(len(data) - 1))
Imagine not using x == sorted(x) as an is_sorted test smh
 
no you should do it like this
is_sorted = lambda data: data == [] or data[0] == min(data) and is_sorted(data[1:])
 
Since when do you write named recursive lambdas? :P
 
8:51 PM
@cairdcoinheringaahing It's not too hard if you're a snake charmer
 
sorry i meant
(lambda f:lambda x:f(f,x))(lambda f,x:x==[]or x[0]==min(x)and f(f,x[1:]))
 
this is the only correct way to write python, lol
 
i'm trying to think of how to exploit the new output format for your challenge in jelly :p
can't think of a great way though
 
f=lambda d:d[1:]==[]or d[0]<=d[1]and f(d[1:])
@hyper-neutrino o.O
 
8:54 PM
what is this, all equal check?
 
Oops
 
also imagine naming your recursive lambdas smh
 
@hyper-neutrino Given that it's basically just equivalent to splitting then rejoining on -1, I can't see an obvious way
 
@cairdcoinheringaahing yeah jelly isn't great at working with the structure of a list IMO
like, inserting elements, replacing, etc
since it autovectorizes everything lmao
 
TBF those are typically triadic
 
8:55 PM
yeah, which is a slight issue for jelly
 
imo having a flat output goes against the nature of the challenge
 
I allow having a "flat" output with a newline separator if you input as a string
How is this different?
 
good point, but imo it should be a flat list to a nested list
 
Its mainly an accommodation for "awkward" languages with no other way. I doubt it'll be the shorter of multiple ways for anyone
Given that it still involves finding the "split point", then, instead of splitting, you have to insert a value
 

« first day (3779 days earlier)      last day (1063 days later) »