Members in Shoutbox
None.

Shoutbox Search
Search for:


Shoutbox Commands
/w [name] > Whisper
/r > Reply to last whisper
/me > Marks as action

Shoutbox Information
Moderators may delete any and all shouts at will.
Global Shoutbox
Please log in to shout.
Pages: < 1 « 3297 3298 3299 3300 33013572 >

[2014-10-21. : 3:32 am]
jjf28 -- why are you rotating bits? :P
[2014-10-21. : 3:32 am]
O)FaRTy1billion[MM] -- hey why doesn't C have an easy way to rotate bits? I never thought about that
[2014-10-21. : 3:31 am]
jjf28 -- i like poiuy's, if you can remember it :) pretty much just takes the same algorithm into 1 line (and the numbers he used are for 8-bit numbers)
[2014-10-21. : 3:27 am]
jjf28 -- just tells you if the bit you're about to lose is set
[2014-10-21. : 3:27 am]
Dem0n -- and what are you checking with it?
[2014-10-21. : 3:27 am]
Dem0n -- what does wrapBit do?
[2014-10-21. : 3:24 am]
jjf28 -- http://puu.sh/ckkFP/88ebb5e21e.png
[2014-10-21. : 3:23 am]
jjf28 -- so in the most basic terms: you shift 1 bit at a time, if the bit you're about to lose is set (which you can check with AND), you need to set it on the other end (which you can do after the shift with OR)
[2014-10-21. : 3:21 am]
jjf28 -- WHY GOD WHY
[2014-10-21. : 3:20 am]
jjf28 -- puush not working
[2014-10-21. : 3:20 am]
jjf28 -- ughh
[2014-10-21. : 3:17 am]
O)FaRTy1billion[MM] -- otherwise you get too many 1s
[2014-10-21. : 3:17 am]
O)FaRTy1billion[MM] -- I think both cases it needs to be unsigned
[2014-10-21. : 3:17 am]
O)FaRTy1billion[MM] -- That is, for right rotating. Left rotating would be ((a & 128) >> 7) | (a << 1) (as long as it's unsigned)
[2014-10-21. : 3:15 am]
poiuy_qwert -- so for correctness: ((a & 1) << 7) | (a >> 1)
[2014-10-21. : 3:15 am]
O)FaRTy1billion[MM] -- dunno, you got it mostly right ... just got a bit too excited with the amount of shifting. xD
[2014-10-21. : 3:14 am]
poiuy_qwert -- teach me to shout before thinking ;P
[2014-10-21. : 3:14 am]
poiuy_qwert -- i was thinking that too
[2014-10-21. : 3:13 am]
O)FaRTy1billion[MM] -- also would it be << 7? Otherwise you just move it on to the next byte
[2014-10-21. : 3:13 am]
poiuy_qwert -- lol yep
[2014-10-21. : 3:13 am]
O)FaRTy1billion[MM] -- like (a >> 1)?
[2014-10-21. : 3:12 am]
O)FaRTy1billion[MM] -- shouldn't one of those be a shift of 1?
[2014-10-21. : 3:12 am]
poiuy_qwert -- ((a & 1) << 8) | (a >> 8)
[2014-10-21. : 3:10 am]
jjf28 -- h/o, need to test this program think i got it down
[2014-10-21. : 3:09 am]
O)FaRTy1billion[MM] -- It helps because in order to rotate you need to move the bit that gets pushed off the end to the other side ... otherwise you are only shifting bits
[2014-10-21. : 3:08 am]
Dem0n -- Well i don't really see how using AND/OR helps to rotate the bits
[2014-10-21. : 3:01 am]
jjf28 -- Dem0n
Dem0n shouted: Is it 00010011? :O
yep, want help with the rest? it's a bit content-y so i'd skip it if you have a lot else to study
[2014-10-21. : 2:58 am]
O)FaRTy1billion[MM] -- http://www.staredit.net/skins/1/images/nav.png Was this always there?
[2014-10-21. : 2:56 am]
O)FaRTy1billion[MM] -- I messed that up. Hopefully you get the idea ... !x == 0 when x != 0. :P
[2014-10-21. : 2:56 am]
O)FaRTy1billion[MM] -- basically, if x == 0 then !x == 1, else ![i]/i] == 0.
[2014-10-21. : 2:55 am]
O)FaRTy1billion[MM] -- int c = !5345; // c == 0
[2014-10-21. : 2:55 am]
O)FaRTy1billion[MM] -- or, char d = !1; // d == 0
[2014-10-21. : 2:54 am]
O)FaRTy1billion[MM] -- signed short c = !0; // c == 1
[2014-10-21. : 2:54 am]
O)FaRTy1billion[MM] -- unsigned int b = !0; // b == 1
[2014-10-21. : 2:54 am]
O)FaRTy1billion[MM] -- char a = !0; // a == 1
[2014-10-21. : 2:54 am]
O)FaRTy1billion[MM] -- because it !0 will always return 1
[2014-10-21. : 2:53 am]
Dem0n -- FaRTy1billion
FaRTy1billion shouted: Dem0n ! is logical-not, meaning it returns only true (1) or false (0)
But what does that mean when assigning it to a variable? How does it know which to return?
[2014-10-21. : 2:49 am]
O)FaRTy1billion[MM] -- errr, shit ~0 would be -1
[2014-10-21. : 2:49 am]
O)FaRTy1billion[MM] -- so !0 would be 1, while ~1 would be -1 (Which unsigned char would be 255)
[2014-10-21. : 2:49 am]
O)FaRTy1billion[MM] -- Dem0n
Dem0n shouted: Do you know what assigning an unsigned char to !0 means?
! is logical-not, meaning it returns only true (1) or false (0)
[2014-10-21. : 2:49 am]
O)FaRTy1billion[MM] -- yay, the mysql errors are gone
[2014-10-21. : 2:49 am]
Moose -- Jack
Jack shouted: Dem0n structs are basically objects
strekt
[2014-10-21. : 2:48 am]
O)FaRTy1billion[MM] -- the shoutbox keeps not letting me shout D:
[2014-10-21. : 2:48 am]
Jack -- Dem0n
Dem0n shouted: objects don't exist in C :massimo:
structs are basically objects
[2014-10-21. : 2:47 am]
O)FaRTy1billion[MM] -- it means assigning it to 1
[2014-10-21. : 2:47 am]
Dem0n -- Do you know what assigning an unsigned char to !0 means?
[2014-10-21. : 2:39 am]
Dem0n -- true
[2014-10-21. : 2:38 am]
O)FaRTy1billion[MM] -- when in doubt, compile and see what happens ... :P
[2014-10-21. : 2:38 am]
O)FaRTy1billion[MM] -- I think that makes sense, but I've never seen or done anything like that before
[2014-10-21. : 2:37 am]
Dem0n -- So since p points to the third element in array a, would r then point to the second?
[2014-10-21. : 2:37 am]
Dem0n -- it's int * const r = p - 1, where p is a pointer to a + 2, where a is an array
[2014-10-21. : 2:36 am]
O)FaRTy1billion[MM] -- Wait, I'm thinking of const int*
[2014-10-21. : 2:35 am]
O)FaRTy1billion[MM] -- I don't know how or why you would use a constant pointer ... Is it an argument?
[2014-10-21. : 2:28 am]
O)FaRTy1billion[MM] -- a constant pointer, I assume
[2014-10-21. : 2:27 am]
Dem0n -- What is an int * const?
[2014-10-21. : 2:26 am]
O)FaRTy1billion[MM] -- You're right, that was a joke.
[2014-10-21. : 2:25 am]
Moose -- You don't need no paper
[2014-10-21. : 2:25 am]
Moose -- FaRTy, stop being a scrub
[2014-10-21. : 2:24 am]
O)FaRTy1billion[MM] -- However, (3&0), using several sheets of paper, I am still at a loss.
[2014-10-21. : 2:24 am]
O)FaRTy1billion[MM] -- "(3|17), off the top of my head, is 19. :P
[2014-10-21. : 2:20 am]
Moose -- C, I'm failing already! C the pun there? :D
[2014-10-21. : 2:20 am]
Moose -- See, I'm failing already!
[2014-10-21. : 2:19 am]
Dem0n -- objects don't exist in C :massimo:
[2014-10-21. : 2:18 am]
Moose -- Or a constructor, I'd be like "uhhh it's a CS term" and maybe I'd get partial credit
[2014-10-21. : 2:18 am]
Moose -- I'd be like idk?
[2014-10-21. : 2:18 am]
Moose -- They would probably ask some shit like what an object is and
[2014-10-21. : 2:17 am]
Moose -- I barely know programming, I would do horribly
[2014-10-21. : 2:17 am]
Dem0n -- take my C midterm for me tomorrow pls
[2014-10-21. : 2:15 am]
Moose -- Yes, it just has a 1 wherever either 3 or 17 does.
[2014-10-21. : 2:09 am]
Dem0n -- Is it 00010011? :O

Pages: < 1 « 3297 3298 3299 3300 33013572 >


Members Online: Roy, ZOVBOT