Quick Chemical Formulas

ChemEqn app.

While teaching chemistry this year, I’ve needed a quick way to write chemical formulas. The fastest thing to do is just write it out flat–sans sub and superscripts–like Na+, or CO2-. But that’s not pretty, and introduces another potential element that could confuse.

I found that you can use Lingojam’s sub and superscript generators to copy and paste the official UTF-8 characters for pretty much all the sub and superscripts I need for chemistry, but that takes a while to do.

So instead, I put together, just in time to write my finals, a little ChemEqn app that uses keyboard shortcuts to quickly substitute in the sub and superscripts as you type.

  • [Ctrl][number]: give you the number subscripted:
    • e.g. [Ctrl][2]: gives ₂
  • [Ctrl][Shift][number]: gives superscripts:
    • e.g. Ctrl][Shift][2]: gives ²
  • [Ctrl][Shift][+]: gives a positive charge (⁺)
  • [Ctrl][Shift][-]: gives a negative charge (⁻)
  • [Ctrl][>]: gives a forward arrow (→)
  • [Ctrl][<]: gives a backward arrow (←)
  • [Ctrl][/]: gives the double arrow (⇌)

The method is not perfect, since you still have to decide which comes first when you have both a sub and superscript after an element (O₃²⁻ for example). Another issue is that when I do [Ctrl][Shift][+] and [Ctrl][Shift][-] it zooms into and out of the browser window since we’re using the default zoom shortcuts, but that’s, at least for me, a minor inconvenience.

I do like the app since it still makes for quite readable formulas that can be easily copied and pasted almost anywhere without messing up since it only uses UTF-8 characters that are pretty standard across the web (and most computer programs).

WW2 in Real Time

TimeGhost is an utterly amazing project. They’re currently going through World War II, week by week, in real time. That is, every week they post a really good summary of what happened in the corresponding week of the war.

They’ve also done WWI in the same way and have ancillary channels about other conflicts, like the Cuban Missile Crisis Day by Day.

Definitely, worth a look.

What is Real? A Math Seminar (Prelude to Imaginary Numbers)

We had a really nice, thoughtful seminar discussion in Algebra II, with the simple question: What is real?

I did this as a lead into the topic of imaginary numbers (i = \sqrt{-1}).

The distinction between tangible and intangible objects came up pretty early in the discussion. That morphed pretty quickly with the realization that there were things that you can’t touch, like ideas and thoughts that were real as well, despite being non-physical.

Then they considered some of the more edge-wise cases, such as, are dragons real. After all, they never really existed, but are parts or real myths. That thought lead to the idea that anything that was thinkable–anything you could think of–was real.

I jumped in, near the end, to insert the idea that maybe there were things that were not real–that were imaginary–but could be useful. And that’s how I set up my lesson on imaginary numbers.

Because even if you can’t calculate the square root of -1 (no number times itself will give a negative number).

 \sqrt{-1} = ?

You can give it a name.

 i = \sqrt{-1}

And under certain circumstances:

 i \cdot i = i^2

You might find that imaginary numbers can combine to give you real numbers.

 i^2 = (\sqrt{-1} )^2

 i^2 = -1

Which means we can do a whole lot of calculations that were impossible before, making imaginary numbers extremely useful.

 \sqrt{-9} \cdot \sqrt{-4} = 3i \cdot 2i  = 6 \cdot i^2 = 6 \cdot (-1) = -6

Linux Laptops

We had a couple laptops recently donated to the Makerspace (thanks Ms. A) and I’ve installed Ubuntu’s Linux (20.04 LTS) to see if I could get them to be useful for my students. I particularly wanted to see how hard they’d be to set up for programming (especially given the issues I’ve had with python). They’re working quite well so far, and this is my record of what I’ve done to set them up.

Installing Ubuntu

Ubuntu makes it really easy to install their operating system; it’s the main reason it’s one of the more popular flavors of Linux. You can download the ISO and get instructions on how to create a USB installation stick on their page.

Getting System Information

inix is a nice tool to for finding information about your computer (which you sort-of need when you’re dealing with donated machines): what type of cpu, how much RAM, size of the hard drive and things like that. Install with:

sudo apt-get install inxi

and to get the full set of information, run:

inxi -F

Extremely useful, but I did not really need this to tell me that I needed to upgrade the hard drive. Swapping the hard disk drive (HDD) for a solid state drive (SSD) is one of the quickest and cheapest ways to upgrade an older system. I picked up a 120 Gb SSD for less than $20 and the computer is now an order of magnitude faster (though I’m down from 500 Gb).

