r/ProgrammerSuccesses • u/ohlaph • May 21 '18
r/ProgrammerSuccesses • u/Talen_Kurikson • May 21 '18
I'll go first! Debugging at a startup for 4 hours only to discover that it wasn't our fault!
TL;DR: Spent 4 hours debugging a project that had not changed. Turns out it was an issue with Script Execution Order and a pretty major framework being developed by BookFace had been working purely by luck until this point.
So a couple weeks ago I was working on this project. The night before our tale begins, I had updated the development branch of my fork of the project and released a new version into the staging server for people to test out. When I went to bed, everything seemed to be working fine.
When I woke up, it was a very different story. As a matter of fact, the entire project was crashing almost immediately. My first thought was to check the changes I made and see if any of those could have contributed, so I commented out some stuff, then added some extra debug statements...etc. After about 30-45 minutes of this, I just rolled back all the changes and started working from there.
Only, when I compiled and ran the old version to confirm it was working, the old version also crashed shortly after starting, at the same point the new version was crashing.
So, then I went through and checked to make sure everything had, in fact, been rolled back. Didn't take too long to confirm everything was rolled back correctly, but I wanted to be sure.
Next, I started adding breakpoints to a few key places in the code and analyzing any local values I could find that might be affecting it. I discovered that the crash was caused because one of the plugins we were using, developed by a company we shall call...Bookface, for anonymity's sake, was getting a null value for the instance of another class in the project. However, when I added debug statements, I could see that the class was in fact being instantiated, even though the read was coming back with a null value.
Down the rabbit hole I went, tracing every layer of their implementation and inserting breakpoints and debug statements into their codebase so I could track down the source of the error. I ended up eventually discovering the order in which all the code in their library ran, so I chained a couple breakpoints through there. As I watched, I finally discovered that for some reason the script was looking for an instance of the class before it had been instantiated. Looking deeper, I discovered that Bookface had not built anything into the system to deal with this case, nor to ensure that the scripts executed in the proper order (no callbacks, no coroutines, no error handling...etc. Nothing. It was just allowed to crash and produce no meaningful error message.)
A bit of digging and I learned that day that Unity has a Script Execution Order where you can specify certain scripts and the order in which they should be executed. I added both scripts to the Script Execution Order, put them in the correct order, then fired up the program again.
And it worked flawlessly.
Next, I added back the changes I had rolled back at the start, added the new fix in, and tested it again. Sure enough, the Script Execution Order fixed the problem with my commit as well.
I contacted Bookface and asked them about this, and got a response that essentially amounted to them saying "Huh. Weird. Guess we were lucky before. We'll have to bake that into the next version." I submitted a few comments on the help page about this issue and have had a few other people mention that my solution also worked for them, which always feels good as well.
r/ProgrammerSuccesses • u/awesome2dab • May 21 '18
Minigames
Last night I was trying to make a browser minigame with Phaser.io. First thing I try, there’s just a blank canvas on the browser. I spend the rest of the night debugging cross-origin requests until I rediscovered Phaser requires running a server on localhost.
Currently celebrating the fact that I can put up an image onscreen.
r/ProgrammerSuccesses • u/Liberaces_Isopod • May 22 '18
Python, Flask, and "you know how to program, right?"
Newly minted wannabe programmer here. Got tapped for a "go build a site to help this team" type of deal. Had only ever played in sharepoint/powershell before. Learned python, learned flask, learned linux, learned nginx, took months to write a site that would have taken someone knowledgeable a few weeks. Launched today and it fuckin' works!
r/ProgrammerSuccesses • u/ezrael2396 • Aug 14 '20
Got my first pull request approved at my new job!
After a month's work of onboarding with my mentor, getting access to all our systems, and tons upon tons of new information to digest, I finally made my first pull request and it was approved! Never mind the fact that the actual change was super small, we have to take our wins where we can get them haha
r/ProgrammerSuccesses • u/BE3N • May 21 '19
I submitted my first pull request today.
I was hired at the start of this year, for my first job out of university.
After 7 weeks of (very difficult) training, almost 2 months of not being assigned to a team, and another 3 weeks of training and preparing to join the team, I have submitted my very first pull request.
Not a very difficult ticket, but it was the first one I did alone. And I wasn't really mentally prepared to do it alone. The senior dev I was suppossed to be pair programming with was away for some (somewhat unexpected) training. So I could only ask the rest of the team, whom I have not met in person, who are on the other side of the country, for help. But I did asked them, and I think it went fine.
I dawdled for a long time before actually creating it, because I was so nervous. It was pretty scary.
I few people have already approved the PR, but there are no serious comments yet. One guy asked 'why are you doing this work?' I basically told him I don't know, I just do what is assigned to me.
I am waiting for approval from the tech lead, and then I can merge it!
r/ProgrammerSuccesses • u/derlozi • Aug 07 '18
I was finally able to create a neural network.
I tried to make a small neural network and train it on the Iris dataset using the TINN library. Everything seemed to work out, but it turned out that the program only worked in the IDE's debug mode, but not when it was compiled normally. I tried to debug it for a few days, got frustrated and gave up. Yesterday, some months after I started the project, I revisited it. I tried to debug it again, found some errors, corrected them, but nothing actually fixed the bug. Then, after ~20 hours of debugging, i finally found the error: when reading in the dataset from a file, there was a \n at the end of every line, and when comparing strings, they caused some data not to be initialized. The fix was typing in 6 letters, and it took me ~20hrs to find the bug. But it finally works!
r/ProgrammerSuccesses • u/TGotAReddit • May 21 '18
Hello World
Spent 4 days to get unity to use a 3rd party client to connect to an arduino and get the information (Hello World!) that is was outputting. Felt very silly being so excited over a Hello World program but it really was a lot of work
r/ProgrammerSuccesses • u/ezrael2396 • Nov 14 '19
Made a website for my gf!
My girlfriend and I's one year anniversary is coming up in a few days, so I made a quick little website to celebrate. It has some notes I wrote to her on it, as well as an image carousel with a bunch of pictures of us in it with captions I wrote for them. Hoping she likes it! :)
r/ProgrammerSuccesses • u/einkria • Jul 12 '18
Finally saw my ipv6 dhcp relay forward packet floating in wireshark!
I've been working on this ipv6 dhcp relay agent for a while, jumping through all the hoops of socket programming in C and receiving a packet on one interface and sending from another, and today I finally saw my packet all correct in Wireshark! So happy!
r/ProgrammerSuccesses • u/Byroks • Oct 09 '18
Finally got to use the camera of my notebook
After 5 Hours trying to use my Notebook camera in Swift and endless many tabs, I gave up and switched to objective-c where it worked in less then 20 mins. I can finally start on my Project.
r/ProgrammerSuccesses • u/pretentiousegghead • Aug 04 '20
Realized the solution to a problem as I was about to fall asleep
I see memes about this so it was nice to finally experience it myself. I've been tasked with a massive project at work that I had no idea how to do or where to start but I've logged about 30 hours into it (projected to take 15 but I'm fresh out of school). During mid review this past week I found out I'm pretty close to being done and was given the go ahead to add a few more touches to the project. I've been stuck on one aspect for a few days now and it's been demoralizing but I realized what I had been doing wrong! It was such a nice lightbulb moment!
r/ProgrammerSuccesses • u/[deleted] • Aug 30 '19
Getting familiar with making GUI interfaces!
I feel like I've "leveled up." I've been learning how to make programs with smooth, working interfaces with Qt and C++. I have a couple programs that used to be pure C++ console that I turned into GUI programs. It's such a good feeling and of course much easier to use these programs now.
The moment when I was able to build a Save As dialog and save data to a file with it really got me excited. It's such a critical part of software and it feels so good knowing a method for doing it.
r/ProgrammerSuccesses • u/exoskeletons • Aug 10 '18
The glorious feeling of succeeding first try
So there's this game I'm working on, and recently I've been thinking of this very specific change I can make to my entity class. Nothing to fancy, just reorganising my code a bit, a few refactoring and adding a some functions.
Now of course, a change to the base often breaks a lot of things higher up. So I was fully aware things could go bad really easily, and I could be stuck all day finding logic errors everywhere.
So I kept a level head, and went through all the potential issue areas, one by one.
And it worked. First try.
Nothing broke or turned upside down, and I'm happy.
r/ProgrammerSuccesses • u/[deleted] • May 23 '18
Got mouse click working - fixed some faulty calculations
My calculations for where mouse click should activate were off. I was trying to base the cutoff point on the width of the screen, rather than the width of the object I wanted the clicking to be limited inside of.
Also just got a bunch of stuff working in general. In three crazy long days, went from having a semi-functional game in the console, to having a good half of it implemented with the SDL library. The console project was months worth of work and learning on and off and I've been getting some mad grins of happiness at seeing it come to life more visually and smoothly with images and key/mouse input using SDL.
r/ProgrammerSuccesses • u/Btracker • May 22 '18
Always check your random picker
Made a monty hall game bot using machine learning, as a assignment, had it totally not converge better than random picking, after a morning debugging the machine learning part, as i thought surely that's what was wrong, i decide to check the door picker, turns out my random door selector was picking doors that were already open, fixed that, it worked flawlessly, huzzah!
r/ProgrammerSuccesses • u/[deleted] • Aug 10 '18
Learning C
I'm studying my Bachelors in EE
Our first "quick" task for my Embedded Programming course was program an Arduino to communicate via the USB serial port, with the catch: No Arduino specific functions, must use UART
This was reasonably simple as the course covered it thoroughly
The "quick" task was a typical Account creation.
Create account with a name, a number, a date, a pw, and a ballance.
Allow a maximum of 10 accounts.
I have some background in python and am used to object oriented code.
I figured I should put all these fields in a structure and create an array of structures
I quickly figured out I did not understand C syntax, or memory allocation or arrays or pointers.
It took me a good 15 hrs over 4 days to figure out.
I just got it to work.. (2 hrs before the project is due.. it's not complete)
I would like to thank:
fresh2refresh <for clean concise explanations
tutorialspoint < their online compiler made checking code scratchings so much quicker than uploading to an Arduino
stackOverflow < but particularly teknoPaul who has the least votes but the only answer that actually helped me after searching sooo many stackOverflow questions
r/ProgrammerSuccesses • u/Fuchur0n • Jun 09 '18
Got my TeamSpeak running on a VPS
I don‘t really know if this is supposed to be here because it‘s about Linux commands and not programming but here we go!
I bought myself a 2$ per year VPS earlier today with the goal to learn more about how to use Linux and my first project was to set up a Teamspeak server for me and my mates. I just finished it after over 3h of starring at command lines and looking up commands which is quite exiting for me!
r/ProgrammerSuccesses • u/willia02 • May 24 '18
I finally done debugging a function in C programming
I have just done fixing an error logic in my function. This function works like this, it will display only first 5 results in console windows from a linked list and user will use left and right arrow button to navigate around the "page". The problem, which I noticed 3 days ago, is it doesn't change the "page" or reset when reached the end of linked list (either head or tail). It looks like this and first I reshuffled the order of command like from changing the reset linked list traverse position. It didn't work at all, only give me different display. Then I suspected a char variable which take keyboard button, so I test it with another function that take int instead of char and yes, it works. And I check the ASCII value of arrow keys and I was putting the wrong value of ASCII number of arrow keys. So I changed it and just now it works smoothly, here is my latest commit.
You can check my repo for more.
r/ProgrammerSuccesses • u/[deleted] • Dec 01 '18
I FINALLY GOT PYWEBVIEW TO INSTALL
This might not sound like much but it's the first programming-related thing in a long while that has caused me actual happiness.
r/ProgrammerSuccesses • u/mcnnowak • May 21 '18
Don’t forget your return statements
I was debugging a new feature that displays some info to a user, after making an API request, which calls a stored procedure. This request is right in the middle of a promise chain in our Angular JS application.
I checked the stores procedure, everything was working fine. I ran the tests in our API and manually called the endpoint in our preproduction environment. I fired up the chrome dev tools debugger and everything looked totally fine, but the value was undefined.
30 minutes of googling later and I actually READ my own code, only to find that the previous promise callback didn’t have a return statement.
RIP half my morning quiet happy programming time debugging everything but the issue.