« first day (3782 days earlier)      last day (1063 days later) » 

7:00 PM
@ngn Pretty sure destructuring assignment's an example of pattern matching, but that'd be something like [1, 2 | A] = ... instead (not totally sure, though)
 
@ngn Python's destructuring assignment only works on iterables, and can't have defaults. Python's now (last I checked like a year ago) added a dunder method to allow pattern matching from most objects.
 
ngn
@Peilonrayz so, when it's with an iterable, it's called destructuring assignment, and when it's with an arbitrary object, it's called pattern matching?
 
@ngn When it's an assignment where you look at the structure of an iterable or an object, it's destructuring assignment
Pattern matching can also be a switch-style thing where you have multiple branches, like if + assignment instead of just assignment
 
@ngn Python's analogue to destructuring assignment is *args. But I don't think it has a name... or at least I forget it every time I learn it.
 
@Peilonrayz Python can't do destructuring assignment on objects?
 
7:13 PM
No
 
Oh, that's weird
 
Yeah. Every time I use JS I always leave thinking "it'd be nice if Python had {foo, bar} = obj"
 
@Peilonrayz splat?
i think that's what it's called under some contexts
 
what does (~0 << 3) mean in C?
 
-1 << 3 = -1 * 2 ^ 3 = -8
I think. I can never remember the precedence of <<
 
7:17 PM
unary always takes precedence i believe
 
~ takes precedence over << (which is pretty low on the list anyway)
 
@hyper-neutrino Splat comes back with unpacking, which AFAIK is different to destructuring assignment. head, *tail = value vs values = head, *tail.
 
@Peilonrayz ah, never mind then. i've just seen the term thrown around when it comes to functions like lambda *x: ... and f(a, *b)
 
@cairdcoinheringaahing this is in code optimized for speed. Why would you do that?
 
7:18 PM
@cairdcoinheringaahing It's -8
@hyper-neutrino lol imagine using good formatting
 
@Anush context?
 
@hyper-neutrino Nah, get rid of those spaces :P
 
I thought shifting a negative sign value was undefined
 
7:20 PM
@hyper-neutrino The joys of every language seeming to having different terminologies ;)
 
In my language, "splat" is when a pigeon poops on your head
 
@Anush why would it be? you just need to move the bits over
0 is 00000000000000000000000000000000
 
@hyper-neutrino it's what gcc says :)
 
@Anush Shifting by a negative sign value probably is
 
so ~0 is 11111111111111111111111111111111 or -1
 
7:21 PM
@Anush Shifting by a negative value is undefined IIRC
 
so ~0 << 3 is 11111111111111111111111111111000
 
ngn
@Peilonrayz try this :) locals().update({"foo":123,"bar":45});print(foo)
 
why would it be in this code? I mean why not just write -8?
 
which is -2147483648 + 2147483640 which is -8
@Anush probably clarity
 
@hyper-neutrino ???
 
7:22 PM
@ngn Are you trying to trigger me, being a CR mod and all ;)
 
it's a bitmask
 
@hyper-neutrino how is it clearer?
the whole line is confusing
for(m = (unsigned char *)(&vector[size & (~0 << 3)]); n < m;) {
 
@Peilonrayz being a CR mod in this room is a risky endeavor ;)
@Anush true
 
can anyone translate it?
 
@Peilonrayz Here, get triggered >:)
@Anush Guess it's to make them look smarter :P
 
7:24 PM
@user :)
@hyper-neutrino oh!
 
size & (~0 << 3) is just "truncate the size to a multiple of 8"
 
@Anush That was an odd edit
 
I replied before your message by mistake
:)
size & -8 truncates to a multiple of 8....?
doesn't size * size%8 do the same?
 
@hyper-neutrino That's smart (and actually looks clearer now)
@Anush % and * isn't fast enough maybe?
 
ah maybe
 
7:26 PM
Shifting bits is probably trivial
 
yes
I get 62 warnings from clang :)
mostly warning: shifting a negative signed value is undefined [-Wshift-negative-value]
but it is very fast
 
@Anush wait what how would that work
 
