« Back to home

Reflections on Teaching Intro to Programming

Over the last semester I had the pleasure of teaching programming as an adjunct professor at a local major university. I sought out this opportunity because I genuinely enjoy teaching, I knew I’d have a little extra time on my hands, and I think it’s valuable to my current assignment to be in the community putting a face to the Air Force. I cold-called the computer science department and asked around just prior to the fall semester, and they were interested in bringing me on for the spring semester. More than that - they wanted someone to turn their existing Intro to Programming (in Python) course into an Internet-based course. Python is my jam, so this sounded good.

Python code on a computer screen, from https://commons.wikimedia.org/wiki/File:Python_image.jpg

Python lookin sharp.

I learned a lot while teaching this class: about teaching, about students, about learning Python, and about learning programming in-general. I wanted to put my thoughts down because they’ve been bubbling around in my head. I think this would be a great talk topic for some nerd conference too, so it makes sense to take the notes while they’re fresh.

Read more »

One-File Tools

Many of us use computers that are locked-down by some corporate policy. The restrictions prevent you from downloading software, or running anything that’s not pre-approved. Most of us have used workarounds of some type - Excel spreadsheets created by that one guy in the office, Word documents with macros, Sharepoint sites, maybe even the occasional Powershell script…

One-File Tools are open-source self-contained one-file utilities implemented as a webpage. These are easily shared, easily used, their saved versions may contain your user data. They don’t require an Internet connection.

Read more »

Scope: Not Just Mouthwash

I’m teaching a Python class which acts as an introduction to programming, for most of the students there. This is an awesome experience - for me personally because I enjoy this, and for my resume. I hope to do this full-time someday, but today I’ve just got 3 sections of the same class. We’re doing a lot of cool things that I should write about some other time - one of them is using a free, open source textbook called, Runestone - How to Think Like a Computer Scientist.…

Read more »

Deploying Github to Dreamhost

One feature I lost moving from Wordpress to Hugo for this blog was the ability to write a blog post from anywhere. I really liked being able to do that… I could be riding in the car, or smoking brisket at 2 AM, or on vacation without a computer, and just login and write something. I wanted that back - a posting solution from my cellphone. The reason I lost that ability is because the simplest update process for Hugo is:…

Read more »

Archive Pages

I recently converted this blog over from a WordPress installation to use static pages generated by Hugo. I’ve used Hugo for my other recent web creations and I’ve been very impressed. The templating system is very nice, the page generation is lightning fast, and I’m always able to find something near what I need in the themes. One WordPress feature I liked was the listing of articles by year and month… My blog had a little timeline on the side with each year and month listed, annotated with the number of postings I made during each.…

Read more »

Syntax Errors

Syntax Errors in Python are great. Here’s one: File "asdf.py", line 2 print("Result is: {}".format(result)) ^ SyntaxError: invalid syntax result = ((5 * 10) + 15 print("Result is: {}".format(result)) Two lines of code… Syntax error on the print line, evidently. But where? That line looks so simple and correct! And pointing directly at the t? Well - it’s not really on the print line. Folks who have done any amount of programming will look at the preceeding line fairly quickly and notice the missing parenthesis.…

Read more »

Writing About Writing Secure Shell Scripts

I recently read this cautionary tale about shell scripts. https://www.linuxjournal.com/content/writing-secure-shell-scripts It’s cautionary in two ways: it is intended to cause shell programmers caution, and I caution against you taking the article too seriously. One of the biggest threats to the shell in memory was the Shellshock vulnerability. This wasn’t typically a direct threat to shell scripts, but one caused by a bug in a shell, and by other programs exposing parts of the shell to external input, often in unexpected and unlikely places.…

Read more »

RasPi Flow Meter In A Pinch - Part 2

META: Part 1 describes the problem I’m trying to solve here. I need a way to monitor water flow through my water filter over several days, and I don’t want to sit and watch it. So - I took a Raspberry Pi I’ve got and a little Python and hacked a solution together. The basic idea was that I’d position a plastic cup below the output stream of the waste water, I’d put two wires into the cup, I’d put a voltage on one wire and attempt to see the voltage on the other.…

Read more »

RasPi Flow Meter In A Pinch - Part 1

META: This first part is about the problem that caused me to build the solution. Part 2 is about the solution. My new place has an awesome feature that was disabled when I moved in - a reverse osmosis water filter! It’s not a whole-house hookup, it’s just for the refrigerator and a dedicated tap on the sink. We definitely wanted to use this thing! At first, I just turned it on and it seemed to work fine.…

Read more »

Unix Text Editing Awesomeness

Oh, LaTeX acronym package, you won’t automatically alphabetize my list of acronyms? Strange… Let’s see if Unix will… $ echo "\acro{SCADA}{Supervisory Control And Data Acquisition} \acro{PLC}{Programmable Logic Controller} \acro{RTU}{Remote Terminal Unit} ..." > toSort $ for i in `cat toSort |sed "s/.*\\acro{\(.*\)}.*{.*}/\1/" | sort`; do grep "{$i}" toSort; done \acro{ADC}{analog to digital converter} \acro{API}{application programming interface} \acro{APT}{Advanced Persistent Threat} \acro{ASCII}{American Standard Code for Information Interchange} ... Unix, you rock my world.…

Read more »