Posts
Debugging GNL
Yesterday I refactored and corrected (almost) all the debugs on my get_next_line. I also created a script that setups and runs all the tests automatically:
https://github.com/librity/ft_get_next_line/blob/main/github_testers.sh Today I’m gonna fix what’s left to fix on get_next_line consider whether or not it’s worth it to do the bonus part.
Some of the testers don’t give you a lot of feedback when they fail. My biggest challenges was plowing through the tester’s messy code to try and understand what was failing.
Posts
Get Next Line working!
Yesterday I managed to get my get_next_line working!
Today I’m going to refactor it, correct all norminette errors and debug it with the github testers.
My biggest obstacle was breaking it into smaller functions as it has to pass a lot of pointers to its sub-functions. Looking back now, I should have used a struct, and I will when I refactor it again.
Posts
Stack VS Heap
Yesterday I learned with @viniseneda about the difference between arrays and pointers, between the memory stack and heap, and about static and extern variables.
https://stackoverflow.com/questions/29717970/do-i-need-to-free-char-array-of-fixed-length https://vivadifferences.com/difference-between-stack-and-heap-in-c / https://stackoverflow.com/questions/1286515/extern-and-static-pointers-in-c Today I’m gonna code like mad!
Posts
| Bitwise &
Yesterday I learned with @viniseneda about bitwise operations and how they can optimize the code: that’s when we make comparisons with | and & instead of || and &&. Modern compilers do several optimizations on their own, and these optimizations vary from compiler to compiler. Using bitwise operators doesn’t necessarily mean you’ll have an edge in performance. If performance is a priority we need to analyze the assembly output of the compiler to know exactly how it handles optimizations:
Posts
Tight
Yesterday I didn’t manage to work on any projects.
Today I won’t be able to code much of anything again. I’m so glad Driver’s ed is almost over, can’t wait to git rid of it.
Posts
Context
Yesterday I talked to @dutenrapha, who answered all my questions about get_next_line:
get_next_line is a function that reads an entire line from a file indexed by a file descriptor fd. It then alocates a string with the contents of that line without the linebreak '\n' and points line to it.
We don’t have to pass anything allocated to get_next_line, we just pass the address of a pointer that will point to the allocated string.
Posts
Get Next Line baseline
I started doing get_next_line yesterday. I have a pretty good idea of what to do. I’m looking for a way to advance the position of the file descriptor in read. I’m also trying to understand how I’m going to allocate enough memory for an entire line, since I can only read BUFFER_SIZE bytes at a time, and the line can be longer than the BUFFER_SIZE.
I won’t be able to code much today due to lingering reasons.
Posts
Unit tests w/ Unity
Yesterday I wrote unit tests for Libft with the Unity framework (only 14 functions, WIP):
https://github.com/librity/ft_libft/tree/main/tests Today I’m starting get_next_line.
I had no major obstacles.
Posts
Libft destroyed!
Yesterday I finished the libft!!!
If I have time today I’ll start researching get_next_line.
Posts
Last evaluation
Yesterday I didn’t manage to install the VM.
Today I will do libft’s last correction.
Posts
Out of time
Yesterday I passed the second libft correction.
If I have time today I’ll try and install the official VM in case I have to evaluate a level 3+ project.
My biggest obstacle these last few days has been time.
Posts
Driver's ed
Yesterday I didn’t do anything related to the 42’s cursus.
Today I’m going to do my second libft correction.
My biggest obstacle has been time: I’m spending 13 hours a day on work and driver’s ed and it’s taking a toll on me.