« first day (4223 days earlier)      last day (622 days later) » 

1:30 AM
Oops, I did it again.
I played with computer science, got lost in the game, and next thing you know it, I've created another esolang. esolangs.org/wiki/Stisp
5
This language is a "Lisp implementation helper." The idea is that it's easy to implement Stisp, and it's easy to implement Lisp in Stisp.
 
you have my full attention
 
Here's an implementation of a very tiny subset of Lisp in Stisp:

(CONS xh xt) -> eval[] = xh -> eval_cons[xt];
(QUOTE x) -> eval[] = x;

xh -> eval_cons[xt] = xh -> eval[] -> eval_cons_2[xt];
h -> eval_cons_2[xt] = xt -> eval[] -> reverse_cons[h];

t -> reverse_cons[h] = (h . t);
See esolangs.org/wiki/Stisp for the full spec.
 
one day i will understand this SDFG orz
 
The basic idea is a little bit like Haskell. Lines 4 and 5 of that are basically the same as

eval_cons xt xh = eval_cons_2 xt (eval xh)
eval_cons_2 xt h = reverse_cons h (eval xt)
However, the form of an expression is tightly restricted. Basically, function application is denoted using this arrow-and-brackets notation, and it's illegal for function applications to be nested.
The purpose of all the restrictions is to make Stisp easy to implement without any recursion.
 
2:21 AM
LDQ: if a user tries to feed multiple args to a unary operator, what options do i have (besides erroring and informing the user of their mistake)
 
The other obvious option I can think of is to just use the first one.
 
and just act like the other args dont exist?
oh i did think of something though
 
Mapping over the args is also an option
 
oh yeah
that seems reasonable too
the idea i was about to say didnt actually make much sense lol
 
3:04 AM
0
A: Sandbox for Proposed Challenges

BubblerAn algorithm to find even sublime numbers code-golf math number-theory A perfect number is a positive integer whose sum of divisors (except itself) is equal to itself. E.g. 6 (1 + 2 + 3 = 6) and 28 (1 + 2 + 4 + 7 + 14 = 28) are perfect. A sublime number (OEIS A081357) is a positive integer whose ...

 
3:42 AM
Hi guys
You can't award yourself your own bounty right on your own question?
 
3:52 AM
I'm pretty sure "You can't award yourself your own bounty" on any question
 
You can't award a bounty to yourself, period.
 
4:10 AM
Oh, but is it different on SO?
Cuz I just saw someone award himself/herself 300 rep
 
Link?
 
3
A: React native typescript number 0 read as NaN

jackAs it turns out, this is some kind of issue with VSCode. The NaN output only appears when using the VSCode Debug Console or the active VSCode debugger (hovering over the variable). The logcat output is correct. Furthermore, console.log(typeof variable) shows the variable type to be number (which ...

His rep graph shows +300 too
 
> This answer has been awarded bounties worth 300 reputation by Jared Smith
jack != Jared Smith
Someone else can award a bounty on your answer to your question
 
Oh whoops
my bad
I messed up the names
Sorry!
 
 
2 hours later…
6:00 AM
> ◉ Yearling × 2
I did not realise you could earn it more than once
I guess it makes sense though
 
 
2 hours later…
8:18 AM
Hi there
 
8:32 AM
How to golf the program n/(;{.1=88<\4/zip{&}*!&"YNeos">2%n}%?
Because I saw @lyxal , @lyxal
 
9:06 AM
worst code I ever wrote without intending it to be bad:
from functools import reduce

def radix_sort(array):
    number_of_digits=len(str(max(array)))
    for digit in range(number_of_digits):
        bucket = [[] for _ in range(10)]
        for i in array: bucket[(i // (10 ** digit))%10].append(i)
        array=reduce(lambda x,y:x+y,bucket)
    return array

print('\n'.join([f'{i//10} {i%10}' for i in radix_sort([int(input().replace(' ','')) for i in range(int(input()))])]))
(the last line especially, )))])]))
 
@NumberBasher Wouldn't it be nice if all functions could use Python 2's print syntax?
from functools import reduce

