The final update to the sconvert function includes translating characters &, <, and > for proper HTML output. With this update to the code from last week’s Lesson, the conversion filter is complete and can be used to translate C program text output into HTML code that I can easily post on the web.
Continue reading
Properly Padding Spaces and Tab Widths
The task for last week’s Lesson was to convert tabs as well as spaces. The problem is that tab stops aren’t considered: On the terminal, a tab character generates a variable number of spaces based on where the next tab stop position is located. It isn’t a fixed value.
Continue reading
C Blog 10th Anniversary
It was ten years ago today that I made the first post on this blog.

Continue reading
Properly Padding Spaces – and Tabs
As you can tell by the post title, part of the sconvert program I missed is to convert tab characters into HTML spaces. Like spaces, tabs output blanks that must be converted to the code for proper output on a web page.
Continue reading
Counting the Non-ASCII Bytes – Solution
Several items are noteworthy for this month’s Exercise , with the biggie being how to detect a non-ASCII character. The secret involves a wee bit of type conversion.
Continue reading
Counting the Non-ASCII Bytes
Difficulty: ★ ★ ☆ ☆
The file utility in Linux quickly identifies known file types. It identifies text files, graphics images, or other common file types by using some sort of magic beyond checking the filename extension (which isn’t a guarantee). You can employ similar sorcery by writing your own Is It ASCII program.
Continue reading
Properly Padding Spaces
I’ve written two programs specifically for this blog. The first converts a C source code file into HTML. The second translates program output into HTML. Both of these programs are time-savers, helping me prepare and present the code and output without having to hand-code everything.
Continue reading
Hang On a Sec, Part II
The old days are gone, and with them the practice of using a for loop as a timing delay. Loops still do pause program execution, with the question being how long does it take a computer to wait for a loop?
Continue reading
Hang On a Sec, Part I
I learned to program on a microcomputer, a gizmo radically different in software and hardware design from today’s systems. An example of this difference is that if you wanted to write code that paused for a second, you wrote a for loop delay. Such a thing is obnoxiously impractical today — which sounds like a dare!
Continue reading
Building a New, Sum Matrix
Yet another fun way to mess with a matrix is to add its values to those in another matrix, creating a wonderful third matrix of the sums. Not everyone is going to agree that this notion is “fun.”
Continue reading