Dual Booting Laptop: Win7, Slackware

September 10, 2009

Bam! School’s in. The inevitable has happened and the most hideously busy few months of my educational life have begun: the university applications term. And to support this packed timetable I reckoned I’d need some pretty decent technological backing. In other words Windows Vista had to go.

I’d been wanting to rid my laptop of this slick but extremely ungainly and messy monster for some time (ever since I bought the laptop actually) – it crashed at a very embarrassing moment at Young Rewired State (plugged into a projector in front of a big audience with lots of media cameras pointed at me…) which was probably the last straw for me, and it’s had reliably frequent networking issues (wifi and ethernet took it in turns to fail). After testing out Win7 on old machines and liking it, I decided to go for a dual boot with Win7 and Slackware – my opinion is that Linux shouldn’t be all about Ubuntu, Fedora and Debian and I reckoned this would be a good opportunity to give a less mainstream distro a try. There was of course a snag: the main reason I held off uninstalling Vista was that I had a setup of Firefly installed (for my freelance work) which had taken literally half a day to set up so I wasn’t too keen on losing that; clearly virtualisation is the key to the problem here. So I created a new VM in Virtualbox and installed Firefly and supporting software (SQL server, IIS etc.) onto that.

So I backed up my data and installed Win7 and Slackware side-by-side. The last thing Vista did for me was crash while trying to resize a partition so I took a chainsaw (= cfdisk) to my HDD and annihilated Vista. OK I’ll admit the reason I deleted Vista was because I screwed up and hit ctrl+c while cfdisk was running … oops. And I somehow managed to forget to install LILO (boot manager) at first so started off with no boot OS which was just a tad concerning … but in the end everything worked out! I’m using a ~100GB NTFS partition for Win7 + Windows programs. Slackware has ~20GB of ext3 and there’s a 100GB NTFS data drive.

Partition Table for my HDD. In hindsight I should really have used a separate partition for Windows programs and a swap partition. Oh well...

Partition Table for my HDD. In hindsight I should really have used a separate partition for Windows programs and a swap partition. Oh well... Click to embiggen

VirtualBox running in Slackware. Its so much more convenient using virtual machines - they can be transferred from Win7 to Slackware or my desktop or even to someone in China; the portability factor is seriously useful

VirtualBox running in Slackware. It's so much more convenient using virtual machines - they can be transferred from Win7 to Slackware or my desktop or even to someone in China; the portability factor is seriously useful

Linux on laptops, especially Slackware, is all about hackery and cool stuff so I’m hoping to implement sometime soon multitouch gestures (which Mac users have) and customise the OS beyond recognition.

Goods

I was also apprehensive that Windows 7 would fail to realise my laptop has a wifi card thus negating the entire point of the operation, but in the end everything works and wifi was set up as part of the installation process; even standby and hibernate which always crashed the computer in Vista work in Win7! Every time I use the OS I find some small but hugely awesome new little feature that makes me love it just that little bit more. MS have got it right this time in my opinion and I hope it sells well. And I couldn’t help but feel just a little smug when one of my friends came in with a new laptop with Vista on it complaining to me about a wifi failure…

Slackware’s also pretty great – it installed literally in about 15 minutes. I was slightly annoyed at first that it doesn’t have a package manager like apt-get or yum (or at least I can’t seem to find one) but actually now I find svn and make/make install more than adequate substitutes; although installing software is now a lengthier process I get up-to-date packages and have more control over installation. Even better (for me), Slackware starts with a command line and the GUI has to be started manually. So next time someone asks to borrow my laptop to check email be warned: you’ll be using lynx!!

Problems

There are still two things I can’t work out:

1. I’ve got all my Virtualbox information in the shared drive and I’ve managed to boot VMs in both OSes. However if I save the machine state in Win7 and then boot into Slackware it doesn’t seem possible to restore that saved state. If I run that state-saved VM in Slackware and save a new state then return to Win7, Win7 restores the state saved in Win7, not the one in Slackware. A perplexing problem – google time methinks.

2. Linux in general is allergic to Intel Wifi cards. Enough said; though I managed to connect through wifi in Backtrack 3 (not 4 beta though!) so maybe if I do a little driver shuffling it might work eventually.

Overall I’m pretty pleased with this. I didn’t intend to do much advertising in this post but I would certainly recommend Win7. At least give the RCs a try – it is *so* worth it. And having two very good OS’s should give me a huge amount of freedom: Win7 does what I *need* and Slackware does what I *want*. Perfect.


Young Rewired State

August 23, 2009

