momijizukamori: Grey tabby cat with paws on keyboard and mouse. The text reads 'code cat is on the job', lolcats-style (CODE CAT)
Cocoa ([personal profile] momijizukamori) wrote2014-11-03 03:47 pm

A Programming-related Request...

Because I know I have some people on my subscriber list who do non-Perl programming! Does anyone have any good resources for practicing bitwise operators, octal and hexadecimal math, and/or conversions between different types of int (short vs long, signed vs unsigned). I screwed that section of my last C programming exam up massively because Perl doesn't even make you declare int vs double, and Java doesn't get into different int types.
batrachian: Dom (from the webcomic Megatokyo) talking on a phone (Dom)

[personal profile] batrachian 2014-11-03 11:00 pm (UTC)(link)
Nothing usable coming to mind; what I know I know from crawling around in the guts of the C++ shambling horror at work. Just last month I spent a week tracking down a bug which ended up being a uint16_t incorrectly cast as a uint8_t. this is somewhat problematic when the value in question is approximately 300.
batrachian: Dom (from the webcomic Megatokyo) talking on a phone (Dom)

[personal profile] batrachian 2014-11-03 11:26 pm (UTC)(link)
I've never worked with Perl. does it just treat everything as double?

and yes, it was a small nightmare. I was converting from an older function that used uint8 everywhere, and thought i'd gotten them all. CLEARLY NOT, AHAHAHA.
geekosaur: Chuck the FreeBSD Daemon (geek)

[personal profile] geekosaur 2014-11-05 02:04 am (UTC)(link)
Similar but even more horrid: a customer ticket I recently dealt with turned out to involve a missing header file #include on a system where sizeof (void *) > sizeof (int). Better, it just happened to work most of the time unless you turned on address space layout randomization for improved security.

(I considered using my "programming" icon just for the irony....)