Uncategorized

Simulating C&EN and JACS

I decided to make a robot that would Tweet fake C&EN headlines and JACS titles. There are many ways one could go about doing this. The way I decided to do it is to use something called Markov chains. This is similar to how your cellphone’s keyboard works: Your cellphone will try to guess which word you want to type next based on your previous history of typing. I’ll give an example below.

Let’s say I have fed these two headlines into my database

  1. “Novel Ruthenium Catalyst”
  2. “Ruthenium Based MOFs”

The Markov chain will think headlines should start with either the word “Novel” or “Ruthenium”. Now let’s tell the bot to roll the dice and start constructing a sentence.

The bot picks: Ruthenium

The bot knows that after the word Ruthenium either “Catalyst” or “Based” are typical. Let’s have the bot roll the dice again.

The bot picks: Catalyst

Now the bot knows that the word “Catalyst” is associated with a full-stop and there is no way for it to generate anything further. So from only two headlines the bot is able to generate something unique, “Ruthenium Catalyst”. Based on these rules and the luck of the dice “Novel Ruthenium Based MOFs” would also be a possible headline for it to make.

I fed a large batch of real C&EN headlines into a database, told my bot to go at it, and Tweet what it comes up with, and also grab the first image on Google Images if someone were to search for that headline. Here is an example

C&EN Simulator

Sometimes I get lucky and the story is funny, usually it just comes out nonsensical, absurd, or worse an actual real headline. You can befriend the bot through this link: @C&EN Simulator

Taking it one step further I also made a JACS bot based on the article titles I have been scrapping at ChemFeeds for the past 7 years.

You can friend the bot here: @JACS Simulator

The bots will update randomly throughout the day. If you have any questions for me leave them in the comments. I can open source the code if there is any interest in such things.

Mitch

By September 11, 2015 1 comment Uncategorized

How science lost one of its greatest minds in the trenches of Gallipoli



August 10, 1915. The Gallipoli sun beats down on the back of a Turkish sharpshooter. He is patient and used to the discomfort. He wipes the sweat from his eyes and peers back down the sight of his rifle, sweeping back and forth across the enemy lines. He’s hoping to spot a target worth taking a shot at as each muzzle flash risks giving his position away.

His sight settles on the shoulder pip of a second lieutenant. The target bends down out of sight, then reappears, now with a phone at his ear. He stands still as he sends his dispatch. It’s an easy shot for the sniper. He squeezes the trigger and yet another young man dies.

Infantry from the British Royal Naval Division in training during the Battle of Gallipoli.
wikimedia

The Turkish soldier settles down in his hole, pleased with his marksmanship. He wonders if he’s made a significant difference to the war effort (probably not).

However, he may well have caused the single most costly death of the entire war. His victim, now lying in a trench on a peninsula in Turkey, is 27-year-old Henry Moseley. The loss to science is incalculable.

Hidden patterns

Despite his young age, Moseley had already made a stunning contribution to chemistry and physics. It is thanks to him that that the periodic table looks the way it does today.

He had graduated from Oxford just five years before his death. Immediately after graduating he was employed as a teaching assistant by the great physicist Ernest Rutherford in Manchester. Moseley hated it, describing his duties as “teaching elements to idiots” and his students as “mostly stupid”. His real passion was research, so in his spare time he used his energies to set up his experiments.

Moseley was working in an era of physics that was concerned with the power of X-rays. The Braggs, a father-son team working in Leeds, were developing X-ray crystallography. This allowed science to probe the atomic structure of molecules.

But instead of jumping on that bandwagon – shining X-rays at crystals to work out chemical structures – Moseley turned his attention to the elements themselves. He studied the X-rays the elements gave off when bombarded with electrons. His results had major implications for the famous periodic table in which elements are presented.

Back in 1869, Dimitri Mendeleev arranged the elements in a logical fashion. He ordered them by weight and then laid them out in a table. Next he shuffled the dimensions of his table to take similarities of elements into account. For example, lithium, sodium and potassium have similar chemical properties and were arranged in one group on a line of the table (modern tables have been flipped so that these groups are now in columns).

Mendeleev’s periodic system.
wikimedia

