So... for exactly quadratic complexity you can build two suffix tries for S and T and traverse both, counting overlaps
One of my concerns in general is that string algorithms often involve the size of the alphabet in their time complexity, which makes the category of string algorithms a bad choice for restricted-complexity or fastest-algorithm.
Simulate weathering
Simulate weathering / erosion.
Input
Input will be given as a string of any 2 character you like in the shape of the rock (here i use space and hashtag):
###
####
######
########
#######
#####
Or if your language doesn't support strings, a matrix of 1s and 0s.
AND
a nu...
There's consensus that answering with fractions is allowable for decimals that can be expressed as fractions. But what about irrational numbers? Can they be expressed as a rational representation of the corresponding decimal approximation?
Examples:
\$\sqrt{2}\$ can be approximated as \$1.4142135...
How large does interleave operator generate a maximu value?
[code-golf]
INTERCAL has an interleave operator which does the following operation. Let left operand be asdf and right one qwer in binary, respectively. The operation produces a binary value aqswdefr.
INTERCAL internally treats data as u...
I just realized that for challenges that let you ignore whitespace in the score, you can always solve it with Vyxal in 8 bytes by encoding the real program with spaces and newlines and then executing it: Try it Online!
"Hey, we think you'd be a great fit of Texas University of Texas" Yeah, lemme just get a refund on the tuition fees I just paid so I can get a flight out to start uni there
@RedwolfProgrammed pro tip: create an auto email filter rule to immediately delete any email containing the word "unsubscribe", and you'll never get another newsletter again
TIL if you type something into the chrome omnibox and hit Ctrl+Enter instead of just Enter, it automatically appends .com to the search and tries to go to that site. So you could type github instead of github.com
@RedwolfProgrammed pro tip: create an auto email filter rule to immediately delete any email containing the word "unsubscribe", and you'll never get another newsletter again
"<name>, we've extended the deadline just for you! Apply now to our middle-of-nowhere university that's so desperate for students we're reaching out to a mediocre student who's never shown interest in us, and we'll give you a scholarship!"
Makes me feel so special with those personalized tracking links and stuff :P
Depends entirely on the context. As a parameter list, it should be alright. Otherwise, it should be an error since you can just use the keyword null instead, much less weird-looking
In accordance with our meta agreement, since one candidate received more votes than the others, we have a new featured language! Throughout November 2021, our Language of the Month will be:
Zsh
What's a Language of the Month?
See the meta post for nominations. In short, during April, those who ...
@Anush The only argument I can think of for not making the nominations post community wiki is that it might decrease people's sense of ownership about their nominations. But there's no rep involved, so maybe it wouldn't.
@user I've been saying "zeesh," not because I think it's necessarily the "right" way to say it, but because it's fun to say. ^_^
A user's nomination answers belong to them, because there is normally an association between that user and the language they nominated (e.g. I nominated Zsh because I regularly use Zsh)
I don't really have an opinion on it either way, but I think it should be mentioned that a lot of LotM nominations are done by the creators of the language (e.g. Vyxal, Plumber, Add++, tinylisp, Arn, etc.), who would probably prefer to have their nominations remain their own.
CW here makes sense, as the post gets edited at least once a month by a large number of (overall) users. While tradition is to allow the person who posted the nomination to post the LOTM thread, anyone can do it. Ownership of the answer isn't important
Besides, I think people can figure out what is meant when people use "I"/"me" in a CW post
and np makes sense because NumPy = NP whereas SciPy and SymPy would get confusing and if you call it like scp or something that's just not as nice anymore
If a user who likes a nominated language thinks its lacking in listed resources/info/pros/cons etc., they can only edit those in (including suggesting an edit) if they have 2k+ rep
They can leave a comment, but the better thing to do is to edit
@cairdcoinheringaahing Granted, it won't be used that often, but there's very little downside, and if it helps one person, ¯\_(ツ)_/¯
It also allows us to do the edit-down-and-delete steps for successful nominations more easily. Once or twice, I've had to flag a nomination for mod deletion because the user who posted it wasn't active anymore. Like caird said, not a big deal, but a small annoyance.
@hyper-neutrino I started programming using Visual Basic in Excel, and wow, those scars certainly still haunt my dreams
@lyxal at school I made, what was, looking back on it, quite a complex P2P network, for a chat system, precisely because a web chat would get shut down very quickly
@pxeger Out of interest, how did this work? I've considered something like that before, but I'm not really sure about some stuff (like how they'd get each other's IPs).
@emanresuA I use VS Code because it's got Metals and IntelliJ's support for Scala sucks, Atom because it's cool but pretty much the only language I can use it with is Python (which Vyxal uses), and IntelliJ because I have to for Java
@emanresuA See now that's why I stopped pinning stuff to my taskbar
@RedwolfProgrammed I think it was something like "attempt connect to a few hardcoded ips of a computers that are commonly used to run my chat app [mine and some friends, probably] and send them this computer's IP"
wow, did that approximate a compliment? I'm gonna take that as a compliment
@RedwolfProgrammed old_man_shaking_fist Back in my day, young man, we didn't even have a "protocol" to deal with the post office, we had to rsh in and more the Maildir ourselves!
TBH using something like gmail doesn't feel lazy, it feels like the default and anyone doing it the old way either should have a good reason or just has a case of i-want-to-feel-smart syndrome
I'm reimplementing Flipbit, and I have a couple questions, since there isn't really a spec. 1) Can input be limited to characters where ord(char) < 256? 2) Must the tape be finite in size?
is there any websocket / or non-stupid way to get all chat messages in real-time? by non-stupid I mean not just while True: get("https://chat.stackexchange.com/transcript/message/x"); x++
@cairdcoinheringaahing ah, okay. That's fine - I only need real-time new messages (the idea is to do a CHQ-like thing for chat - we're just speculating on whether or not that would even be feasible)
(also, when you say "bot here" I think you misunderstood - I want all messages, not just this room)
Watching all current messages in one room is trivial
NP/SP actually does that, but only to acknowledge pings to stop it from emailing me every other day
And to listen for status/REDWOLF! messages
I don't think it's possible for all rooms though
I'd thought the main page updated the list of rooms every time a new message was sent, but after some inspection it seems it does not
And that's the only place I could see there being a socket for all messages
If you wanted a somewhat gross but still functioning solution, you could watch the chat homepage for new rooms, then listen to every single non-frozen room
The incrementing message IDs is honestly probably the best option
If you checked every second or so, you'd accumulate a small backlog if a lot of messages were posted at once, but as long as you check faster than the average rate of messges being sent you'd always catch up in theory