« first day (2703 days earlier)      last day (2140 days later) » 

12:47 AM
@LeakyNun I'm going to implement SMA*+ easychair.org/publications/open/TL2M
in Python and then in Rust
it's a really useful routine to have around
 
nice
 
a lot of problems you can model as graph searches
and as long as you have a reasonable guess for some heuristic you can make a fairly fast optimal solver right away
like I did for the block partitioning challenge
 
CMC: Given a partial ordering of a finite set, find a maximal element.
 
@LeakyNun how is the input given?
 
as you like
maybe I should say that the input is to be given as an adjacency matrix of a directed graph
 
12:57 AM
@LeakyNun what if the input is given with a maximal element as the right-hand part of the last element of the input :P
 
@ASCII-only right
 
hmm. could you give an example of a more complex poset
 
So I'm reading this document
on P.3 it says "this proof is long"
I went like "how long can it be"
and then I scroll and scroll
ok it takes up 2 godforsaken pages
ok you win
 
eh
that should be lambda
@LeakyNun m=lambda C,r=0:m(C,C[r].index(1))if any(C[r])else r
 
m takes two arguments...
 
1:01 AM
@LeakyNun well one is optional :P
 
@LeakyNun oops
fixed
C[a][b] is 1 when element b > a
 
sure
 
@orlp * >=? or am i confusing that for something else >_>
 
nope
@LeakyNun I believe that's valid, right?
any(C[r]) is true if there's an element bigger than r
 
ok
 
1:04 AM
and since I can return ANY maximum element
I can just start at 0
 
CMC: Do this in brainfuck
 
and keep finding elements bigger than it until I reach a maximum
 
@orlp and congratulations you have proved Zorn's lemma for the finite case
 
this is assume consistency of course, if a < b < a for some ungodly reason it will never finish
 
sure
 
1:08 AM
ok so apparently partial order is usually <=?
 
right
but let's allow < because this is a CMC
 
huh?
my metric is exactly the same
 
@LeakyNun but that's not the same thing :(
 
"C[a][b] is 1 when element b > a" <=> "C[a][b] is 0 when element a >= b"
 
@orlp ???????????
did you assume totality
 
1:10 AM
!(b > a) == (a >= b)
 
that's totality
 
no it's not
 
assume !(b>a). go prove a>=b.
 
or is it?
also what's wrong with assuming totality
 
@orlp yeah. except it doesn't always handle a <= b <= a (i.e. a = b) corrrectly (since what you're passing it isn't exactly a poset, I think?)
 
1:11 AM
isn't that the usual understanding?
 
@orlp partial order
 
@ASCII-only yes it does
 
i think? idk
 
a partial ordering is one that satisfies reflexitivty and transitivity and anti-symmetry
 
C[a][b] = C[b][a] = 0
 
1:12 AM
a linear ordering / total ordering is one which also satisfies totality
 
@LeakyNun I just assumed a partial ordering was a set of comparison results
 
@orlp yeah. the thing is, you never have to handle that because the input is already preprocessed for you, I think?
 
In mathematics, especially order theory, a partially ordered set (also poset) formalizes and generalizes the intuitive concept of an ordering, sequencing, or arrangement of the elements of a set. A poset consists of a set together with a binary relation indicating that, for certain pairs of elements in the set, one of the elements precedes the other in the ordering. The word "partial" in the names "partial order" or "partially ordered set" is used as an indication that not every pair of elements need be comparable. That is, there may be pairs of elements for which neither element precedes the other...
 
