Discussion in 'General Chatter' started by Morven, Feb 26, 2015.
is anyone else doing nanogenmo this year? like nanowrimo but instead of writing a novel u write a robot to procedurally generate it for you
https://adventofcode.com/ Anyone here want to do advent of code?
oh! that looks fun!
That sudden realization that 232 isn't actually all that big. And also that you need to change some types and/or be more clever, or at least write a better unit test.
FizzBuzz Enterprise Edition
Who thought that the naming scheme that gave us sage.plot.plot.plot.plot was a good idea?
That sounds like me at 4am, but way more dogmatic about the bad idea than I could ever muster the will for.
I am currently trying to track down a bug in a program I started writing almost seven years ago and I feel this so hard. "Next week" I do usually understand my own code, but a year or two later and it's just like debugging someone else's. (There's the additional wrinkle that it's actually become too big for me to hold all the logic in my head at once, meaning interfaces become very important.) On the plus side, I am actually pretty good at commenting; I do my best to at least comment everything another programmer would need to run the program as-is.
I’m pretty bad at anticipating my own future needs it turns out. I’m just never ever touching the original copy of anything in the python script file that does image processing with list comprehensions ever again. Not that I particularly think I’d want to. The performance was fine but the code is unreadable.
I think we all have scripts like that. I have one titled "calc.py" that I have no idea what does. I remember very clearly that it does what I fucking told it to and does it correctly, but I don't know what that actually was. I think it was related to caption timing, audio editing, or video editing, but that really isn't saying much.
Anyway currently I'm trying to figure out why my program is telling me a file path doesn't indicate a real file when I can physically see with my own two eyeballs that the file is RIGHT THERE.
hi everybody. lately i’ve been doing some grading for online python classes and i had to share my absolute favorite story.
the kids are learning recursion, and they’re supposed to write a method that uses recursion to generate all the permutations of a string - like, u know, by generating all the permutations of n-1 length strings and recombining it with the chopped-off character.
this one kid decides that INSTEAD,
if they are asked to find the permutations of a 3-digit string,
they will iterate from 100 to 999 and throw out every number that doesn’t contain each digit from 1 to 3 exactly once, ending up with 123, 132, 213, 231, 312, and 321.
and then they will use those numbers as keys to re-order the corresponding characters in the original string. same for other lengths (although presumably they’re just hoping no one will input a string of length >9.)
it took me ages to figure out what they were doing but when i did i just lost it. SO MUCH creativity went into this VERY BAD solution
You have got to admire that, preferably from a safe distance.
I have seen that kind of nonsense in actual production code, and it makes me sad.
What I'm wondering is how they managed the other lengths bit -- did they REALLY do 10^x with the length of the string?? Because if so that is the sort of advanced hacker nonsense I have to SERIOUSLY admire. More than just the sheer guts it took to submit that as a solution to a recursion exercise.
Also speaking of advanced hacker nonsense:
Featuring a complete incompetent attempting to compromise a honeypot machine.
So I was considering seeing if I could add an eat script to a Creatures garden box mod so norns could eat it, and then I went down a rabbithole of looking at the default cosfiles due to having gotten into a conversation about how I tried to make gardenbox-compatible, edible grazers and they didn't work and nobody could figure out why. They just obsessively ran left until they died and it maybe has something to do with a script to avoid the learning room door?
Why did they inflict this on themselves. Why does the grass have 10 kilobytes of code! It's grass! It does not need to be this detailed! Why is there a FISH with 26 kilobytes of code! It's a fish! There are entire compiled plant agents, sprites and all, smaller than that!
turns out it's overcomplicated, overdetailed, spaghetti that spams the debug console constantly with things like updates on the fish having turned around. why do they have food perferences, they're simple agents! why does the grass simulate how many leaves it has and the contribution to photosynthesis of each leaf and how much water evaporates every tick, this game isn't about grass! why is the debug spam so inconsistent, there are agents that debug output for everything and agents that debug output for like 2 random things and agents that don't debug output at all! why are the comments so inconsistent, sometimes nothing is labelled and sometimes they only label the variable name and in the case of the snails two of the comments are literally just question marks even the commentator is stumped
this is why i gave up on gardenboxifying the c3 ecology...
(meanwhile DS ecology is of a sane code size. 8 kb of code for an animal and its population monitor scripts and rescue agents. Comments range from "names variables and gives a general idea of what each subroutine does" to bramboo's very nice explanation of what is going on and why. Clearly they learned their lesson...)
the hummingbird code is 20kb and it has zero comments
also due to the way the engine works unshared variables have to be designated with numbers, not an actual name, so usually if you're using those you define them in a comment so you know what the hell va[number] and ov[number] even are. most of the c3 ecology stuff has properly comment-defined variables.
the hummingbirds don't even have that
they have a commentated-out subroutine but that is it
they didn't even say what the variables were
TWENTY! KILOBYTES! and they didn't even name their variables!
Yup! It iterated over a range from 10^(x-1) to (10^x)-1. Like I said, a LOT of effort (and honestly, a lot of skill for the kids at this level!) went into this wild solution.
Kintsugi is based on the premise that nothing anyone can do or say makes it okay to treat them like trash. By logging in, you affirm that you understand this to be the foundational premise of the community. More on our community philosophy here.
Separate names with a comma.