Upgrading

The final step after installing the operating system is to update the software. Ubuntu runs an automatic update on your first boot. However, since I’ll be doing most of my installations from the command line, I run the update commands (just in case):

sudo apt update
sudo apt upgrade

Setting up Python

Python 3.8.5 was installed by default, but I need the python package installer (pip) to install the modules I’ll need:

sudo apt install python3-pip

Now I can install numpy (-U option to upgrade) for numerical stuff:

pip3 install -U numpy

as well as, matplotlib:

pip3 install -U matplotlib

and vpython

pip3 install vpython

and for virtual environments (venv):

pip3 install virtualenv

and the IDLE editor for python

sudo apt-get install idle3

also the Thonny editor that makes using Raspberry Pi Picos much easier (especially for the pico LED strips)

sudo apt install thonny

Now we should be good to go.

git, github, and vs code

git: I’ve been using github.com for keeping my programming projects and GitHub Classroom for my programming class. The GitHub Desktop program is great for Windows and OSX, but does not exist for linux at the moment. So I needed to install git:

sudo apt install git-all

VS Code is a pretty popular IDE for coding that I’ve been using for my computer programming class. It’s a Microsoft product that is designed to work closely with github repositories. You can download the .deb from

It’s usually saved in the ~/Downloads folder, so to install this should work:

sudo apt install ./Downloads/code*.deb

I usually test the VS Code installation with my ledPixelsPico repository because I want to make sure I can operate my Raspberry Pi Pico LED strips.

To get VS Code to be able to make commits and sync with the repository (you’ll have to test this with a repository of your own–or that you have permission to sync with) you’ll need to run the ‘git config –global user.email “you@example.com”‘ and ‘git config –global user.name “Your Name”‘ commands in the VS Code Terminal.

LaTeX

For typesetting beautiful documents (mainly for the equations) I use LaTeX.

Since I don’t want to worry about downloading LaTeX packages when I need something esoteric I install the full Tex Live distribution (Note: for texlive on Fedora use ‘texlive-scheme-full‘).

sudo apt-get install texlive-full

Editor: To use LaTeX we need an editor. I prefer TeXstudio:

sudo apt-get install texstudio
  • Folder with all files needed to test the typical things I do with LaTeX in a chapter format: LaTeX Demo Report.

NOTE: if you’re low on memory, you can install something like Miktex instead of Tex Live because it installs packages only when you need them. Also, some of my students who use Apple computers seem to find TexShop easier to set up than TexStudio.

Installing Additional Software

The basic Ubuntu installation comes with a lot of the free software I use, but, using the command line:

sudo apt install ...

or the Ubuntu (or other package manager) Software tool, I added:

  • [Atom] [depreciated]: text editor for coding (being depreciated unfortunately, I’ve been forced to use VS Code instead: see above, or Thonny: see below and above).
  • Thonny: Coding editor for working with Raspberry Pi Picos in particular (may already be installed from the python section above).
  • GIMP: for image editing
  • Inkscape: for vector graphics
  • OpenScad: for 3d Modeling (for printing)
  • Shotcut: for video editing (it’s multi-platform). I’m trying this one for extracting time information from experiments (like ball drops). Can install with ‘sudo apt-get install shotcut’

UxPlay [Optional]: A crucial piece of software for online teaching that I had to install via the command line was, UxPlay, and you can see my variant of the installation instructions here. This program allows me to mirror my iPad to the computer.

The Rest

The rest is mostly tweaking the settings to your specifications (there’s even a program called Tweak you can install for extra settings).

Tweaks

I use this to enable hot-corners and customize the desktop interface.

sudo apt install gnome-tweak-tool
sudo apt install gnome-shell-extensions
Fonts

Added the student fonts following LinuxConfig’s instructions, specifically the section on “Manual system-wide font installation”, which just meant copying the folder with all the fonts to the “/usr/local/share/fonts/” directory.

php

I use php a lot so I’ve set it up so I can run php off the command line (I haven’t figured out how to use url parameters this way though).

sudo apt install php libapache2-mod-php
sudo apt install php-cli
gdebi

gdebi is a little application for installing .deb software. I’ve had enough hiccups with the Ubuntu Software tool, to find it useful to right click a downloaded .deb file and install it using gdebi. To install:

sudo apt install gdebi
Imager

