Tumgik
#debugging
Text
Different ways of debugging my source code ...
Tumblr media
Post #88: www.pythonforbiologists.com, My code isn't working, 2023.
183 notes · View notes
programmingmadness · 9 months
Text
Me trying and failing to find out why a bug is happening:
Tumblr media
168 notes · View notes
askagamedev · 7 months
Text
Debugging Complications
Tumblr media
Sometimes a bug is easy to catch. You do some normal set of inputs and the aberrant behavior appears. Sometimes a bug is difficult to reproduce. Here are some of the qualities that can make a bug difficult to nail down:
[Build-specific] - The bug only shows up in release or final builds.
Platform-specific - The bug only shows up on a particular platform (e.g. PS4, Linux dedicated server, Windows 10 service pack 2, etc.)
Random timing - The repro steps are always the same, but the bug doesn't always happen when the steps are taken
Frame-specific timing - Specific inputs must be made within a specific frame window to cause the bad behavior. Bonus difficulty if you have to reproduce the bug on a debug build with a low frame rate
Silent failure - The bug doesn't actually trigger any error messages or logs or anything, it just fails silently without a trace
Requires multiple players to repro - Happens only on a dedicated server with multiple squads all playing at once! Player A must do the action to Player B, and the bug appears on player C's screen!
Requires a long time to reproduce - The bad behavior happens only when leaving the game on for multiple hours, like via a [smoke test]
Live Environment Only - This bug only ever shows up in the live game
Tumblr media
Even more fun, there's nothing stopping more than one of these complications to happen within the same bug. A build-specific, platform-specific, live-only bug that silently fails and requires a bunch of players that only happens after many hours? Fun!
[Join us on Discord] and/or [Support us on Patreon]
Got a burning question you want answered?
Short questions: Ask a Game Dev on Twitter
Long questions: Ask a Game Dev on Tumblr
Frequent Questions: The FAQ
59 notes · View notes
omeletcat · 2 months
Text
I know when a tutorial or like person who has been programming for a long time says "you should take errors as tips and a helping hand instead of something negative" they try and help you out! and i bet that would make error hunting way less annoying but like.. no, i hate errors, if it was a person i'd punch it in the face.
i'm sorry errors, i'm sorry debug menu, but we can never be friends.
19 notes · View notes
peachgull · 5 days
Text
Tumblr media Tumblr media Tumblr media Tumblr media
Debug scraps I found at :
9 notes · View notes
izicodes · 1 year
Text
Tumblr media
I keep not reading my code properly. This time it was with JavaScript.
Button wasn’t working because I used “.querySelectorAll” instead of “.querySelector” when I was targeting just one button.
The console kept saying “btn.addEventListener() is not a function” like yes it is, I used it on my other button elements so WORK.
But no. Spent an hour trying to fix it. I wasted an hour on this and my work is due in less than 4 hours.
Thanks JavaScript. Thank you. YOU COULDN’T HAVE SAID “Oh btw Loa, you’re using .querySelectorAll(), I think you should change that bestie” BUT NO IT LEFT ME TO CRY FOR AN HOUR.
78 notes · View notes
visual-oddities · 11 months
Text
youtube
New Psychonauts video showcasing Raz interacting with the game pieces of the Asylum (which is normally glitched but I fixed the code).
31 notes · View notes
nerdymemes · 4 months
Text
Tumblr media
16 notes · View notes
frog707 · 5 months
Text
Seen on a coffee mug
Debugging = being the detective in a crime story where you are also the murderer
13 notes · View notes
milkweedman · 10 months
Note
Tumblr media
What is going on with this? The fiber loses the twist almost immediately, as I wind it on the spindle. My instincts say I'm pre-drafting too thick, but I'm not sure. I'm still a beginner and I'm trying to teach myself to love the variability of being a learner (lifelong perfectionism is a butt)
Your instincts are correct--that's a pretty thick singles to be spinning on what looks like a fairly small drop spindle. You could absolutely spin that thick on a bigger one.
There's sort of a rule of thumb here: small spindles spin fine yarn, big spindles spin thicker yarn (or are used to ply yarn). A small spindle like that might just not have the momentum to actually add twist to your fiber.
(There's exceptions to this rule and some complications re: supported spindles especially, but for drop spindles it's pretty much always true !)
But I'd guess that your main problem is that you're trying to spin fiber that's too thick for that spindle, so it's just not even taking the twist. If you spin the spindle and it only goes briefly: that's definitely what's happening. (if it spins for a good long while--at least 30 seconds--let me know) Pre-draft thinner and you should be good to go ! You can just rely on pre-drafting entirely here if you want (just to keep things simple while you learn) and try to pre-draft to the thickness that you want your single to be. That can help you learn consistency.
Another tip, just in case this is also happening here: make sure you're always winding the yarn onto the spindle in the same direction that you're spinning. Otherwise you're going to untwist the yarn somewhat as you wind on (less of a problem if you've got adequate twist, but if it's already really undertwisted then you will notice), plus it will be less stable and can even fly off or start to unwind as you spin.
Hope that helps !
And good luck with your spinning. Learning to embrace the imperfect nature of your handmade items can be hard, but it's really worth the effort. I'm currently having a great time spinning some extremely imperfect rolags for a museum display, and like--it doesn't get any more fun than that, imo :D
24 notes · View notes
ukagakadreamteam · 4 months
Note
Hey, so this one's about the underfell sans ukagaka by change side (I think, thats the dev on the wiki anyways), and for some reason I've noticed that what would normally be a clothes pile (I think) has changed into..Two underfell sanses? Is there any fix to this? Also, the one that was the clothes pile is permanently stuck as holding a phone and looking at it. So only the actual one moves. For other info that may help, I'm on windows, only running this ghost + there is no error message when this happens/happened.
Tumblr media
This is a tricky one! This ghost in particular has very unique code, and as I am not terribly familiar with it it is hard for me to spot errors in it. I took a look, but didn't find anything yet. We haven't seen anyone else with this issue before either, so there isn't a known fix.
Does this issue happen upon restarting the ghost/SSP? Or does something specific trigger it? That information would be a good place to start.
Additionally, it would be helpful if you can bring up SSP's script log, and show the log when the issue occurs, whether that be on boot or otherwise.
To open SSP's script log, you'll need to be in developer mode. You can toggle developer mode in the SSP preferences, on the General page.
Tumblr media
Once you've done this, you should be able to click on a ghost and then press Ctrl + L to open script log. This will display a log of all the scripts that your open ghosts have run recently.
A screenshot of the log would be useful, although if the script is longer than the window itself, it would be more helpful if you could copy out the script(s) in question! You can do this by highlighting an entry, then clicking the Copy button.
Tumblr media
I can't guarantee that we'll be able to find the issue or provide a fix, but we'll certainly try if we can have a bit more info to go off of!
7 notes · View notes
eyepool · 5 months
Text
Tumblr media
Rubber Duck Debugging is the method of working through a problem by verbalizing the problem at hand. There is something that happens once you verbalize your problem that makes your brain skirt around the log jam, and jump over to the solution. No really, it works! It turns out, it doesn't matter who you're talking to, the solution follows the action; you might as well be talking to a rubber duck. Try it out if you want: ask any person "what are you stuck on?". While they are describing the problem, 50% of the time you'll see them pause, and then regroup as they realize a solution to the issue they just described. You've been made into a rubber duck. Congrats!
The SparkFun Debugging Duck is a flexible, exceedingly buoyant, clearly fabricated, cognitive device for hardware debugging. Guaranteed to reduce debugging times and increase productivity and conversation. Before you ask your coworker, ask your Debugging Duck "Can I bother you for a minute?".
This is a product that is 50% tongue in cheek, and 50% legit. Ask any engineer and they'll tell you similar stories.
8 notes · View notes
sybilius · 1 year
Quote
Most coders think debugging software is about fixing a mistake, but that's bullshit. Debugging's actually all about finding the bug, about understanding why the bug was there to begin with, about knowing that its existence was no accident. It came to you to deliver a message, like an unconscious bubble floating to the surface, popping with a revelation you've secretly known all along. [...] A bug is never just a mistake. It represents something bigger. An error of thinking, that makes you who you are. [...] When a bug finally makes itself known, it can be exhilarating, like you just unlocked something. grand opportunity waiting to be taken advantage of. Because, after all, a bug's only purpose, it's only reason for existence is to be a mistake that needs fixing, to help you right a wrong. And what feels better than that? [...] The bug forces the software to adapt, evolve into something new because of it. Work around it or work through it. No matter what, it changes. It becomes something new.
Mr. Robot, Ep 1.2 - Excerpts from Elliot’s internal monologue on debugging
24 notes · View notes
Text
What type of error did you get?
Tumblr media
Source: https://pythonforbiologists.com
Post #254: PythonForBiologists, My Code Isn't Working, 2023.
9 notes · View notes
nixcraft · 1 year
Text
Do you agree?
Tumblr media
20 notes · View notes
golmac · 9 months
Text
Inform Basics: ACTIONS and RULES
Note: this is a longer post than usual, but some of it is debug content that isn't required reading.
I've been promising to talk about debugging for a long time. And, in truth, figuring out disambiguation problems with the TRACE command is debugging. But since you may not have known the term disambiguation a couple of weeks ago, that's probably not what you had in mind.
No, you were probably thinking about some hardcore, silly weirdness in your game, some very hard to pinpoint problem. Today's post is about that kind of thing. We've talked about action processing. The events of a player's turn happen in a set order. We deal with that in the actions we define. The order is, first to last:
Before
Instead
Check
Carry Out
After
Report
Of course, there are things that happen outside of these phases. For instance, if we create an EVERY TURN rule, those fire at the very end of the turn, after report rules have been processed. In the course of play, players don't have a lot of insight into the various machineries of an Inform 7 turn. A lot of it is there just to keep Inform 7 being a thing at runtime, and that doesn't interest us. There's a very complicated mapping of the turn's processes, but I think it would just discourage beginners from trying to write IF at all. So let's not. Most Inform 7 stuff just works, and that's why I like it.
Still, at times there will be a head scratcher. When that happens, we have two tools that can help us figure out what's going on. The first is ACTIONS. Let's say we have a nice, juicy 50,000-word game, and one of our testers gives us a transcript in which "jump" isn't working properly. Instead, the jump command is printing a description of the room. With ACTIONS on (just type "actions" at the command prompt in a test environment), Inform 7 will print the specific actions being attempted and let us know if they succeed or fail.
Under default conditions, with JUMP working as expected, that would look like this:
>actions Actions listing on. >jump [jumping] You jump on the spot. [jumping - succeeded]
The text in brackets is the debug content toggled by ACTIONS. If we've set actions that interfere with jumping.... well, let's look at this code as an example.
Before jumping in the lab: say "Look before you leap!". Instead of jumping: try looking.
OK, so the BEFORE is specific to the lab, but the INSTEAD applies to the entire game world. So we must have forgotten something somewhere. We can use the ACTIONS command to have a look:
>actions Actions listing on. >jump [jumping] Look before you leap!
[(1) looking] lab nice lab.
[(1) looking - succeeded]
[jumping - failed]
This gives us something to chase after! This is a pretty simple example, but ACTIONS is most useful for helping us find problems once we get to a certain level of complexity in our game world. In this example, we can see that jumping "failed" and that looking "succeeded." By "failed," we know the jumping action never completed. Most commonly, that will be caused by an "instead" rule--they stop actions from continuing, right? A control-f on "instead of jumping" is probably in order.
But what if something more devious is at work? What about a case where the ACTIONS command doesn't report anything unusual? The next step is the RULES command, which is a verbose listing of every rule that fires in the course of executing a command. Now, as I said at the start of today's post, a lot of those rules are really none of our business. Their strangeness can be intimidating when reviewing the output in RULES mode. My advice is just not to worry about it. Just like the TRACE command, only a handful is likely relevant to us, so don't pressure yourself to figure it all out.
Though by all means do, if you're curious. Just don't be bothered by it.
So brace yourself, I'm going to print the output. I'm only going to talk about the pink text, so don't worry too much about the rest. I just want you to know what you're looking for.
>rules Rules tracing now switched on. Type "rules off" to switch it off again, or "rules all" to include even rules which do not apply.
[Rule "parse command rule" applies.]
>jump [Rule "declare everything initially unmentioned rule" applies.] [Rule "generate action rule" applies.] [Rule "announce items from multiple object lists rule" applies.] [Rule "set pronouns from items from multiple object lists rule" applies.] [Rule "before stage rule" applies.] [Rule "basic visibility rule" applies.] [Rule "basic accessibility rule" applies.] [Rule "carrying requirements rule" applies.] [Rule "instead stage rule" applies.] [Rule "requested actions require persuasion rule" applies.] [Rule "carry out requested actions rule" applies.] [Rule "descend to specific action-processing rule" applies.] [Rule "work out details of specific action rule" applies.] [Rule "investigate player's awareness before action rule" applies.] [Rule "player aware of his own actions rule" applies.] [Rule "check stage rule" applies.] [Rule "carry out stage rule" applies.] [Rule "carry out jumping" applies.] nice lab.
[Rule "after stage rule" applies.] [Rule "investigate player's awareness after action rule" applies.] [Rule "report stage rule" applies.] [Rule "report jumping rule" applies.] You jump on the spot. [Rule "last specific action-processing rule" applies.]
[Rule "A first turn sequence rule" applies.] [Rule "scene change machinery rule" applies.] [Rule "every turn stage rule" applies.] [Rule "timed events rule" applies.] [Rule "advance time rule" applies.] [Rule "update chronological records rule" applies.] [Rule "A last turn sequence rule" applies.] [Rule "scene change machinery rule" applies.] [Rule "adjust light rule" applies.] [Rule "note object acquisitions rule" applies.] [Rule "notify score changes rule" applies.] [Rule "parse command rule" applies.]
So you'll see in there the text that's been troubling us. That's "nice lab," which is the room description of the lab. We can usually start by looking at the rule immediately above the output. In this case, that's the "carry out jumping" rule. Hm, ok, so let's do a ctrl-f on "carry out jumping." We'll find this:
carry out jumping: print the location's description.
What a strange bit of code! Who knows why we did it. This is why I recommend giving names to particularly experimental or impactful rules. They are printed by names during a RULES debug session. So this code:
carry out jumping (this is the dubious jumping rule): print the location's description.
Will look like this in debug:
[Rule "dubious jumping rule" applies.]
The main thing to take from all of this is this: these tools can help you understand what Inform 7 is doing with a command. Like most debug content, you don't need to understand all of it, you just need to know what you're looking for. Usually, that's going to be some or all of the output that the player is seeing. Hopefully, that information will lead to a productive search of your code. I personally found the output from RULES intimidating; I gave myself permission to only understand what I needed to understand.
OK, next time, some lighter fare. We'll look at other useful commands and features for developers and testers.
11 notes · View notes