Managing Attention Leaks
27 Sep 2018 | rants
If I need memory for something I don’t know the size of in C, I have to dynamically allocate it.
malloc does this by allocating memory from the heap. Then I use a pointer to point to this block of memory. But there is no garbage collection in C. That means after I finish with it, I have to call
free to deallocate the memory so it can be used for something else.
What happens when I just keep asking for memory without freeing it? Memory leaks. Over time, the program will hog all the memory until the system runs out of memory. When this happens, the whole program will crash.
Tackling the C Programming Language
07 Sep 2018 | programming
I’m finally back from hiatus. It’s been a while since I wrote my last blog post. I’ll take some time in this post to share what I’ve learned during the time period. One of the thing I was always hesitant to approach while learning to program was C. This is because I had this image in my head that C is an extremely difficult language to learn. I remembered my friends told me that they hated writing C code because it is a low level language. They had to manually allocate memory, fiddling with pointers, and all the other good stuff C provided. Since I had time this summer, I decided to bite the bullet and finally sit down to learn C.
Putting My Blog on Hiatus
19 Apr 2018 | rants
Due to personal reason I’m going to put my blog on hiatus for now. Once I finish sorting things out, I’ll be back. Thank you for stopping by and reading my blog.
Getting the Edge in Blackjack with Python
12 Apr 2018 | programming
For the past several years in Maryland, there seemed to be a new casino opening up every other year. My first experience of going to the casino was for a friend’s birthday party back in college. We thought it would be an interesting experience to come in and check out the newest casino, Maryland Live!, that just opened up back then. When we got there, I was in awe at how much money people were blowing on games. People were laughing, yelling, and drinking while putting stacks and stacks of chips on the table. Then a friend pulled me over to a Blackjack table that had open seats and asked me to join him.
Going down the Programming Rabbit Hole
30 Mar 2018 | rants
If you want to start learning programming today, it’s very easy. There are so many resources available online that makes it seem like you can become a good programmer in no time at all. I did a quick google search for “how to learn python” and the first thing that pops up is a video titled How to Learn Python in Five Minutes. This video gives you a basic outline of the steps you need to take to become proficient at programming. But the title is extremely misleading. The path to become a programmer is not always linearly laid out as the speaker described.