Wednesday, March 7, 2018

March Madness brackets in PHP

It's March, and that means I've written yet another article about a program that helps you fill in your NCAA "March Madness" game brackets. This article is a bit different. Where my previous articles described how to write a Bash script to "predict" March Madness brackets, this year's article walks through a PHP script that generates a full bracket.

For those of you who aren't in the U.S., we have a game here called Basketball. And every year in March, the university level (called the National Collegiate Athletic Association, or NCAA) holds a single-elimination championship of the different university teams. If you follow basketball, you can fill out a bracket to "predict" the championship outcomes at each round.

Some people really get into creating their brackets, and they closely follow the teams over the season to see how they are doing. I used to work in an office that cared a lot about March Madness (although in honesty, the office I'm in now doesn't really follow the games that much—but forgive me that I didn't update my Linux Journal article to say so.) I didn't want to miss out on the fun in following March Madness.

I don't follow basketball, but one year I decided to write a little random-number generator to predict the games for me. I used this program to fill out my brackets. And a few years ago, I started writing about it.

Read the article, and use the PHP program to fill out your own March Madness bracket! Let me know how your bracket fared in this year's games.
image: Wikimedia (public domain)

Wednesday, February 21, 2018

Using groff to write papers

In 1993, I discovered Linux, when I was an undergraduate university student. Linux gave me the same power as the Big Unix systems in our campus computer labs, but on my personal computer. I was immediately hooked.

But in the early 1990s, Linux didn't have a lot of applications. When I needed a word processor to write a paper for class, I rebooted into MS-DOS and ran WordPerfect or the shareware word processor, Galaxy Write. I wanted to stay in Linux as much as possible, but I also needed to write papers for class.

I knew a bit about the nroff and troff text processing systems from our campus computer labs, and I was pleased to find that nroff and troff existed on Linux as GNU groff. So I taught myself how to use the groff macro sets to write my class papers. The first macros I learned were the "e" macros, also known as "groff -me" because that was how you invoked the macros from the command line.

I recently wrote an article for OpenSource about How to format academic papers on Linux with "groff -me." I cover the basics for writing most papers, and skip the really esoteric stuff like keeps and displays, nested lists, tables, and figures. This is just an introduction for how to use "groff -me" to write common documents, like papers for class.

Wednesday, February 14, 2018

What open source software programs I love

Earlier this week, someone asked me what Free software and open source software programs I really love. I thought I'd share that here, too.

As I started to go through my favorite programs, I realized it was quite long. So I'm trying to keep the list short here, just the programs I use the most:

I'll start with Linux. I first installed Linux in 1993, when I was still an undergraduate university student. When I heard about Linux, a free version of Unix that I could run on my 386 computer at home, I immediately wanted to try it out. My first Linux distribution was Softlanding Linux System (SLS) 1.03, with Linux kernel 0.99 alpha patch level 11. That required a whopping 2MB of RAM, or 4MB if you wanted to compile programs, and 8MB to run X windows.

I ran a dual-boot Linux and Windows system at home until about 1998, using Windows only to play games. Then I switched to Linux full-time, and haven't looked back. Today, I run Fedora Linux, with GNOME as the desktop.

My other favorite operating system is FreeDOS, but that's not a surprise because I am the founder and project coordinator for the FreeDOS Project. FreeDOS is a complete, free, DOS-compatible operating system that you can use to play classic DOS games, run legacy business software, or develop embedded systems. Any program that works on MS-DOS should also run on FreeDOS.

I usually boot FreeDOS inside a PC emulator called QEMU. I used to run DOSEmu, which was ideal for writing FreeDOS programs because DOSEmu boots its C: drive from a folder in my Linux home directory. That made it really easy to transfer files between FreeDOS and Linux. In QEMU, I set up a folder that is mapped in QEMU as a D: drive.

I write a lot of articles, and now some books, and I use LibreOffice for all of my finish work. In total honesty, I do my collaboration and initial drafts via Google Docs, but all my final drafts and formatting is done in LibreOffice.

Many of my articles are about writing programs, and I use GNU Emacs as my editor. I'll use vim to write shell scripts, and GNOME gedit to edit web pages, but I prefer GNU Emacs for all my programming work. Emacs was my first Unix editor, even before I learned vi, so I'll always have a fondness for it.

While I could compile and debug programs from inside GNU Emacs, I prefer to do that work at the command line using GNOME Terminal.

For any graphics work, I rely on GIMP. This works great for creating graphics for my websites, or enhancing a personal photo, or creating a new cover for my next book.

And finally, I like to listen to music while I'm working, so I usually have Rhythmbox running in the background. I like to listen to one of several streaming radio stations, or I'll listen to my own MP3 music collection.

Thursday, January 18, 2018

Programming with ncurses

Over at Linux Journal, I am writing an article series about programming on Linux. While graphical user interfaces are very cool, not every program needs to run with a point-and-click interface. So in my "Getting started with ncurses" article series, I discuss how to write programs using the ncurses library functions.

Maybe you aren't familiar with curses or ncurses, but I guarantee you've run programs that use this library. Many programs that run in "terminal" mode, including vi editor, use the curses set of functions to draw to the screen. The curses functions allow you to put text anywhere on the screen, or read from the keyboard.

My article series starts with a simple example that demonstrates how to put characters and text on the screen. My example program is a chaos game iteration of Sierpinski's Triangle, which is a very simple program (only 73 lines).

Follow-up articles in the series will include a "Quest" program to demonstrate how to query the screen and use the arrow keys, and how to add colors.

Linux Journal has posted the second part of my article series: Creating an adventure game in the terminal using ncurses. And part three: Programming in color with ncurses. Soon to come: why the Linux console only has sixteen colors, and how to use windows and frames in ncurses.

Monday, January 1, 2018

Write about open source software

I just wanted to point out that over on the FreeDOS Blog, we're asking people to write about FreeDOS.

It's a new year, and we wanted to encourage people to contribute to FreeDOS in new ways. If you're already working on FreeDOS through code, design, testing, or some other technical way - thank you!

If you aren't sure how to contribute to FreeDOS, or want to contribute in a new way, we'd like to encourage you to try something new: Write about FreeDOS!

Write about something that interests you! Others will want to see how you're using FreeDOS, to run existing programs or to write your own programs. We want to hear from everyone! It's not just about developers, or people who contribute to the FreeDOS Project directly. Tell us how you use FreeDOS.

Post on your own blog, or email your articles to me and I'll put them up as a guest post on the FreeDOS Blog. If we can gather enough articles by Spring, we'll try to collect them in a "how-to" ebook in time for the 24th "birthday" of FreeDOS on June 29.

Friday, December 29, 2017

So long, Linux Journal

If you don't know, Linux Journal has ceased publication. Unless an investor drops in at the last minute, the LJ website will soon shut down. Thus ends over twenty-three years in Linux and open source publication. That's quite a legacy!

Linux Journal first hit shelves in April 1994. To remind you about those times: that's when Linux reached the 1.0 version milestone. That's also the same year that I started the FreeDOS Project. Elsewhere in technology, Yahoo!, Amazon, and Netscape got their start in 1994. That's also the same year the shows E.R. and Friends first hit TV. Also that year, the movies Pulp Fiction, Forrest Gump, Speed, and Stargate.

In 1994, you most likely connected to the Internet using a dial-up modem. KDE and GNOME were several years away, so the most popular Linux graphical interface in 1994 was FVWM, or the more lightweight TWM. In 1994, you probably ran an 80486 Intel CPU, unless you had upgraded to the recently-released Pentium CPU. In mainstream computing, Microsoft's Windows 3.1 ruled; Windows95 wouldn't come out for another year. In the Apple world, Macs ran MacOS 7.1 and PowerPC CPUs. Apple was strictly a hardware company; no one had heard of iTunes or an iPod.

With that context, we should recognize Linux Journal as having made an indelible mark in computing history. LJ chronicled the new features of Linux, and Linux applications. I would argue that Linux Journal helped raise the visibility of Linux and fostered a kind of Linux ecosystem.

Linux Journal operated in the same way that Linux developers did: LJ encouraged its community to write articles, essays, and reviews for the magazine and website. You didn't do it for the money; I think I received tiny payments for the articles I submitted. Rather, you wrote for LJ for the love of the community. That's certainly why I contributed to Linux Journal. I wanted to share what I had learned about Linux, and hoped others would enjoy my contributions.

So before the Linux Journal website goes dark, I wanted to share a few articles I wrote for them. Here you are:


Looks like Linux Journal was saved at the last minute by investors! From the article:
In fact, we're more alive than ever, thanks to a rescue by readers—specifically, by the hackers who run Private Internet Access (PIA) VPN, a London Trust Media company. … In addition, they aren't merely rescuing this ship we were ready to scuttle; they're making it seaworthy again and are committed to making it bigger and better than we were ever in a position to think about during our entirely self-funded past.

Saturday, December 23, 2017

Top ten in 2017 (part 2 of 2)

Following up from part 1, here's the rest of my favorite blog articles from this year:

6. Debian and GNOME usability testing
Intrigeri emailed me to share that "During the Contribute your skills to Debian event that took place in Paris last week-end, we conducted a usability testing session" of GNOME 3.22 and Debian 9. They have posted their usability test results at Intrigeri's blog: "GNOME and Debian usability testing, May 2017." The results are very interesting and I encourage you to read them! Here's an overview.
7. FreeDOS is 23 years old
In the 1980s and early 1990s, I was a huge DOS nerd. I loved DOS, and used it for everything. I wrote all my class papers in WordPerfect or shareware Galaxy Write on MS-DOS, and did all of my physics lab analysis using the As-Easy-As shareware spreadsheet. I just though DOS was a great little operating system. So I wasn't pleased when Microsoft said they were going to "kill" MS-DOS with the next release of Windows (Windows95). In June 1994, I announced an open source software project to create our own compatible implementation of DOS, which became the FreeDOS Project. In June 2017, FreeDOS turned 23 years old. See also our free FreeDOS ebook.
8. A look back at Linux 1.0
The Linux kernel turned 26 years old this year. To celebrate, I installed one of the first true Linux distributions: SoftLanding Systems Linux 1.03, featuring the then-new Linux 1.0 kernel. I wrote about it on Great to go back to explore what Linux looked like in 1994.
9. How I put Linux in the enterprise
I used to work in higher ed. In the late 1990s, we moved to a new student records system. We created an "add-on" web registration system, so students could register on-line—still a new idea in 1998. But when we finally went live, the load crushed the web servers. No one could register. We tried to fix it, but nothing worked. Then we had the idea to move our web registration to Linux, which rescued our failing system. I wrote about the experience on, and shared some lessons you can apply to your own Linux migration.
10. Reflection on trip to Kiel
This summer, I attended the Kieler Open Source und Linux Tage in Kiel, Germany. I shared two presentations: a history of the FreeDOS Project, and how to do usability testing in open source software. Here is my summary of that trip.

And here's looking forward to a great 2018!