I’ve spent the last two days at the Google HQ in London attending Young Rewired State [hit link for more info about event] (#youngrewiredstate), and it’s been nothing short of epic.

And of course, I’ve taken some photos.

The schedule (shamelessly copied from the site) was as follows:

Saturday 22nd August:
10:00 Start
10:30 Planning session
12:30 Lunch
13:30 Hacking starts
17:30 Dinner
18:30 Home (Hacking overnight allowed!)

Sunday 23rd August:
10:00 Back to hacking
11:30 Brunch
12:30 Back to hacking
16:00 Presentations to Judges and Press
18:30 Prizes announced

On the first day we split into groups and started thinking up ideas. At about 4pm we finally settled on our idea: to make something very similar to RentACoder, but much simpler, targetted at talented coders who need experience in order to get a proper job. Here are a couple of screenshots of the final result (click to embiggen).

We decided on a PHP/MySQL project and as luck would have it, I was the only PHP/MySQL programmer in the group! So it was fairly frantic work (solid coding from 10 till about 3 on the last day) and we ran into all sorts of problems with versioning and people overwriting each others’ work in FTP, especially as the CSS people tended to be working on the same files as I was at the same time!

IRC

As with all hack days, IRC was one of the most important methods of communication. Literally everyone had their laptops out during talks, especially during the presentations at the end and there was a fairly constant stream of chatter on the channel. @samhale123 also put up a bot on the channel to tweet things over IRC – we had several hours of fun attempting to overload the script / twitter / the server!

Immaturity with Twitterfall

Immaturity with Twitterfall

Google

Google is an amazing place with by far the best decor I’ve seen in a company building. The floor is laid out like the London underground and the meeting rooms are more or less in the right place for stations (with consistent naming). There are ducks on the ceiling and random awesome other bits of furniture / decor adorning the walls / ceiling / floor.

We were also given a load of Google freebies, including Google yo-yo’s, Google cakes, Google water, Google pens, Google notebooks…

This actually was a telephone box!

This actually was a telephone box!

Google and Youtube Cakes

Google and Youtube Cakes

People

Of course it was a floor full of geeks, which essentially means a brilliant selection of geek T-shirts (I spotted several from ThinkGeek, at least one from the xkcd store…). The mentors (helping out with coding / guiding the groups) were also working in all sorts of fantastic companies; one of our mentors is working at last.fm, one at moo, one with the BBC etc. And needless to say there was a wide array of OS’ – the large majority seemed to be using Macs, those with PCs were probably split 50/50 between linux (mostly ubuntu, one debian that I know of) and windows.

There was also a brilliant selection of judges, including people from Wired (for some reason looks very familiar; came to school to give a talk maybe?), C4, etc.

Some of the judges

Some of the judges

The presentations were good fun – there were something like 40 people from the press / outside making the buzz all the more exciting. And we (@workforpeanuts) won the “Wish I’d thought of that” award!

Anyways, this is the first hack event that I’ve ever been to, and if this is anything to go by, I’m definitely game for another at some point. Heck, maybe DEFCON next year… *MANY* thanks to @hubmum for organising such an amazing event.

And I took other cool photos so go for it and browse!


Quantum Computing Work Experience – Week 2

August 21, 2009

Today concludes another fantastic week working at Imperial. This post will probably be a lot less massive than the previous one owing to time constraints (I’ve just come back from several exhausting hours of rock climbing at the Westway and Google Calendar tells me I have my driving theory test at some point in the near future).

Firstly, some pics to support stuff from my last post.

The entire table looks like this - I can understand why everything needs to be realigned and tweaked every 15 minutes for the experiment to work! The two blue lasers are I think the main cooling lasers, pumping from the ground to the high energy levels of Ca+.

This is a used Cu O-ring (actually called a gasket) - you can easily see where the knife edge bit into the Cu making a vacuum seal

This is a used Cu O-ring (actually called a gasket) - you can easily see where the knife edge bit into the Cu making a vacuum seal

A top view of the laser setup. You can see the diffraction grating (with an arrow drawn on it) and the connections to the piezo behind it. Click to embiggen.

A top view of the laser setup. You can see the diffraction grating (with an arrow drawn on it) and the connections to the piezo behind it. Click to embiggen.

Equipment

Tantalum Oven

This is the equipment used to produce neutral atoms which are to be ionised.

The oven is suspended between the two electrodes by a Ta wire. The Cu foil is there for a test run of the oven - if it works we should be able to see a spattering of grey Ca on the Cu.

The oven is suspended between the two electrodes by a Ta wire. The Cu foil is there for a test run of the oven - if it works we should be able to see a spattering of grey Ca on the Cu.

This is the plate on which the entire experiment (ion trap, oven and all) will sit. It will get inserted into one of the holes in the central 6-way cross can.

This is the plate on which the entire experiment (ion trap, oven and all) will sit. It will get inserted into one of the holes in the central 6-way cross can.

When I first heard they were going to use an oven, for some reason I imagined some sort of miniature baking oven that somehow emits atoms when turned on! The actual oven is actually a tiny 1cm long tube of tantalum (Ta), sealed at one end by essentially squashing the end, with a tiny hole in the middle of the tube. Ca shavings are stuffed into the open end before the oven is closed, again by squashing. The whole oven is attached by a piece of Ta wire to two electrical contacts across which a potential is applied. The Ta conducts current and heats up, acting as a heating filament. The Ca heats up and the most energetic atoms spit out of the hole (the process is basically evaporating the Ca at very low pressure and high temperature).

I asked why Ta is used – presumably Tungsten (W) has virtually the same properties in that it heats up when current flows through it, and since W is the metal of choice in light bulbs, presumably it’s cheaper? Apparently W can indeed be used; for such applications the criteria for metals are that they are UHV-suitable (don’t trap/adsorb other molecules/atoms on/to their surface which subsequently outgas, ruining Ultra-High Vacuums) and won’t melt at high temperatures. However Ta is normally more suitable than W because it’s more malleable (whereas W is very springy) and can be easily spot-welded (to stick the wire onto the oven). However thoriated W is better than Ta as an electron source since the thorium gives it a much lower workfunction, allowing more electrons to pop out for the same energy input.

Vacuum Pumps

In my previous post about this work experience I omitted some detail on the pumping that I learnt this week. As it turns out, the actual pumping requires three pumps. The first is a roughing pump, to get the pressure down to a very rough vacuum (~10-2 mbar). Here they were using a rotary vane pump:

This image was nicked from wiki

This image was nicked from wiki

Essentially as the off-centre internal cylinder turns, the vanes get longer / shorter accordingly such that the pressure at the input is always getting lower and at the output it’s always getting higher, forcing the air out of the output. The principle is essentially PV conservation.

The second stage is a turbo pump which is basically an electrical version of the intake fan of a jet engine. It spins extremely quickly (so quickly that it requires a low pressure to operate lest it smash itself to pieces) and the idea is that it spins so quickly that any molecule that hits a spinning blade hits the part of it such that it gets kicked outwards, away from the vacuum. This gets the pressure down to about 10-5 mbar. The final stage of course the ion pump.

When air is pumped out the can sits in an oven - the idea is to heat up anything that can outgas while pumping, making it outgas more, thus getting rid of outgassable stuff

When air is pumped out the can sits in an oven - the idea is to heat up anything that can outgas while pumping, making it outgas more, thus getting rid of 'outgassable' stuff

Wavelength Tuning using Iodine

There are several ways of tuning wavelength (I wrote something about the cavity method – setting up a standing wave – in my previous post), but I found this way of doing it particularly interesting. Like all other elements, iodine has a certain absorption spectrum, a feature used in star spectroscopy to determine elemental composition. But instead of doing what astronomers do (measure wavelengths to identify elements), here we were using a known map of iodine’s spectrum to tune the wavelength: light shining through the iodine has a certain attenuation which is dependent on the wavelength (owing to electron energy levels). By shifting the wavelength around using a piezoelectric it is possible to obtain a local iodine absorption spectrum (wavelength against intensity). By comparing this local spectrum with an ‘atlas’ – iodine’s spectrum for a large range of wavelengths, it is possible to locate the local spectrum within this atlas, thus identifying the wavelength. Apparently a narrow band of local spectrum is sufficient to identify a unique location in the atlas: there are no ‘repeats’. Whether this is non-repeating property is specific to iodine (hence its use) I’m not sure; the isotope used is radioactive so there must be some really good reason to want to use it!

Techniques and Procedures

Saturated Absorption Spectroscopy

All atoms radiate photons. However in a cloud of atoms these photons are affected by the Doppler shift owing to the random movement of the atoms, and a graph of frequency against intensity (basically a spectrum) shows an underlying distribution for this radiation. However the interesting bit of spectroscopy occurs on the surface of this curve, in the form of ‘ripples’ on the underlying curve’s surface. While a human can normally see the ripples roughly by eye, the underlying curve gets in the way of accuracy.

The solution is a method of somehow obtaining the underlying distribution without the ripples using lasers and subtracting this curve from the spectrum, resulting in a graph of just the ripples. I’m still clueless as to precisely how this works / is performed since I didn’t personally bear witness to the process (I heard something about matching lorentz curves to points but that was probably more to do with analysis of the ripples rather than the process of saturated absorption spectroscopy) so it looks like some wiki-ing is called for.

Walking the beam

This isn’t some physicist’s attempt to be a pirate and getting the words muddled; it’s actually a rather clever (though extremely time-consuming) method of aligning a laser beam. Bascially the ideal situation is a laser beam passes precisely through two points. This is very difficult to achieve with just one stand so a setup with mirrors is necessary. Here are several different failed attempts at diagram-ifying the thing:


The dotted lines were added by me to show where the beam will go

The dotted lines were added by me to show where the beam will go

At each of the two points the beam needs to go through an adjustable iris is placed (think circular doors in sci-fi films), and mirrors alpha and beta (making up the periscope) can be adjusted so the beam’s height (h) and angle of elevation (e) can be adjusted more or less independently. Then the following two-step process is iterated until the beam is almost exactly where it needs to be.

1. Open B completely, close A so it becomes a tiny hole, and adjust the laser so it goes through A using mirror alpha
2. Open A, close B so it becomes a tiny hole, and adjust the laser until it goes through B using mirror beta.

Illustrations of the steps are as follows:

For some reason it reminded me of numerical analysis / Newton Raphson type things – constantly optimising and getting closer and closer to perfection yet never reaching it. GL’s cobweb illustration of numerical analysis seemed particularly similar to this situation. Anyways while I quite like how it works, walking the beam does start to lose its novelty after doing it for a couple of hours…

Scanning Tunnelling Microscopy

Danny also explained some awesome stuff on this and how it works. Basically the idea of STM is to use quantum tunnelling calculations to make a map of a surface. A probe is held (say at +5V) very near a surface (grounded), and owing to quantum tunnelling, a certain current flows between the probe and the surface. This current is proportional to exp(-l) (or something like that) so it is possible to measure l to a very high degree of accuracy. As the probe is scanned across the surface, a matrix of measurements of l against (x,y) can be created, thus mapping the topology of the surface. This mapping can in fact be so accurate that it can pinpoint individual atoms sticking out from / adsorbed to an otherwise flat surface.

Conclusion

The last two weeks have been nothing short of awesome. I’ve learnt (and sometimes noted down) many new things on every one of the last ten working days and I’ve recounted here and in last week’s post merely a handful of the more interesting bits and pieces. I even solved an apparently insurmountable practical problem thus moving the entire scientific community forwards! I mean … I came up with a (pretty good) solution to unscrewing a stuck nut… Many thanks to Danny Segal for giving me such a wonderful opportunity.

There is one thing I still can’t work out though:


Quantum Computing Work Experience – Week 1

August 14, 2009
5W Green Laser used for pumping Titanium-Sapphire Laser

5W Green Laser used for pumping Titanium-Sapphire Laser

I’ve been looking forward to this for quite some time – two weeks of work experience in a lab at Imperial College working with some PhD students with an ultimate goal of making some progress towards the construction of a quantum computer that doesn’t take tens of man-hours to perform each calculation. After a week I feel I’ve learnt a lot about formal lab work and large-scale experiments (*slightly* different from the 20-minute assessed practicals from AS!) and about the general physics and concepts behind some of the experiments and equipment – I’ve been (not so) conscientiously filling pages of my notebook with messy notes and cryptic diagrams so hopefully some of the stuff I write here will make some vague sense and not quite directly contradict truth.

There are also several interesting bits and pieces lying around the place. There’s an enormous Newton’s Cradle in which each ball looks like it could be heavy enough to be a ship’s anchor. There are also enormous capacitors lying around everywhere for the people working on high-density fluxes.

Capacitor banks lying around

Capacitor banks lying around

The Building

The Physics / Maths / Computer Science part of Imperial is somewhat bizzarre – from what I gather it consists basically of two adjacent buildings which were built at different times and were haphazardly connected together by knocking down bits of walls. Unfortunately the actual floor levels are out of alignment and the floor heights are also different, which means there’s a crazy staircase joining the two buildings together and floors 6 and 7 in one of the buildings had to be rechristened 6 and 6M for the sake of keeping the numbering consistent with the lifts. There are also only connections on certain floors of each building so it’s possible to leave the Blackett Lab on the bottom floor, go up one level and be confronted with a solid-looking wall where the connection should be. As if things aren’t crazy enough, there’s a set of lifts placed almost exactly at the junction (so to speak) between the two buildings, making it really confusing to navigate the whole 3D maze. It’s pretty good fun actually!

The Lab and Equipment

Optics

I was quite surprised when I first saw the lab – I was expecting a Leonard Hofstadter style lab (as seen on The Big Bang Theory) but actually quantum computing with ions (ions therefore being the main focus of most of the projects which I’ll come to later) involves a fairly large amount of optics work, so each of two adjacent, connected labs I was working in has an optical table as its centrepiece littered with lasers and ridiculously complicated setups of mirrors and lenses which have been tuned very accurately to direct laser beams into tiny optical fibres and whatnot. Speaking of accuracy, the setups are so sensitive to small shifts that they need to be tuned almost constantly. The PhD students told me they detect a lot more drift during the daytime when other experiments are going on in other labs which release radio waves and traffic is rumbling overhead (despite being two floors below ground level and over a block away from a small road) than at night when there is less activity.

The equipment is also sensitive to tiny temperature fluctuations. Most of the lasers are basically diode lasers:

It’s a fairly standard laser setup in which electrons and holes come together in the depleted region between n and p type semiconductors and then either wait for a nanosecond or so before annihilating and releasing a photon (spontaneous emission) or get hit by a photon, resulting in stimulated emission. What was experimentally interesting was that the cavity length in fact determines the wavelength of the laser owing to the fact that a standing wave needs to be created which ‘fits’ exactly in the cavity (a whole number of half-wavelengths need to fit in the cavity) and this is sensitive to temperature. So each laser box has four BNC sockets: one for providing the laser with electricity, one for a thermistor which is hooked up to a feedback loop system which regulates temperature using a Peltier junction heat pump (which occupies another socket on the laser), and one for a piece of Piezo (placed on the diffraction grating) which can change width depending on the voltage across it (or maybe current through it, or something) thus allowing the cavity length to be adjusted, though my suggestion to manipulate the piezo in the feedback loop to compensate for temperature changes would fail since the temperature-dependent expansion of the cavity is several orders of magnitude greater than anything the piezo can correct. When I heard that I was pretty astonished the laser cavity had to be adjusted to such an exact length – several orders of magnitude more exact than the expansion of a bit of metal when raised by a few degrees. The entire laser is covered by a thick black piece of foam to protect it from temperature fluctuations in the room.

Electromagnets

It was pretty cool to find out that I was to be working in the same room as a 2.5 Tesla electromagnet! Ion trapping, as I will also come to later, involves not only charge and potential fields but also magnetic fields, so the Penning Trap the researchers there were using was sitting inside an enormous superconducting electromagnet.

The superconducting electromagnet uses liquid He to keep cool – as a sidenote I asked why they (and CERN) use cool superconductors (more expensive liquid He) instead of the more recently discovered crazy warm ones (cheap liquid N2); the reason is because above a certain current, superconductors end up failing and develop some resistance causing heat to be produced resulting in a quench (the He boils off, expands to something like 15x its volume and the whole can explodes in a fit of freezing fury), and the cool superconductors can carry a much higher current before this happens, allowing more powerful electromagnets. Of course this comes at a very high cost. As can be seen from the diagram, the He (at ~4K) is shielded from room temperature by a layer of liquid N2 (at a balmy ~77K). The He needs to be replaced about once every couple of months, while the N2 is replaced about twice a week. The superconducting coil, power supply and cables are eventually going to have 80A coursing through them – a truly formidable current!

Refilling with N2

Refilling with N2

N2 is very cold!

N2 is very cold!

Apparently the way they get the electromagnet to start conducting current is to simply arrange the coil in a loop – they can’t expose the 4K superconductor to air, so it is necessary to induce the current in the superconducting coil. Once this is done, the power supply can be switched off and the current in the superconductor just keeps going round (owing to the lack of resistance), allowing a very strong noise-less magnetic flux to be produced (the flux’s precision is something like 10-6%)

Vacuums

This was particularly new to me. I’d never worked with 2.5 Tesla or 5W lasers before, but while I’ve come across magnets and lasers in experiments, I’ve never really observed experiments involving vacuums before (apart from the bell-ringing-in-a-jar/gerbil-squeaking-in-a-jar one to show sound doesn’t travel well through a near-vacuum). There’s a lot of novel (to me) and interesting experimental stuff that goes on here.

Basically the idea of creating a seal when joining two flanges together is to use a copper O-ring. Each flange has a ‘knife edge’ (90° very sharp edge) and when they’re pressed together with a Cu O-ring in between, the knife edges cut into the soft Cu; thus the Cu itself becomes the seal.

While flicking through Inward Bound by Abraham Pais (recommended by CAPS) I read about various attempts at making a good vacuum pump. Modern technology has come a long way since the mercury-filled jar, and now creating a very good vacuum is a multi-stage process. First all the equipment is cleaned thoroughly – for some reason fats and oils from people’s hands (for example) are disastrous for a vacuum so everything needs to be wiped squeaky clean with something like acetone or isopropanol. Then everything is sat on the optical table which has a source of clean dust-free air on the ceiling which constantly blows on the equipment, keeping dust off and constantly cleaning it of bits of dust that have settled. Then everything is put together using gloves, nuts, bolts, Cu O-rings and *a lot* of effort (believe me, putting flanges on sideways while stopping the Cu O-ring from slipping out is infinitely more difficult than measuring SHM of a cork in a tub of water – reference to AS practical; one of the researchers also described putting He into the cannister having first cooled it sufficiently to stop everything boiling off immediately as a dark art rather than a science). The air is pumped out using a conventional pump until the pressure inside is something like 10-6 millibars, at which point an ion pump is turned on to essentially evacuate the remaining air molecule by molecule. The pump essentially ionises the gases inside the chamber and use charged plates to attract them out. The final result is a very good vacuum.

The Projects

Photon Ionisation

There was a MSC researcher from Germany sharing the lab with the PhD students from Imperial, and he was working on a different method of ionisation. The supervising prof, Dr Danny Segal (a reader in Quantum Optics), explained that the previous approach to getting ions was to use a ’splat gun’ approach – basically a stream of neutral atoms from an oven hits a stream of electrons from an electron gun, and those electrons will tend to knock out some electrons from the stream of particles, resulting in a few ions. This has a few problems: lots of atoms never get ionised so end up getting deposited on the side of the chamber, screwing up the shape of the potential well in the ion trap; lots of electrons end up floating around in the chamber and get deposited on insulators, again causing irregularities in charge distribution.

The German MSC researcher was working on using photons to create these ions – a much more tenuous stream of neutral particles is projected into a beam of photons which, via the photoelectric effect, knock out electrons creating ions. This should have a higher rate of ionisation leaving fewer ‘waste’ atoms sticking to the inside, and the number of photoelectrons knocking around the chamber should be much lower than the number of electrons being shot from the electron gun. I suggested the photons might knock electrons off other bits of the apparatus, again screwing up the flux; apparently this should happen infrequently enough to allow a reasonably controllable flux, though some researchers using a Paul trap (involving an oscillating EM field) apparently detected ionisation using photons of the wrong frequency for direct ionisation leading them to believe electrons were being knocked from the apparatus and these, accelerated by the oscillating field, slammed into atoms causing ionisation.

Anyways the setup was more or less thus (a picture is worth a thousand words):

The way to ionise these Ca atoms is to first use a laser to excite the atoms – push some electrons up to a higher energy level. The UV LED then does the actual ionisation from that energy level. The picture above is of a half-finished setup (optics haven’t been sorted out yet and there are two unsealed flanges).

Laser cooling

GSM/KPZ gave us an article in class last year about laser cooling (‘Cool things to do with lasers’, Ifan G Hughes et al 2007), and it turns out it’s useful for Quantum Computing – a jittery ion is presumably pretty bad for physicists who want a stable wavefunction. Well, here’s the setup.



Click to embiggen

It’s in fact mostly about using lasers to manipulate electron energy levels in a Ca+ ion:

The Ca+ ion has an energy level electrons can fall down to (RHS of diagram) where they would stay for quite long before falling back down which is undesirable considering the cooling involves shuttling electrons between the leftmost levels (in the diagram). So four red lasers are required to pump those back up to the top energy level.

QED

I’m not really sure what’s going on in this experiment but basically, since QED is only significant at high charges (something like that), the researchers go to GSI to conduct this research. The idea at GSI is to slam super-high energy ions through a gold foil which apparently strips them of all electrons. Different ions are separated via a very similar system to how a mass spec works.

Some Other Physics-ey Stuff

Ion Trapping

There are of course lots of different methods of trapping ions – I mentioned one in my post about the UCL antimatter lecture. Apparently it’s provable from Maxwell’s equations that it is impossible to create a static 3-dimensional potential well to trap ions, so there are currently two main methods: using a purely electromagnetic system (using either some feedback system to wobble the ions towards the centre of the trap or a constantly oscillating field like in a Paul trap), or to use magnets:

A cation is sitting at the bottom of a potential well in the z direction. It is surrounded in the xy plane by oppositely charged plates. As it is attracted to the plates, the z-directional magnetic field causes it to move in a circular motion (as seen in cloud / bubble chambers to determine momenta of ejected charged particles), represented on the diagram by ‘micro OOO’. The charge on the plates are then somehow tuned to make the large-scale motion of the particle resemble a circle and so it eventually loops back on itself, so its path shape looks like what is labelled in the diagram as ‘tuned, get O’

The Ca+ Ion

The actual quantum computation to be done with the Ca+ ion (not a typo: just one +; this isn’t chemistry!) involves electron energy levels. An electron can be in one of two energy levels, and that is the qubit. In Ca+ there are two more or less independent distinct situations in which an electron can be in one of two energy levels, allowing two qubits to be encoded into one ion.

The use of this isn’t only to cram more qubits into fewer ions (I read a research group somewhere is making base-5 ‘qudits’ using microwaves and superconducting things) but also to allow easier entanglement – since both qubits are in the same ion it’s supposedly easier to make them interfere in a predictable manner, which allows a quantum NOT gate to be set up which is critical to quantum computing; supposedly only two research groups in the world have managed to get this quantum NOT gate to work.

Ion hopping

The biggest limitation apart from the sheer fiddly-ness and slowness of everything in the quantum computing world is the fact that it’s impossible to put more than about 8 ions in one trap before they start screwing up each others’ wavefunctions. The PhD researchers had previously been working on a solution to this problem that the theorists came up with – getting the ions to hop around in the trap, thus manipulating each ion more or less individually. This has already been done using Paul traps (I think) but the researchers here were trying to use Penning traps and show they are in fact better for quantum computing (or at least can do the same things as Paul traps).

Overall

There’s a lot more I would say if I had the time but as with all blog posts, you’ve got to stop somewhere. But overall I’ve never done modern practical physics before (at UCL we looked at some particle traces on the computers which is the closest I’ve really got so far) so this is a pretty damn amazing experience for me, hence the mega-post.

Introducing: the worlds smallest allen key!

Introducing: the world's smallest allen key!


Aerospace Challenge Finals at Cranfield

August 1, 2009

Last week I was in Cranfield participating in the Aerospace Challenge Finals. The challenge this year was to come up with a design for a device to drop humanitarian aid accurately (within 20 metres of a target) from 3000 metres up. Our idea managed to make it to the finals which turned out to be a week of lectures on general aerospace engineering, activities and flying! Photos are here.

Flying

Each person got two flying experiences, both of which included some time piloting the aircraft: about 10-20 minutes in a helicopter and about half an hour in a fixed-wing plane.

My first flying experience was with a small Robinson helicopter, which can only really be described as terrifyingly, exhilaratingly awesome. The pilot managed the take-off which was one of the most breathtaking experiences I’ve ever had – in a helicopter you’re literally sitting in a big transparent flying bubble with the engine behind you, so the view and experience is truly amazing as the land falls away beneath you… I later took over and found control extremely difficult – even a tiny movement of the stick causes the vehicle to tilt violently in that direction making a beginner like me very prone to overcorrection leading to a serious case of increasing-amplitude SHM! The actual stick is situated between the pilot and the copilot and a rotating handle is stuck on the end allowing dual control, so my rather flailing and uncontrolled flight was abruptly and expertly rectified when the pilot took control (though not before I turned and prepared to land by erratically lurching towards a patch of grass). The pilot then demonstrated some cool things one can do with a helicopter including skid landing and take-off, going backwards and sideways while spinning etc.

Here you can see how control over steering is shared between pilot (me) and real pilot (instructor)

Here you can see how control over steering is shared between pilot (me) and real pilot (instructor)

The next day I got in a PA28 – my first fixed-wing experience. The pilot had to go through an enormous list of things to check before taking off and explained a little about what she was doing (mostly checking the engine could rev at certain RPMs and wouldn’t give out in certain situations, flicking on and off various lights and calibrating [and pointing at] instruments). The runway was also ridiculously long so she didn’t even bother with flaps for takeoff. This was much easier to fly than the helicopter and the dials and instruments in the cockpit didn’t obscure the view as much I had inferred they would from MS Flight Sim’s portrayal. I did a few rather ginger turns and pitch adjustments before relinquishing control back to the pilot who then demonstrated some steep banks, a stall (which sounded dangerous and seemed to imply the engine cutting out) and a dive (which was extremely cool). Later that week Matthew and I were inspired enough to ask about possible places to get flying instruction – flying has always been one of those things I’ve wanted to learn but I’ve always ended up not having enough time or money to start…

Here the instructor is doing a steep bank. She even did a pretty steep dive totally relaxed and with that pen in her hand!

Here the instructor is doing a steep bank. She even did a pretty steep dive totally relaxed and with that pen in her hand!

Me flying the PA28!

Me flying the PA28!

Activities

The week started with some group leadership exercises which consisted of attempting to place 30 cards in the correct pattern (easy) and work out the shape and colour of two missing shapes while blindfolded (hard) – both were much more enjoyable than I had expected from that genre of exercises.

The first engineering challenge we were given was an egg-drop challenge – the idea was to construct a package which will protect an egg from a drop of 4 metres. We were given limited materials and each material had a price; the idea was to make the cheapest package that doesn’t crack the egg. Our attempt turned out to be the most epic non-fail in history – literally seconds before the end of the construction phase we managed to pop two balloons which made us completely change our plan and in the last few seconds and in great haste we crammed stuff into a crumple zone and added a parachute … and it somehow worked and turned out to be the cheapest package (if wastage is deducted)! I guess that really proves the KISS principle: Keep It Simple Stupid.

The second engineering challenge was along similar lines – dropping aid – though it was from a more macro perspective. The game was called ‘airlift’ and sold by Elite – the idea was to plan an air route through several African villages which uses the least fuel, while dropping packages of aid which we had to construct out of wooden blocks, paper and tape while making sure everything fits in the cargo hold. The first thing I pointed out when time started was that both problems were NP-complete: the packing problem was almost exactly the same as the knapsack problem and the route planning was basically the Travelling Salesman problem with fuel added in as a factor. In other words we had to be either very good at intuitive problem solving or somehow get lucky. As it turned out, as perhaps a combination of the two, we somehow managed to come up with both the the optimum packing configuration as well as the best route, and finished literally as the final buzzer went – not bad!

The rest of the week was dotted with things like paper plane competitions (which included an awesome flying paper ring which seems impossible when you first see it fly), a game of (actual) CTF and some sports.

Lectures

Over the week there were daily lectures. Much as I would love to discuss them all here in depth I haven’t got that much time / space and besides most people aren’t as interested as I am in the effect of negative angles of attack… But I’ll go a little into some of the most interesting lectures.

Fly by Wire (FBW)

The problem for a long time had been that when going sufficiently quickly, adjusting the controls from the cockpit was really quite hard work – the air going past has so much momentum and the mass flow rate is so high that to change its direction by (for example) adjusting the ailerons requires a lot of force. To make things worse, at supersonic speeds a shock cone is developed (some awesome videos of this are on Youtube) – if this touches the aileron the stick can be wrenched out of the pilot’s hand. Some of these controls were partially solved by making the stick adjust small tabs in the wing instead of the entire aileron, reducing the force required to steer, and by making controls non-reversible (force on the aileron doesn’t affect the flying stick). There are of course some problems with these such as lack of ‘feel’ of the controls. So recently manual stick-aileron transmission was replaced with an electronic motor which receives instructions from the cockpit and adjusts the ailerons itself. Not only does this take all the strain off the pilot, but it also allows a computer to neutralise bad judgements on the part of the pilot such as initiating a sharp dive at 50 feet, implemented by a feedback mechanism from the aircraft to the computer. It also simplifies the cockpit – instead of filling the area with controls, dials an instruments, a computer screen with a joystick and throttle suffices to fly a FBW plane. I asked whether, since FBW significantly reduces the pilot’s direct control over the aircraft, FBW might actually make complicated manouevres more unsafe or indeed completely impossible. John Farley, who was giving the talk, said that, from his vast experience, pilots, however experienced, cannot really be trusted to fly planes safely all the time, and in fact he would feel safer trusting a computer’s judgement and letting a computer do such manouevres than a pilot. That talk also proves that a Boeing 747 probably has non-reversible controls so that scene in Snakes on a Plane (I think it was that film) in which the pilot asked the co-pilot to help pull back on the stick very hard was probably a load of rubbish. Not that you needed to be told that.

Basic Aerodynamics

One of the interesting things from this talk was the reasoning for why helicopters don’t go fast. There is always one part of the rotor going forwards, and if the helicopter moves forwards sufficiently quickly that part of the rotor travels at supersonic speeds generating a shockwave that could rip apart the rotor. In addition, even at lower speeds, there is an imbalance between the airspeed of the fowards-going part and backwards-going part of the rotor meaning a gimbal has to change the angle of attack of the blade depending on which way it’s going: the angle of attack of the rearwards-going blade has to increase to increase lift on that side otherwise the helicopter would just roll over. Of course, there is a maximum angle of attack this blade can be set to before it stalls which is about 20°. This limits the helicopter’s speed at subsonic speeds.

An RAF Hawk landed at the airstrip for us - here is the pilot demonstrating how the entire tailplane rotates

An RAF Hawk landed at the airstrip for us - here is the pilot demonstrating how the entire tailplane rotates

Automation and the future

This was probably the most interesting talk of the week; unfortunately it was cut short for us owing to a jetstream flight. Apparently currently pilots of Euro Fighters get sensor fused info presented to them in the form of advice as to what to do and they simply act upon that, which means half the time the plane is telling the pilot what to do: it is telling the pilot how to control it: semi-automation. Even in commercial aircraft a system called TCAS (Traffic Collision Avoidance System) senses other aircraft and advises the pilot on how to manoeuvre. There is clearly room for improvement: unmanned aerial vehicles are coming. This of course led to the whole humans v computers discussion but for every example of a pilot doing something heroic and saving the plane, there are several examples in which pilots screwed up and computers would have saved lives – Chris Roberts, the speaker, asked whether it *really* is desirable to have a pilot flying the plane, and whether the problem of pilots becoming de-skilled from letting the autopilot take over really is such a problem after all. I also found it very interesting and surprising that currently many landings of commercial aircraft are performed by the autopilot in low-visibility situations.

Anyways overall it was a fantastic week. Whatever the results of the competition turn out to be, I for one got a lot out of six days in Cranfield. I learnt a lot, made some friends, made some good contacts in the industry, and had some great fun relaxing in the English countryside!

Walking in the English countryside

Walking in the English countryside


Microsoft – Week 2

July 25, 2009

This week has gone pretty quickly and I’ve mostly been working on the text analyser / summary program. I even managed to take some photos! The week started with @dumbledad (= Tim) showing me some of the visualisation stuff he and an intern had been working on to visualise a book, some of which will appear shortly on a site somewhere… It’s all in the spirit of new and interesting data presentation in the spirit of Information Aesthetics and he sent me a link to some stuff he did on ManyEyes – word clouds (or ‘wordles’) comparing frequencies of words in narrative and speech. Some of the other ones are more difficult to describe but I’ll be sure to tweet link to them when they get published.

The idea of the summary program was that it split the book into sections then compared a histogram of word frequency densities in each section with another histogram for the entire book, then picked out the words which were most likely to be important to the section by choosing the most unusually frequently used ones. The problem with that was the program wasn’t picking out main characters because they were being mentioned all throughout the book. So I was to implement a system to split words into three categories: local to the section, local to the book (main characters) and common to the English language. The existing framework for a two-way local to section vs local to book had already been written so I was to implement the three-way split.

Factor graph showing the model

Factor graph showing the model

By Wednesday I’d finished the actual implementation so I started trying to invent a visualisation. My original idea was to have a ’story line’ (no pun was actually intended) along which various threads would undulate, and the further out from the story line they are, the more important they are; think of it as a radial graph – I think I was probably inspired by the RealPlayer (yuk, I know) ‘cosmic string’ visualisation. I built a really flickery version as a mockup which was approved, and since I was by then starting to shy away from WPF I ended up learning DirectX overnight to implement a final 3D non-flickery version of it. After spending a whole day stressing over the edges of the scene getting cut off and finally realising I’d set the camera’s maximum viewing distance ridiculously low, I finally got it to work, and after writing some homebrew bezier curve code it looked pretty good (if I may say so myself); Tim tells me he’ll probably add a screen video of it to the online display of visualisations so … watch this space.

Another excitement of the week was a talk from TrueKnowledge (= TK), an internet answer engine. It’s similar to the famous Wolfram Alpha (= Walfa); however in my opinion it actually has more potential. Walfa throws manpower at writing new code to scrape information from various different sources on the fly which essentially means the more information you want, the more you’re going to need to work. TK on the other hand stores information in an enormous database which has a structure suitable for storing any type of information, and although work is done to ‘crawl’ Wikipedia and other sources for knowledge, it also sources the community for information which means it can gather lots of important knowledge very quickly with minimal effort. It also has awesome features of natural language parsing (ask it ‘what colour are red cars’ for example) and it can also give you a step-by-step explanation of the logical process that leads to its final answer.

The bottom half of the screenshot shows TKs stages of logical inference

The bottom half of the screenshot shows TK's stages of logical inference

It of course differs from Walfa in that it hasn’t got a tonne of Mathematica code behind it – its strengths are in factual and inferred knowledge as opposed to evaluating integrals. It’s currently in Beta and has an API (yay!) so I strongly encourage anyone who has used Walfa to give TK a go.

On Tuesday the weekly Mexican food van appeared – until then I’d never realised quite how amazingly good burritos can be! While we were eating we started discussing presentation of text. The problem is that a conventional layout presents the reader with a formidable block of text interspersed with some images which is difficult to follow and annoying to read since one always has to alternate between studying the image and reading the text. However attempts at producing non-linear presentations of information such as embedding text into the image as tooltips or expandable areas of the image etc. have always resulted in people simply not reading very much of the text and consequently missing out important stuff. The best solution we came up with is using an old method of collapsible clauses, just like collapsible code. For example, if a relative clause which in this case is italicised and relatively long yet somehow doesn’t contribute much to the sentence thus merely adds length and unnecessary information to the text making the ultimate meaning more difficult to discern is considered superfluous to the meaning of the sentence, it could be replaced by a small button that only shows the clause if clicked – such ideas are particularly relevant to German sentences which tend to have huge diversions into clauses before the verb is revealed right at the end. This way readers can quickly get the gist of what’s going on so they may study the image in an enlightened way, then go back and expand the text to get the full meaning.

There are also a few things I noticed about MSR in general. There is a strong sense of company loyalty – all employees seem to use Bing, and everyone I’ve seen even goes as far as using IE instead of Firefox! Using only Microsoft products to perform tasks however did make me aware of the wide range of programs they do produce – they even have Virtual Machine software and an internal proprietary alternative to SVN. I guess it does help the developers of these applications a lot if they have an enormous internal test group: all the employees and interns. There’s also pretty close integration with Redmond (Outlook + Office Communicator + global WAN shares) so feedback could be quite efficiently delivered. The entire place also operates in the spirit of trust – all users have admin rights (necessary for developers anyway) – which is so much better than what is implemented at school: a highly restrictive policy which, despite recent changes for the better, still filters out most protocols (FTP included) and in fact, instead of preventing people from doing things simply makes everything so much more difficult to do. Now I have to connect through encrypted VPN to use FTP…

Anyways overall it was a great two weeks. I enjoyed it hugely, I didn’t need to touch Excel, I didn’t make anyone coffee and I didn’t do any filing (who needs paper anyway? It’s a software company!) – instead I worked on real (and rather cool) projects, learnt some useful things, and made new acquaintances.

In other news, I’m off tomorrow to Cranfield for the Aerospace Challenge Finals – I’ll get to fly (actual!) planes, take lots of photos and it should be another great experience. They’d just better have wifi, though I’m bringing my Alfa Awus (ridiculously powerful) along in case of weak signal!


Inovazone

June 25, 2009

It suddenly strikes me that I haven’t been blogging much recently. Exams finished several weeks ago but I have been somewhat busy.

In particular I’ve been working on a new site for a client, Inovazone. In the words of the site’s inventor, Alastair Darwood:

How does an invention go from a scribble on a page to a world-changing product that advances humanity? The answer is that at the heart of the invention there lies a set of distinct and crucial necessities that the invention is addressing … Until now, the only way in which necessities were discovered was through large companies carrying out expensive research, or a spark of genius from someone who suddenly sees one and thinks of a solution. Inovazone is designed to change this. The idea is that users of the site post their ‘necessities’ (short explanations of problems, ‘necessities’, they think need to be solved to benefit them (or humanity)), or rough outlines of inventions they would like to see and anyone can browse the necessities if they want to and look for interesting problems to try to solve through innovation. This could be in the form of an invention or simply a quick online response to the post on our comments system.

Interestingly enough, there doesn’t actually yet exist a site or system available to the general public that serves this particular function by providing a framework within which ideas for inventions are openly submitted and accessed, so I agreed to work on it, especially considering the core of submitting and displaying necessities is a relatively simple PHP/SQL project.

Submitting a necessity

Submitting a necessity. Click to embiggen

What I found particularly compelling was that, according to Alastair, everyone with whom he’s discussed the site has expressed enormous enthusiasm for it, and even a seasoned inventor he’d talked to had described the idea as long overdue and predicted huge success. Although I originally liked the idea and somehow felt it would do pretty well owing to its novelty, I for some reason assumed one would obtain mixed reactions in discussions.

Original image at http://rockstartemplate.com/wp-content/uploads/2008/12/social-bookmark-icon.jpg

Original image at http://rockstartemplate.com/wp-content/uploads/2008/12/social-bookmark-icon.jpg

In terms of the hard sell, we’re employing several different methods to publicise Inovazone. We’ve created a Facebook fan page and a Twitter account – feel free to follow us (@inovazone). One.com also kindly provide adwords coupons so with some SEO we might be able to appear in ads on relevant Google searches.

The site is currently about to go into beta testing. From wiki:

Beta testing comes after alpha testing. Versions of the software, known as beta versions, are released to a limited audience outside of the programming team. The software is released to groups of people so that further testing can ensure the product has few faults or bugs. Sometimes, beta versions are made available to the open public to increase the feedback field to a maximal number of future users.

The idea of this is simply to fine-tune what we already have rather than to add more features, though both these are desirable outcomes from this round of testing; though for me personally the primary objective is to see whether the system works well with a large user base. So for that to happen we need some willing volunteers to go test out the site: anyone reading this is welcome to join the test group. Go ahead and post as many necessities as you deem reasonable, and comment on existing ones. Try out creating new subcategories and send us feedback about features that you think should be created or made better via the awesome uservoice-powered feedback utility. I’m especially interested in bugs and vulnerabilities you find; if you somehow work out how to delete posted necessities or spam the site with adverts, or if the site spews out a series of errors while you’re using it under normal circumstances, get in touch (there is a contact page). Chances are the database will be reverted to its initial (more or less empty) state before the site is released in a few weeks’ time, so disasters should be recoverable.

Before you (readers) go, I’d be interested to hear your feedback on the idea of the site – do you think it has potential? Will it be useful?

That’s all from me for now. The site will get a working and hopefully regularly-updated blog pretty soon for general status information and news so you probably won’t be hearing much more about it from me.

๏̯͡๏﴿


Automatic Email Reminders

June 22, 2009

Many services seem to provide automatic email reminders these days – notably Google Calendar; however what I need is something that can send me daily reminders about things, and setting up a Google calendar with daily repeats seems an altogether inelegant solution. Virgin Media operates a throttling policy in which downloading is limited between 10am and 3pm, and again between 4pm and 9pm. As far as I’m concerned, all this means is I need to make sure I’m not downloading much between those times. I thought of setting up my various alarm clocks and watches to ring at 10am, 3pm, 4pm and 9pm to remind me – but considering I’d have to use four different devices (none of my alarm clocks support multiple alarms) and the fact that it would all be useless if I’m not at home, the best solution is to use a daily email reminder which would alert me even if I’m working off my laptop at school (for example).

I also jumped at the opportunity to find out more about Linux and PHP; besides I didn’t want to sign up for several free email reminder services hunting for a good one so opted simply to write my own. For the sake of anyone attempting to implement any of the features of PHP and Linux I used, here is my solution which can essentially be broken down into four parts:

1. Emailing script

It was fairly easy to find out how to send an email via SMTP in PHP so I set up a script to connect to my gmail and send an email from there to myself. After turning it all into a function, in accordance with the modular approach to development, I was ready to proceed.

2. Scheduler

This was more difficult. PHP can’t by itself do anything on a schedule so it was necessary to delve into Debian’s scheduling system. I tried to look up how to make the damn thing work and eventually found (amongst other irrelevant info – hurry up Wolfram Alpha and add support for coders!) how to use it. It seems like cron is already pre-installed upon Debian installation, and is constantly running as a daemon. It checks a file every minute to check whether it should be executing a scheduled task. To edit this file you type ‘crontab -e’ and get a plaintext editing interface (looks like vi). The format of the file is a list of lines, each one representing a scheduled task. Each line’s format is:

[minute : int] [hour : int] [day of month : int] [month of year : int] [year : int] [script pathname : string]

So to run the program ‘rtorrent’ at 17:30 every 3rd of the month, you go:

30 17 3 * * rtorrent

Asterisks are, as always, wildcards. To execute a process every minute, the first 5 terms look like ‘* * * * *’. There is a slight problem with this: you can’t use vi from a PHP script (at least it’s not possible using exec). It turns out there’s an alternative way of using crontab – by importing a file. So the command looks like:

crontab foo.txt

Great. So the PHP script creates a text file containing the new line then executes a command to add that file to the cron file. Eventually I set it to run the script every minute and have the script itself check for whether it should be doing anything by referencing a MySQL database.

So in the end the PHP looked like this:

$fh = fopen(“foo.txt”, ‘w’) or die(“can’t open file”);
$stringData = “* * * * * /opt/lampp/bin/php /opt/lampp/htdocs/php/ereminders/s_mail.php &> /dev/null\n”;
fwrite($fh, $stringData);
fclose($fh);
exec(“crontab foo.txt” . ‘ 2>&1′, $output);

The &> /dev/null is just to stop it ‘helpfully’ sending email to root every time it runs (i.e. every minute) containing a log of exactly what happened.

3. Database

It’s a fairly simple MySQL thing – nothing fancy. I wrote a nice function in PHP to tabulate the results of a query which I use in my screenshot. It’s a single table and I haven’t bothered to normalise it or anything. Nothing to see here. Move on.

4. Admin panel

This was, like with most good things, the final stage of development. I was also getting lazy and bored so it’s pretty rudimentary; I wrote it just so I don’t have to go into PHPMyAdmin to change things. It makes use of that rather neat ‘tabulate’ function that I had written which tabulates the MySQL query. The var_dump is the contents of the cron file.

Final thoughts

In hindsight, this is pretty good for two hours’ work, especially considering about half an hour was spent writing scripts to automate things from an admin panel. I’ve also actually found it quite useful (pardon the surprise) – the other day I wanted to download an episode of Lost Windows 7 but the throttling period had already started and that one download would probably have pushed me over the download limit. At exactly 9pm I got an email reminding me to download so was able to watch the episode install the OS that very night. Though I doubt it’ll be much use to anyone other than me since there exist systems out there that do the same thing, just much better (probably).

๏̯͡๏﴿


Songbird v Foobar

April 29, 2009

Interestingly enough I switched away from iTunes 7 and haven’t touched it ever since their highly hyped update to 8. I switched to foobar2000 which is actually a pretty awesome bit of software. I have however been constantly hearing about Songbird and its amazing features so I’ve now finally got round to installing it and testing it out. Here are my thoughts.

Foobar > Songbird

One of the reasons I switched away from iTunes in the first place was obscene memory usage. I’m not sure how iTunes 8 is with memory but I had many grievances about the performance of iTunes 7 when I used it. Testing Songbird on a decent laptop (3GB RAM, Intel Core2 Duo T8100 @ 2.10 GHz, a processor that benchmarks faster than most in its clock speed range), it took 5 seconds for the program to start up fully while foobar loaded instantly. Foobar’s memory footprint was absolutely miniscule at 10MB while Songbird required a hefty 80MB, though that’s fairly unsurprising considering its capabilities as a browser.

In terms of usability, as a foobar2000 user, I miss features like Cursor Follows Playback (and more importantly Playback Follows Cursor), complete ID3 tag control, advanced syntactical filters and fully customisable shortcut keys, for which I have yet to find Songbird extensions. Whatever the case these are minor concerns and are bound to be ironed out / provided in the long run by extensions or built in natively. However my concern is that Songbird seems directed more at less savvy / control-freak users who don’t necessarily want to use something like a RegEx string or SQL query to perform operations or filter their music – the functionality is based more around forms and buttons rather than console, debug window and command prompt. While most people probably welcome this user-friendly approach, I personally enjoy the ‘hackability’ and almost complete controllability of foobar. Of course, since Songbird is open-source a real hardcore user may prefer to hard code in mods, though I for one prefer not to have to recompile software to make it do what I want.

There are also several components which come natively with foobar (or as pre-installed plugins) such as ReplayGain (very important; Songbird’s equivalent is the ‘VolumeProfiles’ addon); minimise to tray (again critical [to me]; Songbird has the ‘MinimizeToTray’ addon); and a ‘resume playback after restart’ option (a nice touch to foobar; Songbird has an addon called ‘last track resume’).

This demonstrates the syntax of a Foobar preference element - a lot of the preferences are like this. Theres just so much control

This demonstrates the syntax of a Foobar preference element - a lot of the preferences are like this. There's just so much control

You can even control exactly what text is in the window title, status bar and system tray tooltip

You can even control exactly what text is in the window title, status bar and system tray tooltip

Songbird > Foobar

Enough nitpicking. Songbird really does have some really awesome features. Its integration with the web is very nciely done – I get the impression more or less every online music service is supported to some extent, and the whole browser integration is a brilliant idea. Foobar’s web integration comes in the form of ‘freedb’ which I assume is some sort of tags downloader though it’s never given me any vaguely sensible suggestions so isn’t very good. There’s also a mini player built in which foobar doesn’t seem to have without resorting to skinning. Ratings are native which foobar is critically missing – you have to use ‘quick tagger’ [addon]. The default iTunes interface was offputting at first but the browse library by artist/genre/album etc at the top is another feature foobar lacks but Songbird has. And, of course, Songbird is open source.

It’s interesting that Songbird was developed as an open source project thus appealing to the techies while also being amazingly pleasant to use with some of the most useful and critial features built in and vast extensionability. Someone commented Songbird is like the Firefox of media players. I can’t say I disagree.

I find the way theyve built a media player around a browser quite cool and certainly in line with the whole web integration thing

I find the way they've built a media player around a browser quite cool and certainly in line with the whole web integration thing

Songbird has a clear iTunes-like interface and the mashTape (web integration with artist/song info, reviews, even youtube) is a pretty cool feature IMHO

Songbird has a clear iTunes-like interface and the mashTape (web integration with artist/song info, reviews, even youtube) is a pretty cool feature IMHO

Songbird, Foobar > iTunes

Despite a slow load time, Songbird wipes the floor with iTunes when it comes to performance. There was a problem with iTunes 7 in which scrolling through a large library was a misery owing to the intense slowness of just about everything. Songbird on the other hand is actually pretty snappy. And of course Foobar runs like lighting.
Both are extensionable. I know there are iTunes addons etc. but both these alternatives take extensionability to a much higher level. Songbird probably uses extensions about as much as Firefox while Foobar takes extensionability to an extreme by more or less requiring them to function normally (hence the pre-installed ones).
And of course neither associates itself with a store that sells DRM music ;) So it’s all good.

