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

Fetching, wrangling and visualising sunrise and sunset data using Python

Previously I showed how it was possible to obtain sunrise and sunset times for a whole year at any location on Earth, from a public source. This time I am going to explain how to fetch that data, clean it up and create graphical visualizations like the one below, all using Python. A Jupyter Notebook is available on GitHub. Such data might even be useful in, for example, simulation of solar power generation....

February 2, 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

Parallelization in Python example with joblib

It can be ridiculously easy to parallelize code in Python. Check out the following simple example: import time from joblib import Parallel, delayed # A function that can be called to do work: def work(arg): print "Function receives the arguments as a list:", arg # Split the list to individual variables: i, j = arg # All this work function does is wait 1 second... time.sleep(1) # ... and prints a string containing the inputs: print "%s_%s" % (i, j) return "%s_%s" % (i, j) # List of arguments to pass to work(): arg_instances = [(1, 1), (1, 2), (1, 3), (1, 4)] # Anything returned by work() can be stored: results = Parallel(n_jobs=4, verbose=1, backend="threading")(map(delayed(work), arg_instances)) print results Output:...

April 3, 2017 · 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

Deutschsprachige Artikel auf dieser Website

Heute, nach einer personlichen Diskussion wobei mein Deutch leider sehr schwach war, kam ich auf der Idee um mein Blog ins Deutsch zu übersetzen. Mittlerweile, gibt es viel mehr auf dem englishsprachigen Netzplatz. Wilkommen!

May 11, 2015 · Simon

Paper “Hard Magnet Coercivity” published in proceedings of REPM2014

This August Prof. Dominique Givord of Institut Néel – CNRS presented our paper titled “Hard Magnet Coercivity” during the 23rd International Workshop on Rare earth and Future Permanent Magnets and Their Applications (REPM2014) in Annapolis, Maryland. The manuscript was included in the conference proceedings and we would now like to make the reprint available to the wider public: Please click here for the PDF file. Abstract: Based on a critical analysis of the experimental coercive properties, general considerations on the reversal mechanisms in RFeB magnets are recalled....

December 12, 2014 · Simon

Aligning qhost output on the commandline when hostnames are too damn long

qhost is a UNIX command line tool to print the status of nodes on a Grid Engine system. The output is normally quite readable and is sorted by columns to give information on the hostname (“HOSTNAME”), architecture (“ARCH”), no. of CPUs (“NCPU”), processor load (“LOAD”), total available memory (“MEMTOT”), current memory usage (“MEMUSE”), swap memory size (“SWAPTO”) and current swap usage (“SWAPUS”) of each node on the cluster. Unfortunately, when the hostnames are too long, instead of truncating them to keep the columns aligned the row gets shunted along, making the output messy and much harder to read quickly....

September 24, 2014 · Simon

Paper “Micromagnetics of shape anisotropy based permanent magnets” accepted for Journal of Magnetism and Magnetic Materials (JMMM)

Our new paper titled “Micromagnetics of shape anisotropy based permanent magnets” has been accepted for publication in Journal of Magnetism and Magnetic Materials (JMMM). Short description Visualizations of the computed magnetization data during reversal of soft prolate spheroids for aspect ratios (a) 1.95 and (b) 15.6, showing the different reversal modes. Permanent magnets are important components in electrical generators and motors, among other technologies, and they are critical to the operation of wind turbines and electric/hybrid cars....

March 26, 2014 · Simon