def radix_sort array:
    number_of_digits=len str max array
    for digit in range number_of_digits:
        bucket = [[] for _ in range 10]
        for i in array: bucket[i // 10 ** digit % 10].append i
        array=reduce(lambda x,y:x+y,bucket)
    return array

print '\n'.join [f'{i//10} {i%10}' for i in radix_sort[int input().replace(' ','') for i in range int input()]]
 
9:23 AM
@NumberBasher [print(f'{i//10} {i%10}') for i in radix_sort([int(input().replace(' ','')) for i in range(int(input())]
 
9:38 AM
Again: how to golf the program n/(;{.1=88<\4/zip{&}*!&"YNeos">2%n}%? (GolfScript)
Anyone? :(
 
I fear GolfScript isn't as popular as it once was.
Try on CR ;-)
 
:(
GolfScript is the only golfing language I can write program in
 
You find yourself in the same situation as many an expert COBOL programmer.
8
 
:(
 
10:03 AM
@Adám ruby
 
 
1 hour later…
11:16 AM
@Adám print isn't a function in 2.x though
 
Right.
 
@PyGamer0 I think he want to replace every function with a keyword
 
@Adám looks nice tbh
 
11:48 AM
Python 2.8!
 
wait does it
 
Oh nope
 
I love that it's #404
 
PEP Not Found
Let's prove it wrong should we
 
11:52 AM
Release your own langauge and name it python 2.8
 
Correct.
Now for some non-golf questions
You are give two set of point. Select two points, one from each set, so that their distance is maximized.
Lowest complexity wins.
 
What type of distance?
 
given*
@mousetail Euclidean
points*
 
Hmmm I'm not sure if a more efficient solution exists
 
I know if the "one from each set" restriction is removed
It is UVa 1453
But I'm
> not sure if a more efficient solution exists
in this case
 
12:04 PM
What is a point here?
How many dimensions?
 
Two
 
UVa 1453 seems to be different
 
@mousetail Well that's the same thing but with some extra useless fluff
Actually the idea here came from there
 
I imagine you may be able to build a Btree in O(n) time then somehow eliminate some pairs that way but I don't see a way that is guaranteed to reduce the number of potential pairs to something like n log(n). Imagine something like this has to be the way though
 
Hmm
I'd imagine that you get the convex hull for both sets and then perform some magic to get the answer
But IDK
 
12:19 PM
I'd have sworn it impossible
 
m90
12:37 PM
@null Indeed; simultaneously rotate two parallel lines around the two sets: i.stack.imgur.com/bRMjr.png
 
Ohhhhhhhhhhhhhhhhh
I get it
 
12:59 PM
> It is an ex-release
there a lot of quality Monty Python jokes in that PEP
 
 
1 hour later…
2:19 PM
@mousetail has an extra line
 
 
1 hour later…
3:22 PM
@DLosc Silly me, BQN totally has flatten: it's just monadic , no need to fold. :P 18 bytes.
 
3:35 PM
if i pick a random number from 0 to 1, and then whatever i get out of that, use that as the probability of heads for a coinflip, is it still a 50/50 chance?
intuitively i want to say yes, but i just want to make sure im not missing something lol
 
att
yes
integral from 0 to 1 of p dp / 1 = 0.5
 
oh interesting
that makes sense
right i guess im just picking a random point in a square, and seeing which side of the diagonal im on
neat
 
att
yep
that's assuming your random number is uniform, ofc
 
right yeah all that yadda yadda :P
 
att
just to be sure ;)
 
3:44 PM
"Yes, my infinite monkeys are all uniformed. Generating random numbers is serious monkey business."
 
4:00 PM
 
lgtm
 
4:27 PM
Every time I see lgtm I think it's lmgtfy, which makes my brain try to read it as "let's google that ... m???"
 
lol
 
5:11 PM
@DLosc same here.
 
only recently has it settled as "looks good to me" for me finally
 
0
A: Sandbox for Proposed Challenges

AdamFind "Millionaire" score code-golf string I was looking through the uploads of GAMES Magazine to archive.org, and in the first publication I found a challenge called "Millionaire: a word-and-number prize competition". In this game, each word is assigned a score in the following way: Turn each le...

 
6:09 PM
LDQ: previously i asked about users attempting to pass multiple args into a unary operator; now i ask this: What can I do if the user tries to give a binary operator more than two operators? I know if it's commutative, just reducing by the arg is reasonable (like how addition can be a binary operator but also add(1,2,3) makes perfect sense)
in particular, i am thinking about range, but in general i find the question interesting and wonder if it can be generalized :P
cause for range i can imaging range(1,5,3) being like [1,2,3,4,5,4,3] but that doesnt seem generalizable
 
6:32 PM
@thejonymyster Interesting question. I'd say reducing is reasonable if the operator is associative, even if it's not commutative: for example, concatenation.
So I guess the top three options in my mind are 1) ignore the extra arguments, 2) reduce (which wouldn't work for your three-point-range example, unless you back it up with some type shenanigans), or 3) special-case what you want each operator to do.
"Ignore the extra arguments" is what funstack.hs currently does, but I'd like it to do something more useful if there's a good option.
 
@thejonymyster Associative makes more sense than commutative
A commutative non-associative operator doesn't really make much sense to reduce by, whereas a noncommutative associative one is still useful
(E.g., reducing by concat is very common and useful)
Average would be an example of a binary commutative non-associative operator that doesn't make sense to reduce by
Since averaging one by one will bias heavily toward later items
 
6:50 PM
@thejonymyster I think you'll have to special-case them, or at least, categorise operators into groups of behaviours (e.g. one category for operators which reduce, etc.)
 
7:05 PM
Yeah, I agree with ^
 
"And you know why four plus minus one plus ten is fourteen minus one? Because addition is commutative, right"
 
@thejonymyster Do you have a link to previous discussion of this? I was considering supporting variadicity in an upcoming golfing language, in a similar way to this
@DLosc I propose "Let's Google This Motherf***er"
 
17 hours ago, by thejonymyster
LDQ: if a user tries to feed multiple args to a unary operator, what options do i have (besides erroring and informing the user of their mistake)
 
Ah, thanks
 
@RadvylfPrograms :/
 
7:12 PM
@thejonymyster Applying a reasonable variadic operation before applying the unary one
E.g., for negation, product could make sense
Same with square root (that would make geometric mean easy)
Then again in a golfing language this would rarely add golfiness, and in a practical language it would be really confusing
 
For unary, it makes a fair amount of sense to wrap everything in a list and map the operation. But that doesn't generalize well to higher arities.
 
@DLosc right, thats what prompted the question lol
also thanks all
 
7:33 PM
I suppose here's one possible generalization (don't know how useful it would be): given an operator of arity a and n arguments, with n > a, apply the operator to all length-a slices of the argument list and return a list of the results. E.g. Plus(4, 5, 6, 7) -> [Plus(4, 5), Plus(5, 6), Plus(6, 7)]
Or if T is some arity-3 operator, T(4, 5, 6, 7) -> [T(4, 5, 6), T(5, 6, 7)]
 
why just slices? why not all combinations :P
 
Sure, that's another possibility.
 
7:51 PM
actually yeah i guess that could work, i was like half joking lol
 
8:09 PM
@thejonymyster how does the parser even parse that?
 
Presumably some sort of spread/splat operator
 
I can't speak for thejonymyster, but in the language I'm working on, the program is a function with a well-defined arity, so I have to figure out what happens when you give it too many or too few arguments.
 
9:07 PM
Does anyone know if there's a way in BQN to check whether an identifier is undefined?
 
CMC: Given n, output the length of smashing the FizzBuzz sequence from 1 to n together. So 5 => 11 because smashing becomes 12Fizz4Buzz which is 11 characters long. Standard rules apply, so you can output the infinite sequence or whatever.
No OEIS.
 
@Steffan i still havent found a good fizzbuzz in fig :(
 
@Steffan i think this has a closed form solution
 
The thing that makes it tricky is that the numbers get longer
 
@Steffan CMC: This but handling up to 1 quadrillion
 
9:21 PM
i feel like the fizzbuzz part doesnt actually add that much to this :P
but i digress lol
 
@thejonymyster i concur
50 rep to who can provide it
 
@Steffan BQN, 32 bytes: +´·{×◶⟨≠•Fmt𝕩,⊢⟩+´4×0=3‿5|𝕩}¨1+↕
Feels pretty clunky
 
yay kotlin native worked on the first try
in my universe, nothing ever works on the first try
 
9:36 PM
@Steffan I'm like 100% sure this is a dupe
 
There's thet bytewise fizzbuzz
 
@RadvylfPrograms There's one with the inverse of that.
 
23
Q: How did I end up with this FizzBuzz?

walpenFizzBuzz is so simple, bet you can do it backwards. In this challenge, you will be given the length of the FizzBuzz string and must give the positive integer that produced that string. Description To break this down, a FizzBuzz string for n is generated by the following algorithm. Start with ...

I've got 13 bytes in Vyxal
And should be 12 without a bug
seems like half my Vyxal solutions can be shorter without a bug
actually, got 12 bytes
or 11 with flag
 
@Seggan welcome to the universe where everything works on the first try
 
9:54 PM
@thejonymyster thanks. now how did i get here?
 
@Seggan integration isnt closed form is it? cause if not i need to figure out how to integrate floor(log(x+1))+1 :P
@Seggan idk im from the universe where no one can think of a funny response
anyway congrats :-)
 
@thejonymyster No, integration is generally not included in "closed form"
 
thats what i thought u_u
 
Also, integrating floor(f(x)) is usually pretty easy, as it's just a series of rectangles
 
ah yeah
 
10:16 PM
@thejonymyster no
 
@Zionmyceliaadamancy easy sure, but not necessarily closed form is it?
 
Depends on the bounds of the integral
 
damn
im doing fizzbuzzlength(x)=int(from 1 to x){floor(log_10(t+1))dt}+f(x) where f(x) is some other junk
not looking good for me :P
 
10:34 PM
Let \$x = \lfloor \log_{10}(n)\rfloor\$. The total length of concatenated integers up to \$n\$ is \$n - 10^{x} + 1 + \sum^x_{i=1} 9i\times10^{i-1}\$
 
i feel like sum also isnt closed form
 
It's more closed form than integration, but you can probably manipulate that sum into a closed form solution
@Zionmyceliaadamancy Sorry, that should be \$n - 10^{x} + 1 + \sum^x_{i=1} 9\times10^{i-1}\$
 
is chatjax busted or is something else going on? it looks all \$-ey
 
Works for me
 
is floor even considered closed form?
 
10:39 PM
floor is close enough lol
nah idk
floor is closed form if mod is closed form
 
@Zionmyceliaadamancy Ignore me, it was right the first time
 
@thejonymyster hmm same with me
ChatJax++ error: ReferenceError: GM_getValue is not defined
 
Just wanna test this: \$\mathbb R\$, \$\mathbb 3\$ and \$3\$
Aww, doesn't affect 3 :/
 
im not getting any errors i might just not have it installed right somehow lol
 
10:47 PM
i just see a bunch of \$
 
is it chrome only
^^
 
Interestingly, for sufficiently large \$n\$, \$n - 10^x + 1 + \sum^x_{i=1} 9i \times 10^{i-1}\$ is actually an upper bound, not a lower bound :P
 
CMC: Golf the constant 6086555670238378989670371734243169622657830773351885970528324860512791691264
= 2^126(2^3-1)(2^5-1)(2^7-1)(2^19-1)(2^31-1)(2^61-1)
 
11:03 PM
@Bubbler is there any significance to that
 
It is the only known sublime number other than 12
 
In number theory, a sublime number is a positive integer which has a perfect number of positive factors (including itself), and whose positive factors add up to another perfect number.The number 12, for example, is a sublime number. It has a perfect number of positive factors (6): 1, 2, 3, 4, 6, and 12, and the sum of these is again a perfect number: 1 + 2 + 3 + 4 + 6 + 12 = 28. There are only two known sublime numbers: 12 and (2126)(261 − 1)(231 − 1)(219 − 1)(27 − 1)(25 − 1)(23 − 1) (sequence A081357 in the OEIS). The second of these has 76 decimal digits: 6,086,555,670,238,378,989,670,371...
 
is there any reward to finding the next one :P
 
> there can be no more even sublime numbers unless there are other (presently unknown) Mersenne prime exponents that are themselves Mersenne primes.
 
You may earn some reputation (not SE rep) if you prove or disprove the existence of odd sublime numbers :P
For evens, yeah it is very constrained by the known list of Mersenne primes
My upcoming challenge has a bit more info on that
 
11:10 PM
@Zionmyceliaadamancy How did OEIS let that in?
 
why wouldnt it?
 
Maybe the editors thought it is worth having despite having only 2 known terms
Usually it requires at least 4
Or it could be just a guideline, idk
 
watching the clone wars, just love the droids' straight faced responses: "Get us out of here!" "Uh, where are we supposed to go?"
as if the droid didnt know a thing about danger :P
 
11:29 PM
@Zionmyceliaadamancy 13 bytes
@Bubbler Also would this make an ok challenge on main?
 
@Bubbler Huh, neat
 

« first day (4223 days earlier)      last day (622 days later) »