Overall, based on my experience of them so far, both are far more than adequate replacements for iTunes (unless you’re a fool and actually use the iTunes store in which case your music is useless if played by anything but Apple products). Foobar even has support for iPods (not sure about Songbird). Neither has performance issues, and both are more or less customisable enough for the standard user. If you’re after an easy and pleasant-to-use player with an automatically decent-looking interface with truly wonderful web integration, go download Songbird. If you’re a control-freak in search of hackability and control almost to the extent of writing your own RegEx (and also a completely no-nonsense player), foobar’s the one for you. On the other hand if you want a program that is slow, memory-hogging and defaults to buying music from a store with hideous DRM, go ahead and download iTunes.

๏̯͡๏﴿


How to Download Youtube Video/Audio

April 21, 2009

There are lots of tools out there claiming they can stream Youtube video and audio to file. I’ve tried to use many different ones but most seem to fail either at the downloading stage or the playback stage, i.e. they produce unreadable output files. Even worse is when you end up with an FLV file which only seems playable in VLC. I think I’ve found the perfect solution which can stream Youtube to an AVI file (properly, using a standard algorithm and producing a fully legitimate file) which can subsequently be converted into any format at all, be it audio, video or whatever.

1. Download

The best solution in my opinion is VDownloader. It provides a no-nonsense interface with settings for the use of a proxy, AVI codec, and download directory. It’s freeware of course, with a small encouragement at the bottom of the window to donate. To use it, simply paste the Youtube URL into the URL box and hit download. It first downloads it as a file without extension before converting it to AVI.

