MySQL Database Collation/Character Encoding Change With phpMyAdmin To Recover Special Characters/Languages In Very Old/Recently Migrated WordPress Instances

The Death of Socrates - painting by Jacques Louis David (MET, 31.45)

Above: if only he'd waited, Σωκράτης (that's "Socrates" to the rest of us) could have seen his name rendered correctly on my site. From "Death of Socrates," by Jacques-Louis David, 1787.

The lack of rendering of "π" and replacement with "?" in the title of the recent blog post "Examination Of Metal-pi Interactions In The Coordination Chemistry Of Heavy Alkaline Earth Metal Tetraarylborates" irked me, as I never remember having had an issue with "special" characters before. Noting here a quick fix that might be due to the fact that I'm sitting on a very old WordPress database (started in 2005) or that I switched hosting companies after 23 years (web.com –> greengeeks.com) and find that not all defaults are the same.

And I'm Greek on both sides, so this was personal.

Logging into phpMyAdmin for this site, I was greeted with (the key part of this being the latin1_general_ci)

And, from all reports, the latin1 character set does not support special characters. The character set of choice seems to be utf8mb4, for which a completely usable collation is utf8mb4_unicode_ci. So, to begin, change that.

Next step in this process was the replacement of all instances of latin1 to utf8mb4 in my database, which I performed as per the recommendations found at brianli.com/how-to-fix-wordpress-character-encoding/ but with the SQL query box.

And yes, for f's sake, back up your database first or download a copy and then do this.

That's:

update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME, 'DEFAULT CHARSET=latin1', 'DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci');

And, with that set of changes, π.

GaussSum 3.0 apt-get Install simpledialog Fix In Ubuntu 24.04 (Others)

Above: Just needed an output from GaussSum for show-and-tell. This image from the article "Computational Study of Benzothiazole Derivatives for Conformational, Thermodynamic and Spectroscopic Features and Their Potential to Act as Antibacterials," available at https://www.mdpi.com/2073-4352/12/7/912.

Continuing on the Ubuntu 24.04(.1) migration theme and in the thick of needing a program to simply prepare partial Density-of-States (that link, but in this case for molecular systems) analyses, users might find themselves working through the python3, numpy, gnuplot, cclib, python3-tk installation process on the old GaussSum Installing on Linux page without knowing that gausssum 3.0 has been available as a stand-alone apt-get for several recent Ubuntu versions.

apt-get GaussSum (3.0) after 502 MB of installs and one line change to preferencesbox.py

That, minus the amount of dependencies that get installed to make the program happen, is the good news.

First attempting to run gausssum from a terminal after this apt-get install produces the following:

user@machine:~$ gausssum 
Traceback (most recent call last):
  File "/usr/bin/gausssum", line 23, in <module>
    import gausssum.gausssumgui
  File "/usr/lib/python3/dist-packages/gausssum/gausssumgui.py", line 27, in <module>
    from gausssum.preferencesbox import PreferencesPopupBox
  File "/usr/lib/python3/dist-packages/gausssum/preferencesbox.py", line 21, in <module>
    class PreferencesPopupBox(simpledialog.Dialog):
                              ^^^^^^^^^^^^
NameError: name 'simpledialog' is not defined

As much as https://stackoverflow.com/questions/25905540/importerror-no-module-named-tkinter looks like an answer to the problem, the solution is a simple change at the very top of preferencesbox.py that can be found in https://stackoverflow.com/questions/9570550/pythons-tkinter-simpledialog-askstring-not-working-from-command-prompt (I didn't bother to ask ChatGPT just to help keep the SO traffic up). Use your editor of choice:

sudo nano /usr/lib/python3/dist-packages/gausssum/preferencesbox.py

and make the following change to line 17:

import tkinter.simpledialog as simpledialog

After that, type gausssum, click on Help > About, and you should see the above, minus the previous NE-1 install in the background from the last post.

NanoEngineer-1 Version 1.1.1 – Still A Go-To In Ubuntu 24.04

Above: A six-stranded triple-crossover (TX) DNA Junction (again). See Ned Seeman's ACS interview for more background (also again).

With great thanks to Bryan Bishop for keeping his github account alive, a very old version of NE1 sitting on a fresh install of Ubuntu 24.04.

Sixteen years (!) since its release, it's still something I return to regularly because it does a very specific set of operations very well (I'd say that even if I didn't help with the development). Having made the leap on one of my machines to get used to anything new in 24.04 ("Noble Numbat." And re-testing all my other usual apt-gets to see what else I'm using from a decade ago that still has a chance of loading), trying NanoEngineer-1 (NE1) was on my short list of "if this doesn't work, I ain't upgrading" apps.

Bryan Bishop's github repo for Version 1.1.1 is alive (some highlights from the old gallery included) and the program is still kicking with this new install. I note that googling "NanoEngineer-1" now takes you to his page first above others, which is great.

This post is just an FYI – NE1 still runs like a charm. From his download link and how-to, it's a simple few steps.

My only installs on 24.04 include:

sudo apt-get install mesa-utils libx11-dev

And I'm not entirely sure about needing the libx11-dev. The snippet below taken from the github readme will have you running:

# download the ready-made chroot archive (600 MB)
wget http://diyhpl.us/~bryan/irc/nanoengineer/nanoengineer-chroot.tar.gz

# extract the chroot
tar -zxvf nanoengineer-chroot.tar.gz

# mount these things if you want the GUI to work
for i in etc/resolv.conf tmp proc dev; do sudo mount --bind /$i nanoengineer-chroot/$i; done

# allow connections from other uids over the local X11 socket
xhost +local:

# jump in
sudo chroot nanoengineer-chroot/

# now run nanoengineer
su nanoengineeruser -c "python ~/code/nanoengineer/cad/src/main.py"

And with that, NE1. No effort to optimize, I've not tried loading a REALLY BIG mmp file to see what might crash, but I'm happy to have at least three or four more years of access to my old mmp ("molecular machine part") files before, at worst, jumping to VirtualBox.

Update: 24 February 2025

Because its use has come up in some recent twitter/X discussions (1, 2), adding the compilation of the good olde NE1 simulator engine to the mix to make NE1 fully-operational (albeit it a bit slow).

For the record, this process was written up for myself and others by the great Matt Moses. The sim owes its origin (talking waaay back) to the also great J. Storrs Hall.

From a fresh command line (or not, I'm just going through the rigorous process), the following:

sudo mount -t proc none proc
sudo mount -o bind /tmp tmp
sudo chroot ~/nanoengineer-chroot
su nanoengineeruser
cd code/nanoengineer/sim/src
make clean
make
touch *.pyx
make clean
make pyx
cd ../../cad
mkdir bin
cp ../sim/src/sim.so ./bin
cd ~
python /home/nanoengineeruser/code/nanoengineer/cad/src/main.py

And you should be able to minimize, adjust, and do simulations. When set to ND1 and not GROMACS. And on a single core. I told you it was old.