« first day (4186 days earlier)      last day (667 days later) » 

7:20 AM
Gotta love C man
When it shows you a bunch of unrelated errors only when a syntax error occurs
 
@emanresuA Is it maybe because of that "feature" where the compiler tries to guess what you meant despite the syntax error, and its guess also comes with loads of other errors?
TypeScript does that especially poorly
 
7:36 AM
@pxeger Context: I'm golfing, and I got a bunch of implicit scanf errors burying that I was missing a semicolon
 
because you didn't include stdio.h?
"implicit declaration of function scanf"?
those are at least probably right
 
@pxeger Yeah, but I don't get those when there isn't a syntax error...
 
Huh
 
 
2 hours later…
9:39 AM
Time to try creating an interpreted golflang
In theory the code should be elegant and simple. In practice, it'll probably be held together with duct tape by the time I'm done
 
10:04 AM
@emanresuA ... so you have been transpiling this entire time?
 
Pretty much yeah
 
10:57 AM
CMP: Should lists be immutable? (flax)
 
For a tacit lang, probably not
Jelly's get-head-remove is quite useful
 
 
2 hours later…
1:10 PM
Eh, i think it’d be okay for a tacit lang
Immutability is nice if you have infinite lists
But if you don’t have them then mutability can be pretty useful too
 
2:02 PM
@user i am planning to add those.
 
2:33 PM
@PyGamer0 no. At least, not on the surface
it's okay to implement them as immutable objects, but allow users of flax to mutate them
 
How are you gonna allow proper mutation if you don't implement them as mutable objects?
Implement your own memory management system?
 
return deep copies
 
The point of mutation would be that if you use the same object more than once, its value can change during that time
@lyxal but then that's not what one normally means by mutation
 
it simulates it though
@pxeger I was considering surrounding mutate in quotation marks originally
because I understand that it's not exactly mutability
 
a language in which you can't ever copy or modify any values wouldn't be very useful
so of course you're gonna allow that
but unless I'm misunderstanding you, what you're describing is immutability
 
2:37 PM
I'm talking about allowing things like assignment to lists without actually ever changing the internal list
 
like "substitute the value at index i of list a with the new value x"?
 
yes
like a[x] = b in python
 
that's only a single operation
and it isn't the same as mutation
 
3:17 PM
@lyxal why? vyxal has immutable listsm
@lyxal oh
so every operation returns a new list?
 
3:53 PM
@emanresuA Let's gooo
CMC: Given a matrix and a nonnegative integer, rotate the matrix that many times. (Clockwise or counterclockwise, your choice.)
 
@DLosc matrix? so these are 90° rotations?
 
4:34 PM
@Neil Yep
 
4:46 PM
0
Q: Infinite quote escaping sequence

Command MasterRelated We start with the string a, and forever append to the string a comma followed by the string quote-escaped, where quote-escaping means doubling all quotes in a string, and then surrounding it with an additional pair of quotes. In the first few steps we will get a, a,'a', a,'a','a,''a''', a...

 
@DLosc Charcoal, 4 bytes: A⟲⊗A (matrix of characters as a newline-separated list of strings)
 
5:01 PM
0
A: Sandbox for Proposed Challenges

AdamRuns Between Values code-golf In my work, I needed to find all the indices of values in a list that were between two given values. However, because these associated values tended to come in "clumps", it made sense to compress them into "runs", which describe sections of the list matching the crit...

 
@DLosc 05AB1E, 3 bytes: Føí
 
 
2 hours later…
6:54 PM
@DLosc Charcoal, 4 bytes: ✳⊗AA
interestingly, this takes the same inputs as my first version, even though the is now before the first
 
7:09 PM
Hi all
If you start a symmetric random walk on the number line at the origin and have the rule that if you are at 0 and try to move left you stay at 0, how can you compute the expected time to get to x?
 
appears to be x * (x + 1)
 
Oh!
So 2 if x=1 which seems right
 
Yep, I've simulated 100k tries with numbers ranging up to 100 and the pattern seems to hold
 
That's pretty cool
 
7:22 PM
I am very impressed!
Another question.....
I have two buttons and one gold ingot. Button A has prob p1 of giving you the gold each time you press it. Button B has prob p2
It costs c1 to press button A and c2 to press button B. You want to find the gold with the minimum expected cost
To do this you would compute p1/c1 and compare it to p2/c2 and repeatedly press whichever button gives the bigger ratio
But then you learn that each time you press a button, the cost of pressing that button again goes up by 10.
What should you do?
 
@pxeger It appears that on average you return to 0 x times, plus the first time when you start on 0 (which is where the x + 1 comes from), and on average you'll get halfway there (or more accurately, move half of x times), and since you do that in both directions you get x, which is where that comes from
 
good explanation
 
@graffe I'd imagine it'd be to recalculate the cost of pushing the button after each time you do it, and greedily push whichever has the higher expected value
 
@NoHaxJustRadvylf yes but is that optimal?
 
It feels like it would be
But I don't know
 
7:29 PM
I was hoping someone might have an argument for why it was or wasn't
 
I think it works, because the cost of pressing each button is independent of how many times you've pressed the other one, so you can freely reorder any sequence of pushes without changing the total cost of the whole sequence, and the reordering therefore only changes how far into the sequence you're likely to get before you get the gold
 
We are worried about the total cost, not just the cost incurred on the winning button
Maybe I didn't follow your argument
 
8:14 PM
@pxeger I follow you up to ", so you can freely reorder any sequence of pushes without changing the total cost of the whole sequence,". For "the reordering therefore only changes how far into the sequence you're likely to get before you get the gold" how does this argue that the proposed strategy is optimal?
@pxeger my confusion is that you haven't used that the costs increase by a constant in your argument
@pxeger does it make no difference how the costs are updated?
 
8:31 PM
CMC: Convince me that 2+2=5
 
not convinced?
 
Simple visual proof:
user image
13
 
I like that!
 
@emanresuA I could blame it on satellite Internet. Sometimes the satellite is Voyager 1.
 
8:51 PM
Lol
@NoHaxJustRadvylf That's clever
 
 
2 hours later…
10:35 PM
See y'all in a week!
 
att
10:48 PM
@pxeger indeed
 

« first day (4186 days earlier)      last day (667 days later) »