Thursday, April 29, 2021
مصر القديمة وأصل فكرة وكلمة المسيح
Thursday, October 15, 2020
Freeing memory safely in C
The standard way to free dynamically allocated memory in C is through the function:
However, after the function frees the dynamically allocated memory the pointer still points to the same -now invalid- location, making it a dangling pointer.
a common solution to this problem is to make sure that you assign NULL to every pointer after you free it. However, it would be nice if you could call only one function that does the 2 steps for you; freeing the memory and assigning NULL to the pointer.
You could do this by making a wrapper function around free, but this would require a pointer to a pointer:
However, I do not like pointers to pointers very much and tend to avoid using them whenever I can. I'd much rather use a macro:
Notice the absence of a semicolon at the final statement, that's because I will add that semicolon myself each time I invoke the macro to stay compliant with C's syntax.
Done.
Monday, March 14, 2016
Why I hate new anime
I won't deny that nostalgia does play a considerable factor in this, but I don't prefer older anime because of the nostalgic value (most of them are anime I have never watched in my life), I really think that old anime did many things better than anime nowadays.
Here's why I am not really fond of the current state of anime (even though I found some new stuff to be pretty good)
- Colors First, the colors.
Everything is too bright nowadays, it's like the anime industry decided it needed to pull a Michael Jackson.
One of the most prominent examples of this is the 2011 adaptation of Hunter x Hunter, when you compare it to its 1999 counter park it will become apparent what anime is like at the moment.
For me, the color choices make all the difference. the 2011 colors imparted a childish feel on the anime that didn't suit Hunter x Hunter very well imo - Characters I can't mention Hunter x Hunter here because it actually does have great characters (and not to mention, the manga is quite old), so do many modern anime tbh.
But you'd have to be blind not to notice how bland most of the characters nowadays are. you don't need to pay a lot of attention to realize that most anime characters have become generic and fall into certain stereotypes.
And what's with all the philosophy? Many of these characters are extremely pretentious and lack emotion that they feel more like robots than fucking humans.
It's like the mangakas have these character templates that they use freely and effortlessly to move their story along. While having readily made templates can be very useful in many fields (as a programmer I can assure you of this) it doesn't seem to work so well with something as complex as the human psyche. I don't understand how people are buying this crap. - Music Like characters, music has also become too boring and repetitive. I mean some sound tracks are great, but the openings and endings are usually not.
I don't have much to say here since music isn't as bad as the other aspects but it's definitely not as good as the music of classic anime. - "Otakus" This is probably the most annoying one, fucking otakus, the people who watch anime for the sake of watching anime.
It's my belief that people like these are the ones who ruined the anime industry and are responsible for a huge part of what makes anime what it is today.
It's no secret that most seasonal anime are targeted towards them.
