Propogation of Errors by Bleak Knowledge About Coding
- 0 Posts
- 95 Comments
kryptonianCodeMonkey@lemmy.worldto
Not The Onion@lemmy.world•Thieves dressed as Santa and his elves bust into grocery store and steal $3,000 worth of foodEnglish
4·20 days agoTake it up with the Employers under paying, the Landlords over charging, and the Goverment Officials that prioritize anyone but the poor. They got my money. Ask them for yours.
kryptonianCodeMonkey@lemmy.worldto
Not The Onion@lemmy.world•Thieves dressed as Santa and his elves bust into grocery store and steal $3,000 worth of foodEnglish
2·20 days agoDamn, Santa has so many Elf mouths to feed. And don’t act like we don’t owe him one. Didn’t see a damn thing.
kryptonianCodeMonkey@lemmy.worldto
Programming@programming.dev•what's the coolest thing you have ever programmed?
4·26 days agoMines nothing amazing, really, but i find it handy.
I 🏴☠️ movies. The downloads often come with excess files, images, text, sample videos, etc. The only files I want beside the movie file are subtitle files if they came with the download. And the video files often have obnoxiously long file names with coding info in it, the uploader’s name, etc. And sometimes they get nested weirdly.
Most of the time, the file name and nesting is not really a big deal since I use plex and does good at ignoring nesting and it typically matches the title to imdb entries even if the file name is full of garbage. But sometimes it doesn’t match correctly and has to be manually fixed. And I just want my files to be clean, readable, and get rid of the bloat.
So I made a script that walks through my movie libraries, deletes all unneeded files, generates a directory structure dependent on whether or not there are subtitles, and renames the files (and directories) by removing all of the junk words and coding and leaving only the title and release year. Like I said, it’s nothing amazing, but it’s the only utility I ever wrote in it’s entirety for myself that I actually use on the regular.
kryptonianCodeMonkey@lemmy.worldto
Programmer Humor@programming.dev•What are some of the worst code you have seen in a production environment?
4·1 month agoSure. There were worse problems to. SQL injection vulnerabilities, dense functions with hundreds of lines of spaghetti code, absolutely zero test coverage on any project, etc. That’s just the easiest to show an example of and it’s also the one that made me flinch every time I saw it.
"".equals()😨
kryptonianCodeMonkey@lemmy.worldto
Programmer Humor@programming.dev•What are some of the worst code you have seen in a production environment?
61·1 month agoJoined a new team and one of my first tasks was a refactor on a shared code file (Java) that was littered with data validations like
if ("".equals(id) || id == null) { throw new IllegalArgumentException() }The dev who wrote it clearly was trying to make sure the string values were populated but they apparently A) didn’t think to just put the null check first so they didnt have to write their string comparison so terribly or else didnt understand short circuiting and B) didn’t know any other null-safe way to check for an empty string, like, say StringUtils.isEmpty()
kryptonianCodeMonkey@lemmy.worldto
movies@piefed.social•Project Hail Mary | Official Trailer 2
9·2 months agoI don’t agree about the movie being better, mostly because I think getting Mark’s inner monologue made much of the humor land so much better than the vocalized stuff in the movie. And they had to handwave a bunch of the more technical sciences and engineering that I found genuinely interesting in the book. But it was very cinematic and a pretty solid adaptation.
I expect PHM will have to do some more handwaving on the science, which will be unfortunate, but I also think Ryan can deliver on the humor a bit better than Matt did, so I am anticipating that to work quite well. I feel like Ryan’s personality will be a good foil for both the ultra series nature of the threat and the characters dealing with it and the more out there sci-fi elements in PHM (compared to The Martian).
kryptonianCodeMonkey@lemmy.worldto
movies@piefed.social•First images from Nintendo's live-action "Legend of Zelda" movie
31·2 months agoI wont judge a whole movie just from three still images. I’ll reserve my true judgement for later. But I will say that the costume design looks suitable. And the actors, physically, arent far off from what I would expect for their characters, so I’m at least pleased with that. The tone invoked by the imagery feels a bit off, but, again, without context, that’s basically no information at all.
Ah yeah, those eggs would be moist. They didn’t have cinnamon and vanilla in them, did they? 😝
Also, I’ve never air fried sausage links before. I can see how that would probably get the whole sausage cooked through before much browning on the casing happens that way. When pan-searing, the casing gets much darker from direct contact with the pan, and it taken longer for that heat to conduct in the meat in the middle. I usually sear them and get them nice and brown, tossing them around to get even browning all over, and pull them at the first sign that casing is about to split.
Personally I’d brown the sausage a bit more and get a softer scramble on the eggs, bit it looks good. Well done
Had to do a double take and zoom in to see that they were just painted. I was confused and concerned for a second there.
kryptonianCodeMonkey@lemmy.worldto
Programmer Humor@programming.dev•with a break statement right?
13·2 months agoCPU temp will be my break statement.
kryptonianCodeMonkey@lemmy.worldto
Not The Onion@lemmy.world•China is running out of garbage. Now they want to burn their neighbors'.English
14·2 months agoThat is a very important apostrophe.
kryptonianCodeMonkey@lemmy.worldto
Not The Onion@lemmy.world•Florida man opens fire during argument over how many eggs a chicken can lay: policeEnglish
8·2 months agoWas he right tho?
kryptonianCodeMonkey@lemmy.worldto
Not The Onion@lemmy.world•Elon Musk Announces Plan to Control Climate by Surrounding Earth in Adjustable SatellitesEnglish
18·2 months agoEven if it weren’t fuck nuts suggesting it, this is surely a bad idea. We need direct sunlight to hit the earth. The problem is the dissipation of the heat generated by that light due to greenhouse gas saturation. Blocking the sunlight in the first place WILL cool the Earth, but with the cost of decreased capacity for plant and algae life to carry out photosynthesis and, thus, remove carbon dioxide from the air and produce oxygen at a minimum. Seems like that would contribute to the greenhouse gas problem, rather than address it, with the additional consequence of reduced yield for crops. I’m sure there would be other consequences too. They have the potential of being MASSIVE!
kryptonianCodeMonkey@lemmy.worldto
iiiiiiitttttttttttt@programming.dev•The problem is older than I thought...
36·2 months agoi.e. “I’m not smart enough, nor dumb enough, to understand how you arrived at such a stupid question.”
kryptonianCodeMonkey@lemmy.worldto
Programmer Humor@programming.dev•goto spaghetti1 goto spaghetti8 goto spaghetti6 goto end1 goto start5
14·3 months agoBut anyway, I kind of like goto too much. I find it more intuitive to just jump around and re-use parts rather than think about how to do loops without too much nesting.
Might I introduce you to functions?
Need to write a prompt to the console and get an input? That could be a function. Need to check if a character matches some option(s)? That’s could be a function. Need to run a specific conditional subroutine? That could be a function. And function names, done correctly, are their own documentation too.
You main function loop could look almost like pseudo code if you do it right.
#include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <string.h> char* prompt_for_input(const char* prompt_message) { char temp[100]; printf(prompt_message); fgets(temp, 100, stdin); temp[strlen(temp)-1] = '\0'; char* input = malloc(strlen(temp)); strcpy(input,temp); return input; } int string_to_int(char* input) { return (int)strtol(input, NULL, 10); } int prompt_for_loop_count() { char *input = prompt_for_input("\nI'll loop over this many times: "); int loop_count = string_to_int(input); free(input); return loop_count; } bool prompt_to_do_again(){ char *input = prompt_for_input("Let's do that again!\nShallow we? (y/n): "); bool do_again = (strcmp(input, "y") == 0 || strcmp(input, "Y") == 0); free(input); return do_again; } void print_and_decrement_counter(int loops_remaining) { do { printf("Current = %d\n", loops_remaining); loops_remaining--; } while (loops_remaining > 0); } int main() { bool need_to_get_loop_count = true; printf("Hello."); while(need_to_get_loop_count) { int loops_remaining = prompt_for_loop_count(); print_and_decrement_counter(loops_remaining); need_to_get_loop_count = prompt_to_do_again(); } printf("\nBye\n\n"); }

It’s a silly riddle that, for some reason, has stuck around in my head for decades, I think from an old tv show (anyone else remember Crashbox?). I remembered the answer immediately. So, this would be less of a test of my reasoning/problem solving skills, and more of a test of my ability to find and store vast amounts of useless trivia and instantly recall it decades after the fact. If that’s what you’re hiring for, I’m your guy!