Doesn't C optimise bitshifts? Maybe it actually is faster to do ~0 << 3 than use negative numbers?
 
also (size >> 3) << 3 would be clearer IMO
 
@cairdcoinheringaahing Probably won't be faster, but it'll be done at compile time
 
7:28 PM
@Anush yes because -8 is 11111111111111111111111111111000
and so & -8 will just set the last three bits to 0
thus truncating to a multiple of 0b1000 or 8
 
@hyper-neutrino is it wrong?8*(63%8) = 56
ah I made a typo above
 
@Anush I think what HN meant is that it rounds to a multiple of 8 by clearing the last 3 bits
 
I mean 8*size%8
@user thanks
 
okay and 8*(62%8) isn't 56
 
@hyper-neutrino oops
 
7:30 PM
Did you mean 62 - 62%8?
 
(x/y)*y works (assuming int division) in general
^^
 
8*(62//8) in python
@user yes.. sorry all
 
if you reverse the multiplication you can avoid brackets
 
@Peilonrayz I meant size - size%8
thanks for the deciphering all
 
but again & -8 is way faster lol. because bit operations are really quick
multiplication takes 4 ops i think?
division takes like 32 or 60? i don't know details
idk if the compiler or CPU will optimize division by a power of 2
 
7:34 PM
that code is designed to avoid the compiler needing to do any optimization
 
@Anush May I ask why?
 
it makes no difference if you use -Ofast or no optimization it seems
 
Isn't that the compiler's job?
 
@user I don't know. Maybe they wanted to make sure it was equally fast on all compilers?
 
¯\_(ツ)_/¯
 
7:35 PM
it is about 10 times faster than qsort
maybe they just didn't think the compiler could optimize as well as they could
I am amazed someone who makes that many typos in their English can write correct code!
 
English and C are completely different languages
 
yes but sloppiness is the same in all languages :)
 
@Anush IDEs catch typos in C, but not English (some do, but somehow I feel this person uses butterflies to code)
 
8:13 PM
@user that's a great expression :)
 
i believe it's a reference to
xkcd.com/378 (onebox is too large)
 
Why does SE chat even bother oneboxing xkcd? There's nothing special about it
 
