I’m no math genius. I’d love to understand it all, and I appreciate the complexities, but I’m just the noob first-time player walking across a field in Call of Duty where I’m a target to all the more experienced players. In short: The study of compound interest eventually gives rise to the mathematical concept of e, also known as Euler’s number.
Continue reading
Author Archives: dgookin
The URL Decoding Filter – Solution
Unwinding percent-encoding involves three steps:
- Pass-through the unchanged characters.
- Change
+back into a space. - Decode the percent strings, which is the most involved process.
Compound Interest Calculations
You would think that simple interest (from last week’s Lesson) would be enough. After all, if you’re investing, you make money; if you’re paying back a loan, you can figure the math. That aspect of interest wasn’t enough for mathematical and banking geniuses, who devised a second type of interest calculation, which is “interest on the interest.”
Continue reading
The URL Decoding Filter
Last month’s Exercise was to write a filter that converts ASCII text into a percent-encoded format. This month, you’re task is to reverse the process: White a filter that converts a percent-encoded string back into the original ASCII.
Continue reading
Of Great Interest
I’m frustrated, as are many investors, at the lack of interest generated in “savings” accounts these days. It’s pitiful. The interest formula is based on solid mathematics, which is easy to code in C. Doing so may help you understand the concept of interest and how it works.
Continue reading
The fmod() Function
The Change Due Exercise, presented earlier this year, offered a solution that uses the fmod() function. That function is to real numbers as the modulus operator is to integers, though it’s not a straight-across comparison. That’s because floating point numbers can be imprecise.
Continue reading
Null Versus Empty Strings
The C language offers some delicious predicaments you may not find in other languages. Many of these odd situations involve variables, which are strongly typed in other languages. As a case in point, consider the difference between an empty string and a null string.
Continue reading
The URL Encoding Filter – Solution
A URL filter isn’t that difficult to code, once you know the rules. I’m sure you can concoct something clever or obfuscated in the C language, but I chose to use a clutch of if/else if/else statements to process input and generate output.
Continue reading
Other Ways to Fix fgets() Input
The C language string-input function was once gets(). That function has become Chernobyl in that it exists but you go there only when you don’t care about your health.
Continue reading
The URL Encoding Filter
URL encoding is a method of translating ASCII codes (not just text or URLs) into what’s often referred to as percent encoding. You’ve probably seen this format on your web browser’s address bar or in a search engine’s text. The encoding format is necessary to preserve the original content as plain text.
Continue reading