Details
-
About*nullptr++
-
SkillsC/C++, Embedded, OpenGL, Android, Java, Rust, TDD
-
LocationGermany
-
Github
Joined devRant on 8/18/2018
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
-
This awesome moment when you‘re late into your thesis, find a possible improvement that would require new measurements, but then find out that this improvement can‘t be done with your constraints and there is nothing to do❤️1
-
We had to finish a student project, our project leader had done some work on the project before and his algorithm to detect an event was complete bullcrap.
I took it in my hands to rewrite the algorithm with the risk that it doesn‘t work and i hadn‘t done any work i could show, which would result in a bad grade.
Luckily my algorithm worked better in orders of magnitude and we managed to deliver on time -
C is nice and all but have you ever had to massacre your code with preprocessor instructions to make your code portable?3
-
I had to generate different kinds of graphs at compiletime and had to compile a graph and write down the code size for that specific width/height in addition to one of three implementations which all need to be evaluated. I computer scienced the shit out of it!
I wrote some Rust code that easily lets me build some graphs with the dimensions passed as input parameter. Then i wrote a method that converts the graph into the definition of the graph in a C header (sadly the only way) and wrote a bash script that executes that rust code with all possible dimensions and saves the header into my source folder. Then i build the application and write the programsize into a file.
In the next step i run a python script that reads all the generated files with the sizes and created a csv file which in turn can be used by excel/numbers to visualize the dependency between depth of graph and code size 😄
I had only some hours for it all, it is messy but works 😄 -
Give me a full 1-2 weeks of work for the project and then i relate it to how big the project seems in comparison to previous projects 😄
-
I need to tell you the story of my MOAB (Mother of all bugs).
I need to write some stuff in C (which i am fairly used to) and have a function that allocates memory for a Matrix on the heap. The matrix has a rows and columns property and an associated data array, so it looks like this
struct Matrix{
uint8_t rows;
uint8_t columns;
uint8_t data[];
}
I allocate rows*columns + 2 bytes of memory for it.
I also have a function to zero it out which does something like this
for(int i=0; i < rows*columns;i++){
data[i]=0;}
Let‘s come to the problem:
On my Mac the whole stuff works and passes all tests. We tried the code on a Linux machine and suddenly the code crashed in various places, sometimes a realloc got an invalid pointer, sometimes free got an invalid pointer and basically the code crashed at arbitrary points randomly.
I was confused af because did i really make THAT many errors?
I found out that all errors occured when testing my matrices so i looked more into it and observed it through the debugger.
Eventually i came to the function that zeroes out my matrix and it went unusually high and wondered if my matrix really was that big.
Then i saw it
The matrix wasn‘t initialised yet
It had arbitrary data that was previously in the heap.
It zeroed out a huge chunk of the heap space.
It literally wrote a zero to a shitload of addresses which invalidated many pointer.
You can imagine my facepalm2 -
Needed to help a friend with her Bachelor Thesis. She writes in Javascript and needs to synchronously use the result of a postgresql query. The query call is asynchronous.
We did what any person that searches for a dirty solution would do.
We saved the result of a query in a file and load the file when we need it.
Why is Javascript a thing?6 -
If you want other people to have fun at their job, tell them they did good work and give a compliment or two.
Everyone loves appreciation2 -
Whenever i get bored at work i try to motivate myself, because i notice that as soon as i am less interested, i loose focus and make mistakes.
Therefore i try to keep motivation up. One thing that helps is actually TDD, because you are able to have several small subgoals, which each leave you with a feeling of achievement, when a test you wrote passed, kinda like achievements in games.
When the task itself is so boring that even TDD doesn‘t help, i try to have fun while painfully working through it. Like have a coffee break every now and then or rant with a coworker about the task.
One time a coworker and me had to create a demo in Unity and we hated the task, because it was exactly this brainless and cumbersome clicking in the Unity3D UI which felt awful to us (we are embedded developers and we find comfort in the terminal 😄)
The only thing that got us through the task was ranting at Unity and periodically goofing around in the engine and adding weird behavior to objects. -
In a class i attended we learned about advanced image synthesis and had to write OpenGL in the exercises.
It was incredibly difficult and i put incredible amounts of time into it and solved the tasks and was incredibly happy when it started to work ☺️2 -
Currently there is a lot of work done in native application development, like android/iOS apps, desktop applications and such.
I feel like those will be replaced over time by websites and electron based apps.
I just don‘t see native apps in ten or twenty years from now1 -
„Couldn‘t figure out how to detect the end of a case, forced every developer to end a case with a break; so it doesn‘t go through all cases“
- the guy who invented switch case10 -
When working in embedded, you basically write your program, compile it and flash it on some hardware.
Compiling and flashing usually require some black magic commands with lots of parameters so i set up two shortcuts in my terminal
yolo to compile
swag to flash
Understandably i keep it to myself1 -
Currently i am working as a student at a teaching chair for embedded systems, so my boss is the professor there and the subject of this weeks story 😄
He is very passionate about his field and keeps close contact to the students and their representatives.
He invests a lot of resources into getting students to learn and make projects and pays us to supervise a hands on course for students to build IoT projects.
As employees we get to work on interesting projects and he listens to us and our concerns if we feel a project is having certain problems.1 -
31 hours
I was on a hackathon, we got time between Saturday 10AM until Sunday 5PM.
Most people went to sleep at some point, i literally used all the time i got and could submit a finished and playable game.
I felt drunk and incredibly dizzy at the end3 -
I absolutely love the work put into Visual Studio Code.
It is a great editor, which evolves quickly and has a nice community.
Was using vim for literally everything and switched at some point to VS code and love using it since2 -
Computer Scientists:
Programming close to the hardware requires different strengths. That‘s why we created a manifold of systems programming languages
Also computer scientists:
Lets do everything the browser does in javascript lol -
How i think i write code
void safeFree(void *ptr){
if(ptr != nullptr){
delete(ptr);
}
}
How i actually write code
void safeFree(void *ptr){
*nullptr = 7; //TODO
}1 -
We had to work in Unity once. Our goal was to create a tube, which is striped with two alternating colors and we should make it look like the colors are moving upwards to symbolise some flow inside the tube.
In Unity there is a way to do this with particle effects, sadly we weren‘t able to do this as it always looked 2D in the VR.
As the deadline rushed closer i had the most hacky idea i ever had.
I created a long one colored Cylinder and one very short and slightly bigger cylinder in the other color.
I then wrote a script, which spawns a big number of the little cylinders and slowly moved them towards the other end, where they get destroyed eventually.
It worked
It looked great
We never told anybody about this hack3 -
Java has a lot in common with ice skating.
Almost everyone can learn it
It looks great if you are pro
It is efficient in rare occasions
If you have to make a living off it it pity you1