Likewise for fluorine, chlorine, bromine and iodine. And so the periodic table was born. The elements were now arranged in a clear sequence – and each was given an atomic number denoting its position in that sequence. But there were a few problems, some elements didn’t quite fit the order. Their behaviour suggested one position in the table, but their atomic weight put them somewhere else. So the atomic weight and atomic number of the elements didn’t quite correlate.

In Manchester, and later in Oxford, Moseley took samples of all known elements, from aluminium to gold, and measured the X-rays they gave off after bombarding them with electrons. He discovered that each element emitted a distinct frequency of X-rays, and that this frequency correlated with the atomic numbers. When he plotted the square root of the frequency, against the atomic number everything fell into straight lines on his graph.

For the first time it became clear that an element’s atomic number, corresponding to its position on the table, had a basis in physics and was not merely a convenient label. And that these numbers (confirmed by Moseley’s measurements) resolved the previous issues with the periodic table. He also noted points missing from his graph and surmised that these gaps must be due to yet-to-be discovered elements. It was wasn’t until 30 years after his death that that the last of Moseley’s missing elements were discovered.

Nobel effort

Moseley’s achieved all this in a research career lasting just 40 months. At the outbreak of war in 1914 he signed up, becoming a signalling officer in the Royal Engineers. Had he survived, it is likely he would have been awarded the 1916 Nobel Prize in Physics (as it was no Nobel Prize in Physics was awarded that year). There is no telling what other breakthroughs might have been achieved in the alternative history in which he survived the war.

There is one more legacy that Moseley left. His death raised the question of whether great minds such as his should really be risked on the battle field. Despite the war, the international scientific community was outraged at the loss of such a renowned scientist, who still had so much to offer.

From then on scientists were used in a very different way in wars. For better or worse scientists in the next great war developed penicillin, radar, programmable computers and, of course, the Manhattan project. All these inventions had much greater impacts on World War II than any of the individuals involved could have made at the front line.

The Conversation

Mark Lorch is Senior Lecturer in Biological Chemistry at University of Hull.

This article was originally published on The Conversation. Read the original article.

By August 10, 2015 2 comments Uncategorized

Campaign for Clear Code starts here!





I’m concerned about the software that’s installed on my electronic devices.

You should be worried as well.

Have you really considered what you are opening yourself up to every time you download a new app or install an upgrade?

Have you thought about what all those faceless software giants are doing with the code that they are busy sneaking onto your phone?

Do you have any idea what they are slipping directly into your pocket? It certainly isn’t good for you. After all its not you they care about. All that really concerns them is profit, pure and simple. They want you coming back for more, why else would they make those damn games so additive?

Screen Shot 2015-05-08 at 21.26.12

And has that code even been tested properly? They claim it has, but why then does big software continually release patches and updates?

Just stop for a minute and ask yourself this. Do you really know what you are putting on your computer when you downloaded Candy Crush? Have you ever seen the code?

Take a look at this.

“;
for(i=0;i<=20;i++)
{
f=random(3);
z=random(3);
if(tic[f][z]==’ ‘)
co-ordinates
{
tic[f][z]=’O’;
goto x;
}
else
continue;
}
x:newdisp();
d=check();
if(d==0)
user();
else
{
cout<<“

Understand it?

No, me neither.

Want to know where that snippet of code came from? Its just a small part of a computer program for tic-tac-toe. And if a game as simple as that has stuff like that in it then imagine what’s in Candy Crush, Angry Birds or even Powerpoint?

And it gets worse. Because some computer programer, in the pay of cooperate giants, writes this sort of thing before processing it into something that might not even contain recognisable words! The software companies call this ‘compiling’ and afterwards its bears no resemblance what-so-ever to the natural code.

I, for one, won’t stand for this sort of thing being foisted on me by big-software any longer.

Now is the time to take a stand.

I call for a campaign for clear code.

Basically, if a 10 year old child can’t code it then it has no place on my devices.

From this point onwards I’m reverting back to simple code that anyone can understand. I’m using nothing more than Scratch running on a nice wholesome Pi. I urge you to do the same.

And don’t even get me started on anti-virus software. Much better to share infected USB sticks around.

By May 8, 2015 3 comments fun, opinion, Uncategorized

What has Chemistry got to say?

The XKCD comics have been keeping me entertained and informed for years.

But sadly, in the latest comic, Chemistry seems rather quiet.

So how about some suggestions for the next panel, where Chemistry finds a voice?





 

By May 5, 2015 2 comments fun, Uncategorized