because there is always a relevant xkcd (disclaimer: not an xkcd)
(if you visit that page, click the link in the comic panel. it's cool)
 
AAHHHHH RECURSION
 
@hyper-neutrino That's brilliant. Also, why didn't Randall draw such a cartoon?
 
I've been wondering too. With how prominent the meme is (or seems to be) having a relevant xkcd for "relevant xkcd" would be absolutely great
 
People regularly submit questions to him. Hint hint.
 
Has xkcd ever been mentioned in an xkcd?
 
I don't think so
 
Well maybe there was an xkcd about a relevant xkcd, but it's on meta.xkcd.com :P
I wish I could express thoughts directly without resorting to such imprecise methods as typing with my stupid fingers in this stupid language
 
8:32 PM
just use Jelly's "this is what I mean" builtin
 
I half suspect Mathematica has a ReadMindAndTransmitThoughtsDirectlyToSomeoneElsesMind builtin, but it's just that no one's found its true name yet :P
 
Its true name keeps changing; it's always what thoughts you are trying to transmit written in whatever language or medium you are trying to use.
 
@hyper-neutrino that's great!
 
@user YES! I found one mention.
 
@hyper-neutrino Are we sure it isn't some kind of fae or demon?
No one eat any food offered to you by Mathematica, you might be trapped in the world of Stephen Wolfram
 
8:36 PM
@hyper-neutrino in think Seinfeld was like that to a lot of older people too
 
It's too late, the TrapCairdCoinheringaahingIfTheyDiscoverStephenWolframsSecretPlanInStephenWolframsWorld builtin is already implemented
 
Appears in xkcd.com/1416
 
@Adám Interesting
I love the interactive ones, Monroe seems to put a lot of work into those
 
I do love it when Jelly absolutely demolishes 05AB1E :P 53 vs 36 bytes
 
apparently chat feeds pull from meta half as often as main, which is why they are noticeably slower. TIL... presumably some of y'all already knew? i didn't :P
 
8:56 PM
@Wezl codegolf.codidact.com/posts/281956#comment-10576 sorry only just saw this, go ahead
 
9:09 PM
I am once again asking for solutions on my new challenge codegolf.codidact.com/posts/282075
@hyper-neutrino that was fast!
 
i am speed
 
0
Q: Evaluation order of an APL n-train

AdámFrom Codidact with permission. Description APL trains are a series of functions, that get applied to an argument in this way: (f g) x = f g x (f g h) x = (f x) g (h x) (a b c d e f) x = (a (b c (d e f))) x = a (b x) c (d x) e (f x) Trains evaluate from the right to the left, so in the last examp...

 
@NewPosts I'd steal HN's Codidact answer, but that's cheap :P
 
hey that looks familiar :P
 
I am Lobachevski.
 
9:17 PM
Out of interest @rak1507, why didn't you post it?
 
because I'm lazy and Adám said he'd do it :P
 
you already wrote up the post, it would've taken you like 20 seconds :p
 
lol, true
 
@cairdcoinheringaahing Yes.
 
Yes.
 
I think I'll do some more work on my chatbot library
I'm going to make NP/SP use it eventually
 
Oh nice, a new user's started posting lots of answers so I can get Late Answers reviews :p
 
9:23 PM
a staff without a diamond? o.O
 
They usually only give staff a diamond if it's likely they'll need it (e.g. the CMs, devs and higher ups)
 
ah, I see
 
Besides, they can usually do stuff directly to the database if they want to :P
 
I'd be absolutely terrified I'd forget part of the UPDATE and ruin everything
 
I have a habit of managing to destroy production code, development and testing copies, and backups with a single mistake, so I'm sure my superpowers could evolve to find workarounds for transactions too :p
 
or you could pull a tom scott and just forget to use BEGIN TRANSACTION and destroy a ton of prod data :)
 
I love that Tom Scott could be 25 or 45 and I'd have no idea
 
16 or 60 is a more accurate range honestly
 
9:30 PM
> When working on a database, you don't work on the live version. So I was working on the live version, ...
 
You know how sometimes golfing languages can be painful to use? Well I decided to make one. I got the pain part right, but I might have added too much of that to compensate for reduced golfiness. Can't share any details yet, but it should be released within a day.
As far as I can tell it includes a major feature never before seen in a golfing language.
(Or any languages (that I know of))
 
Is it a golfy feature?
 
exciting
 
How do you keep a code golfer in suspense?
 
9:45 PM
Hmm, there are ~28716 bugs/FRs on MM with no [status] tag
Sounds like a fun cleanup for the staff :P
 
@Adám Hw do u ⌸p a cdglfr∊suspense? ftfy
further golfing can be accomplished through string compression
 
This looks like a minor issue that isn't impacting how things are working which is why we status-declined this. However, if there are more instances of users being awarded the same badge twice please let us know and we may revisit if this is a larger bug. — Rosie ♦ 4 hours ago
Idk, letting lyxal have two silver code golf badges severely affects his ability to brag about having two silver code golf badges :P
 
The condition that caused that to happen is known, right?
 
I guess so, otherwise it'd be [status-reproduced]?
 
Probably has something to do with one of the conditions getting fulfilled, then unfulfilled, then fulfilled again
 
9:49 PM
 
Since badges can't get revoked
 
Tag badges can
 
Oh they can?
 
Yep
If you delete a bunch of answers, or get a heavily downvoted one, you can lose your tag badge
 
10:29 PM
Apparently, I had this answer in my SE app drafts for the past month (converting my comment to an answer) and only realised just now :/
 
