Category Archives: Programming

Diffraction Grating Orders Calculator

Diffraction gratings are used in optics to split light into multiple paths. The number of diffracted orders and the angles they are seen at vary depending on the angle at which light hits the grating, the spacing of the grooves in the grating and the wavelength of the light used. I wrote this Javascript app to save me time while performing some calculations for an experiment for my PhD, I had to find the best angle to set the grating at for several wavelengths of light so that I could use the reflected orders.

I wanted an app that didn’t just tell me what orders were present and what angles they were at, I wanted to be able to more easily visualise them. I needed to be able to easily select the grating properties as well as the wavelength of light used, since for my application I was using several light sources all of different wavelengths.

Diffraction Grating Order Calculator. It’s on a separate page so that there’s more space available than in my main website’s layout.

Diffraction Grating Order CalculatorThe app was written with Javascript and a Javascript vector graphics library called Raphael.js. It was my first time using either of them, Raphael was excellent, the demos are really impressive.

The Raphael parts were fairly straight forward. The hardest bit was getting the HTML to play nice with all browsers. Time to start my next app now, I’m hooked! Email with any suggestions for others, be they educational, time saving or commercial, I’d be interested to hear.

 

WordPress Plugin Subscribe2: Removing the “Unsubscribe” button.

I wanted a way to allow visitors to my blog to subscribe to it and get email notifications when I updated it with something new. Subscribe2, a plugin available on the WordPress site seemed like just the ticket. It installed easily and worked well with no tweaking, however I didn’t like unsightly “Unsubscribe” button that it added with the subscribe button.

Having looked around online I couldn’t find a tutorial or post on how to remove it, so decided to work it out myself and post this here in case anyone else had the same problem.

Read more »

Total Views 2nd Run

I ran the total views script for the second time today. The Top Trumps collaboration I did with gmjhowe and some others pushed my total past 150k total views.

While on the subject, the Top Trumps ‘ible has now had 20 sales. We’re going with a print run of 50 tomorrow to raise some money to pay for some awesome projects to have on our stall at Maker Faire in 2011. Selling 50 packs should net us about £50 to spend on printing instructions and buying some supplies.

Instructables Total Views Group

Back in November I started playing with using Perl to scrape data from Instructables.com. I saw lots of information that was scattered around that would be useful to members of the site if made available to the. One of the first scripts I developed was one to visit all the instructables of a user and tally up the views of each to give a total. I asked users to subscribe to me and in return I ran the script on them (link), showing them how many total views they had.

In the latest incarnation of this script I created a group for people to join. The new script, run on the 1st and 15th of every month reads the members from the group and scrapes the data from their instructables for each, dumping it into a .TSV file. Twice a month I will be running this script and handing out the following cartoons by Caitlinsdad as patches as people pass the 50k, 100k, 250k, 500k and 1m views marks.

Tomorrow (1st June) will be only the second time it’s been run so we’ll get to see some interesting stats on who’s count has grown the most.