It does not match foobar@dk which is a valid and working email address (although probably most mail servers won't accept it or will add something.com.) — bortzmeyerOct 14 '08 at 19:30
Idiots don't know that my email validation was actually better than what they suggested
Dowker notation is a common way of representing mathematical knots.
Dowker notation can be derived from a knot diagram in the following way (based on the description from the wikipedium):
We will label each of the \$n\$ intersections with two numbers whose absolute value is on the range \$1,...
ok so I'm running into an issue (this is happening in windows 11 WSL ubuntu 20.04.2) - if i do print(input()) and input something longer than 4095 characters, it just gets cut off to that
Brainfuck is an esoteric programming language that is Turing Complete, meaning you can't tell whether a given program will halt without running it. It's cell-based and has an infinite tape of cells, values containing an unsigned integer from 0 to 255, but if you give it arbitrary-size cells, just...
I've been doing quite a few code golf recently and I realised that a lot of times, I have to do something involving list.
Most of the times lists are space-separated or comma-separated values in the first argument (argv[2]), and the return value should also be a space/comma-separated string.
Are ...
From my CMC.
Given a regex and a non-empty printable ASCII text, return one bit per character in the text, indicating the positions of beginnings of non-overlapping matches, and also the positions of beginnings of sequences that are not part of any non-overlapping matches.
You can:
take the rege...
UTF-1 is one of the methods to transform ISO/IEC 10646 and Unicode into a sequence of bytes. It was originally for ISO 10646.
The UTF-1 encodes every character with variable length of byte sequence, just like UTF-8 does. It was designed to avoid control codes. But it was not designed to avoid dup...
@NewPosts Makes me want to implement UTF-69 where each character is represented as a string of 1s joined on 0s
and the length of each run of 1s is the character code for each character
the 69 in UTF-69 is just to make it extra confusing
because you'd expect it to use like 69 bits, but instead, it's just a horrible version of unary.
and so everything becomes either byte value 255, some number where just a single bit is 0 or where it's just less than 8 1s
so something like Hello, World! in UTF-69 assuming UTF-8 display becomes ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿýÿÿÿÿÿÿÿÿÿÿÿÿÿïÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿûÿÿÿýÿÿÿÿÿÿÿÿÿÿýÿÿÿÿÿÿÿÿÿÿÿÿÿýÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¿ÿÿÿÿÿÿÿÿÿÿÿÿýÿÿÿÿÿÿÿÿÿÿÿÿïÿÿÿ
Oh wait, it's actually more varied than just history. I've got 5 history assignments, 2 math ones, and an english one.
We're having to write some sort of research paper thing in english. Since I literally just did that for another class, I wonder if I could get away with submitting the same paper
unfortunately for we chronic procrastinators, procrastinating procrastination usually just means staring off into space in a dissociative state, silently screaming at yourself for not getting anything done
What am I missing here? According to the examples, U+0100 should result in A1 21, but the first value is calculated with A1+x/BE, so if x>BE the result should be at least A2 right?
Note to self: newlines in a chat message break markdown formatting
I am the world's luckiest person...I got all sorts of stuff in a survival word on the first few days, full iron, lots of food and supplies, and then fell off a cliff, failed my MLG, and died. I managed to find it, 800 blocks from spawn, at night, with no coordinates or even the faintest idea of which direction I'd taken. Then a creeper blew me up. Then I did the exact same thing and found all my stuff.
@RedwolfPrograms I think that applies to the version number as a whole. the changes in 1.8 were so extreme that the modding community stayed in 1.7.10 for years. The community didn't make a serious attempt to move on until 1.12
and even then there's still a sizable group of people who never left 1.7.10
@hyper-neutrino 1.8 brought a lot of changes to how the game worked, which meant Minecraft Forge, the most-used modding API took a long time to update, and had a very different API to pre-1.8
We lost a lot of mods to that change. Lot of modders were so opposed to basically completely rewriting their mods for a new version that they just stopped modding
it's just Java. There are tutorials out there that teach the basics, which are good for learning how MC and Forge work under the hood. Once you've got that down it's just like any development really
yeah I don't really see a point in learning it lol; even with a custom dict i don't think it'd be faster for coding and i don't have any need to exceed 140 wpm lol
Also the last line can be f=lambda n:[p(*[[n-d,4,252],[n-16406,2,246],[n-256,1,161]][(n<16406)+(n<d)]),([160]*(n>159))+[n]][n<256] - replacing the ternary if with a list index/selection
(even if you had to include everything inside the function, you could just assign the other things inside the default arguments of the lambda to make one horrible expression for the same byte count) nope doesn't work because the other functions rely on being able to call each other, which they can't if they're not stored as global variables
I recently came across this very interesting project: https://github.com/eignnx/misp
It is lisp, but the m expressions used are much shorter than normal code. It would also pay a tribute to the original development history of lisp, where this feature was planned but never implemented.
Having more...
@leo-but-not-the-other-guy Welcome to The Nineteenth Byte! In answer to your question earlier, I'd say: 1) Sure, we always welcome new golfing languages (though you may find that you're the only person who uses it); and 2) another idea is to golf in misp directly, without making a new language.
@DLosc Cool, i was worried because it looked unmaintaned, but maybe i can fork it and look at the code. (Im a python noob, so keeping the code working is the best i can do)
@Mayube I thought each distro used its own thing (on my computer, at least, I have an app called Ubuntu that launches an Ubuntu terminal that doesn't look anything like cmd)
And I think if you use Windows Terminal, you'll have to make a profile for Ubuntu (or any other WSL thing) yourself, the defaults are just cmd, powershell, Azure (?), and something else
@Anush Probably, especially the more advanced flavors that aren't even regular expressions anymore
@user They all use conhost.exe, which is a console host (like a terminal), which I think is what Mayube meant by cmd (but cmd.exe is actually a shell, like bash (but worse))
@user ok but have you ever tried to use Batch (the scripted form of what cmd is interactively)? Its only flow control is a really terrible kind of for loop, and... goto
@Anush The fact that (I'm guessing) it doesn't matter what order the upper case/lower case/digit are in (e.g. both Ab1 and b1A would be matches, ignoring the "no three chars" bit) makes it a lot more complex for a regex
I'd suggest just doing some basic string manipulation / using multiple regexes
@Anush I think ^(?=.*[A-Z])(?=.*[a-z])(?=.*\d)(?!.*(?:[A-Z]{3}|[a-z]{3}|\d{3})).* should do it: Try it online!
with copious use of lookaheads, and assuming the string is printable ASCII only
But yeah, probably better not to use regex for this task.
Well, let's try it, actually:
CMC: Given a string of printable ASCII characters, return truthy/falsey (or two consistent values) based on whether the string contains an upper case, a lower case and a digit and has no three characters in a row from the same of these three classes.
World1 -> false (too many lowercase in a row) WorLd -> false (doesn't contain a digit) WorLd1 -> true
It's quite a naive solution, I just get all possible orders of the character classes' first appearance and generate a regex for each of them (generator program) :|
Yeah, my first thought was to test for every possible order of upper-lower-digit, but then I was thinking about the negative lookahead for the no-three-in-a-row rule and realized lookaheads could be used for the must-have-at-least-one rules too.
I think $&_Na\&_X3NIaM[XUXLXD] should work in modern Pip (22 bytes), though I haven't tested it.
Slightly oversimplified explanation: - Make a list containing the builtin regexes XU = `[A-Z]`, XL = `[a-z]`, and XD = `\d` - For each regex: > Count its occurrences in the input string > Test whether the regex repeated three times occurs in the input string; return falsey if it does, truthy if it doesn't - Logical AND all the results
You may use any language! Have some fun!
P.S.: If you don't know what a CMS is, it's like self-hosted website builder, but only works with one site! They have pages, and edit functions.
@DLosc It does mean that any submissions in the language on this site can append a } to be functions instead of full programs, if that makes a difference (e.g. see CJam)
@NewPosts Ah, OP deleted just as I was finishing my welcome comment :/
Well I suppose it could mean that the first undefined variable found (in this case, index, assuming lhs and rhs are defined elsewhere) is the loop variable