@hyper-neutrino well, (set 'a b) is syntactic sugar for (set (quote a) b), where quote is what the q of setq stands for. setq apparently also takes an even number of arguments, while set always takes two; I don't know why that is.
@hyper-neutrino did you mean the link in the 4th panel of the comic, the link in the 4th panel of the comic in the 2nd panel of the comic, or the link in the 4th panel of the comic in the 2nd panel of the comic in the 2nd panel of the comic?
@hyper-neutrino I think the first client-server database that I used turned transactions on my default, so if you typed "delete from foo;" then all that would happen is that everyone's application would wait for you to commit rollback. I don't know why that setting isn't more popular.
 
10:49 PM
For anyone who wants to play it: Unikong - SE themed Donkey Kong style game from 2016's April Fools
 
@Neil (setq a 1 b 2)=(set 'a 1)(set 'b 2) so in the quoting and multiple assignment cases, it's a feature set' adds
and set is the lower-level work-doer
however picolisp allows direct access to the dynamic environment, so set may actually be a function implemented in terms of replacd
 
@user this is an epic victory royale
 
@Neil oh, okay, that makes more sense. from mathematica's naming Q seems like a predicate lol
@Neil yeah that sounds like... a very wise choice
 
in lisp (not scheme), predicates usually end with a p (listp, evenp), however picolisp chooses to have no suffix (atom, pair, not) or have a ? (num?, sym?, flg?)
 
11:01 PM
2 hours ago, by caird coinheringaahing
 
i think ? is what racket uses so that makes enough sense to me
 
Picolisp? What inspired your choice to use that language?
 
I'd like to post that soon, feedback would be appreciated :)
 
@ hyper-neutrino same
 
@Downgoat Wow, welcome back!
 
11:04 PM
@Wezl O.o huh how in tarnation did this ping me
hello!
 
oh sorry for that
 
haha all good, just curious
 
Hey Downgoat, been a while!
How's things?
 
in Sandbox, 7 hours ago, by Wezl
@person-it-looks-like-i'm-pinging I present to you...

...A new generation of stealth pings!
 
Oh please no
 
11:06 PM
only if you get on my bad side :P
 
If they won't fix what's practically an XSS, they probably won't fix that :/
 
> fix
 
Hang on, let me rephrase that: Don't do that. Stealth pings got banned for a reason. Pinging can be disruptive, and you should only use it to ping people you're trying to talk to
 
It's worse than a stealth ping because it works regardless of the time delay
 
If you want to "double ping" someone by reply and @ing them, go ahead. But don't ping someone who isn't a part of the conversation
 
11:09 PM
@Wezl it's probably because placing the name of the user messes up alignment, example:
@Wezl .--.
'--'
 
I can't find the exact message, but the policy here will stay that stealth pings result in a kick-mute.
gtg for now o/
 
.--.
'--'
 
@Wezl Except of course that it doesn't apply when alignment is most important; multi-line code blocks.
\○/
 
and people probably shouldn't be replying with ascii-art usually anyway
 
No, but I've often wanted to reply with a code block as an answer to a "how do I" question in chat.
Instead, I end up writing
@user Like this:
And then the block.
 
11:12 PM
@Downgoat Jelly, 6 bytes: ḢḤ;ṖḅƓ
 
@cairdcoinheringaahing good! I'm at work now, so I suppose I shouldn't be here :P but I see a lot has changed
 
Given that you're around, I figure the old ping won't be too disruptive :P
@Downgoat Yeah, not all for good unfortunately :(
 
Now working at the Swift team, and w/ WWDC here, it's a big week!
@cairdcoinheringaahing did the community ever migrate to another platform? Axtell, was never finished, but I recall other people working on other sites
 
A few people moved to Codidact, a few to Top Answers
 
codidact has seen some activity
 
11:15 PM
Codidact really took off after Monica's firing (actually, wasn't it created because of that?)
@cairdcoinheringaahing I am idiot
 
Top Answers Code Golf is basically dead.
 
@Wezl woah, it looks pretty well fleshed out
 
It's pretty good tbh. The biggest issue is activity - it gets maybe 1 question every few days, if that
Plus, I can't speak for others, but I'm definitely "sunken-cost fallacy"-ed for CGCC
@hyper-neutrino the chaining in this answer really confuses me. Why does ) not create a new monadic chain so that it's parsed as (×BS)€(ċ>1)# instead of (×BS)ċ>1)#?
 
