« first day (3967 days earlier)      last day (869 days later) » 
00:00 - 17:0017:00 - 00:00

5:00 PM
yikes
 
@PyGamer0 ⍤/ is a useful monadic operator.
 
CMC: infinite list of 2-tuples of positive integers, ordered by the sum of the two elements. Tuples with the same sum should be ordered lexicographically.
 
5:22 PM
52 bytes in python using the trivial approach
Jelly, 11 bytes: ®ṖżU$Ṅ€µ‘ɼ¿ (Try It Online!)
really clunky cuz register things; there's almost definitely a cleaner way to do it
 
nice
@hyper-neutrino 47 bytes
 
ah, nice
 
hmm, ATO doesn't seem to be giving the 128kb output limit warning
 
@cairdcoinheringaahing Absolutely. I mean, there's even a badge for it.
@lyxal If you're using this, shouldn't you import it first? ;)
 
import antigravity;
NEXT
 
5:37 PM
@ThomasWard Drop the semicolon, -1 byte :P
 
import nuke
nuke.explode()
i challenge you to golf that xD
#SelfDestructiveCode anyone? xD
 
Tuples as dictionary keys is something I really wish existed in JS
(Or something similar of course, since JS doesn't really need tuples)
 
@ThomasWard Well, on TIO the first line throws a ModuleNotFoundError, so you can remove the second line entirely b/c it's never executed :D
 
lol
 
@RedwolfPrograms I assume the JS idiomatic solution is to concatenate the tuple elements into a string and use that as the key? /hj
 
5:40 PM
Yes
That is actually what I'd do
I love JS, don't you?
 
ಠ_ಠ
5
 
@RedwolfPrograms Sometimes
 
@RedwolfPrograms That's fairly close to what I did to make Pip types hashable. PipType.__hash__ just converts the Pip object to its string representation and returns the Python hash of that string.
 
@AaroneousMiller that would basically be a meta-tag, so no
TIL that Python's enumerate can take 2 arguments: enumerate("abc", 6) -> [(6, "a"), (7, "b"), (8, "c")]
 
5:44 PM
@AaroneousMiller The AoCG challenges are also clearly labeled as such in the title, and pretty easy to find by searching "advent of code golf"
@pxeger Oh, cool
 
6:06 PM
@hyper-neutrino You're watching and judging people today aren't you :p
 
@DLosc But... you get some other stuff
@pxeger Vyxal 2.4.1.something, 3 bytes: ∞:Ẋ(because of the way Vyxal's cartesian product on infinite lists works)
 
6:22 PM
what's our stance on this?
 
It's fine, but needs golfing
 
@ThomasWard when am I not xD
 
@DLosc True
 
@emanresuA also you can just look up AoCG2021
and even if you couldn't it's still not a good tag because like pxeger said that's a meta-tag
 
Or look at the meta question which lists them all
 
6:24 PM
Yeah.
 
Tho, if we do it again in later years, and organise it on meta, may be appropriate
 
@cairdcoinheringaahing That's what I meant. They posted it non-golfed so that someone else could golf it, since they don't know how. Do we help them golf it, or direct them to TNB so we can give them tips? I guess I'm just not quite sure how to complete the review
 
@hyper-neutrino when you sleep :P
 
Can they get into tnb?
 
Currently, it applies to 2 meta questions, and potentially more in the future
@AaroneousMiller You can show them a trivially golfed version (single letter vars, reduced whitespace) etc. and link to the Python golfing tips
 
6:26 PM
@emanresuA yes, they have association
@ThomasWard wrong >:-D the power of the diamond leads to abilities many consider unnatural
 
Darth Hyper the Neutrino, Sith Mod :P
 
@cairdcoinheringaahing lol
 
So this is interesting. I VTCed this question. However, because I didn't VTC as dupe (I VTCed as unclear), I didn't hammer it. I didn't VTC as dupe, because I don't think the linked challenge is a good dupe target. But, because I have a gold tag badge, and it's been closed as a dupe by majority vote, I can still edit the dupe target list
Because that allows me to add or remove any challenge tagged to the list of dupe targets, I can, for all intents and purposes, reopen it and close it as a dupe of a different challenge, without actually VTRO/VTCing :P
 
you didn't know gold-badge gives you extra permissions in review did you :P
gives you some instaclose like diamonds have in that tag
 
Yeah, I know I can hammer with a gold badge :P
 
6:47 PM
@cairdcoinheringaahing Except... you're not listed as a gold tag badge holder.
 
Because I didn't vote to close as a dupe, I VTCed as unclear
Yet, I still get the powers of the gold tag badge on the question
 
This is weird.
 
CMQ: what should combinations(seq, k) return when k > len(seq)? Just an empty list?
 
7:14 PM
@pxeger wrap so you don't need to modulo
 
@pxeger Combinations without replacement, right? Nah, you should do fizzbuzz.
o/
 
8:00 PM
0
A: Sandbox for Proposed Challenges

caird coinheringaahingOutput an algebraic number Consider a polynomial with integer coefficients \$a_0, a_1, a_2, \dots, a_n\$, with \$a_n \ne 0\$: $$p(x) = a_nx^n + a_{n-1}x^{n-1} + \cdots + a_1x + a_0$$ We say that a (potentially complex) number \$z\$ is algebraic if there exists such a polynomial \$p\$ such that \$...

 
@SandboxPosts So long as this is clear enough, I'm planning on posting this in a few hours. Just wanted to get a second pair of eyes to take a look at the output requirements
@SandboxPosts Wait no. Am I stupid, or is this trivial: Given n, output 2^(1/n)?
 
@cairdcoinheringaahing Yeah, I think that would do it.
 
@DLosc Well then Python REPL: 2**(1/input())
 
@pxeger Brachylog, 9 bytes: ≜~+Ċℕ₁ᵐẉ⊥
 
@DLosc Good thing I've got another challenge about algebraic numbers in draft, but that's annoying that I didn't see that until posting :/
I had a feeling in my gut that I should use the Sandbox rather than post directly to main :P
 
8:09 PM
≜ Pick an integer (trying smaller absolute values before larger ones)
~+ List of integers that sum to that number
Ċ List has to be size 2 ("C"ouple)
ℕ₁ᵐ Each element of the list has to be an integer >= 1
ẉ Write the list with a trailing newline
⊥ Fail; backtrack and try the next possibility
 
@SandboxPosts Golfed to more concisely explain the challenge :P
 
@pxeger Pip, 17 bytes: W++oFi1,oPi.k.o-i
 
@emanresuA ?
 
@pxeger Given that nCk = 0 for k > n, yes
 
@cairdcoinheringaahing hey, that's not true, you could output 3^(1/n)!
 
8:22 PM
Seems like it'd be easier to just output 3^(1/n), no need to take the factorial :P
 
@cairdcoinheringaahing I think that was a exclamation mark, not factorial.
 
I put the ! outside the code block specifically to guard against that kind of bullshit​!
From now on, I'm going to put a ZWSP before every ​! I use so you can't do that
 
@AlanBagel I don't know what you're talking about, any ! at the end of anything mathematical is obviously a factorial
 
@pxeger What does ZWSP stand for?
 
@cairdcoinheringaahing Can you even take the factorial of a non-integer? I'd think you would need to use the gamma function instead ;)
 
8:24 PM
@cairdcoinheringaahing But it's outside the code block.
 
@DLosc if n=1, it would work...
 
:59837762 That's using a triple factorial of 3 (which is just 3) and a double factorial of 11 (which is 11*9*7*5*3*1 = 10395), so that equals 31189
@DLosc Idk about you, but if someone ever says "take the factorial of 0.5", I'm assuming they mean the gamma function :P
 
@cairdcoinheringaahing what about 2+2! (outside code block)?
 
@cairdcoinheringaahing At least that's normal.
 
8:27 PM
Yeah, cause 2! = 2, so it's just 2 + (2!) = 2+2 = 4 :P
 
@cairdcoinheringaahing If they're a mathematician, I'm assuming they misspoke. If not, I'm assuming they don't know what they're talking about :P
 
Clearly, we need to make the factorial operator distribute over division, so that 0.5! = 1!/2! = 1/2 :P
 
@cairdcoinheringaahing So 1+1=2!
 
@cairdcoinheringaahing 3+4! ? (outside block)
 
@AlanBagel 27
At least I make more sense than Jelly :P
 
8:29 PM
@cairdcoinheringaahing 2+2exit()!
 
In fact, in Jelly, addition isn't even commutative
 
@cairdcoinheringaahing whhhhhy
 
@cairdcoinheringaahing That's just Jelly using desk calculator precedence rules :P
 
@AlanBagel Cause it does 4! first, then +3. But in 3+4!, it does 3+4 first, then applies ! :P
 
8:31 PM
@cairdcoinheringaahing reminds me of smalltalk (i think smalltalk didn't follow precedence rules, correct me if wrong)
 
@AlanBagel Right (and WP even uses factorial in their example)
More to the point where Jelly is concerned, APL is the same way (and I assume J follows suit)
 
@DLosc Does not following precedence rules benefit the language in some way?
 
Yeah, it can have lots of built-ins without you needing to memorise a huge precedence table. (Looking at you, C++)
 
I mean, Jelly follows precedence rules (in fact they're the thing most people find difficult, and are termed "chaining rules"), they just aren't consistent with math
 
Yeah, I was about to say. APL/J/Jelly do have such rules, and they are much simpler than traditional mathematical notation.
 
8:38 PM
"Simple" depends on what you're used to
But yeah, it definitely scales better
 
@RedwolfPrograms I used to traditional math.
 
No, simple is objective.
 
There are fewer of them. Therefore, simple :P
 
My language's chaining rule is based on the factors of a 2048 bit integer
It's a very simple rule
 
8:40 PM
Exactly. The rules of TMN and C++ etc. are long and involved. APL-type rules are possible to describe in just a couple of sentences.
 
@Adám What does TMN stand for.
 
Traditional Mathematical Notation.
@RedwolfPrograms But then that integer, or its factors, are part of the rule-set. That's huge.
 
Imagine not working things out left to right and so having no need for precedence rules
 
@Adám But it's just one rule
Isn't one rule objectively simpler than two? :p
 
1*2+3!/6^2 is 400
 
8:42 PM
@RedwolfPrograms Not if that rule has more details than the two combined.
 
How do you objectively describe how detailed something is?
 
E.g. write it up and compare letter counts.
Or implement a parser and see how much code you need.
 
But someone who speaks english would potentially find one method shorter than another, and someone who speaks spanish could get the opposite
 
Yes, if it is close. It isn't.
 
Relying on a natural language for complexity doesn't exactly make it "objective"
 
8:44 PM
Then use my second method.
 
Python vs. Java
Maybe one language has a built-in that makes it easier to compactly write one of the options, and the other doesn't
 
Doesn't matter, if you use the same language to describe both (and do not rely on eval).
 
But depending on which, your measure of simplicity changes
That's hardly objective
 
Only slightly. The differences are so great as to make those variations minute.
 
And you're saying that complexity to implement with code === complexity to learn and use as a human?
 
8:45 PM
No.
 
I thought simplicity was objective
 
No, precedence rule simplicity is objective.
 
But the things I described above apply to precedence rules
 
OK, I'm not going to discuss this further. I have stuff to do.
 
@Adám C++'s precedence table is tiny. Take a look at Pip's! (When you don't have stuff to do.)
 
8:49 PM
APL's precedence table:
1. Stranding
2. Operators: left-associative
3. Functions: right-associative
 
@DLosc pip's parser must be ridiculous lol
 
Then of course you need to list the operator and function glyphs, but they can fit on a line.
BQN is even simpler:
1. Stranding
2. Operators (all superscripts and glyphs with unbroken circles): left-associative
3. Functions (all other glyphs): right-associative
Done. No need to list the symbols.
 
I think our definitions of "simple" are different. You seem to be describing how simple it is to write down, and I'm talking about how simple something is to use or implement.
 
Both of which are pretty clearly subjective
 
8:53 PM
@pxeger Not particularly, as it turns out. It has one function that parses expressions, essentially treating all operators as if they had equal precedence, and then another function that rearranges the parse tree according to the operators' correct precedence.
 
I love that amazon lists "Scary Movie" as a horror movie :P
 
@DLosc Adding a new operator is as simple as adding a new entry to the list of operators. I haven't substantially changed the expression parsing implementation in years.
 
@pxeger kCl returns 0 in that case, so empty list would seem to be reasonable
 
I will say, one nice thing about the APL style of precedence for golf is that you don't need parentheses to write something like 2*(3+4)--you just change the order.
 
tfw you haven't drank water in over 20 hours but you're at school and have to wait another two hours
 
9:12 PM
who wants to fund my campaign to provide water for endangered redwolves?
only 1 known, and it's in captivity
6
this is a special redwolf, not a red wolf
over 2% of our donations will be used to support our cause
that's more than $1 in $50
oh wait, there are more than one
 
9:40 PM
That moment when google relies on xkcd for information:
 
interesting
 
att
why wouldn't you :)
 
I hope they don't rely on xkcd for getting random numbers :P
 
4?
 
Ugh add that xkcd to my list of overused and unfunny jokes
Nov 22 at 22:12, by Redwolf Programs
Jokes that are no longer funny:
1. Integer overflow
2. Mathematica having a built-in for everything
3. (I can't think of any others at the moment)
 
9:44 PM
'); DROP TABLE overused_xkcd_jokes; --
Now we can start making those jokes again :P
 
@cairdcoinheringaahing That's not even really an xkcd reference though lol
(If it was intended to be)
 
@RedwolfPrograms What happens if Redwolf's listing overused and unfunny jokes becomes an overused and unfunny joke?
 
If it ever becomes a funny list I will have failed lol
 
@RedwolfPrograms Little Bobby tables.
 
Idk, Exploits of a Mom made SQL injection more well-known/understood IMO
 
9:45 PM
Randall didn't invent SQLi though lol
 
He also didn't invent "random" numbers
 
@RedwolfPrograms Correct, Redwolf, battery staple
 
3 mins ago, by caird coinheringaahing
I hope they don't rely on xkcd for getting random numbers :P
@cairdcoinheringaahing I wonder what this was referring to :p
Almost certainly one of those pre-xkcd jokes about non-random numbers
 
 
No, my point is that you don't have to invent a joke to popularise it, which is what xkcd did with Bobby tables
@Adám Chosen by a fair Google roll? :P
 
9:48 PM
@cairdcoinheringaahing Wait really?
 
So Google found 4E9 random numbers, but chose to put this particular one at the top…
 
I guess I wasn't around enough on the 2014 internet to know if SQLi was commonly joked about :p
 
@RedwolfPrograms I think so, yeah. Bobby tables helped me understand what SQL injection was, and it's referenced a lot
Take a look at some of the older SO threads that still survive for 2010 era programming jokes :P
 
The HNQs on a question I just read tell an interesting story...
"Toilet detached from floor" followed by "should I get a divorce before marrying again" followed by "is it illegal to have a child out of wedlock"
 
10:05 PM
@RedwolfPrograms what
 
@RedwolfPrograms Wait a minute
I just realized the implications of the second one o_o
 
10:31 PM
Hey so fun fact: GPT-3 is now available to everyone 18+ - there is no wait list anymore
Now you too can make funny TNB autocompletions
Codex is still wait list though
 
 
1 hour later…
11:46 PM
antifreeze
 
Don't worry, the room doesn't freeze so quickly.
 
it's only joke
 
You mean to comment on the fact that the room had been quiet for an hour?
 
5
Q: Tips for golfing in Chef

FmbalbuenaWhat general tips do you have for golfing in Chef? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to Chef (e.g. "remove unnecessary whitespace" is not an answer). Please post one tip per answer.

^^^ the bounty ends in 32 mins
 
00:00 - 17:0017:00 - 00:00

« first day (3967 days earlier)      last day (869 days later) »