Aug 31, 2018 02:30
@KevinCruijssen Yes, random.
Aug 31, 2018 02:30
Ohhhh I see, there's my logic flaw. I am so sorry. I will change it to exactly 2 rows and 2 cols contain exactly 1 digit and N < 27. Is that okay?
Aug 31, 2018 02:30
@KevinCruijssen Why is it so hard? I am saying 2 rows and 2 cols (EXACTLY 2&2) must have at least one digit (obviously you can have more). Finally, the rest of the rows/cols can only have letters.
Aug 31, 2018 02:30
@Emigma Exactly 2 rows and 2 columns must contain **at least one** single-digit number.
Aug 31, 2018 02:30
Okay rule #4 should be pretty clear now: Just to be easier, you can assume that the case of the letters doesn't matter, as long as the cases are symmetrical which means: a==A, b==B, etc. that leaves us to: N < 36 26 letters (lower==upper case as soon as they are symmetrical) and 10 digts.
Aug 31, 2018 02:30
Okay, okay just to be clear consider a == A, b == B, etc So, 2 < N < 36 .
Aug 31, 2018 02:30
@JonathanAllan In that case I should just stop trying with challenges. I don't know how to explain it better. Maybe there's a flaw in the challenge's logic that I missed.
Aug 31, 2018 02:30
@Οurous Actually no, my rule says: Exactly 2 rows and 2 columns must contain at least one single-digit number. which means you can have more than one digits in a row/col. Doesn't that mean that N < 63 or am I missing something here?
Aug 31, 2018 02:30
@LuisfelipeDejesusMunoz Sorry, but I don't get this. How can you combine random and fixed?
Aug 31, 2018 02:30
@Οurous Yes, I missed this. Thanks.
Aug 31, 2018 02:30
I tried to explain some things. I hope it's not still unclear !!
Aug 31, 2018 02:30
put on hold as unclear what you're asking Is this challenge that bad?
Aug 31, 2018 02:30
@ngn This rule mainly exists to prevent someone from printing the same character for the entire matrix (which wouldn't be random anymore). Please read rule 6, Every possible output must have a non-zero probability of occurring. So, you have to randomly choose from all chars (including digits).
Aug 31, 2018 02:30
@Ourous 1 is a single-digit number, 2 is, etc. 1.3 isn't single-digit.
 
Aug 28, 2018 00:51
@JulianSilvestri Sorry, my mistake. I messed odd and even meanings..
Aug 28, 2018 00:51
"Multiply each odd number by 2 and each even number by 3" But you multiply 8 by 3? Am I missing something therE?
Aug 28, 2018 00:51
Sorry, but with your edit I just got more confused. You say: "Multiply each odd number by 2 and each even number by 3. Each letter in ...." but then on the desired output, all I see is dicts y and z together, no multiplications happened. Correct if I am wrong.
 
Aug 28, 2018 00:46
Let's just assume the array is already sorted and just pick array[j] as max.
Aug 28, 2018 00:46
Well, I would have failed as well :P
Aug 28, 2018 00:46
Maybe I am wrong but is it even possible to do better than O(n)? I mean in order to find the max you need to check every array element between i and j.
 
Aug 25, 2018 20:56
@Rakete1111
Aug 25, 2018 20:56
Wait, you lost me. I am checking for the type of the arguments. Not the type of the dereferenced iterator. An iterator is an iterator no matter what the std::vector contains. Unless I get this wrong smh.
Aug 25, 2018 20:54
@Rakette1111 No no, look again: !std::is_integral.
Aug 25, 2018 20:54
@Rakette Actually, I used this: typename std::enable_if<!std::is_integral<Iter>::value>::type* which seems to work.
Aug 25, 2018 20:54
@Rakette Can't do 16 because the constructor with 2 iterators conflicts with the constructor with 2 T args.
Aug 25, 2018 20:54
@Rakette Great, Thanks.
Aug 25, 2018 20:54
@Rakette Question: When I have a better "version" of this (adding stuff, implementing suggestions) should I make a new question posting the new code for further suggestions? As far as I understand I shouldn't re-post code on the same question.
Aug 25, 2018 20:54
So, now exceptions at all?
Aug 25, 2018 20:54
Yes, I will eventually include everything. I am still doing changes
Aug 25, 2018 20:54
9) Yes, eventually I will add more aliases, 10) True, I will fix this, 11) Nice, I didn't know this, 12) will do that too, 13) i didn't think of that :P, 14) I was thinking of that, should I use enable_if?, 15) I think I lost you here :P, 16) I will
Aug 25, 2018 20:54
Thanks a lot for all your suggestions. 1) No, there was something else I wanted to do and I didn't, unfortunately I can't re-post the code. 2) I could use using, 3) yes, I will use exceptions, 4) does this work for the implementation as well? 5) if you mean ==, !=, <, > etc, I will. I am just thinking 2 possible ways: a) == returns true or false if both vectors are the same or not and b) == returns a vector of bools (like matlab does) 6) yes, I should and I will, 7) I know, it's just my style, 8) I am still thinking if I should go with assert or exceptions or both (any suggestion)?
 
Dec 14, 2016 06:27
One last question. Which library is better? Adafruit or SparkFun?
Dec 14, 2016 06:27
Should I continue using the 2 10k resistors from SDA, SCL to 5V or 3.3V?
Dec 14, 2016 06:27
So both VCC and CS to 5V. and SDO to GND?
Dec 14, 2016 06:27
This is it: ebay.com/itm/…
Dec 14, 2016 06:27
The pins I see: GND, VCC, CS, INT1, INT2, SDO, SDA, SCL. I don't see any VS pin.
Dec 14, 2016 06:27
That's CS or SDO depending on which side you start counting.
Dec 14, 2016 06:27
Makes sense but I have seen people on youtube doing this only using an arduino and the adxl345.
Dec 14, 2016 06:27
What's the VS? I don't see any VS pin on adxl345.
Dec 14, 2016 06:27
Doesn't CS connected to 3.3V puts it into I2C mode?