Tag: programming
hAPI hAPI joy joy
by Jacob on Jun.30, 2008, under Technical
Dear Google,
Let me tell you why you are a winner in my book. Three letters, A-P-I. I think opening up your services through developer APIs is what gives Google an edge over your competitors. It is what makes Google more than just a web site. It makes Google a web service. Your latest efforts to make Google data more mashable is a good example of your continued efforts to support nice APIs.
Thank you for your efforts and keep up the good work.
atoi(getenv(”MYVAR”))
by Jacob on May.28, 2008, under Technical
These are mostly personal notes. I’m not sure if they will make sense to others.
I had a problem with a line of code like this:
int x = atoi(getenv("MYVAR"));
If this line was in daemon-ized code started at init level 2, it would segfault. (I’m not sure if these conditions are necessary, but those were my conditions).
getenv("UNKNOWN_VAR") == NULL
atoi(NULL) should == 0
But for some reason, things were segfaulting. I corrected the problem with:
if (getenv("MYVAR") == NULL) int x = 0;
else int x = atoi(getenv("MYVAR"));
What bothers you most about this code?
by Jacob on Apr.01, 2008, under Technical
I came across this line of code today, and while I don’t normally hate other people’s coding style, this one has something in it that really bothers me:
i = ((unsigned int)(crcAccum >> 24) ^ *dataBlkPtr++ ) & 0xff;
Cross post code
by Jacob on Mar.01, 2006, under Technical
I’ve implemented a method which will automatically take posts I make on blogger.com and publish them on this blog as well. I thought I would share the code I used to do this. If you were to use use this script, you would need to replace text in all caps with actual values.
My code makes use of the Blogger Class from Dented Reality. Use at your own risk and don’t blame me if it doesn’t work or screws up your blogs.
(continue reading…)
Dining Philosphers Problem
by Jacob on Oct.03, 2005, under Technical
http://en.wikipedia.org/wiki/Dining_philosophers_problem
This should help with my CS 345 program.