« first day (2717 days earlier)      last day (2142 days later) » 

12:00 AM
@EriktheOutgolfer True, but ⊢(/⍨)⊢≤≢ is a byte shorter.
 
@Adám What is it even supposed to look like?
 
@Adám ...anyway
 
 
1 hour later…
1:21 AM
0
A: Sandbox for Proposed Challenges

WretchedLoutA note about this meta post: I just have one example right now, but I will have three in the final. I thought it would be interesting to have a problem about something I know a bit about. Right now it seems a bit mathy, but I wanted to ground the problem on something real. It feels more 'real-...

 
So, in .NET, types are either structs (stack-allocated) or classes (heap-allocated). The latest version added a new construct, the ref struct. Which is a stack-allocated struct that gets passed by reference when used as a parameter. I have no idea what the point is.
 
So, a struct is normally passed down by VALUE??
 
Yes.
That's the point of a struct.
 
Whoops, must have been derping for a sec.
 
@Pavel Note that ref structs have to be immutable. So you can't pass it to a function that modifies its arguments.
 
1:33 AM
@Pavel That is pointless.
 
2:08 AM
1
A: Sandbox for Proposed Challenges

Cat WizardExistential Golf Math has a lot of symbols. Some might say too many symbols. So lets do some math with pictures. Lets have a paper, which we will draw on. To start the paper is empty, we will say that is equivalent to \$\top\$ or \$\textit{true}\$. If we write other things on the paper they...

Is my explanation of the system clear? I know the challenge is not yet complete.
 
2:20 AM
I find it rather odd that changing the listener position causes stuttering but not changing the position of the source
oh well
 
2:52 AM
Apparently my IP has been blacklisted from asciitable.com...
 
3:04 AM
Same for me...
There is ascii.cl.
 
 
1 hour later…
4:24 AM
@JoKing ._o
 
Today I saw a .menu domain in the wild.
 
Anonymous
5:13 AM
@Pavel I guess to save memory and avoid unwanted side effects of copying a struct a bunch?
 
@Mego I actually have since looked it up and found that there's another restriction on ref structs: They can never appear on the heap, even as a a member of some other object. This forces them to be local variables and allows them to work more safely with stackalloc'd pointers and whatnot.
(stackalloc is like alloca)
 
Anonymous
Interesting
 
8:59 AM
@Downgoat In Firefox it seems to draw the outline as two squares plus four rectangles plus four triangles, however when the offset causes the hole to have negative size then it just keeps moving the squares and they end up where you see them in the diagram. As for the rectangles and triangles... well, try an offset of -80px... no, I don't understand it either.
 
 
1 hour later…
10:12 AM
@JoKing wait why
 
@EriktheOutgolfer ¯\_(ツ)_/¯
 
it works for me
 
Oh, it's back now
 
what error did you get?
 
Something like "Your IP has been blacklisted. If you believe this is in error, please contact your service provider.".
 
10:56 AM
@CatWizard Very clear.
 
 
2 hours later…
12:33 PM
CMC: Given an edge-connected region of 1s as a rectangular binary matrix, output number of holes in it. Use O(log n) memory and O(n log n) time, in bit complexity (O(1) mem and O(n) time in word complexity).
Try to come up with an algorithm first. I guarantee that it's possible.
 
