Friday, April 27, 2018

Open source software reading list

A colleague recently asked what books I'd recommend about open source software. I go back a ways with open source software. I first contributed to Free software and open source software in 1993, before the term "open source software" was widely adopted.

So my list of book recommendations has some older titles on there. And that's good, because this list also provides a solid grounding for contributing to open source software.

I have to share our free (CC-BY) ebook that we published last year about the history of FreeDOS, written by our developers, contributors, and fans:



And some older books that I find interesting:

​Related to FreeDOS,​ there's Pat Villani's original 1996 book about how you would write a DOS-like operating system. It's a bit dated now (FreeDOS has changed a lot since then) but it's a good introduction to writing operating system kernels:



​Along similar lines (but less technical) is Linus Torvalds and David Diamond's 2002 book about how Linus created Linux:



I might also recommend Eric's 2001 book of essays about open source software:



Most of the contents, including the "Cathedral and the Bazaar" essay, are also available for free from Eric's website:



​I have the original paperback for this, which is now falling apart due to years of use, but O'Reilly has made Unix Text Processing (1987) available as a free ebook. This has some interesting not-necessarily-programmer stuff about how you can leverage Unix (and Linux) tools to do various things with text - including vi, ex, nroff/troff, and some awk:



​Other interesting free O'Reilly books include:

Wednesday, April 25, 2018

A gentle introduction to FreeDOS

FreeDOS is an old operating system, but it is new to many people. New users often ask, "I installed FreeDOS, but how do I use it?" If you haven't used DOS before, the blinking C:\> DOS prompt can seem a little unfriendly. And maybe scary.

So I wrote a gentle introduction to FreeDOS for OpenSource.com. It offers just the basics: how to get around and how to look at files. But it's surprising how much you can do in FreeDOS just with CD (change director) and DIR (directory listing). Learn those two commands, and you can easily become a DOS master.

Tuesday, April 24, 2018

March Madness brackets in PHP (scores)

To get ready for this year's March Madness, I updated my Bash script that filled out basketball game brackets. The new version is a PHP page that generates a bracket in a nice, formatted form that you can print out and hang on your office wall.

This made it really easy for me to participate in the office March Madness pool, even though I don't follow basketball. I'm not really a sports guy, but I like to engage with my office colleagues. It's entertaining! My script gives me a stake to follow the games, but without the emotional investment if my bracket doesn't perform well. And that's good enough for me!

But how did my March Madness brackets fare this year?

Following the standard method for How to score March Madness brackets, each round has 320 possible points, regardless of number of games. In round one, you assign ten points for each correctly selected outcome. That's eight games in each of four regions, so 8 × 4 = 32, times ten points for each contest gives 32 × 10 = 320 in each round. In round two, assign twenty points for each correct outcome. And so on. From that, the math is pretty simple.

Round 1

My Midwest bracket did really well in the first round, predicting 7 of 8 games correctly. My East region was off, only predicting 4 games correctly. West did well, with 6 games correct. My South bracket had 5 correct predictions. So that's (7 + 4 + 6 + 5) × 10 = 220.

Round 2

Things fell apart pretty quickly in my second round. My Midwest bracket had 2 correct predictions, and East had 2. My West bracket also predicted 2 games correctly, but my South had only 1 correct. Total for this round was (2 + 2 + 2 + 1) × 20 = 140.

Round 3

I was almost completely knocked out in the third round. Of all my teams, my PHP script only correctly predicted one game (Villanova). In this round, my score was 1 x 40 = 40.

Rounds 4–6

If you followed March Madness this year, you know Villanova went the distance to win the NCAA. Fortunately, my PHP script also predicted Villanova all the way to the end. For the Final Four and the championship round, I made to make my own guesses (Villanova). That makes the math very easy:

round 4: 1 × 80 = 80
round 5: 1 × 160 = 160
round 6: 1 × 320 = 320

Total

Overall, my PHP script did pretty well. Across all rounds, my final score was 220 + 140 + 40 + 80 + 160 + 320 = 960. That's great!

Compared to an earlier version of my Bash script to fill out March Madness brackets, 960 points is excellent! In that previous iteration, I had two runs of the script, with 530 and 490 points each. In an improved version of that Bash script, a sample run netted 390 points. My 960 compares well!

Of course, the outcome of my PHP script is based on weighted guesses, so things could have gone the other way very easily. Without Villanova, my brackets would have been completely out in the third round, resulting in only 220 + 140 = 360 points. So don't use my PHP script to bet with. But my script did keep up my interest in this year's March Madness basketball games, and that's a good thing.