The first thing I used gdebi to install was Imager, which is used to write the Raspberry Pi operating system to USB’s or SD cards. Download the imager .deb, right click and install using gdebi.

nmap

nmap maps your local network, which is useful if you have a bunch of Raspberry Pi’s around and need to figure out their IP addresses.

sudo apt-get install nmap

To use nmap to find all the raspberry pi’s on the local network use something like this, where you change the IP address (192.168.4.0) to whichever IP your computer is on, but switch the last number for 0:

sudo nmap -sP 192.168.4.0/24 | grep -in -B 2 'pi'

UxPlay: Sharing iPad Screen on Linux (Ubuntu)

My setup for teaching online and in school students simultaneously requires me to mirror/share my iPad screen, which I’m using as a whiteboard, with a computer that’s doing video-conferencing for the online students and is hooked up to a projector for the in-class students.

I’ve been using X-Mirage on a Windows computer, but this week my Windows desktop started having trouble connecting to the internet in the middle of classes, and I’ve not been able to debug. Fortunately, I’d been setting up a donated laptop with Ubuntu Linux, mainly to use as a machine for programming, but a quick internet search lead me to Rodrigo Ribeiro’s UxPlay that allowed me to switch over to the Linux laptop for the last two days.

The installation instructions are straightforward, but I wanted to make a note to myself for future reference, because I did this on two different laptops and both times I had to run one of the commands I found in the comments.

So, to install run:

sudo apt-get install cmake
sudo apt-get install libssl-dev libavahi-compat-libdnssd-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-libav
sudo apt-get install gstreamer1.0-vaapi

The last command was redundant on at least one of the computers, but didn’t seem to hurt.

You then download the UxPlay program from his webpage, and follow his instructions to unzip the file, cd into the directory, make a ./build folder, cd into that, and then run the commands:

cmake ..
make

At this point you may be able to run the program, but I was not able to connect my iPad until I ran:

sudo apt-get install gstreamer1.0-plugins-bad

Then I could launch the program (while still in that build directory) with:

./uxplay
Screen mirrored using UxPlay showing my Jamboard notes that were written on the iPad.

Now, I just need to figure out the best way of streamlining the use of the program.

Update: I copied the “uxplay” executable into the “/usr/local/bin” folder so it’s now accessible from everywhere, and available to all users on the laptop.

The Technology I Use for Teaching in Person and Online at the Same Time

This year we’ve been doing a hybrid system with most students at school and a few, who’re more sensitive to the COVID risk, at home. Setting up the technology to accomplish this has been quite tricky, but we’ve settled on a system the works reasonably well.

Hardware

The standard system involves:

  1. iPad: for notes that will normally be written on the board,
  2. Computer: the iPad screen is mirrored on the computer and then,
  3. Projector: to project what’s on the computer/iPad the kids in the classroom.

In practice it looks like this.

The iPad is mirrored to the computer which connects to the project and shares the screen with the kids at home.

If it looks a bit messy, that’s because it is.

Software

Video Conferencing

We’re using Google Meet for our video conferencing software, pretty much because we’re using Google Classroom for our classes and it’s built in. However, all you need is something that can share the computer screen with the kids at home, so Zoom, which we used in the spring, would probably work as well. One advantage of Meet is that it’s easy to set up a meeting for the class and the link is posted at the top of the page every time you log into Google Classroom.

Jamboard as a Whiteboard app.

After trying a few programs we’re using Google’s Jamboard as a whiteboard program for the iPad. Jamboards are shared documents, just like another Google Doc or Sheet, so in theory, if I shared the specific Jamboard document with them (which I do) the students at home could just follow along in the same document in real-time. In practice Jamboard can be extremely laggy, so I’ve given up on that approach and now I just share my entire computer screen over the video conferencing program.

One nice thing about Jamboard is that they are files, so the whiteboard notes can be saved and cataloged with other materials for a particular lesson or assignment. It’s also probably a good thing that you’re restricted to 20 slides otherwise I’d end up with some really large documents.

The ability to save them as files with all the other google documents, and the fact that it’s free, are the main reasons I prefer Jamboard to the other whiteboard options I’ve tried.

Mirroring the iPad (X-Mirage and UxPlay)

Mirroring the iPad to the computer turned out to be quite tricky. Since we’ve been working primarily with Windows PC’s, I ended up going with X-Mirage. I’ve set it up so X-Mirage automatically launches when you start up the computer, but it’s another piece of software to pay attention to. This program has a mac version as well. On the downside it costs about $14 for each computer it’s on.