A potential alternative is Orbit Downloader with Grab++ which can grab streamed flash off any website. While it will work without fail, you end up with a FLV file which for some reason only VLC media player seems to be able to play and recognise as any sort of legitimate video file, preventing the next step from working. I thus never managed to get VLC to stream anything to a file. Perhaps it uses an outdated / incorrect .flv format.

2. Convert

If you feel the need to convert it from AVI to, say, an audio format like MP3 (some very rare classical recordings only exist on Youtube for some reason, but I’m not sure about the legality of downloading them to local storage), by far the best all-purpose media converter I’ve come across is SUPER. Frankly I find the interface revolting but the functionality is truly wonderful and more than makes up for looks – just take a look at their site to see what features are on offer (the site is also not very pretty…). Again, it’s all free.

To use it, first install then run the program. You’ll be confronted with a hideous UI. Select the top-left drop down menu and select the target format (e.g. mp3). If necessary change the codec (top right drop-down). In the blue ‘Audio’ rounded rectangle set your preferences for the output stream. Drag and drop the AVI you downloaded with VDownloader into the grey file list box near the bottom. Tick the file you want converted and press ‘Encode’. It might take a while (and the window sometimes freezes) but chances are it’ll complete and you’ll have an mp3 waiting in the output folder. The default is C:\Program Files\SUPER\OutPut\

So there you have it – that’s the best way I’ve found to download youtube content and convert it into any format desired. I’ll leave the legality of this for you to decide / work out / research – if you download music from Youtube and it turns out to be illegal, don’t blame me!

Good hunting ;)

๏̯͡๏﴿