Promoting Women in Science is all very well, but what about the actual science?

There seem to be blogs popping up all over the place about women in science. They are, without exception, great. In a new blog I aim to marry the my name is … and I am a … and I like … format with actual science. I encourage people to add as much science as they like, just as I will continue to do as my projects progress. So please be brave women and Submit Something Fabulous by visiting sciwomen.tumblr.com and clicking the link at the top of the page. Be as scientific as you like.

Chemical Imbalance

An excellent short film on the disparity between the sexes in science.

The Go Faster Try Place at the Water House Dog (Accelerator Test Facility at Brookhaven Lab.))

@BrookhavenLab ‘s website, this week, displayed several attempts to follow #UPGOERFIVE ‘s lead and explain complex ideas using only the most common 1000 words. Descriptions of long-term effects of elevated concentrations of carbon dioxide on plants in the field,  investigating superconductivity with Raman scattering and quark-gluon plasma studies
are all described here.

I decided to make use of the up-goer five text editor to have a go at describing the activities at the Accelerator Test Facility at Brookhaven National Lab.

We make tiny bits of matter go faster in a small space. Sometimes we hit these fast bits of matter with bits of light to make light with very short waves which can be used to take very good pictures of people’s insides. We also hit other types of matter with bits of light to make new matter which may be used, some time, to kill balls that grow inside people and make them sick.

We try to come up with very small bit go faster things so that they may fit inside hospitals and eat less money.

How to backup your MAC without a fancy time machine.

I have used a number of good internet sources in learning how to perform scheduled backups from a MAC to a Linux server and I thought I’d share them.

MAC backup via SSH and rsync

Due to a lack of external hard drive for use with Time Machine I found the need to explore alternative backup solutions. I decided to back up my data onto a linux server. After a little research it seems that using rsync via SSH is one way to go. In the terminal, type the following

$ rsync -av ssh /Users/me/Documents 
   username@123.123.123.1:/mydirectory/macbackups/

This copies the Documents folder to the server. The first location is the “from” folder on the local machine and the second is the “to” folder on the server. See the here for a complete guide including performing scheduled backups and passwordless remote login.

Public-private key generation

To use a public-private key pair to allow passwordless rsync backup via SSH I did the following:

In the terminal type

ssh keygen -t -rsa

If you wish to setup an automated backup (see below) leave the password blank. Two files will be generated; copy the .pub file to ~/.ssh/authorized_keys on the remote host. See this link about restricting key usage to rsync only and this reference for more details about securing your key.

Scheduling a Cron job

I automated the backup using a Cron job. Cron is a unix based job scheduler which can be used to run any terminal command on a given schedule. The simplest way to do this is to paste the required command into a Cron code generator. The output must then be used to create a crontab as follows:

Open the terminal and type

Crontab -e

Paste the generated code and save.

Science: It’s a Girl Thing!

I wonder who will get shot for this.

Mathematica memo – Saving data using “FileSave”

It’s great to automatically save an output at the end of a script. It is sometimes desirable to run the script multiple times, saving the data under a new filename. It’s simple to generate new filenames using the date etc. If the script were to be used regularly by multiple people, with different file naming tastes, it maybe useful to use a dialog box to export data. This avoids people screwing with your script to add different filenames and can be done using a single line of code

Export[SystemDialogInput["FileSave",
       "/home/cswinson/Desktop/data.m"], data]

This pops up a dialog box with a preset file path and suggested filename.

Mathematica Memo – How to import multiple data files into a single variable.

So, you’ve measured something many times and need a simple way to import all the data into a Mathematica notebook. The method below works under the following assumptions:

  1. All data files are of the same format
  2. All data files have the same number of datum, arranged in the same manner (i.e. all containing the same number of rows and columns)
  3. You wish to import all files present in the folder, though this example can easily be edited to cherry pick files.

Set location of folder containing data

SetDirectory["/.../data/"];

Get the names of the files contained in the target folder

filenames = FileNames[]

Import multiple files into a nested list

alldata = Import /@ filenames;

Note: /@ is shorthand for Map[] which performs element wise operations.

For files containing a single column you get an n x m matrix (or nested list), for files containing multiple columns you get an n x m x p 3d matrix.

Errors will result if the number of datum in each file is not consistent, though they may not appear until you try to manipulate or act on the variable alldata (see mathematica mini-memo: element wise operations).