« first day (3629 days earlier)      last day (1065 days later) » 

12:00 AM
@Lyxal I did have to read the edit message :P
You're the first person to vote accept for one of my anonymous edits
This the third time I've tried to get an edit through on my own posts anonymously
@Lyxal I think I've done it twice now, but I have to check the edit message before hitting reject :P
12:40 AM
I wonder if I went on a larger site like SO and made a minor-ish edit to an old question by an inactive user, waited for it to be accepted, waited a few hours, and repeated that, if I could slowly change the meaning of it to be a completely and totally different question without anyone noticing
Like different title, totally different subject (some random Node + React bug to something about memcpy or Rust pointers), totally different code, tags, and question, etc.
@RedwolfPrograms Maybe a few days, not a few hours
It would be pretty funny if something like a hundred edits later someone decided to look at the edit history and realized it used to be a totally different question and there isn't a single word left that was written by the OP
1:00 AM
@cairdcoinheringaahing crap it already ended, but it wasn't many, as I'm too lazy to create the necessary accounts
1:37 AM
Ugh, this is such a bad question, someone please tell me there’s a VTC reason that applies here
2:21 AM
@cairdcoinheringaahing needs details or clarity?
2:35 AM
Well, tonight's creepy story: For a few days my family's had our christmas decorations in boxes to put in the shed. It's dark outside, but we've been busy all day so my mom and I go to put them away. There's maybe half a mile of ranch behind our neighborhood, with more houses on the other side, and construction is pushing coyotes closer to our house. Well, I get outside, and you can hear them yipping and howling maybe a few hundred yards/meters away. As we're moving boxes into the shed,
I point my flashlight toward the sound of the coyotes. I can't see anything, since the beam isn't that bright. I notice two bright circles, maybe two meters past our fence. I jump back as I realize they're eyes. I see faint light brown around it, probably its body. My heart is pounding. As I start backing toward the door, it turns and runs away. It was a fricking whitetail deer. I'm probably never going outside again lol.
1 hour later…
3:50 AM
@RedwolfPrograms excuse me but wth were you scaerd?
I looked up "Whitetail deer predators" and it listed wolves
And now, I don't know about you, but, uh
"Redwolf" == Wolf
Just saying.
And apparently wolves also eat coyotes.
either way, you missed a good food oppourtunity
3 hours later…
6:59 AM
1 hour later…
8:17 AM
Q: Help Stack Exchange transpose tables

AdámStack Exchange doesn't know how to transpose tables. Let's help. Given a markdown table, transpose it. Input assumptions: There will be at least two columns Either all cells have no leading space or all cells have exactly one leading space (you must handle both) If the cells have a leading space...

4 hours later…
12:11 PM
@RedwolfPrograms "probably its body" Does that imply that it may have just been 2 floating disembodied eyes? :P
can anyone help me compile rust code? I am trying to compile https://codegolf.stackexchange.com/a/217286/91489 but cargo build gives me "error: failed to parse manifest at `/home/raph/rust/Cargo.toml`

