|
Ranzear posted:I definitely overthought the complication. No I'm sure I'll encounter more issues like you described KillHour posted:Issue marked as Closed - Not a bug. Immortal Wombat fucked around with this message at 18:17 on Nov 11, 2022 |
# ? Nov 11, 2022 18:11 |
|
|
# ? Jun 7, 2024 01:56 |
|
Immortal Wombat posted:No I'm sure I'll encounter more issues like you described I know I said it to poke fun at Hadlock, but XSLT really is the right way to do it if you want anything more complex than "everything is now 0" For instance, this will take all fDegradePerUse values that aren't 1 (because those are one-time-use items) and halve the amount of per-use degredation. code:
|
# ? Nov 11, 2022 21:29 |
|
No posts since 2018
|
# ? Nov 11, 2022 22:56 |
|
I am super stuck. I think I'm supposed to figure out which string is missing a character other two strings have. Ie. in {'bcdefg', 'abdefg', 'acdefg'} abdefg doesn't have c. How I can figure out from that set that the correct choice is abdefg? I have been at this for 2 days and my brains just don't work. Normally I just compare 1vs1 but ugh this Ihmemies fucked around with this message at 23:50 on Nov 11, 2022 |
# ? Nov 11, 2022 23:48 |
|
acdefg is missing a b, which is present in the other two strings. Likewise, bcdefg is missing an a. Is there a more precise specification for what you're being asked to do?
|
# ? Nov 11, 2022 23:52 |
|
Jabor posted:acdefg is missing a b, which is present in the other two strings. Likewise, bcdefg is missing an a. Is there a more precise specification for what you're being asked to do? Well it's AoC 2021 day 8 b. It has a 7-segment display: https://en.wikipedia.org/wiki/Seven-segment_display https://adventofcode.com/2021/day/8 So 0, 6 and 9 share the same amount of on states. I'm supposed to figure out how to differentiate 0 6 and 9 from each other. I managed to do it for 2/3/5 I think. 0 is missing a character which both 6 and 9 have. Six is missing one chracter which is in one. Nine is then left... Ihmemies fucked around with this message at 23:58 on Nov 11, 2022 |
# ? Nov 11, 2022 23:56 |
|
camoseven posted:No posts since 2018 There is also an ardunio thread in the hobby forum - https://forums.somethingawful.com/showthread.php?threadid=3505424
|
# ? Nov 11, 2022 23:57 |
|
Ihmemies posted:I am super stuck. I think I'm supposed to figure out which string is missing a character other two strings have. As Jabor observed, the example given doesn't seem to match the rubric. But I'll proceed by supposing you just came up with that one off the top of your head, as opposed to it being an actual example. In the absence of any compelling reason to optimise, I would approach this as follows: 1. Make a list of the distinct characters appearing at least once in any of the strings. In this case we would get 'b', 'c', 'd', 'e', 'f', 'g' and 'a' (ordering by first appearance). 2. For each character in the list, count how many of the strings contain it at least once. This results in a mapping of characters to positive integers (in principle nonnegative integers, however from the method of construction of the list, each character is in at least one string). 3. Look at the mapping and see which character maps to the value 2. 4. Look at the original strings and see which of them does not contain the character identified at step 3. Hammerite fucked around with this message at 00:03 on Nov 12, 2022 |
# ? Nov 12, 2022 00:00 |
|
Ihmemies posted:Well it's AoC 2021 day 8 b. It has a 7-segment display: https://en.wikipedia.org/wiki/Seven-segment_display https://adventofcode.com/2021/day/8 You can just start with what you already know, instead of trying to figure it out just by looking at that 0-6-9 set. Why not start with figuring out which one is 6, instead of trying to figure out 0 first?
|
# ? Nov 12, 2022 00:01 |
|
Jabor posted:You can just start with what you already know, instead of trying to figure it out just by looking at that 0-6-9 set. My solution is not exactly great, so it's not easy to tell 0 and 9 from each other then. Maybe I should have kept book about which letter means which segment
|
# ? Nov 12, 2022 00:11 |
|
Ihmemies posted:My solution is not exactly great, so it's not easy to tell 0 and 9 from each other then. Maybe I should have kept book about which letter means which segment Can you think of any other digits that have a segment that's in one of 0 or 9 but not the other? Thinking about it four a moment might give you some fivehead big brain enlightenment.
|
# ? Nov 12, 2022 00:15 |
|
Yes. I guess it is easier when you told me I can compare it to other numbers. Finally. What a piece of utter garbage my solution is. Luckily I don't need to submit the code anywhere, only the result. Well I'll submit the code here anyways so you can laugh at me: https://pastebin.com/2zd6vQSM Thanks for the help! Even with the uh.. spaghetti... runtime is "only" 3313.92020ms with 1000 iterations.
|
# ? Nov 12, 2022 00:51 |
|
Do we have a kubernetes specific thread ? I would ask this there if so, maybe devops thread is better, but anyway - I am adding a ReadWriteOnce volume to an EKS cluster, and in this case I want to have one of them one each node in the cluster appear automatically, but only one, and assigned to each node, so 4 node = 4 volumes. Then I may have 1 to N pods mounting this same volume to read from it, the pods all do the same thing, just scaling it so maybe more than one pod per node. My question is how to configure the deployment templating such that when a pod comes up it knows what node its provisioning to and the volume name is set accordingly in the pod deployment. Not sure how to approach this dynamically really. Possible in helm perhaps ?
|
# ? Nov 14, 2022 18:08 |
|
Hello, I have a little question: How would one generate a hashcode for a Bingo card? A Bingo card is a class that has a 5x5 matrix, with numbers from 1..N (inclusive) with the middle cell ignored (let's say, set to 0). 2 bingo cards are equal if they have rows or columns or the diagonals equal. These are equal if they have the same numbers in them, regardless of order. For example: pre:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 pre:5 2 3 4 1 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 The purpose of it all is to generate a set of X cards, where there are no 2 same cards, basically trying to ensure that there are no 2 winning cards. Now, placing them all in a list and just calling contains works fine, since just equals is what matters. But, ideally, I'd have them placed in a set, both for speed of comparison and for code simplicity. But ... I can't figure out how could I go about generating a proper hashcode, given the equality rules. Is it even possible? edit: updated the example Volguus fucked around with this message at 16:50 on Nov 17, 2022 |
# ? Nov 17, 2022 16:34 |
|
Sort the numbers, concatenate them with your favorite separator, and generate your hash code from the resulting string.
|
# ? Nov 17, 2022 16:36 |
|
ultrafilter posted:Sort the numbers, concatenate them with your favorite separator, and generate your hash code from the resulting string. That I don't think would work, since the numbers are 1 to N where N is greater than 25 (can be 50, can be 100). So, it's possible to have this: pre:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 pre:5 2 3 4 1 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 Volguus fucked around with this message at 16:48 on Nov 17, 2022 |
# ? Nov 17, 2022 16:46 |
|
The ith column on a regular bingo card can only have numbers in the range [15 * (i - 1) + 1, 15 * i]. Is that not a constraint here?
|
# ? Nov 17, 2022 16:49 |
|
ultrafilter posted:The ith column on a regular bingo card can only have numbers in the range [15 * (i - 1) + 1, 15 * i]. Is that not a constraint here? No, not that I'm aware of. I have no idea how the regular bingo works, but for this exercise the numbers are to be replaced with pictures, as in christmas-themed bingo. So it has nothing to do with regular bingo that the elderly play.
|
# ? Nov 17, 2022 16:52 |
|
Volguus posted:No, not that I'm aware of. I have no idea how the regular bingo works, but for this exercise the numbers are to be replaced with pictures, as in christmas-themed bingo. So it has nothing to do with regular bingo that the elderly play. Brute force it and get the list of every winning combination of numbers/picture IDs and then sort those (both by the order within the row/column/diagonal and then sort the groups) and hash that.
|
# ? Nov 17, 2022 16:59 |
|
I can’t think of any way to write a hash that’s consistent with your equivalence relation except to use a trivial hash. Note that if you’re trying to make it structurally impossible for two people to achieve bingo in the same round, your rule isn’t good enough, and it’s not obvious that any rule could possibly be good enough besides every card having an independent set of numbers. In normal bingo, I’m pretty sure organizers just aren’t supposed to hand out identical cards. In addition to the range restrictions on columns, numbers are sorted in columns, so card identity is purely reducible to the set of numbers.
|
# ? Nov 17, 2022 17:28 |
|
I think the intent is to prevent a situation where the cards are effectively identical (so avoid rotations, flips, etc), not necessarily prevent any rows/columns being the same. But yeah, you could just always sort the images by ID and enforce the regular bingo constraints to avoid that.
|
# ? Nov 17, 2022 17:30 |
|
Assuming you’re only going to generate at most few hundred cards per game I don’t see any reason to bother with a hash anyway - just generating a random sequence of cards and retrying any that .equals() any previous card in the sequence will certainly be Good Enough™️
|
# ? Nov 17, 2022 17:56 |
|
KillHour posted:I think the intent is to prevent a situation where the cards are effectively identical (so avoid rotations, flips, etc), not necessarily prevent any rows/columns being the same. But yeah, you could just always sort the images by ID and enforce the regular bingo constraints to avoid that. Yeah. I think you wouldn’t have to go all the way to sorting if you didn’t want to, though. You’re just worried about rotations and flips, and there’s a way to find a traversal of the grid that will ignore those: pick the smallest corner, then traverse rows/columns from there starting with its smallest neighbor. If OP was just worried about not having cards with the same 12 winning sets, they could hash that set of sets. But I can’t think of any non-trivial hash that will be equal for cards that share any of those sets.
|
# ? Nov 17, 2022 17:59 |
|
rjmccall posted:Yeah. I think you wouldn’t have to go all the way to sorting if you didn’t want to, though. You’re just worried about rotations and flips, and there’s a way to find a traversal of the grid that will ignore those: pick the smallest corner, then traverse rows/columns from there starting with its smallest neighbor. For the case of any set, you would just add 12 hashes to the hashlist for each new card instead of one.
|
# ? Nov 17, 2022 18:03 |
|
DoctorTristan posted:Assuming you’re only going to generate at most few hundred cards per game I don’t see any reason to bother with a hash anyway - just generating a random sequence of cards and retrying any that .equals() any previous card in the sequence will certainly be Good Enough™️ That's what I have and it is working, just my OCD wanted to optimize it. The intent was to prevent any cards that haven the same line or column or diagonal, so that for a specific draw of numbers (well, images in this case) there cannot be 2 people that would say bingo at the same time. The odds of this happening, even when generating 50 cards from 36 numbers, are quite low, but not impossible. I was just thinking that there must be a way to properly put them in a set and have them be generated until the set reaches a certain length (my desired number of cards) and I just don't see it. rjmccall posted:I can’t think of any way to write a hash that’s consistent with your equivalence relation except to use a trivial hash. That's what I'm trying to make, is it not good enough? Here's the pastebin to my little program: https://pastebin.com/YE5srPFw . And here are the tests I made for it: https://pastebin.com/20xrfWN4 . I'd love to be pointed out what did I miss.
|
# ? Nov 17, 2022 18:19 |
|
Yeah, so, if that’s what you’re going for, you are definitely not going to be able to satisfy it. Remember that it’s unusual for bingo to be achieved after exactly five calls. Try thinking of it this way: flip it around. Given a list of >5 called numbers, can you construct two cards that satisfy your original condition and yet both achieve bingo on the last number? Almost certainly yes. The actual numbers don’t matter, so we can renumber them for our convenience; let’s make them 1, 2, 3, 4, 5, …, N. Make the top row on Card A (1,2,3,4,N) and the top row on Card B (1,2,3,5,N); now they’ll both achieve bingo in round N, and the top row satisfies your condition, so you just need to make sure neither achieves bingo earlier or violates your condition in a different row/column/diagonal.
|
# ? Nov 17, 2022 18:56 |
|
rjmccall posted:Yeah, so, if that’s what you’re going for, you are definitely not going to be able to satisfy it. Remember that it’s unusual for bingo to be achieved after exactly five calls. Oh drat, thanks for the explanation. That makes sense.
|
# ? Nov 17, 2022 19:09 |
|
You could emulate it by pregenerating a set of draws such that you know that they will always have exactly one winner (and you could even set the games to be a specific length). It would still be fair because the boards are passed out randomly, but it's not really in the spirit of Bingo.
|
# ? Nov 17, 2022 19:25 |
|
That’s a cute idea.
|
# ? Nov 17, 2022 21:12 |
|
KillHour posted:You could emulate it by pregenerating a set of draws such that you know that they will always have exactly one winner (and you could even set the games to be a specific length). It would still be fair because the boards are passed out randomly, but it's not really in the spirit of Bingo. Heh, interesting. Not achievable since this is some thing my sister makes to give to other people (the cards, the images that are randomly drawn, etc.), so there's other people playing. She just asked me to generate "unique" cards for her, based on how many images she has (that's the 1 to N range). I think she now has 36 of them, so generating 50 or 100 cards should yield relatively unique combinations.
|
# ? Nov 17, 2022 21:17 |
|
Does anyone have any useful advice on when a C++ dependency should be a submodule of the git repository, or when you should just tell the user to figure it out themselves and have cmake do its best to find it? having a submodule does seem easier, but also, it seems wasteful to force someone to download the entirety of boost just to build my program when boost binaries are easily available and there's even a good chance they already have the boost repository cloned, given that they work with C++. Perhaps the distinction should be that big, popular packages just get found with cmake, and smaller, more obscure packages get put in as submodules? Or anything that find_package can find should be found with find_package? e: it's possible there's a third paradigm that I should be using instead, too. I really have no idea, I'm a complete novice with cmake cheetah7071 fucked around with this message at 22:51 on Nov 17, 2022 |
# ? Nov 17, 2022 22:48 |
|
cheetah7071 posted:Does anyone have any useful advice on when a C++ dependency should be a submodule of the git repository, or when you should just tell the user to figure it out themselves and have cmake do its best to find it? Just use vcpkg or conan to manage dependencies.
|
# ? Nov 17, 2022 23:13 |
|
Volguus posted:Just use vcpkg or conan to manage dependencies. drat i can't believe i struggled through manually getting cmake to do what I wanted instead of using *checks notes* a program which produces a cmake script, when cmake is itself a program that generates compiler settings just programs that compile to programs that compile to programs all the way down thanks though, conan has every package I need except one and I can just submodule that specific one without too much issue
|
# ? Nov 18, 2022 00:09 |
|
https://en.wikipedia.org/wiki/Fundamental_theorem_of_software_engineering
|
# ? Nov 18, 2022 00:19 |
Is it a module that you own, and it's at least nominally part of the same project portfolio? If yes, consider making it a git submodule. Is it a third-party module that you have custom patches for, making it not directly replaceable with the upstream version? Consider making it a git submodule. Otherwise, probably don't.
|
|
# ? Nov 18, 2022 03:35 |
|
This might be more of a maths question, but: if I have a sequence of 90 degree left/right rotations and horizontal/vertical flips, is there a way to simplify that down to a minimum that is constant so that no matter the sequence of them you used, if you ended up with the same image orientation, the simplified sequence will be the same?
|
# ? Nov 18, 2022 05:02 |
|
Rotations and reflections are affine maps so their composition is also an affine map, but it won't necessarily be a rotation or a reflection. IIRC you can always represent the result as a composition of one reflection, one rotation and one translation, but the details are messy. Do you really need that info or is the final transformation good enough?
|
# ? Nov 18, 2022 05:07 |
|
MikeJF posted:This might be more of a maths question, but: if I have a sequence of 90 degree left/right rotations and horizontal/vertical flips, is there a way to simplify that down to a minimum that is constant so that no matter the sequence of them you used, if you ended up with the same image orientation, the simplified sequence will be the same? This is related to Group Theory, an incredibly important branch of math, if you're curious If you add two more reflections (across the two diagonals) then you have the complete list of symmetries of a square, and composing and two of them will always give you another symmetry on the list. There's only 8 possibilities, no matter how many you do in sequence. There might be a more elegant way to do it (my knowledge of group theory is pretty light) but, if nothing else, here's a lookup table of all 64 compositions: https://proofwiki.org/wiki/Definition:Symmetry_Group_of_Square e: I'm assuming here that the reflections are right down the middle and the post above is assuming you can reflect about any line, I think. I guess it wasn't clear which you meant
|
# ? Nov 18, 2022 05:09 |
|
ultrafilter posted:Rotations and reflections are affine maps so their composition is also an affine map, but it won't necessarily be a rotation or a reflection. IIRC you can always represent the result as a composition of one reflection, one rotation and one translation, but the details are messy. Do you really need that info or is the final transformation good enough? I can throw away the translation element here. Users will be rotating/flipping glyphs at will, and I want to be able to bring it down like that so that I can go 'oh output glyph 1 and 2 are equivalent, so I can throw away 2 and point it to the result of 1 in the output set'. cheetah7071 posted:This is related to Group Theory, an incredibly important branch of math, if you're curious Thanks, I'll look into that. MikeJF fucked around with this message at 05:11 on Nov 18, 2022 |
# ? Nov 18, 2022 05:09 |
|
|
# ? Jun 7, 2024 01:56 |
|
What kind of shapes can the glyphs be?
|
# ? Nov 18, 2022 05:13 |