For anyone thinking about moving to the UK (or maybe any European country), here’s some tips that I wish I had when I came over.

The banks that have been the most helpful:
NatWest required proof of address, and suggested that I get my bank at home to mail a statement to my temporary address here in the UK. Had I known that earlier, this would have been the best option.
HSBC has an account for incoming international people. You can (and should) apply for it before you come to the UK. They call it the Passport account. They do some background checks that took about a week for me. They then required me to prove my address back in the States. Unlike other banks, they accepted my proof of employment letters as proof of address (they had my US address on them.) The one down side is that their account costs 8 pounds per month. When you can’t get an account any other way, that doesn’t sound like so much.

The bank that sort of considered helping me, but screwed up with paperwork and cost me 3 weeks:
The co-operative bank

The banks that outright denied me any consideration:
Lloyd’s TSB
Royal Bank of Scotland

Dear UK Bank system,

In case you were wondering, I hate you. Your absolute refusal to even consider any piece of reasonable evidence that I am worthy of an account (aside from proof of address) is ignorant, irrational and most of all irritating. You acknowledge that I cannot obtain an apartment (and thus an address) without a bank account, yet you insist on proof of address. This is in spite of my proof of employment, proof of clean background check for entry to your national laboratory, and proof that I have paid over 1500 pounds as a deposit on an apartment, which I cannot move into until I have a bank account. Truly your stubbornness puts even retarded donkeys to shame.

Sincerely,
An employed American with a Ph.D. who has zero debt, has made one late credit card payment in 10 years, and now would prefer to put his money beneath his mattress, if only he could actually be paid without your slimy services.

“It is the faith of all science that an unlimited number of phenomena can be comprehended in terms of a limited number of concepts or ideal constructs. Without this faith no science could ever have any motivation.”

L.L. Thurstone, Modern Factor Analysis

Some interesting maths from working on the dissertation.  Yes, maths.  I have to get used to the Queen’s proper manner of speech.

I study a material that is readily exfoliated into sheets.  The sides of each sheet are not the same.  This dissimilarity causes the sheet to roll up.  You might be wanting a figure right about now.  Me too.  The sheet structure is easy – that’s just a matter of getting the crystal structure from some published source (e.g. ICSD).  But how to turn this into a scroll?  I tried Illustrator’s spiral tool to create a path, but got lazy trying to re-create the brush that would represent the structure.  Plus, a friend noticed that when the diamond patterns get too close to one another, illustrator puts white space between them (makes one or both of them thinner).  That won’t do for representations of reality!

So, I turned to the dark, non-artistic side: maths.  You can draw a spiral pretty easily using polar coordinates.  Check it out: if you have a line of length X, you can make a spiral by setting 2 things:

radius = x+inner radius of spiral
theta(angle) = some range of angles – how many times you want the spiral to make a complete circle.

In python with numpy and matplotlib:

import numpy as np
import matplotlib.pyplot as plt