aw, did something happen while I was at dinner again :P
hey there Downgoat :D
@cairdcoinheringaahing I believe µ creates a new chain and groups the old chain into a subchain which if you apply a quick to, loses the "new chain" meaning
don't quote me on that
 
@Adám Not sure if you meant to ping me there
 
11:29 PM
yeah I think the quick subsumes the chain into the next chain
 
but how I see it is ((×BS -- €)ċ>1)#
 
@user That's what you get for having such a user name ;-)
 
>(
 
like I'm pretty sure the way applying quicks after separators works is if the current chain is empty it just substitutes the last chain
 
yeah that's how i believe it works
 
11:30 PM
Yeah, it's got a (chain or chains) condition in the parsing
 
yeah the exact line is something like chain.pop() or chains.pop() except I think popping from an empty list in Python is an error so it's probably more like chain.pop() if chain else chains.pop()
 
Interestingly, I think µ doesn't actually create a new monadic chain, it creates a new variadic chain when followed by a quick: Try it online!
 
But I could be wrong, chains and quicks are weird
Shouldn't ^ be [[[1, [1, 2, 3]], [2, [1, 2, 3]], [3, [1, 2, 3]]]?
 
speaking of ) i'm trying to golf hyper's train evaluation order solution and it may or may not be biting me in the ass that ) just isn't allowed at the start of a line
 
11:33 PM
That's what ,¶ç€ does anyway
 
i say may or may not because i'm not sure it would actually work either way
 
@UnrelatedString Why would you start a line with )?
 
as some kind of jank substitute for
except for also the whole
subsuming it into the next chain bit
 
I don't even think that would work as ) retains the left argument, so the bit after the ) would be dyadic
 
@cairdcoinheringaahing i don't see anything wrong with that
it could be starting a new monadic chain
it's just not ending one
oh. wait. we might have different interpretations as to what "create" a new monadic chain means
 
11:35 PM
yeah come to think of it the "retains the left argument" caveat is also probably just a weird way of explaining how it doesn't really act like a separator to begin with
 
Speaking of golfing hyper's answer: -1 byte
 
does it end the current chain and create it as a monad, or does it end the current chain variadically and create a new one being a monad?
 
...of course
 
@cairdcoinheringaahing thank
 
11:36 PM
If you ever have R and increment/decrement next to each other, there's almost always a one byte version :P
 
R in general is usually suspect
 
@hyper-neutrino Actually the comic has three clickable regions
 
7 bytes, assuming 1 can output as 1 rather than [1]
 
nice
it's always where it's useless that I try to do weird stuff with replacing normal stuff with ƒ
 
@Bubbler Oh wow, you're right.
 
11:45 PM
I've just been trying extreme rearrangements and seeing if I've done the accounting wrong in my head and they turn out shorter
 
I hate it when a port is shorter than an original, clever answer
(cc @hyper-neutrino - some golfs for you)
 
oh :/ well i'll probably just edit both in, thanks
will do it in a bit
 
It annoys me to no end that is reverse digits on integers, but U is a no-op, rather than reverse range ಠ_ಠ
 
11:53 PM
the classic
 
If it were, 4 bytes in Jelly :/
 
Uh, FU Jelly, for not being golfier.
 
i wish jelly had grade down
 
@Adám Hey, at least this way other languages have a small chance of beating it :P
 
@hyper-neutrino Adding grade down would be such an upgrade, wouldn't it?
 
11:56 PM
reverse+grade up doesn't work on non unique arrays right?
@Adám lol, good one
 
Also, for some reason, when reducing n-wise with ƒ, the initial value is prepended to each list (in this example with ;): tio.run/##y0rNyan8/z/I2ujYpP@GBkGH2x81rTk66eHOGUA68j8A
 
@hyper-neutrino No. Try it online!
 
@hyper-neutrino Negate and grade up maybe?
 
oh.
no still won't work
 
:( It's a common trick in Scala
@hyper-neutrino It seems to wok here
*work (not editing that because pings)
 

« first day (3782 days earlier)      last day (1063 days later) »