Caused by:
no targets specified in the manifest
either src/lib.rs, src/main.rs, a [lib] section, or [[bin]] section must be present
@wizzwizz4 are you about?
I fixed that by moving main.rs to src/main.rs
maybe the error message could have said that :)
argh... error[E0554]: #![feature] may not be used on the stable release channel
@thedefault. how did you get the right version of rust?
by using the commands wizzwizz4 sent in the chat: rustup install nightly-2020-12-30 and then rustup run nightly cargo build
rustup run nightly cargo build
error: toolchain 'nightly-x86_64-unknown-linux-gnu' is not installed
that's what I get for the second stage having done rustup install nightly-2020-12-30
ooh it compiled with 6 warnings
ok now I don't know how to run it. target/debug/q216902 abc
Illegal instruction (core dumped)
@ngn your new code is amazingly fast! What did you do?
12:30 PM
I guess not translating my code to C was not a mistake: otherwise ngn's answer would beat mine and thus it would not matter how impressive my answer is (also, was it really your intention to award the bounty to me?)
12:54 PM
@fomin It works on my machine.
But that's a sign that it panicked, which is a sign that something went Wrong.
@fomin It only works with strings between 10 and 16 in length.
/// strlen, if the string's length is >= 10 and <= 16.
unsafe fn cstr_strlen_cheat(ptr: *const u8) -> usize {
    for i in 10..=16 {
        if *ptr.offset(i) == 0 {
            match i.try_into() {
                Ok::<usize, _>(i) => return i,
                Err(_) => unreachable_unchecked()
In release mode, that's 13 instructions, max.
Premature optimisation FTW!
wait, you're optimizing strlen for the input string that has length at most 16, and the function gets called only once?
@thedefault. Yup.
And yet it does a bounds check for every fraction of a line it tries to print.
This is what Knuth warned of.
1:49 PM
I might actually learn Scala
It seems like it has a lot of features I've been wanting in other languages
2:34 PM
A: Sandbox for Proposed Challenges

userKoTH: Solve a maze (WIP) king-of-the-hill scala In this challenge, you and your opponent compete to get to the middle of the maze first. Possible moves each turn: Move one cell left, right, up, or down. If you attempt to move to a cell that is outside the maze, that is occupied by a wall or the ...

@fomin i started flushing the buffer more often. i refactored the recursion into something flatter, where multiple edits are generated together using memcpy()-ing and scatter indexing. i removed stdlib's overhead.
@wizzwizz4 ah it does work! I wasn't expecting it to crash with a shorter string :)
@RedwolfPrograms all scala coders think it is amazing
@fomin Hooray!
I'm currently working on a version that should beat ngn's.
@ngn it's great work. I just wish you would at least add a pseudocode version of the code you write
@wizzwizz4 nice :)
@wizzwizz4 beware premature optimization :)
1. Remove the bounds checking.
2. Fix the crashes caused by removing the bounds checking.
A simple 2-step plan.
2:46 PM
@wizzwizz4 your code really suffers from not being about to do cargo build release
timed it now
isn't this challenge over?
the bounty is over
but the challenge never finishes
bounty.. right
@ngn I'm a supporter of "the challenge never really finishes" idea :P
what does this mean from time? real 0m0.327s
user 0m0.532s
sys 0m0.120s
how can real be shorter than user?
2:49 PM
@fomin multithreading?
ah... the rust code might do that
@fomin It does.
Very badly, but it does.
@wizzwizz4 thanks
@fomin Is that running it piped to >/dev/null?
CMC time code from the command line and return the sum of user and sys.
@wizzwizz4 yes
2:52 PM
Aw… I'd hoped for less from sys.
@wizzwizz4 try time target/debug/q216902 Environmentalism > /dev/null
@fomin Yeah, that's about right. ☹
Does it go down if you increase FRAMESIZE to something absurd (e.g. 0x10000)?
I would quite like an answer to me CMC in fact as it would have saved me time
@fomin Did you add user and sys to calculate the answer?
why not just parse time output?
2:55 PM
@thedefault. Because I don't have the bash skills
@wizzwizz4 yes
Aw… I was optimising for real. (Again, badly.)
Though that is the fairest way of doing it, I think.
Multi-threading shouldn't automatically get you ¼ the score.
@wizzwizz4 to be honest, if there had been parallel code competing I would have had to move to real
But mine was so amazingly not competing.
@wizzwizz4 I am happy to report the sum of real for your code only when you get release to work
@wizzwizz4 :)
@fomin export TIMEFORMAT='%U+%S' and pipe it through some calculator
@fomin btw, did i win?
3:00 PM
@ngn sadly no. I gave it to the C++ answer because I liked it more. Sorry
@ngn TIMEFORMAT='%U %S + p' time $foo | dc
@wizzwizz4 does that work with > /dev/null?
@fomin You're right; I need to do the magic 2&>1 thing.
Don't know how to do that with pipes, though.
I did try myself and failed
@fomin but it was tagged "fastest-code"
3:02 PM
@ngn I think fomin means the bounty (which they're free to give to whichever answer they like)
@ngn yes but the bounty said that I would take the fastest from each language and award the bounty to the answer I found most impressive
@ngn But the rules for the bounty were “fastest in each language, then whichever they like best”.
you won the speed competition @ngn
i see
I couldn't give it to an answer I couldn't read at all
and with no pseudocode to help
3:03 PM
@fomin did you try?
@ngn a bit. I mean it is deliberately obfuscated
@fomin no, it's not
#define F(i,x,n,a...) for(I i=(x),n_=(n);i<n_;i++){a;}
@fomin I thought it was very readable. You just had to keep in mind that @ngn defined an entire new programming language syntax with find and replace.
3:04 PM
That's just a forloop
@fomin ok, do you know what #define means?
I do and I could have tried to de-obfuscate it
but you made an effort to hide the meaning
Just an FYI @fomin if you decide to accept an answer as the winner (we discourage that, but you're free to do as you wish) you should accept the fastest, otherwise your challenge becomes subjective
@cairdcoinheringaahing yes that makes sense
3:04 PM
Saying nothing about the bounty, just about potentially accepting
@fomin it's not obfuscated. these are just a bunch of macros to make c syntax less painful.
@cairdcoinheringaahing understood
@ngn According to IOCCC rules, it's obfuscated.
lol what
@ngn #define _(a...) {return({a;});} is obfuscation
3:05 PM
@wizzwizz4 i don't know those rules, i know some c
No it isn't
bear in mind I am no C expert so I will bow to the experts here
Say it with me y'all: obfuscation is subjective
let's vote
who here thinks the code is obfuscated? Who here thinks it is clear and who here thinks it is clear than it would be without the #defines
@fomin no. it's this:
Nov 26 '19 at 19:33, by ngn
today i discovered an elegant way to make c return the result from the last expr in a function: #define _(a...) {R({a;});}
3:07 PM
Whether something is obfuscated or not is entirely dependant on whose reading it. It might be obfuscated to fomin, but not to ngn
@fomin That's not necessary
@rak1507 IOCCC rules are that all code “rendered obscure”, “darkened” or “confused” is obfuscated.
For example, all code displayed in dark mode is obfuscated.
@cairdcoinheringaahing don't you need to vote when it's a matter of opinion?
It's just +50 rep, and fomin's allowed to award it to whoever they like, without requiring excuses. Let's try to keep things friendly
@fomin You don't need to vote.
@fomin But what would the vote show? Nothing at best, and at worst it causes an argument
3:08 PM
@cairdcoinheringaahing a fair point
I think that the purpose of the macros was not to obfuscate but to allow for more concise syntax, it's a choice for ngn to make, and if the author says code is not obfuscated I'll believe them even if personally it looks obfuscated to me
in any case, the code is clearly amazingly fast and if I were to accept a winner it would be @ngn's
I'm sure anyone can understand
#define F(i,x,n,a...) for(I i=(x),n_=(n);i<n_;i++){a;}
typedef int I;
I main(){F(i,0,10,printf("Hello World\n"))}
@rak1507 Not everyone can understand this, though:
I think it's more a question whether it is easier to understand with or without the #defines
3:13 PM
       /* /* /* /*/           /**/     main
     )                          /////////
                {    printf
"e"                       "l"
           "l"         "o"                     ","
  " "              "w"            "o"
         "r"               "l"      "d"    "!"
     "\n"                                               )
That is obfuscation though
much better!... not really
@wizzwizz4 That just looks like a Whitespace program to me :P
@rak1507 Not really, no. What's V times x got to do with anything?
I feel it shouldn't be too hard to automatically unravel the macros
I mean, that's what gcc -E does right
3:15 PM
@fomin Depends how much stack space you have in your head.
@wizzwizz4 I meant by code
I know.
Most compilers have an option to only preprocess
@fomin It's hard holding “oh, V means void, so V* means void * and isn't multiplication” in your head while processing the rest of the program.
@rak1507 in theory but it gives me bpa.st/XFJQ
so I also need to unravel the typedefs
3:17 PM
yeah, what's the problem with that?
typedefs aren't macros
right but can you do it?
I mean unravel those too?
@wizzwizz4 it's clearly not multiplication
@rak1507 Well, no, because that would be a syntax error.
But I don't particularly feel like performing catastrophic backtracking in my head when trying to read a program.
int f(foo * bar) is clearly not multiplying foo and bar, even if you don't know what foo and bar are
@rak1507 C syntax doesn't come naturally to everyone.
3:19 PM
I agree
what are the # ... lines doing?
@wizzwizz4 that doesn't mean it's unreadable
@fomin Comments :P
@ngn Of course it's not unreadable. But it's less readable.
3:20 PM
I didn't know C supported #
too much time with python :)
@fomin It doesn't.
@wizzwizz4 oh... so gcc -E is returning something that won't compile?
@fomin It would compile, if you used the flag to skip the preprocessor.
Or if GCC's preprocessor treats them as comments.
@wizzwizz4 ah ok
#… is a preprocessor directive iirc.
3:22 PM
so the latest paste is quite close. I just need to work out how to unravel typedefs
Will that really make the code more readable?
@rak1507 marginally
it's much much better than it is was already
maybe :) What do you think?
I don't feel like I understand the code any more in the 'deobfuscated' form than in the obfuscated one
3:24 PM
@rak1507 fair enough
it does need a pseudocode explanation
and/or meaningful variable names
@fomin it only changes the direction in which you have to read - line by line instead of char by char :)
@ngn :)
my best effort bpa.st/AHIQ
yes ok it wasn't a great effort but it's something
@wizzwizz4 please let me know if you fix the rust so I can change the timing
2 hours later…
5:35 PM
CMM: SO, Math.SE and Mother Meta all require new users to go through a "how to ask" tutorial before they're able to ask a question. Given that we're quite different from most SE sites (competition not question, Sandbox first, the occasional off-topic "go to SO" question), I think we could benefit from this feature. On the other hand, is it necessary given our traffic? Thoughts?
I thought homework dumps were this site's biggest fear?
@JohnDvorak I mean, I was just giving some examples. Including a "we're not here to do your homework" bit in such a tutorial would be perfectly fine I'd guess
but would it have any effect?
@JohnDvorak I don't know. I'd hope so, but there's no way of knowing unless we did it. This is just a chat mini meta, if people like it, or think it's worth a shot, I'll draw up a proper meta request
it could be useful for those who actually want to post a challenge though
5:42 PM
Yeah. I'm thinking something along the lines of "welcome to CGCC. This site is for <...>. [This](link) is what's on topic here. What isn't on topic is <blah blah blah>. We highly recommend using the [Sandbox](link) to get feedback on your challenge proposal before posting to main. [Here are some helpful meta posts](links)"
that's just the help/ontopic page
It's hard to imagine what sort of homework we would be useful for
One thing that'd need to be fixed for it to have any actual effect would be this
@Anush one that doesn't ask for code, just its output?
@JohnDvorak Yeah, but users don't have to read through that when they first post a challenge here, whereas a quick tutorial they would
5:44 PM
@cairdcoinheringaahing Codidact solves this problem :P
@JohnDvorak good point. Have we had any examples where you are suspicious?
I'm convinced that no one who actually posts a bad first question here reads the help page
@JohnDvorak Heresy! I've got too much rep here to start over :P
sunk cost fallacy
Normally the OP has to give examples so I am still not sure we really get homework questions
Or at least not questions that get votes
@JohnDvorak Maybe so, but the entire Codiact site is a bit too new for me. If it gets an established user base with users with enough rep to actually moderate, I might consider joining
@Anush The point is to remove questions that won't get votes before they get posted. I've got nothing against good quality homework questions (because you'll be screwed trying to turn in anything actually posted here)
5:47 PM
what about the questions where OP pastes their homework and a high-rep user edits it into a code golf challenge?
I have this stance on "homework" questions: if it's a clear, on-topic challenge, it's ok. If your course is in Python or Java, anything someone posts here isn't going to get you a high grade. You'd be better off faking a "solution" and asking for feedback on Code Review than trying to get people here to do your work for you
Until CS courses start teaching Husk, Jelly and 05AB1E, I think we're good
@JohnDvorak Codidact is getting threaded comments soon, which means we can spread the TNB tangent-finding ability all across the site.
I think I heavily underestimated how hard it would be to implement my recursive regular expressions idea
I should probably learn about NFAs and DFAs, although since I don't think it's a regular language I'm not sure if it'll help much
6:03 PM
@RedwolfPrograms Have you elaborated on that before anywhere?
ಠ_ಠ I just screwed up cooking a frozen pizza. I have great confidence in my future adulting career ಠ_ಠ
I think I was talking about in chat a few weeks ago, I think
I asked if there was something similar here, although I didn't actually elaborate on my idea
Basically I would make a colon act as an assignment operator, so (name:[a-z]*) would make name a shorthand for [a-z]* (and you could use (:name) to reference it). However, you could do something like (nested:.|\((:nested)\)) to match any character wrapped in nested parentheses, something impossible with regexes.
Not completely sure on the syntax yet
In computer science, Backus–Naur form or Backus normal form (BNF) is a metasyntax notation for context-free grammars, often used to describe the syntax of languages used in computing, such as computer programming languages, document formats, instruction sets and communication protocols. They are applied wherever exact descriptions of languages are needed: for instance, in official language specifications, in manuals, and in textbooks on programming language theory. Many extensions and variants of the original Backus–Naur notation are used; some are exactly defined, including extended Backus–Naur...
This is the usual syntax. :-p
It's not as neat as your provisional syntax, though; I expect they have different use-cases.
2 hours later…
8:33 PM
I see codidact has code golf too!
But does anywhere else have fastest code?
9:04 PM
Q: ASCII art reflection

Nathan MerrillIn this challenge, you will be given a text block, and you need to perform reflection on the text. Input: A string to be reflected. The text may not be supplied as an array whose elements are the lines of text. For example, "ab\ncd" and ['a','b','\n','c','d'] are allowed, but ['ab','cd'] or [['a...

9:42 PM
Q: possible chess moves in choice format

someonethe goal is to take a chess board as an input and a color, in any format, and output all possible moves by that color, in the same format. for example: ['pawn',1,1] -> ['pawn',1,2], ['pawn',1,3]. this is fastest-code, so the code that runs the fastest wins!

hmm, have I attracted another phantom downvoter?
10:21 PM
A: Sandbox for Proposed Challenges

someonepossible chess moves in choice format the goal is to make a function that takes in a board in choice format and color and outputs all possible moves. for example: ['pawn',1,1] -> ['pawn',1,2], ['pawn',1,3].

10:58 PM
@cairdcoinheringaahing there better not be bones in it

« first day (3629 days earlier)      last day (1065 days later) »