r=numpy.arange(0,10,0.001)
theta=numpy.arange(0,4*numpy.pi,4*numpy.pi/len(r)
plt.polar(theta,r)

and you get

2 circles, no offset from 0.

Well, cool, but I need the spacing between layers to be some well-defined value.  You can play with starting radii and/or number of times around the circle (and I did, before I got tired of it).  Mathematically, you can set the either of these, and determine the other based on the spacing you want.

Spacing = length of line / number of times around.

So, when I want a spiral with 5 unit spacing, and I start with an initial radius of 100, I get 20 spins around the circle:

And you want Cartesian coordinates, because what good molecular modeling software recognizes polar coordinates?  The nearest plot already shows this, but here’s how I got them.  See how bumpy my lines are?  Those are atoms!  OOOO!

x=r*cos(theta)
y=r*sin(theta)

Basic geometry, I know, but I was proud of myself.  Especially since I’ve been intending to figure this out for nearly a year and finally did it.  And it only took me a day.

Some odd notes of potential usefulness as I stumble through dissertation writing:

  • Proper figure numbering is accomplished by including the \label{} command inside the \caption{caption} command. Otherwise, it catches the section number…
  • Mendeley is great for managing references. Set the web importer up as a bookmark in the bookmark toolbar. It can grab references from Google Scholar, Google books, and many others. I find that the direct grabs from a Google Scholar search are incomplete – where possible click the link through to the page with the abstract, and import the article from there.
  • Store your articles with Mendeley’s web storage to keep them in sync across multiple computers. To start storing them, right click your “All Documents” collection, then “Edit settings” (Why isn’t there any reference to this in Mendeley’s program settings? I had a hell of a time finding this.)
  • \ref and \cite are very different Latex commands. If a bibtex reference refuses to show up, you probably tried to cite it using \ref, rather than \cite. \ref is for references defined by \label.

And… my theme here apparently has a problem showing bulleted and numbered lists…

Sarah Palin is coming to Houston! Yippeee!

“Sarah Palin made history as the first woman ever to be elected Governor of Alaska, and the youngest person to ever hold that office.Her straightforward, no-nonsense approach to politics and life captivated the nation and jettisoned her new book to an instant mega-bestseller. ”

Official site

I think jettisoning her book is the only appropriate action for it, though I worry about overflowing landfills.

Courtesy of Answer.com, the definition of jettison:
verb
To let go or get rid of as being useless or defective, for example: discard, dispose of, dump, junk, scrap, throw away, throw out. Informal chuck, shuck (off). Slang ditch.

noun
The act of getting rid of something useless or used up: disposal, dumping, elimination, riddance.

jettison indeed.

Just in case you ever need to politely respond to one of these…

1. On receipt of a telephoned bomb threat:
(a) Try to be calm and courteous.
(b) If at all possible keep the caller talking, for example, by pretending difficulty in hearing, and repeat all the information you receive alound

2. Try to find out:
(a) Exactly where is the bomb?
(b) When will it go off?
(c) What does it look like?
(d) What organization do they represent or why are they making the threat?
(e) How does the bomb work?
(f) Where is the caller phoning from?

Oh boy, was I seething at Apple after upgrading to 10.6. It seemed like just about everything broke. All of my Python development stuff went to hell in a handbasket (a stylish, well-designed handbasket). My 600$ (educational) copy of the Adobe CS3 Design pack would not even install. To boot, X11 did not work, so I couldn’t even use trusty old NXclient to remote desktop on my linux box.

I’m not sure why, but I didn’t bother searching for anyone with similar problems at the time. After going through the trouble to revert to 10.5, I did that search, and found all kinds of exactly similar problems, mostly caused by cruft from the old system. After a fresh OS X 10.6 install, things are in much better shape. Yes, there are other ways to clean up the cruft, but fresh installs feel so nice. CS3 still won’t install, but I can live with Inkscape and the GIMP.

Long story short: OS X is not the bulletproof OS that it is often advertised as, but it’s also not as bad as I thought.

Oh, one quirk:
Everyone mentions how much space 10.6 frees up on their hard drive. That’s nonsense. It may use a tiny bit less space, but the real “increase” in hard disk space comes because they switched to calling kilobytes 1000 bytes, rather than 1024 bytes (and MB are 1000 KB, and so forth). Because it divides the total number of bytes by an accordingly smaller number, you end up with a “bigger” hard drive. This has long been what the hard drive manufacturers do, but it’s awfully shady and very arbitrary for Apple to make that switch now.

This is more a note to self than anything else, but if you find it useful, hooray!

I’m trying to register images for school. There’s a neat trick to get rotation & scale roughly aligned, without doing any kind of brute forcing (which is really important, because my images can be any angle offset from one another). You take the log-polar transform of each image, and then cross-correlate the two transformed images. The distance from the center to the cross correlation maximum along the Y axis tells you the rotation, and the same on the X axis tells you the scale (on a logarithmic scale). The end result is that you can avoid the local alignment maxima associated with brute forcing, and save a whole lot of time in the process.

However, it doesn’t work perfectly for me yet. Here’s a few steps I’ve taken to improve it:

1. Pad the image that you’re going to match the template on.
Python with ctypes_opencv:

pad_img=ocv.cvCreateImage(ocv.cvSize(cropWidth*3,cropHeight*3),
expIPLimg.depth,expIPLimg.nChannels)
offset=ocv.cvPoint(cropWidth,cropHeight)
ocv.cvCopyMakeBorder(expLP, pad_img, offset,
ocv.IPL_BORDER_CONSTANT, ocv.cvAvg(expLP))

2. Do not cross-correlate the entire template to match. Instead, match only the central strip. There’s plenty of good stuff to match there, and you avoid the correlation penalties of having your template overlap with the padding. If you don’t do this, then the scale correction possible will be limited.

resultWidth = pad_img.width – refLP.width/2 + 1
resultHeight = pad_img.height – refLP.height + 1
result = ocv.cvCreateMat(resultHeight,resultWidth,ocv.CV_32F)
ocv.cvSetImageROI(refLP,ocv.cvRect(refLP.width/4,
0, refLP.width/2, refLP.height))
ocv.cvMatchTemplate(pad_img,refLP,result,ocv.CV_TM_CCOEFF_NORMED)

Funny encounter today with some jailbait at the Woodstocks bar. Here’s how it went:

(2 young girls walk up next to me at the bar, and are wondering what the trinkets in the glass at the bar are)
Me: “those are bottle openers.”
Them: “you smell like beer.”
Me: “that’s because I’m drinking it.”

The real question, though, is how they know what beer smells like, but don’t know what a bottle opener looks like. Hmmmm….

Next Page »