I ran into the documentation on Solo, the one element tuple, and was a bit confused about how it says it can prevent space leaks, which makes me suspect I'm not understanding something about how the Haskell memory model and/or garbage collector works.
To quote the docs, they say:
The most import...
AICMC: Sort a list of numbers by their decimal expansion, ordering by most significant digit then second most significant digit, etc. (e.g. 10 -> 0.001, 1 -> 0.0001, 11 -> 0.0011, 0.001 -> 0.0000001, 0.0001 -> 0.00000001, 0.0011 -> 0.00000011, ...)
AICMC: Given a list of integers l, output a list of triplets (a, b, c) such that the sum of a, b, and c is equal to 0. For example, the input [1, 2, -3] should yield the output [(1, -3, 2), (2, -3, 1)]
@lyxal From all numbers in the range [1, 179], keep those where the sum of whether products of combinations without replacement from the range [1, n] = n equals 2
> A thinks of x in set M; B asks questions: is x in T?; A may lie once but only when true answer is Yes; a(n) is maximal size of M such that B can determine x with <= n questions.
How official is OTTNB going to be going forward? It was originally just an experiment, so there was never any real announcement or fanfare, and now it's pretty consistently got activity and around 4-5 users online. It's currently got the same ROs as normal TNB, and it has TNB in the name, so should we in some way formally make it an official room?
I really don't think 2 weeks is to short, most meta posts reach consensus far faster than that. But I always feel like CGCC users suggest ridiculously long time frames for waiting for things. Ultimately it doesn't matter at all because none of this is really time pressing at all and if we want to way a month or a year or whatever it certainly doesn't matter to me.
> But I always feel like CGCC users suggest ridiculously long time frames for waiting for things.
It's been around for just under 5 months now. Granted, that's longer than a lot of chat rooms, but not that long
Besides, we already direct people there when necessary, you can find it on the site chat room page easily, given it's activity, and you can just star it if you need to get to it
It's annoying when a discussion is "moved to OTTNB" but I have to search through the terrible chat list interface to find the room to continue the discussion
Recently, TNB conducted an experiment in which we created a new room specifically for off-topic discussion, which resulted in a marked decrease in the amount of off-topic content in TNB. This room has now been around and active for over five months. Should we "officially recognize" it and add it ...
Speaking of things like managing off topic - after the mod election, are we going to need another RO election to replace the RO that becomes mod? Because iirc mods don't RO normal rooms
We're both active here, I doubt that becoming a mod will cause either one of us to stop doing any ROing. In fact, it'll probably do the opposite, given we'd have increased moderation powers in chat
the way I do it is: - think of thing - lizard brain goes "ha! funny/constructive!" and posts - at the same time rest of brain is doing a more complete funny/constructive evaluation which takes about 5 more seconds - if rest of brain disagrees then I delete message
@Ginger Please don't delete messages unless they really need to be. It can be disruptive to the conversation if messages that are part of it get deleted
Recently, TNB conducted an experiment in which we created a new room specifically for off-topic discussion, which resulted in a marked decrease in the amount of off-topic content in TNB. This room has now been around and active for over five months. Should we "officially recognize" it and add it ...
A partition of a list \$A\$ is a way of splitting \$A\$ up into smaller parts, concretely it is list of lists that when concatenated gives back \$A\$.
For example [[1],[2,3],[5,6]] is a partition of [1,2,3,5,6]. The trivial partition is a partition that "splits" the list into only one piece, so [...
I don't normally ask for upvotes, but I make special exceptions for getting bot accounts at least 20 rep because they won't use that rep to do anything but chat and will not do anything else on the site.
Given an alphabet represented as a nonempty set of positive integers, and a word made up of symbols from that alphabet, find that word's position in the lexicographically ordered set of all words, assuming words can't contain duplicate symbols.
Example
Consider the alphabet {1, 2, 3} and the word...
CMC: given a string of {|},, determine if the input is a surreal number
(alternatively, you may take the input as a ragged list whose top level has length 2)
(you can assume all the brackets will be properly matched with | between them and commas placed where they need to be, etc. this isnt a "match the brackets" challenge, is my point)
@Ginger This works pretty well with a slight modification: add a 5-second pause before hitting the Enter key. The one drawback is that sometimes an otherwise funny joke doesn't work because the conversation has moved on already, but that doesn't happen to me too often.
local function bitwiseOp(a, b, lookup)
local intA = math.floor(a)
local intB = math.floor(b)
local result = 0
local nibble = 1
while (intA > 0 or intB > 0) do
local aMod = intA % 16
local bMod = intB % 16
intA = math.floor(intA / 16)
intB = math.floor(intB / 16)
result = result + lookup[aMod + 1][bMod + 1] * nibble
nibble = nibble * 16
end
return result
end
the function is the same for all 3, just different lookups
i literally just have
function bitwiseAnd(a, b)
return bitwiseOp(a, b, BIT_AND_LOOKUP)
end
function bitwiseOr(a, b)
return bitwiseOp(a, b, BIT_OR_LOOKUP)
end
function bitwiseXor(a, b)
return bitwiseOp(a, b, BIT_XOR_LOOKUP)
end
@RadvylfPrograms yeah i was wracking my brains for 30 mins trying to figure out how id do it with minimal performance penalty :P
it does compute xor of 100000 and 999999 very fast tho
is it something to do with the complexity of regex or is the task of "replace all of this single character with a different single character" inherently slow?
Gematria is an ancient Jewish method to determine a numeric value of a letter sequence, using a fixed value for each letter. Gematria is originally applied to Hebrew letters, but for the context of this challenge, we'll use Latin script instead. There are many ways to implement Gematria in Latin ...
Yeah, big-O notation is a theoretical tool. It often has practical implications, but there are also situations where an algorithm with theoretically worse runtime complexity will be faster for sufficiently small inputs.
I mean "sufficiently small" can also easily be far larger than you'd ever care about for really well-studied problems where there's something with like, polylog complexity that's theoretically better but only with inputs in the zillions or whatever
does search not like preformatted text? I tried searching for two strings, one of which was in preformatted text and one which was not, and the search failed, but if I searched separately, the correct post was in the search results.
In this challenge, you must print the string "Code Golf." I'm curious what you come up with because unlike what you think, this will be pretty complicated. No literals.
Rules
The output can be anywhere you want (stdout, localhost, stderr, etc.)
The output must be exactly the string "Code Golf," ...