Beyond knowing how many words are in the computer’s dictionary, another good measure to know is how many characters are in the longest word. Together, these two values give you a profile for the complete word matrix.
Continue reading
Author Archives: dgookin
Reading the Dictionary
I admit it: I’m a nerd and I read the dictionary. I know it’s a reference, not a work of fiction. The plot is weak. But I found it enjoyable as a kid to discover new words and their meanings. Alas, the Unix dictionary file lists only words and not definitions. But how many words are in there?
Continue reading
Coin Flipping Madness – Solution
I hope you didn’t “flip out” over this month’s Exercise. Flipping a coin can be done by hand or by using a computer. Using a computer is easier because it can be programmed to record each flip and it saves you hand muscle molecules for flipping and the chore of writing down the results.
Continue reading
Finding the Dictionary
My first Unix System Administrator job was pretty routine: I did backups. It was only later that I discovered some of the many nerdy treasures available in that operating system.
Continue reading
Coin Flipping Madness!
Difficulty: ★ ★ ☆ ☆
Probability. Odds. These are words I often confuse, but the similarity relates to how often things happen. The gold standard is the flip of a coin: two possibilities, heads or tails. If you don’t understand how it works, you can write code to drive home the point.
Continue reading
Using make to Build Projects
The make utility has been around since the early days of Unix. This tool is designed to create large projects by compiling and linking files based on dependencies. It takes care of a lot problems managing multi-module files to streamline the build process.
Continue reading
Memory-File Multi-Module Implementation
At 205 lines of code in last week’s Lesson, my memory-file project is getting larger by the day. At some point, the source code files must be broken out into separate modules, then compiled and linked separately. This is how I handle all large projects when it becomes too unwieldly to edit everything in a single file.
Continue reading
Enabling Random Memory-File Access
The two types of file access are sequential and random. Sequential access means the file’s data is read from beginning to end, one byte after the other. Random access isn’t random in the sense that it’s haphazard. No, random access means you can read data from any position in the file: beginning, middle, or end.
Continue reading
Reading and Writing to Memory-Files
Opening and closing a memory-file is just academic. To make the whole shebang work, you must be able to read and write data.
Continue reading
Finding Characters – Solution
The challenge for this month’s Exercise is to write the charcount() function, which returns the number of characters in a string. The character matches exactly, so don’t worry about checking uppercase and lowercase differences.
Continue reading