Fixing a USB Flash drive that has been “corrupted” by balenaEtcher.

Recently I used balenaEtcher to create a bootable Linux drive. It is a nice Windows program that simplifies the process of creating Linux disks and is recommended by some Linux distro vendors. After the program successfully writes a bootable Linux USB drive, the drive no longer appears correctly in Windows. That’s because a bootable USB contains certain drive partitions with filesystem types that are not visible to the Windows operating system....

May 16, 2019 · Simon

Adding OCR layers to your Zotero library PDF items for Metadata extraction and indexing

Zotero is a cross-platform literature manager that is able to sync to a remote server and across multiple user devices. There are many alternatives available, each with strengths and weaknesses, but I am currently using Zotero to manage my literature because it is free and works with WebDAV for additional free storage. In this article I will describe why optical character recognition (OCR) is important for Zotero and suggest a way to add OCR to existing items in a Zotero library....

November 30, 2018 · Simon

ASCII plotting on the command line terminal with eplot

If you want to plot something on the terminal in ASCII you can use “eplot”. eplot itself is a Ruby script that acts as a frontend for gnuplot. eplot can be downloaded from the project’s GitHub page. It makes it easier to pipe numbers into gnuplot, which can otherwise be a bit of a hassle. It also has a dumb terminal mode which allows us to plot using ASCII. Plotting like this provides a way to quickly check data files without requiring any x windowing system, which might not be available when logging in remotely over the terminal....

August 8, 2018 · Simon

Successfully clearing ports in Salome (Code ASTER)

Figure: Building a geometry in the Salome graphical user interface (GUI). How Salome tracks ports When Salome is starting up, it checks for free ports on your system using a few built-in Python scripts. Then when you close Salome those ports should be freed up again for the next one. This has a number of uses, but one reason is to stop multiple instances of Salome trying to use the same port at once....

June 1, 2017 · Simon

How to get up-to-date Python packages without bothering your cluster admin

If you have ever been stuck as a user on an out-of-date cluster without root access it can be frustrating to ask the admin guy to install packages for you. Even if they respond, by the time they get round to it you might have moved onto something else. The moment could be gone. Luckily, as far as Python is concerned, the pyenv project allows users to install their own local Python version or even assign different versions to different directories/projects....

September 1, 2016 · Simon

Plotting multivariate data with Matplotlib/Pylab: Edgar Anderson’s Iris flower data set

The problem of how to visualize multivariate data sets is something I often face in my work. When using numerical optimization we might have a single objective function and multiple design variables that can be represented by columnar data in the form {x1, x2, x3, … xn, y} a.k.a. NXY. With design spaces of more than a few dimensions it is difficult to visualize them in order to estimate the relationship between each independent variable and the objective, or perform a sensitivity study....

August 31, 2016 · Simon

The new default colormap for matplotlib is called “viridis” and it’s great!

It’s probably not news to anyone in data visualization that the most-used “jet” colormap (sic) (sometimes referred to as “rainbow”) is a bad choice for many reasons. Doesn’t work when printed black & white Doesn’t work well for colourblind people Not linear in colour space, so it’s hard to estimate numerical values from the resulting image The Matlab team recently developed a new colormap called “parula” but amazingly because Matlab is commercially-licensed software no-one else is allowed to use it!...

April 6, 2016 · Simon

Equations in Gmail with the “TeX for Gmail” Chrome extension

Science via email One thing scientists and engineers have to do daily is discuss collaborative work via email exchanges. This often includes the need to share and discuss mathematical equations and to represent variables with subscripts and superscripts or special characters; something that is tricky when you are emailing in plain text. Source: WikiImages/Pixabay Of course it is possible to work around this problem! Email was invented by scientists, and for decades they have been communicating in this manner, using various conventions to convey the correct information using plaintext....

November 25, 2015 · Simon

5 Tips for making finite element models with Salome

Salome is an open source software package used to create geometric models and finite element meshes for use in numerical simulations. It is also able to perform its own numerical simulations and has post-processing capabilities built in. Here are my 5 tips for anyone who is interested in using Salome for model and mesh creation. 1. Practice manually first This goes without saying. Although Salome has a powerful Python-based scripting capability, it is worth practicing with manual model generation....

August 15, 2015 · Simon

Cool code: plotting columns from many data files with Grace

Grace a.k.a. xmgrace is a really useful tool for plotting histograms from tabular data files. Its power comes from the command line control and being scriptable. Yes, there are other options which are sometimes more suitable for specific situations (e.g. GNUplot, Matplotlib/PyLab), but for quick, basic plotting I usually find myself relying on xmgrace. Here is an example of a single line command to plot two columns from each of a large number of data files:...

November 27, 2014 · Simon

ZotFile for syncing PDF articles from Zotero to my eReader

I use Zotero to manage my literature collection, including all the associated PDF attachments. It really made my life easier when I set up the WebDAV file sync on Box. However, until now the only way to sync files to my Onyx Boox M96 eReader (image) was by connecting a USB cable and copying them manually to the device. Since Zotero stores the files in cryptically-named individual folders it is hard to do this manually in an organised manner and involves lots of clicking....

September 17, 2014 · Simon