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.
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
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.
Stack 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...
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 "
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?)
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.
#[inline]
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()
}
}
}
unreachable_unchecked();
}
KoTH: 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.
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
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
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?
@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
@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
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)"
@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)
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
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.
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.
In 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...
the 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!
possible 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].