Live data from Hacker News

Show HN: HN Avatars in 357 bytes

news.ycombinator.com

51–60 of 536 posts

Re: Show HN: HN Avatars in 357 bytes

#53

An unkown person asks you to inject code in your browser. Sorry folks, but this should be a red flag for all of you. I guess you all know enough about obfuscation to know that what you think the code does is not always what the code does. "But it has upvotes!" For all you know, the script could upvote this post.

Even when obfuscated, the code looked safe to me. (But I did wonder, and thankfully, HN has set httpOnly on the cookies.)

Re: Show HN: HN Avatars in 357 bytes

#54

Earlier quoted context omitted.

Thanks, but its still a bit confusing for me. Im looking for a really dumbed down kind of approach: input, operator, visual explanation of what its doing, output. Im a really bad learner, and didnt study computer science or anything. Ive never had a reason to touch binary, so find these operators unintuitive.

the wiki is a visual representation. The representation is 0s and 1s. The use case for bitwise operations is to control the value of 1 bit. Consider if you have a 0000 1000 value. It's mapped to hardware output so the 4th LED is on. Now you want to turn the 5th on, and the 4th off. You would use a left shift so the output becomes 0001 0000. That's all there is to it. Bitwise operators operate on bits, not bytes. Beca…

[deleted]

Re: Show HN: HN Avatars in 357 bytes

#55

Earlier quoted context omitted.

Thanks, but its still a bit confusing for me. Im looking for a really dumbed down kind of approach: input, operator, visual explanation of what its doing, output. Im a really bad learner, and didnt study computer science or anything. Ive never had a reason to touch binary, so find these operators unintuitive.

the wiki is a visual representation. The representation is 0s and 1s. The use case for bitwise operations is to control the value of 1 bit. Consider if you have a 0000 1000 value. It's mapped to hardware output so the 4th LED is on. Now you want to turn the 5th on, and the 4th off. You would use a left shift so the output becomes 0001 0000. That's all there is to it. Bitwise operators operate on bits, not bytes. Beca…

> Bitwise operators operate on bits, not bytes. Because computers operate on bytes, and you can't address a bit - you have to modify bytes to accomplish your goal.

I think this may be the fundamental intent I was missing. How do people wrangle these things in their head! Is it ever intuitive, or are even the proficient externally visualising this stuff in some way?

Re: Show HN: HN Avatars in 357 bytes

#57
Hah! I got a really cool little icon that looks almost like the cassette tape pirate logo of Piratbyrån back in the day. I have old t-shirts with that logo.

MAKE. THIS. PERMANENT!

On the functional side, this really helps you see who is who in a long threaded discussion. Your eye is much quicker at following the little color icons than their names.

Re: Show HN: HN Avatars in 357 bytes

#58

Ive been a dev for over 2 decades but I still cant grok bitwise operators - anyone have a reference that may help with that?

1 3 >> works in the same way 2 >> 1 = 1 because (0010 >> 1 = 0001) The other operators are exactly the same you'd find in electronics (and boolean algebra): ~ is the NOT operator & is the AND operator ^ is the XOR operator Sorry, I don't have a visual representation for this (I haven't looked for a link) but I would strongly suggest to write it down on paper and do some small exercises (checking with the result then…

Right shift can get tricky for negative numbers. There are two operators for it, one which respects the sign bit, the other does not:

- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Re: Show HN: HN Avatars in 357 bytes

#59

Hah! I got a really cool little icon that looks almost like the cassette tape pirate logo of Piratbyrån back in the day. I have old t-shirts with that logo. MAKE. THIS. PERMANENT! On the functional side, this really helps you see who is who in a long threaded discussion. Your eye is much quicker at following the little color icons than their names.

I'm gonna go ahead and vote no on this.
Post reply on HN