« first day (3628 days earlier)      last day (1219 days later) » 

1:49 AM
0
A: Sandbox for Proposed Challenges

HoodDoes the javascript function support keyword arguments? Javascript has no direct support for keyword arguments, but it supports argument object destructuring. It is standard to use a destructed final argument for keyword arguments. Here is an example: function f({ a = 7, b = 2}){ return [a, b...

 
 
1 hour later…
2:52 AM
codidact is trash cant link to comments >:(
 
I was reading the Scala tips page the other day and thought to myself, it's kinda weird that Scala supports partial application of infix operators to the left argument but not the right
but then I realized it would be *way worse* to need a special rule to tell which symbol is an identifier and which symbol is an operator in an expression like `(% %)`
 
@UnrelatedString Yup. And except for dzaima/APL, no APL allowed implicit partial application either. You have to "bind" the argument to the function, so 1∘+ or +∘1 for example.
 
3:13 AM
@UnrelatedString ... though you could invent an infix operator that does the job
 
4:00 AM
Is there an ¡ in jelly like ⍣≡ in APL? (fixpoint)
 
@rak1507 Ƭ perhaps? I always get a bit mixed up on what exactly a fixed-point combinator is
 
found a better way anyway, thanks though
 
4:50 AM
0
A: Sandbox for Proposed Challenges

BubblerLandau logarithm code-golf math number-theory integer-partitions Related: Landau's function (OEIS A000793) Background Landau's function \$g(n)\$ is defined as the largest order of permutation of \$n\$ elements, which is equal to \$\max(\operatorname{lcm}(a_1,a_2,\cdots,a_i))\$ where \$a_1,a_2,\cd...

 
5:02 AM
1
Q: Ellipsoid surface area

BubblerRelated: Ellipse circumference Introduction An ellipsoid (Wikipedia / MathWorld) is a 3D object analogous to an ellipse on 2D. Its shape is defined by three principal semi-axes \$a,b,c\$: $$ \frac{x^2}{a^2} + \frac{y^2}{b^2} + \frac{z^2}{c^2} = 1 $$ Just like an ellipse, the volume of an ellipsoi...

 
5:28 AM
-1
Q: Rust language code golf for pig latin

GavinWorking my way through the Rust book and I know there must be a more compact way to do the pig latin exercise. Here's a functional if fluffy version: // Convert strings to pig latin. The first consonant of each word is moved to the end // of the word and “ay” is added, so “first” becomes “irst-fa...

 
^ This shouldn't be closed, right? It's a question asking for help golfing, and (I think) that's on topic.
 
5:50 AM
@RedwolfPrograms well yes but actually no.
Lel I VTC'd under the "Community specific reason" category, realised it should have been VTC for "Needs more detail or clarity", retracted my vote to make the change and now I cant revote under the correct reason. Very sad. I flagged for mod intervention instead.
 
Relatable
 
Don't worry about it, I just cast the final vote
Why does that make me sound like a movie villain
 
6:37 AM
@NewMainPosts dev at google?
imagine someone has NMP (and all the other bots) running on some computer over at SE
and then they just suddenly hear a ping
 
0
Q: Javascript: Help me make this shorter

myjobistobehappyI have the following code. Help me make it code shorter. new Promise(r=>r(URL.createObjectURL(new Blob(['<h1>Example</h1>'],{type:'text/html'})))).then(u=>open(u)&&setTimeout(t=>URL.revokeObjectURL(u),2e3)) The Catch: This has to be in JavaScript It cannot contain semicolons It must be a "one-l...

 
6:59 AM
0
A: Sandbox for Proposed Challenges

myjobistobehappyI have the following code. Help me make it code shorter. new Promise(r=>r(URL.createObjectURL(new Blob(['<h1>Example</h1>'],{type:'text/html'})))).then(u=>open(u)&&setTimeout(t=>URL.revokeObjectURL(u),2e3)) The Catch: This has to be in JavaScript It cannot contain semicolons It must be a "one-l...

 
@MarkMorganLloyd: Hence why, at least for pragmatic and practical purposes, the (slightly humorous) notion of "Tetris-completeness" is often more interesting: "Can I implement a game, meaning, can I write a (potentially infinite) game loop, have I/O, interact with the OS, interact with C libraries, and asynchronously react to an infinite stream of events, all within soft-realtime constraints?" — Jörg W Mittag yesterday
A hilarious quote in a discussion about Turing-completeness
And the response was
@JörgWMittag Oh, so like Conway's Game of Life? :P — Spitemaster 23 hours ago
 
wow what a discussion
 
8:03 AM
0
Q: Does it return its input?

Wansen Your Challenge Find out if a function returns its input. Input Format Input is a math expression as a string with operators + - x /. Whitespace can be ignored. For more info, check the examples. Example Input/Output Input: n /3 + 2n/3 + 175 - 175x(n/n) Output: true Explain: Simplifies to "n". ...

 
 
3 hours later…
10:58 AM
Mainly quiet day today I see.
In chat that is
 
11:49 AM
LOUD SHOUTING
 
12:13 PM
Last day of Winter Bash :(
 
@wizzwizz4 code update?
@thedefault. Interesting idea to look at the fastest yes challenge!
 
@fomin Adding sub2, del2 and delsub.
Then I'm done, modulo bugs.
 
I feel I want your coding live on twitch :)
 
@fomin it didn't turn out to be that useful. The (few) serious answers were using tricks that can't be used in this challenge.
 
Interesting
Out of interest, if there were a challenge for edit distance 3, what approach do you think you would take?
 
12:18 PM
Is the tag applicable to cops and robbers challenges?
 
@thedefault. ^^^
 
@cairdcoinheringaahing I can easily imagine some questions getting closed now
@fomin probably something like invoking dist2() on all strings with distance at most 1 from the input
 
 
1 hour later…
1:34 PM
That makes sense
 
I hate when programming languages say something's a modulo operator and don't explain it any further. There are at least three (probably more) ways I've seen it implemented for negative numbers.
 
@RedwolfPrograms Just don't support negative numbers. Problem solved.
 
@RedwolfPrograms And that's not even talking about string modulo
@wizzwizz4 Nah, only support negative numbers
2
 
@cairdcoinheringaahing Only support negative primes.
And subnormals, obviously.
 
Oh, those integers 0 < x < 1? :p
 
2:34 PM
1
Q: Find a sequence in the binary digits of π

RomanGiven a binary sequence of finite length, find the starting position where this sequence first appears in the binary digits of π (after the decimal). The binary digits of π start with 11.001001000011111101101010100010001000010110100011... and digits will be counted such that the first one after ...

 
2:51 PM
@fomin How bad is it if my code has degenerated into pointer hacks and macros?
It's not very Rusty; I've got unsafe code outside unsafe.
 
assemble it and embed into C++ and suddenly instead of poor Rust it becomes optimized C++
 
It's completely fixable; I'd just need to introduce a zero-cost abstraction, but that might take more than 2 hours.
 
ngn
@wizzwizz4 if it's fast, it's good
 
for i in 1..input.len() - 2 {
    // Desu .XX.
    main_writeln!(
        &input[0], i;
        a, 1;
        &input[i + 2], input.len() - (i + 2)
    );

    // Desu X.X.
    main_writeln!(
        &input[1], (i + 1) - 1;
        a, 1;
        &input[i + 2], input.len() - (i + 2)
    );
}
@ngn A few hundred lines of this?
I should've done it so I wrote input[0..i] and stuff, but I didn't think of that.
 
ngn
@wizzwizz4 code diluted with spaces - this is unreadable! :)
(i + 1) - 1 isn't that i?
 
3:00 PM
@ngn It is, but I wanted to make it clearer for future-me that it conceptually represented input[1..i+1].
Half an hour writing a suitable macro would've saved me three hours of horrible pointer length hacks and headaches, but I don't like macro_rules.
 
3:41 PM
@wizzwizz4 only 2 hours so
you'd probs have saved waaaay more than 2 hours by writing actual clean code
@RedwolfPrograms who cares, interpreters/compilers exist for exactly that reason
 
Not sure what you mean
 
@RedwolfPrograms you can tell which variant it is by evaluating a single expression
 
But if the language's specification itself is unclear, not all interpreters/compilers may be compatible. if my program expects -11 % 4 to be -3 and your compiler/interpreter makes it output 3 instead that could easily break a bunch of stuff.
 
ok good point
 
4:13 PM
@ASCII-only Probably. On the other hand, I was definitely on track to completing it on time with my hackish bad code. :-p
 
4:29 PM
Or not. I have an off-by-one error making it output null bytes.
 
4:50 PM
And it crashes in release mode now – that used to be the only mode it worked in!
 
Ngl, I'm half expecting @fomin to forget/miss the deadline for the bounty, now that it's 30 minutes away :/
 
@cairdcoinheringaahing remember there's a 24 hour grace period
 
@ASCII-only Oh yeah, I always forget about that
 
@fomin You should avoid awarding it until the grace period, just in case somebody comes in with a killer solution at 3 minutes to go.
 
5:27 PM
let len = input.len();

main_writeln!(input);  // No-op
main_writeln!(input[1..]);  // Predel
main_writeln!(input[2..]);  // Del2 XX.
main_writeln!(input[.. len-1]);  // Appdel
main_writeln!(input[.. len-2]);  // Del2 .XX
main_writeln!(input[1 .. len-1]);  // Del2 X.X
@ASCII-only It looks like it's going to take less than 2 hours.
 
that's 803 lines of code...
 
That's just 'cause it's messy.
I'm taking ASCII-only's advice and making it neat.
So far I've removed around 50 of the lines.
 
is it faster than my solution? I'm getting compilation errors :) (I do not use rust, so it may be outdated or not set up properly)
 
@thedefault. You need to use nightly.
rustup install nightly-2020-12-30 and then rustup run nightly cargo build.
Which will probably work, because I doubt they'd've broken the features I'm using in such a short time.
 
it takes almost 300 real time milliseconds for me, am I doing something wrong, or is it that slow?
 
5:35 PM
It's that slow, because it won't run in release mode.
It did, right up until near the end, then that stopped working.
I don't know why.
I do know why it doesn't compile in regular debug mode; see where I wrote #[inline(always)] // for correctness?
Huh. Now the code's clear, I can see how to choose the frame size such that I can remove all the runtime bounds checking. That's useful.
@thedefault. How are you checking correctness?
 
meanwhile radare2 produced a beautiful visualization of the control flow of main() (viewed at xterm's Unreadable font size, wouldn't fit on the screen otherwise): i.imgur.com/hDToEED.png
 
@thedefault. Which solution is that? Mine?
 
5:51 PM
Yes. I usually check it by counting distinct lines in the output for obenquillo and abcdefghijklmnop (and for my first working version, I also compared it with the Python answer's output)
 
nice link
 
@thedefault. Mind if I re-upload to i.stack.imgur?
 
No :) (I don't mind)
 
That's spaghetti code, isn't it?
 
 
1 hour later…
7:27 PM
@wizzwizz4 great you got your code in!
I know nothing about rust but there are plenty of experts online if you need any help fixing it
 
Yeah… I thought I had sound parallel code.
Turns out I don't. When I make it not spaghetti (which I've done), something changes and neither debug nor release mode work.
Probably the compiler can see more places for optimisation.
 
Hmm
I can't test it for 14 hours so that's how long you have :)
 
That's cutting it short for bounty awarding.
Less short than I left it for posting my solution, though, so it's probably fine.
 
I think that gives me a few hours spare doesn't it?
 
It does.
 
7:33 PM
I was hoping there would be more clones of the c++ answer
And something in Haskell
The pool of answerers is still down on a few years ago sadly
 
Keep in mind that new answers may come in after the bounty
 
That would be great. Does that often happen?
 
Depends on the challenge
I still get answers on challenges I posted ~3 years ago, and some challenges I've posted in the last 3 months have already been forgotten about
 
That is very cool!
 
There is also the idea of a endless bounty which you could set up if you think someone could still beat the existing ones
 
7:40 PM
That is a nice idea.
 
… I feel foolish now.
My program was silently exiting because I'd overwritten the panic handler to, in debug mode, silently exit.
 
7:57 PM
Q: We have 5 previous Best Of category posts, is it worth going through those and deciding which categories we want for this year?
 
 
1 hour later…
9:01 PM
0
Q: Interpret Interval Notation

Aiden4Interval notation is a way to write complicated range bounds more conveniently and concisely than writing an inequality. The challenge, should you choose to accept it, is to write a program or function that interprets a subset of interval notation. In this subset, intervals are a comma-separated ...

 
9:15 PM
0
A: Sandbox for Proposed Challenges

Wansen Your Challenge Find out if a function returns its input. Input Format Input is a math expression as a string with operators + - * /. Whitespace can be ignored. For more info, check the examples. Example Input/Output Input: n /3 + 2*n/3 + 175 - 175x(n+ 1-n) Output: true Explain: Simplifies to "n"...

0
A: Sandbox for Proposed Challenges

79037662Win a K vs KQ endgame Summary The goal of this challenge is to create a program or function which will win a Chess game with a King and Queen against a lone King. The user will specify three squares, representing the locations of the computer's King, the computer's Queen, and the user's King. The...

 
9:30 PM
Someday Internet Explorer's market share will drop down to 0.00% on caniuse and that will be humanity's greatest accomplishment
 
@RedwolfPrograms IE 11 > Chrome.
It's faster.
 
IE 11 isn't too awful, but having to try to support IE 6-10 is like using a fishing net to move water
 
I've never found it too hard.
Just write valid XHTML5, with CSS for the elements not in XHTML4.
 
CSS isn't too bad, Javascript is the real pain
 
What's that?
Oh, yeah, the script thingy. Never really saw much use for that.
I suppose it lets you make popups.
 
9:35 PM
It's not super useful for static websites but that's not what I do
I mostly do game development...I need polyfills for my polyfills thanks to IE 8
 
You write… computer games. In a web browser.
 
60% of one of my project's source code is a patch to get IE 10 to be able to get Unicode codepoints from a string
 
@cairdcoinheringaahing I don't think “answers that have been posted for 8 weeks” is a good idea.
 
@wizzwizz4 What's wrong with browser based games?
 
9:39 PM
@wizzwizz4 Rephrase: "What do y'all think about giving this another shot?"
 
@RedwolfPrograms What's wrong with PDF-based games?
What's wrong with DOCX-based games?
 
@wizzwizz4 If you don't use LATEX to write games, don't call yourself a "game developer" :P
6
@wizzwizz4 Images. That's all I have to say :P
 
HTML5 Canvas with WebGL is no joke
Especially when combined with WebSockets, and WASM is becoming more popular
Comparing HTML5 and modern Javascript with PDF is like comparing a quantum computer with a hand calculator.
 
> HyperText Markup Language
How did a document format become… this?
 
Changing needs, mostly. And lots of badly planned new features added by early browsers in a rush to get as much of the market share as possible.
(As for IE being faster then Chrome, maybe for pure HTML and CSS (and that's a definite maybe), but there's no way IE is going to come anywhere close to V8 in terms of performance for Javascript)
 
9:51 PM
@RedwolfPrograms It's faster.
Maybe not for massively JavaScript-heavy pages, but it takes seconds to load them in the first place, and barely executes any of the bloatware.
 
Yeah, because it can hardly execute anything :p
 
But it doesn't need to.
 
Depends on your needs, I guess.
 
I would like two browsers.
Document viewer and game player.
Because the existing ones do neither well.
 
On my laptop Chrome's good for both, but it's probably really well optimized for it given that my laptop is a Chromebook :p
 
9:55 PM
Chromebook running Debian, right?
 
10:12 PM
@wizzwizz4 No, unmodified Chromebook with the built in Debian VM for the 10% of things I want to do that don't use a browser
I know there's a lot of people who really don't like Chrome OS, but it's the perfect compromise to me. Fast, secure, and robust for simple browsing and text editing, with the option for running other Linux apps in a VM without affecting performance or security. I'm sure there's some telemetry and stuff, but it doesn't affect performance (or if it does it's not at all noticeable), and there's pretty much no bloatware like other OSes have.
 
10:45 PM
1
Q: Linear integer function generator

Michael SternInspired by a recent challenge involving Fibonacci numbers in which OEIS was mentioned, I would like to present a challenge of creating a function that generates a wide array of different linear integer sequences, depending on user input. Specifically, the user should provide three inputs: the k...

 
@cairdcoinheringaahing Nonsense extravaganza. I used to create games in Microsoft Paintbrush. No, I'm not kidding.
 
@Adám CMC: Write a Paint Quine, i.e. a Paint program that executes Microsoft Paint :P
 
Instructions unclear, found root code execution exploit in MS Paint
 
We have to have a challenge which is "Given n, output the integers from n to 0 inclusive, in order" right?
 
@cairdcoinheringaahing I don't think that can be done. But seriously, I found myself locked up in an institution, but I had a laptop, so I painted a "level" and pasted the "player sprite", then used the arrow keys to move through the level…
Programmers, as they say, always find a way…
 
10:55 PM
APL: MS Paint edition 2021?
 
Haha, well, I actually did write a pixel art drawing program in APL when I was about 16 or so. I used it to create pixel fonts for DOS.
 
Oh, and what did I need a custom font for, can anyone guess?
 
...APL?
 
Yes, of course!
 
10:59 PM
So when you were writing in APL, did you not have a font that supported the characters?
 
I did, I just wasn't too happy with it.
 
Ah
 
Given than Winter Bash is going to be ending at some point soon, here's a question for y'all: how many SE sites did you visit over hat season (i.e. how many sites do you have the Social Distancing hat on)?
20 here
 
Main only?
 
Yeah, main only
 
11:04 PM
43
 
(Given that I think you'll have to have via main to get to pretty much all metas)
 
13
 
I think I have too much time on my hands lol
Also is it just me or are the docs for ws absolutely horrible?
 
Looks ok to me, what's so bad about them?
 
ngn
@RedwolfPrograms copy-pastable examples with multi-letter variable names, what more do you want? :)
 
11:08 PM
I can't find any documentation of the connection or message classes
I'm probably going to have to read the source code again just to figure out how to disconnect a client
 
Haha! For the first time since Winter Bash started (and I left the UK), I'm back in all 6 review queues :D
 
I was wondering why the folder was titled doc instead of docs, and I guess I know why now. There's just a documentation, no more :p
2
 
@cairdcoinheringaahing but you're only the most recent in 2
 
@Lyxal 3 by my count, and I'm just now getting back to my previous heights :P
 
Reopen votes hasn't updated yet
 
11:21 PM
"Give it a refresh, that usually works" - Me to me
 
There we go
You only are first in two
I claimed reopen
 
ngn
@RedwolfPrograms if docs/* aren't good, just read srcs/*
 
@cairdcoinheringaahing you've only got first posts and late answers as first
Get good
\s
 
Well, if someone decides to edit their clearly off-topic post, it isn't my fault I'm the first to the review queues :P
Suffering from Success :P
 
Stick you're tounge in
 
11:24 PM
Okay I think I'm just going to switch to another library, this one's main file is 7 sloc and they put all of the actual code in a dozen files of abstract spaghetti in lib/*
 
TBH I wish we had some more meta reviews
 
Yes
 
@Lyxal Never :P
CMC: Without looking, guess the date of the last Suggested Edit review on Meta (bonus points for guessing the user as well)
 
I'm going to say 15 months ago?
 
Not quite that long :P
We've had 8 SE meta reviews last year
 
11:28 PM
I feel like 15 minutes wouldn't be long enough though
 
I think it was 3/4 months ago
Iirc
2x-1?
 
>
caird coinheringaahing suggested edit on status-review tag wiki excerpt Approve Jul 26 '20 at 21:09
 
so it's like 5 1/2 months ago
 
Fun fact: No user has outright rejected a suggested edit on Meta in the last 2.5 years
 
Took me a second to realize we're in 2021 and that wasn't 6 months in the future
 
11:30 PM
lol
 
Idk why, but I'd very happily just collect a whole bunch of random stats about CGCC
Most Meta reviews for a single queue: 103 by WW. After that is 92 (mbomb), 32 (Blue/muddyfish), 29 (me) and 26 (DJ)
 
@cairdcoinheringaahing prolly because you actually need an account to suggest edits on meta
And most people with an account suggesting edits on meta probably are trying to help the community in a meaningful way rather than make stupid edits
 
It doesn't surprise me that most meta SE reviews are accepted or edited, but 2.5 years is a long time
Even more interesting: no-one has ever, in 7 years of meta RO reviews, has ever cast "Edit and Reopen"
 
For this, can someone explain to me how kernel (0, 1, 1) seed (1, 0, 0) gives 1 for the next term?
 
Ugh, WW's no longer pingable
 
11:39 PM
Oh, those kernels are in reverse order, aren't they?
 
Yeah, I think so.
 
Why on earth would you use the variable name ws, the name of the library, short for "WebSocket", for a client? Why not just client??!!?!
 
I always thought that when you tried to upvote with <15 rep and SE said "this is recorded but not applied", they were lying and it wasn't recorded. I now know otherwise.
 
Wait really? What does it do?
 
Q: Should we close this as a dupe of the "Cast your vote for ..." question? Most years the question's been edited rather than a new one posted, but apparently not in 2019
@RedwolfPrograms Goes onto the mod tools and site analytics stats pages IIRC
Related Q: should we instead just lock ^^? Or Close + Lock?
 
11:41 PM
Save that for a day when you have >10k
 
@Lyxal Damn, throwing shade :P
 
@cairdcoinheringaahing Close+Lock, I guess
 
@Bubbler I ask because it had 4 CVs, then WW voted to leave open a couple of days ago, which wiped the CVs
 
:/
 
I always end up never posting anything for months, then suddenly writing 5-10 good challenges, then repeating that process. No idea why I can't just post a good question every week or so instead of all at once.
 
11:43 PM
@Lyxal Oh man the "overrated" and "underrated" tabs on that are so bad
 
@cairdcoinheringaahing what do they even mean?
 
> No votes in the last year, helpful
Apparently, this is the most underrated PPCG post of all time
 
Apr 24 '20 at 7:52, by petStorm
I hope to have a magic book that contains all possible challenge-suitable ideas.
Apr 24 '20 at 7:54, by Bubbler
@petStorm I have three of them. They are called Google, Wikipedia, and OEIS.
 
@Bubbler hey I remember that conversation!
 
@Bubbler And random books that make me go "Oh, what if <thing> was a challenge"
Givin' y'all a meta review, enjoy
 
11:46 PM
I'm not seeing any meta review yet
 
@Lyxal Well, I just cast a CV, give the queue a few minutes to register it :P
@mods Can you guys synonym a tag without needing to have the required scores to suggest+vote?
 
@cairdcoinheringaahing still aint seeing it
 
@Lyxal Unfortunately, I can;t speak for the review queues
Maybe just hang around until something comes up, or cast a VTC (again) on the Best of 2019 post I linked above?
@cairdcoinheringaahing Different but related thought: god I wish I could tag-edit without bumping posts :/
Half (at least) of the posts should be tagged , but I don't want to bump 10ish old posts
 
I think I saw a post on mother meta for "minor edits", which was declined due to a concern about unnoticeable vandals
Might work if it's limited to moderators though
 
@Bubbler Could be a nice 10k+ tool to have
 
11:59 PM
Maybe that too
 
@cairdcoinheringaahing thank you
 

« first day (3628 days earlier)      last day (1219 days later) »