1:01 PM
I just thought I had invented a great algorithm for bitshifts by a rational and started writing a sandbox post until I noticed that a << b would equal floor(a * (2**b) and it would be too trivial.
 
1:12 PM
@user202729 What are you expecting the size of a word to be? The size of the whole matrix? Of one row?
 
@feersum Of n.
 
What's n?
 
Oh, I forgot that. n is the number of 0/1 in the matrix.
 
Number of entries or of each dimension?
 
thinking
O(n) time (bit complexity) is possible.
 
1:14 PM
Not sure how a hole is defined either.
 
Number of connected component of 0 inside the outer bound of the 1s.
Example input: ( for 1, space for 0)
█████
█ █ █
█████
-> 2
Ouch, line spacing...
██ ██
█   █
█████
-> 0
 
I'm afraid I am not really following this definition as that one seems to not be contained by 1s.
 
@feersum Better now?
 
The connected component does not count iff if it connects to an edge of the matrix?
 
Assume the matrix is surrounded by 0s.
 
1:22 PM
Also the memory complexities don't match.
 
@feersum Why?
 
O(1) words of memory is O(n) bits of memory.
 
@feersum O(1) words of memory is O(log n) bits of memory.
10 mins ago, by user202729
@feersum Of n.
 
I interpreted as "the size of a word is n"
Anyway I see that it is supposed to log n.
So far I can do it in O(log(n)) bits of memory, but only at the cost of being slow.
 
1:44 PM
██
█ █
███
-> 1
 
not 2?
 
23 mins ago, by user202729
Assume the matrix is surrounded by 0s.
 
ok
 
Refined statement:
 
so what is a word?
 
1:48 PM
CMC: Given an edge-connected region of 1s as a rectangular binary matrix consisting of n numbers, output number of holes in it. Assume the matrix is surrounded by zeroes, and a hole is a edge-connected region of 0s inside the 1 block. Use O(log n) memory and O(n log n) time, in bit complexity (O(1) mem and O(n) time in word complexity, assume a word is O(log n) bits).
thinking again ...
I have not yet rigorously proven it. I have to find some way to make the spec so it's possible.
 
I'm not believing it can be done in O(log n) memory without at least O(n^1.5) time.
 
I think it can be done.
Looks good.
Should I give a hint?
 
2:11 PM
I'd like to give it a whirl first
ok go ahead
 
Almost spoiler. (I hope I don't make any mistakes anyway)
 
2:53 PM
@user202729 Please explain your solution?
 
Assume that the piece of 1 is a 3D shape (similar to a dihedron). Then compute the number of vertices, edges, faces. Then use that to compute the genus. That's the answer.
 
How do you know the number of faces?
Oh, I didn't read the constraint that the 1s are a single connected component.
That's why it didn't make sense to me.
 
Just two times number of 1.
 
3:18 PM
hi.. I have an algo question. If I want to calculate the pearson correlation coefficient between two vectors of the same length it is nice and simple wikimedia.org/api/rest_v1/media/math/render/svg/…
but what if I have a short vector of length m and a long vector and I want to compute the correlation coefficient between the short vector and every subvector of the long one of length m?
 
3:35 PM
@LeakyNun: do you know what would model would model chained ?'s in befunge?
Never mind: I think it's a Markov chain, right?
 
3:54 PM
did xkcd change the format?
 
 
3 hours later…
Anonymous
6:45 PM
@FrownyFrog Slightly - the image permalink is https now, so the regex doesn't work.
 
That challenge is so poorly written. It only got upvotes because xkcd.
 
7:08 PM
@user202729 Would that count as a different language? Jelly UTF-8 v. Jelly SBCS
This is a plea for @CatWizard to keep up the good work with the avatars.
2
 
8:01 PM
Does anyone know of a C++ compiler that doesn't complain about shebangs?
 
Anonymous
@Zacharý No, because then it wouldn't be C++
 
Why would you put a #! in C++
 
Polyglot...
 
But why would that need a #!
 
Anonymous
Probably because there's already a #! in it
 
8:09 PM
Oh, the polyglot challenge
That one
 
No, most likely not for that challenge.
https://tio.run/##bVJdT9swFH2uf8XBrVBD12TlsV9TVxAgIYY2pm0CNFzHTbwlduQ40G7jt3e3KdkY2kMSO@eec32Pz0KU6WbTxiyOIaASUSVGnMNb2hU2WyeZ9fCq9EiFM6ossVjjQqujH@rbd7tgbcxtlomiVOBzGysOYWLwmUuqXBlfcpRKem1NiaV1WCjvlYNaFcppZaRiTAqPKSRxmbeVTFE4TUTG2Pns4uTj7OT469nF0fHnyYC9/XJ1/GHCO90Hib4cbzkBZ8vK1B2QCZNUIlHd4CdrKZla8DY6/6qE6AxeoVMr0Sg0GW9q31fGaJNQAcd0/5C1FuQN9QHvHPKprXxReda6vqb9G469CV7j9hb7@6jpl84mTuSQjlgqDsMn2b6h@gH/5dT9dDu29CpuOr783zcZa@kl9iDzAruOaMBtp/8CxBrBp8qw1k73k7M0xq4qxKlaxVVeDAldrWI0cyw1a70wmIztvrCrNwiCPwb1cXPX6W7vaycS3NxBm51f0@baHhllIvW@KIdRlGifVotQ2jy6cusz/85k2qjIu7X2tlkrFeWipFhED04UFIySFJq7BN@Gj4P
Trying to fit Befunge in there, but I don't know how...
 
\
# pragma once
That works with C++ and Python, but I don't know D.
 
@Pavel D is the biggest problem there
 
D is the big problem: the only # allowed is #line...
 
Sure, #line works in C++ too
 
8:22 PM
The problem there: we can't figure out how to get Befunge to redirect, not to mention Befunge-98 will just bounce between l and i forever (I think)
 
@Pavel also Error: character '\' is not a valid token :/
 
What does " do in Befunge?
 
Toggle string mode... that means anything inside of " ... " will be a string (so redirects won't work)
We can't put three quotation marks or escape them with ", because D breaks.
 
 
3 hours later…
11:32 PM
0
Q: Double a number's continued fraction

soktinpkYour task is, given x, output 2*x. Easy right!? But there's a catch: x will be given as a (possibly infinite) continued fraction, and the output must be a continued fraction. The input is guaranteed to be a real algebraic number whose degree is at most 2. Input: The continued fraction of x. This...

 
> If the repeating part is empty, that indicates a rational number.
not so sure about that...
 
@EriktheOutgolfer why not?
 
@LeakyNun because 1 ÷ 3
 
@NewMainPosts I'm more than confident Mathematica's builtin multiplication would work, but I don't remember properly how continued fractions work to test
 
1/3 = [0;3]
 
11:46 PM
I suppose ContinuedFraction[2*FromContinuedFraction@#]& would work
 
@Pavel How does mathematica represent numbers?
 
@CatWizard Depends?
 
What does FromContinuedFraction return?
 
@CatWizard Try it online!
 
@quartata since when did Closure Compiler recognize copyright comments?
 
11:49 PM
@Pavel That doesn't help. What type does that function return?
 
@FreezePhoenix no idea
 
@CatWizard List
 
No FromContinuedFraction.
Of course ContinuedFraction returns a list
 
@CatWizard Oh, it returns a normal number
 
@quartata I thought you made closure-compiler...
 
11:51 PM
...what?
 
@Pavel What are normal numbers!?
 
Wait did you just mean you had to fix your code for closure compiler, so it wouldn't throw a fit?
 
no I had to fix someone else's code for it
 
@CatWizard The type depends on the value. Sqrt[2] has type Power, and is a complex type represented by 2 and 1/2.
If you print it, you get Sqrt[2].
It has infinite precision.
 
I don't know then. Mathematica is too dumb for me to want to spend any more time thinking about this.
 
11:54 PM
@CatWizard What do you mean?
 
> The type depends on the value.
 
That's the same as in, say python, where a small value is an int and a really big one is called a long
 
Yeah, and that's bad.
 
It's treated the same as any other number.
@CatWizard I'm not seeing the problem. It's just a number. The low-level representation doesn't matter.
 
Dynamic typing is fine. But you have to put thought into your type system, instead of just pretending types don't exist.
 
11:58 PM
@CatWizard But why does it matter?
Not needing to care about types is kinda the point.
 

« first day (2717 days earlier)      last day (2142 days later) »