The old computer processing adage is “garbage in, garbage out.” What it means is that unless your data is good, don’t expect to see good results. So what can be done to ensure that the data is good? A checksum, that’s what.
Continue reading
Author Archives: dgookin
Merry Cumulative Song Exercise – Solution
I crafted my solution to the cumulative song exercise by separating the parts of the song that are repeated from the unique text. Specifically, the ordinal days are unique as well as the gifts. The rest of the text is sung over and over.
Continue reading
Encoding and Decoding, Part VII
The final part of the decoding program performs the actual decoding: A two-byte hexadecimal string is converted into a value. That value is then manipulated by the XOR 0xAA operation. The result is output. Yep, it took a long time to get to this point.
Continue reading
Merry Cumulative Song Exercise
In my C programming books, I often use the directions on a shampoo bottle as an example of basic programming:
1. Lather.
2. Rinse.
3. Repeat.
Another real-life example of programming techniques happens in music. Specifically, cumulative songs are representative of loops. This type of song includes 99 Bottles of Beer and the holiday favorite, The Twelve Days of Christmas.
Continue reading
Encoding and Decoding, Part VI
Data encoded by my hexencode system is formatted. That means that the decoding program must look for both the header and footer in that formatted output. In last week’s Lesson, code was added to confirm the input file’s first line as the header. This week’s modification is to search for the end of encoded text.
Continue reading
Encoding and Decoding, Part V
You don’t want your decoding program to waste time attempting to process input that isn’t in the proper format. That’s why the encoding program bothers to put a specific header as the first line of text. Therefore, one of the first tasks for the decoding program is to check for that specific header.
Continue reading
Encoding and Decoding, Part IV
It would be a grand thing to set out and craft the entire decoding program in one sitting. That’s ambition in action, but it doesn’t demonstrate much programming experience.
Continue reading
Hex Parsing – Solution
Two solutions are possible for this month’s Exercise, a string solution and a value solution. One is good for parsing the hex string right-to-left, the other for parsing the string left-to-right.
Continue reading
Encoding and Decoding, Part III
You can output values in the hexadecimal format, thanks to the %x and %X placeholders in the printf() function. Getting hex strings as input is also possible, but not entirely obvious.
Continue reading
Hex Parsing
Parsing is the process of sifting through a chunk of data to look for significant information. It’s a big topic.
Continue reading