I recently got my hands on a couple old (donated) laptops, and installed Linux (Ubuntu) on them for the operating system. In the few days I’ve been testing them they seem to work very well. For these I’ve used UxPlay as mirroring software, which has slotted into the system very, very well. Because it’s a command line program, setting up can be a little tricky.

In Summary

In summary, I have a system, and it works well enough that all of the other teachers have adopted it for their classes as well. This works for us because we can mostly use the hardware we have (we did have to buy iPads for the teachers who did not have them), and the software is fairly cheap. The kids at home appreciate it because it allows them to see and hear what’s going on in the classroom, especially what’s written on the board, pretty clearly. I’ve not heard many complaints from the kids at school.

As for the future, I am somewhat excited that I can effectively use the Linux computer now, and I’m always looking for ways to streamline.

Environments for Teaching Python in Middle and High School

I’ve been using python as the primary programming language for all of my classes, from middle to high school. However, with a variety of different machines and operating systems–macs, PC’s, OSX, Windows, ChromeOS–it has been bit of a pain getting everyone up and running and on the same page. It has been especially problematic because I like to use NumPy and, especially, the VPython module because of its nice, easy 3d visualizations.

I’ve tried Anaconda, which works great on some machines but not so much on others. One student with a Mac had to restart the kernel every time he ran a program with vpython, while others had trouble getting it to work properly at all. I do like the way it allows you to put everything into a single Jupyter Notebook, which works nicely for teaching-length programming assignments, but becomes cumbersome for longer projects. Joel Grus goes into detail about why he does not like Notebooks for teaching; much of which I agree with. I do like the Spyder IDE a lot, but I’ve run into some computers that have problems with it (constant crashes).

So, I’ve been using Glowscript a lot with the lower grades. It’s online, so you only need a browser, and its made for vpython, so you can do a lot of the numerical work with it. However, because it’s online you can’t, understandably, get it to write output files to your computer–you have to copy and paste from its output. I’m also not sure how to import user-created modules, which further limits its utility for higher-level classes.

I’ve recently run into repl.it, and I’m having a student try it out in my Numerical Methods class. It looks quite promising as it seems to be able to manage files well and we’ve tried some basic numerical programs using numpy and matplotlib. However, I’ve not got it running vPython yet (although it’s come close).

(repl.it update): One of our other teachers has been trying repl.it with the middle school class and really likes it.

I’ve also recently discovered MakeCode. I’m looking into it for the lower grades, down to 6th grade or even earlier, because it lets you write programs for Minecraft, which is very popular with a remarkably broad age group. It lets you work in blocks, python, or JavaScript. From my poking around, the first couple of things it teaches you to do in Minecraft are write statements (to generate a chicken) and the loops (to generate a lot of chickens). I’ve asked one of my 9th grade, Minecraft players to investigate, so I should have some results to report soon.

At the moment, for my most advanced class, we’re taking a whatever-works approach. We’re learning about finite differences and using matplotlib to graph the output. I have one student, mentioned above, using repl.it, and another one using Jupyter Notebook on a Mac. A different Mac user is invoking IDLE from the command line because they prefer the IDLE IDE, but couldn’t get numpy to install properly with the python 3.9 version they’d installed earlier–the command-line IDLE actually goes to their Anaconda installation. I have one student, on a Windows machine, for whom everything just works and are using their regular IDLE installation. We spent the entire class period getting everyone up and running with something, but at least now everyone has at least one environment they can use. I’m curious to see what the kids who have multiple options are going to go with.

3d Printable Microscopes

A few interesting, low-cost but potentially lab-grade, microscopes that would be great Makerspace projects for students.

OpenFlexure: Out of the University of Bath, this has a Raspberry Pi at the core that can control the stage, focus, and sensor (using the RPi camera module). Since it’s modular the cost varies with the image quality you’re aiming for, but it looks like you can achieve even high resolution results relatively cheaply. They have great detail on their website, including their own version of Raspbian to install on the Pi, so this looks like an good starter project.

UC2: I really like the look of this building block, LEGO-style, system. It seems extremely flexible and there are some interesting projects that go beyond your standard microscope. There are a lot of designs you can go with, including an Arduino or using a Raspberry Pi and camera, but they claim to get good results just with smartphones. This is a big, sprawling project, which suggests a slightly steeper learning curve.

Hat tip to Maggie Eisenberger for introducing me to these.