Off Topic > Off Topic
Programming Megathread
<< < (86/241) > >>
ZSNO:
Here's hex string into an rgb structure

--- Code: ---void hexToTuple(const char *hex, Tuple &rgb)
{
long hexI = strtol(hex, NULL, 16);
rgb.r = (hexI >> 16) & 0xFF;
rgb.g = (hexI >> 8) & 0xFF;
rgb.b = hexI & 0xFF;
}
--- End code ---
BluetoothBoy:
I could have been far more... efficient using a familiar language (like C#, that's my jam), but for some reason I decide to try Python, which I've not used before. It's pretty neat seeing all the ways you guys tackled the problem though.

Also I was using Python 2 because I was using an iPad IDE (I have no laptop). A Python 3 would have cost me money. Not worth it for this.
devildogelite:

--- Quote from: Nickelob Ultra on February 02, 2016, 12:48:42 AM ---Anyone have any books they recommend for C and/or C#?  Preferably on Amazon kindle unlimited but open to suggestions, looking to read moar.

--- End quote ---

Why C# or C, those are two really different languages. I wish I could force myself to do more stuff in C though, you can do some really cool stuff with it.

I've never really been a huge fan of learning through books for programming but I've heard a lot of good things about anything by O'Reilly. They have books on pretty much everything too.



--- Quote from: BluetoothBoy on February 04, 2016, 02:12:55 AM ---I could have been far more... efficient using a familiar language (like C#, that's my jam), but for some reason I decide to try Python, which I've not used before. It's pretty neat seeing all the ways you guys tackles the problem though.

Also I was using Python 2 because I was using an iPad IDE (I have no laptop). A Python 3 would have cost me money. Not worth it for this.

--- End quote ---

I'm a pretty big fan of C#, I really need to start doing more stuff with it. I always start some small stupid project get some part of it done and then forget about it.
Foxscotch:
I hate obfuscated javascript code
mediafire rarely works for me*, and for SOME godforsaken reason people continue to use it in modern times, so I'm trying to figure out a way to deal with these two problems
my best bet right now is to find a way to get the link directly to the file, but this is made very difficult because the code is obfuscated and otherwise there's no obvious way to do it

*pressing the download button just frickin refreshes the page after sitting there for a few seconds. wtf is that about. I've tried logging in and turning off my adblocker, but nothing works. it just seems like it really doesn't want me to download certain files
Headcrab Zombie:
You mean actually obfuscated, or just minified?
A lot of people run their code through scripts that remove whitespace and replace identifier names with single letters.
The intent is to save bandwidth when you send the script to clients. Not sure how much it actually helps these days, but it's a commonly recommended step in speeding up web pages and a lot of people do it
Navigation
Message Index
Next page
Previous page

Go to full version