Question:
Given a String s of randomly-shuffled numbers from m to n such that -100,000 <= m < n < 1E9, your job is to find the number that is missing from the group. Note that the string can be (and generally is) randomly-generated/constructed, and the below cases are only an example of what that...
I used a linked list of URIs pointing to Unix file systems which I FTPed for the index of the multidimensional array of floats which I used to store the unicode representations of the boolean values of the states of each cell, with a SHA-512 checksum and blockchain (plus jQuery to make it short)
hey quick poll for python users did y'all use numpy because i feel like relearning numpy might have gone faster than [this](https://github.com/UnrelatedString/advent-of-code-2020/blob/master/aoc17.py)
now i'm just going to write a solution in fucking jelly in 10 minutes
How Many Atoms?
code-golfchemistryparsingstring
Given a chemical formula as input, output the total number of atoms in the formula.
Input
A chemical formula. Chemical formulas are governed by the (E)BNF:
<formula> = <number>? <group>+
<group> = <atom> | "(" <atom>+ ")" <subscript>
<atom> = <symbol>
Ken Iverson, 1920–2020
Let's implement his favourite expression:
Given a row of Pascal's triangle, compute the next row.
This can for example be computed by taking the input padded with a zero on the left, and the input padded with a zero on the right, and then adding the two element...
Inspired by what I'm doing at work right now.
Your program should take one parameter, the path to the file
It should convert all the windows style newlines (\r\n) to unix style (\n) and write the result back to the file
“What does the Google Analytics.js code do?” – but I misread copyright law in my jurisdiction, and am no longer confident I'm allowed to publish something like that.
@wizzwizz4 A bit out of context, but we've recently looked into that at my company, and it seem quite certain that running that code is prohibited by GDPR unless the user actively agrees to it, so simply including it isn't OK.
Input: binary string
Output: binary string that represents the binary input + 1
Example: Given 10111 as an input, output 11000
Limitations: Can't use arithmetic operators or functions
If a CDN's Terms of Service say “I promise I'm not collecting anyone's data”, my totally-unofficial not-a-lawyer legal opinion is that that's sufficient.
Assuming it's a legally-binding ToS, of course, which it probably is? I don't understand contract law.
Because the user's browser will send a request to the 3rd party server, which can then log IP, without the user having consciously contacted that server, and so there's no consent for that logging.
I've even seen websites for large companes with non-functional "GDPR" links. It seems common behaviour is to pretend that one is compliant just by mentioning compliance!
― Sir, you were driving 120. ― But officer, I have a speedometer!
I will preface this by saying that I made this for fun; I have absolutely no formal knowledge on cryptography or error correction. Do not use this algorithm in anything remotely important.
I was kind of bored a few days ago, so I decided to write a simple function to take some data and return an ...
I made it mostly just for fun, although its intended use was just to give long chunks of text an easily memorable label. Not at all meant for crypto or error correction :p
Although, in what way is it biased? I made sure every outputted digit is equally probable.
You can get it arbitrarily close, but if the number of possible hashes isn't a factor of the number of possible inputs, you can't give each possible hash an equal probability.
A power-of-two base would work.
That's why most people have one.
You can get arbitrarily close, but only if you keep as much information for as long as possible.
You do the “change base” operation after you've thrown away lots of information about the original input.
Just brute forced every possible input to the size 4 one, it looks like every possible output is possible if you use the 6th least significant bit instead
But yeah, some are definitely much more likely than others
Inspired by this challenge about creating a "Hello, world!" program which the npm tool sloc considers to have no lines of code, I thought it would be interesting to have a quine challenge around the same idea.
Quoting directly from the previous challenge,
NPM's sloc is a moderately popular tool ...
@Adám Also, I can't speak for other Jelly coders, but I personally would rather just not post a Jelly answer than post a "compressed Python code eval'd" answer
@cairdcoinheringaahing There really isn't much. ∘. is special syntax, unrelated to both . being outer product and ∘ being compose. But indeed, it does compute a table of results for the function on its right, the ○ function in this case.
It's a well-known fact that Fermat's Last Theorem is true. More specifically, that for any integer \$n \ge 2\$, there are no three integers \$a, b, c\$ such that
$$a^n + b^n = c^n$$
However, there are a number of near misses. For example,
$$6^3 + 8^3 = 9^3 - 1$$
We'll call a triple of integers \$...
Wait, @RedwolfPrograms how do you have 11 hats? Shouldn't you have 12, because you get Milliner once you get 11?
@Adám Yeah, but it might be nice to have a definite consensus on such a thing (or for more general coding competitions outside this site) if we don't have one already
Implement a system that simulates a counter (modulo 8) interacting with the environment as a binary model for Xchek and a set of properties. Build a model for the counter that counts the number of times a variable has the value 1 modulo 8 with binary variables in GCLang. In other words, one of yo...