(so it's a set of <= instead of any comparison)
 
@LeakyNun I'm not used to analyzing this from that context
let's say I have two elements a and b
and I compare them with a <= b
and the result is false
 
1:16 AM
then that's not a partial ordering
 
I now know a > b
I'm used to viewing this from the sorting perspective ^^
where you're counting comparisons
 
@LeakyNun hang on
orlp's solution doesn't work since posets are reflexive right
 
right
I thought he just removed reflexivity, since they can be easily transformed to each other
 
i guess that would work
 
1:36 AM
@ASCII-only hint: count
 
@LeakyNun ??? how can i use that
 
well, you would replace the any in orlp's code with C[r].count()>1
CMC: (extrapolate by yourself) given n=4, output [[0,1,1,1],[1,0,1,1],[1,1,0,1],[1,1,1,0]]
 
@LeakyNun but it doesn't look like it would work here
 
well, there's nothing above r iff the count is 1
 
@LeakyNun is this for orlp's code
 
1:42 AM
for you
 
replace -- with +
 
oh and I have a 49-byter
 
@LeakyNun Charcoal, 8 bytes: EθEθ¬⁼ιλ
 
1:46 AM
CMC: Given a partial ordering, extend to a total ordering.
 
@LeakyNun would it be always possible though
 
@LeakyNun lambda n:[[1]*k+[0]+[1]*(n-k-1)for k in range(n)]
 
no idea
bingo
 
>_> oh yeah. was going to do that but 1. more effort 2. i thought it would be longer. i guess a double loop is really ungolfy though
@LeakyNun so like this just with values flipped
 
right
@ASCII-only also 8 bytes: UOθ1G↘θ0
 
1:58 AM
@LeakyNun :O you can write charcoal. also i guess that works but it's not actually an array :P
 
oh
 
imo text based output is only valid if there's no other choice. e.g. windows batch apparently
 
@orlp that 1/2**0 term dwarfs the others
@LeakyNun Charcoal, 8 bytes: Eθ⭆θ¬⁼ιλ
 
oh and my latest CMC is possible
19 mins ago, by Leaky Nun
CMC: Given a partial ordering, extend to a total ordering.
 
@LeakyNun fun fact
if you know the number of possible linear extensions of a partial order you can make an optimal sorting algorithm
because you can greedily select the comparison which results in the least amount of linear extensions
 
2:13 AM
I see
 
 
1 hour later…
3:18 AM
Hi
 
 
3 hours later…
5:52 AM
I just noticed something interesting.
One complains the type is void* and the other complains it's nullptr_t
 
 
2 hours later…
8:12 AM
@Pavel makes sense though since nullptr implementation is up to the compiler I think?
(well, most of its behavior)
 
8:47 AM
0
A: Sandbox for Proposed Challenges

wastlAnalyse elegiac couplets code-golf natural-language The elegiac couplet is a poetic form, consisting of a hexameter and a pentameter: \begin{align} -\overline{\smallsmile\smallsmile} |-\overline{\smallsmile\smallsmile} |-\overline{\smallsmile\smallsmile} |-\overline{\smallsmile\smallsmil...

 
 
1 hour later…
9:57 AM
hi @orlp
 
@LeakyNun hi
 
 
1 hour later…
11:13 AM
@LeakyNun I'm done with my exams
 
11:53 AM
@LeakyNun How can "a partial ordering" be represented anyway
A solution would be to try all permutations and test validity.
 
ngn
12:12 PM
@user202729 there are better solutions: en.wikipedia.org/wiki/Topological_sorting#Algorithms
 
@ngn Not for code golf...
 
 
2 hours later…
2:26 PM
@ASCII-only No, it's supposed to be nullptr_t. GCC is wrong.
 
3:04 PM
is document.getElementsByClassName guaranteed to return the elements in order that they appear in the HTML?
 
3:35 PM
@Pavel It's just a warning...
 
The warning is wrong.
 
Probably GCC decide to make a "reasonable" conversion first.
I don't know why.
 
 
3 hours later…
6:42 PM
Swift's OOP is just amazing for writing esolangs, but unfortunately the other so-called features such as its very strict type system are upsetting... (yes, I am attempting to write a stack-based language in Swift)
 
@Mr.Xcoder strict type system? O_o example?
 
@Downgoat pow() is the best example I have in mind right now
 
0
A: Sandbox for Proposed Challenges

ngmRotational symmetry in which bases from 2 to 36 A number (here, a non-negative integer) is rotationally symmetric if it "looks" the same after being rotated 180 degrees. For example, 69 (heh.) Here's a related challenge. We're going to consider bases from 2 to 36, using the symbols 0-9A-Z as ...

 
7:07 PM
I spent all afternoon trying to work out how to write some nice plumbing from a C-style callback library to a C++ object. I managed to simplify it down to a template struct and a template function. I'd link some code but a TIO link won't fit in chat.
 
You can make it fit by using CTRL/CMD+ENTER
 
7:32 PM
@orlp lol the example here is a very close call
 
 
3 hours later…
10:16 PM
I have developed such a deep hatred for Docker...
 
are you sure you didn't just type another string and then type "dreh"? also, use gitlab lol
 
Gitlab, the hosted service is absolute trash. The medium time to open a page for a smallish project from our office (two independent fiber connections) is 15 seconds. Hosted build don't work most of the time, because Gitlab.com's infrastructure is garbage (their metrics are public, frequent outages and queue overloads).
The load time for any page on their site that is!
 
and I suspect GitHub is also too slow
 
No, of course not.
 
(and to be acquired by Microsoft)
 
10:22 PM
GitHub is fine. Microsoft's VSTS (the real Gitlab competitor for "real" enterprises) is also pretty great. VSTS build system e.g. is awesome, comparable to e.g. Buildkite.
 
I guess you can't ask for, eh, migration to GitHub, right?
 
Why would you do that? You'd loose pretty much all features of Gitlab/VSTS.
GitHub is a simple git frontend. Gitlab and VSTS are full cycle software project management tools (PM, helpdesk, ticketing, code hosting, merge workflow, build management, cluster management etc).
I love both of them. I hate Docker, though.
 
so, why are you forced to use it?
 
Docker? What else are you going to use?
Oh, the error was / is a full service disruption: status.docker.com/pages/533c6539221ae15e3f000031 :(
 
does this happen often?
and...Docker Status's Twitter account has been suspended
ouch
 
10:34 PM
There is always something wrong, and when you find it, the next thing breaks.
Docker is a Heisenbug accelerator.
I'm giving an in-depth hands-on Docker workshop tomorrow to a team of 30 devs. Hopefully, it'll be back by then I can skip half of it ...
 
10:49 PM
> [Investigating] Our systems are experiencing higher than usual error rates due to a failure in our caching systems. Our team is investigating.
tip of advice: "a" can't replace "another"
 
> tip of advice
Where's the rest of the advice :D
 
if I post it fully, it will be most likely considered noise, so the rest is implied :P
 
CMC: Given an array of integers N (at least 1), output the number which is the concatenation of each integer in N. E.g.: N = [123, 491, 400], output 123491400.
 
is this really not a dupe
 
I'm pretty sure CMC's were just to waste time, not to be unique :P
 
11:02 PM
@ConorO'Brien Convex, 0 bytes: Try it online!
 
huh
neat!
 
it's really just taking advantage of GolfScript's automatic procedure that can be described as 1) flattening the array 2) converting each element to a string (not representation, just string) 3) concatenating the strings together
so the solution is a full program :P
for example, [123 "abc" 400] is converted to:
123abc400
however, this is Convex, not GolfScript
well, it's simple: CJam is GolfScript's offspring, and Convex is CJam's offspring
some behaviors don't go away
 
@ConorO'Brien J, 8: [:;":&.>
 
@ConorO'Brien APL (Dyalog Unicode), 3 bytes ∊⍕¨
@ConorO'Brien Alternative J solution, 8 bytes ' '-.~":
 

« first day (2703 days earlier)      last day (2140 days later) »