An Englishman’s Home is his Castle

Corfe Castle*

Back to rant for the blog post, this time on housing.

A house is like a millstone around your neck, once you’re in it the reluctance to do anything that might cause you to move out is massive.

I’ve been somewhat itinerant since leaving university after my degree, I lived in Durham, in Cambridge and then in Poynton and now in Chester. It goes with the job, I’m sufficiently specialised that I need to travel to find work. For families containing two academics this leads to an even greater “two-body” problem; not every town or village needs a research scientist of my ilk. The downside of this is a degree of rootlessness and a lack of a handy family network. I’m not sure how common this rootlessness is across the population as a whole, it’s true for many of the people I know.

It was when I was house hunting in 2000 that I got some hint of the credit crunch, I’d gone off to see the financial advisor upstairs from my estate agent to ask about offset mortgages (having been mildly burnt on payment protection insurance, I was trying to work out the hitch on offset mortgages). We had a bit of a chat; after some reassurance on what I was trying to get he pointed out that I was ultra-cautious and if I wanted he  could get me a x4 joint salary mortgage. I’d done the sums on this, and frankly it was scary but clearly a lot of people were doing this.

People often have a go at estate agents but personally I think it’s the other punters that really fuck you up. Estate agents at least have to make some pretence of professionalism whilst the punter is free to do as they see fit and since they’re unlikely to have bought and sold more than a couple of houses they can either by malice or ignorance make your life miserable. The bank and the solicitor’s ability to find another little fee to slice off you on the way irritated me too. “Searches” caused me particular ire – it’s not like they actually went and “searched”, they got someone else to do an indexed retrieval, it’s not like they went rummaging anywhere for something lost. Searching for documents these days takes bugger all time and effort. It’s perhaps for this reason that I thought HIPS were a good idea, because I was pretty unimpressed by the system currently in place.

House price inflation is apparently the only good sort of inflation: no one is pleased if cars, carrots, or computers get more expensive every year but for houses it’s different. For those of us on the housing ladder this inflation is no problem, for those not on the ladder it is the sight of the bottom rung being wound up beyond reach. Compared to the 1950’s houses are about x4 more expensive in real terms today, they’re about twice as expensive in real terms as when we bought our first house, about 12 years ago.

The real point of this post was a mild bit of ranting about care for the elderly and the sale of houses. Houses appear to be sacrosanct, you can be sitting on a house worth half a million pounds but rather than sell that to pay for your care the expectation is that the State should provide. Personally I’m hoping for my parents to piss away the inheritance in their twilight years and leave nothing to me – this includes the house. This attitude to housing and inheritance seems to affect every strata of society:

Owners of country estates apparently expect the public to pick up the cost of maintenance. And in the news this week, council houses – I must admit I didn’t realise that council house tenancies were for life and potentially beyond. This strikes me as a nightmare for those responsible for the councils responsible for social housing provision, particularly given the ‘right-to-buy’ legislation. An obligation to provide housing for all is a good thing, the mechanism that via council houses, housing associations and housing benefit doesn’t look like a great way to do it. Actually, housing associations do look like a good idea to me. If you were a company with this obligation you’d want to make bulk arrangements with landlords, and you’d be fantastically nervous about handing over valuable assets for decades. 

The move towards mass ownership of housing is relatively recent – mainly post-war in the UK (see page 12 here), and around Europe home ownership rates are broadly comparable, there are a couple of anomalies. I guess the reason for this is that home ownership fulfils a deep need for security, and literature and recent history reveal plenty of evil landlords.

I suppose the general point I’m making here is that we all want to pass on an inheritance, this is a very natural feeling but the effect of this desire impacts those that are still living and don’t benefit from an inheritance. I actually quite like Billy-Gotta-Jobs proposal on taxing all houses as capital gains on death, as a way of cooling house price inflation.

Update: as supergoonybird points out in the comments, BillyGottaJob’s proposal is actually for capital gains tax on *all* house sales – not just on death. This is a radical idea – but certainly one that strikes in the right place.

*Corfe castle because it’s close to where I was born and lived until I was 18. Image from here.

Bamboo Pen and Touch

This is a tiny technology review. I recently bought a Wacom Bamboo Pen and Touch tablet, I say recently – I picked it up from the post office a little over 2 hours ago!

I used a Wacom tablet extensively as a mouse replacement at work some years back, and rather liked it. I only gave up because I moved into industry from academia and they are a bit more fussy about what I attach to the PC with which I am provided. At home the pen interface didn’t work quite so well because at the time I was quite keen on computer games, first-person shooters in particular, and controlling the little man in such a game using a pen is exceedingly challenging, to say the least.

The big benefit of a pen interface to my mind is that I can hold the pen whilst typing, then when I need to do some “mousing” I don’t have to scrabble around for the mouse. The whole process is just much smoother.

Unlike my original Wacom tablet this model will accept both pen and touch (with your fingers) input – I must admit I’m not really anticipating using the touch input. It appears to support the range of multi-touch gestures that a smartphone will accept. The active area of the tablet is roughly journalists notepad size which makes it small for an artist type tablet.

In terms of software, the installation attempts to guide you into some spoken tutorials which treat you like a moron – praising fulsomely your every successful pen-stroke. None of this is actually necessary since using a pen is largely intuitive and all you really need to learn is what the right-click simulation is (it’s the button on the body of the pen) and what the configurable buttons on the tablet do.

I have the tablet installed on a Windows 7 system, which is “ink” aware – it understands interacting via a pen: A little palette will pop out wherein the miracle of the “handwriting recognition” is performed – being able to read my scrawl is impressive but it’s a bit like a talking dog: it’s very clever but ultimately pointless on a computer with a keyboard. Office 2007 is also ink aware, you can open up a document and scribble on a separate layer – obviously the first thing I did was draw a big circle around something and wrote “bollocks” next to it.

The tablet also comes with some little mini-apps in which you can doodle and play games, you can also download more mini-apps. They don’t look fantastically useful.

All in all I think we’re going to be happy together – holding the pen feels just like old times!

A set of blog posts on SQL

This is a roundup post for a rather specialist set of posts I wrote on SQL (Structured Query Language), a computer language for creating and querying databases. Basically the posts are my notes on the language which I’m learning because a couple of programming projects I have in mind will need it. The main source for these notes is the Head First SQL book. I’ve used a another book in this series (Head First Design Patterns) – I quite like the presentational style. The code in the posts is formatted for display using this SQL to HTML formatter.

Topics covered:
Some notes on SQL: 1 – Creation
Some notes on SQL: 2 – Basic SELECT
Some notes on SQL: 3 – Changing a table
Some notes on SQL: 4 – Advanced SELECT
Some notes on SQL: 5 – Database design
Some notes on SQL: 6 – Multi-table operations
Some notes on SQL: 7 – Subqueries and views

Of course you can find SQL cheatsheets elsewhere.

The Head First SQL book also has material on transactions and security, if I get a renewed bout of enthusiasm I will add a post on these items.

I used MySQL via its command line client to do the exercises, because it’s about as straightforward as you can get. Notepad++ recognises SQL as a language and will do syntax highlighting, so I type my commands into it and copy them into the MySQL command line client. MySQL is pretty straightforward to install. I also installed Microsoft SQL Server Express 2008, which turned out to be a bit more of a struggle but on the plus side integration the C# .NET, which is what I normally program in, looks better than for MySQL.

I’ve been using with the SQL Server via SQL Management Studio (a graphical interface to databases) on the general election data compiled by The Guardian. First contact with actual data, as opposed to learning exercises has proved interesting! A lot of things that are fiddly to do in a spreadsheet are straightforward using  SQL.

SQL was designed in the early 1970’s, with commercial implementations appearing towards the end of the decade. It’s influence visible is visible in more modern languages, such as the LINQ extensions to C# (this influence is pretty explicitly stated). Some of the ideas of database design (normalisation) seem relevant to object-oriented programming.

It’s been an interesting learning experience, my scientific background in programming has me stuffing pretty much any sort of data into an array in the first instance. SQL and a database look like a much better solution for many situations.

Some notes on SQL: 7 – Subqueries, combining selections and views

This is the seventh, and final, in a series of blog posts on SQL, the first covered creating a database, the second selecting information from a database, the third commands to modify the structure and contents of an existing database, the fourth, advanced selection. The fifth post covered database design. The sixth post covered multi-table database operations. This post covers subqueries and views. No claim of authority is made for these posts, they are mainly intended as my notes on the topic.
This is largely a wrapping up blog post to cover a couple of items.As an alternative to the joins described in a previous post, “subqueries” can often be used. A subquery is essentially an entire query embedded in another query. Subqueries can be used with UPDATE, INSERT and DELETE statements, whilst joins cannot. However, joins can be used to bring columns from multiple tables. There are no special keywords involved in creating a subquery. There is some discussion on the pros and cons of subqueries and joins here on Stackoverflow.

In an uncorrelated subquery the so-called inner query can be evaluated with no knowledge of the contents of the outer query. This expression contains an uncorrelated subquery:

UPDATE raw_candidate_data
SET    gender = ‘f’
WHERE  firstname IN (SELECT firstname
FROM   firstname_gender_lookup
WHERE  gender = ‘f’); 

The inner query is the clause in brackets, in this instance it is a shorthand way of building a list for an “IN” comparison. Often an inner query returns a single value, i.e. for an average or maximum in a list.

This expression contains a correlated subquery:

UPDATE raw_candidate_data
SET    party_id = (SELECT party_id
FROM   parties
WHERE  raw_candidate_data.party = parties.party_name); 

The inner query requires information from the outer query to work, this expression acts as a look up.

Complex queries can be given aliases using the VIEW keyword, for example:

CREATE VIEW web_designer AS SELECT mc.first_name, mc.last_name, mc.phone,
mc.email FROM my_contacts mc NATURAL JOIN job_desired jd WHERE jd.title=‘Web Designer’; 

Can subsequently be used by:

SELECT * FROM   web_designers; 

The view web_designers can be treated just as any other table.

The results of multiple select commands can be combined using the keywords: UNION, UNION ALL, INTERSECT and EXCEPT. UNION returns the distinct union of the results of all the selects, i.e. with no repeats, UNION ALL includes the repeats. INTERSECT returns items that are common to both SELECTs and EXCEPT returns those items that are returned by the first SELECT but not the second. The general form for these combination operations is as follows:

SELECT title FROM   job_current
UNION
SELECT title FROM   job_desired
UNION
SELECT title FROM   job_listings
ORDER  BY title; 

Each SELECT statement must return the same number of columns and each column must be coercible to the same datatype. Only a single ORDER BY statement for the set of SELECTs can be used.

Keywords: UNION, UNION ALL, INTERSECT, EXCEPT, VIEW

Spider silk

Photo by Fir0002/flagstaffotos (GFDL license)

I’ve never worked on spider silk myself, but my work on synthetic polymers and biological physics took me to conferences where spider silk work was presented and it always struck me as a very interesting. Spider silk has a rather impressive set of material properties, yet it is produced rapidly at the back end of a spider under everyday conditions. This is a pretty electron micrograph of spider spinnarets from where the silk comes (warning: page includes creepy crawlies).

I introduced molecules, and proteins back in this post. Proteins are the key molecules used to make organisms, an organism’s DNA are the instructions to make a set of proteins. Spider silk is made from protein. A spider is able to produce a whole range of silks with different physical properties: dragline silk is used to make the outer-rim and spokes of a web and is strong and tough; capture-spiral silk is sticky, stretchy and tough; tubiliform silk is used for egg cases and is the stiffest; aciniform silk used for wrapping prey is the toughest; minor-ampullate silk used to make temporary scaffolding for building a web (it’s not as strong but very stretchy). From a technical point of view “strong” refers to how hard it is to stretch something, and “tough” refers to how hard it is to break something. Spider silk is similar to silkworm silk but it is stronger and more extensible.

The properties of spider silk arise from it’s microstructure, essentially the protein molecules make a very fine net held together with little crystals. The fact that crystals form is a function of the protein structure, exactly how many and what distribution of crystals form is influenced by how the spider treats the silk-protein solution as it comes out of it’s spinnarets. Precisely how the spider achieves this isn’t entirely clear, the protein starts off in a liquid solution, the spinnarets force the liquid out into the air whilst changing things such as the salinity, concentration and pH of the liquid and “Hey, presto” it turns into silk! It would be nice if we could farm spiders for their silk unfortunately this is difficult, they just don’t get on with each other.
The strength of natural materials is often compared to that of steel, but there is a trick to watch out for here: the comparison is often based on weight. Steel is about x10 denser than silk, so your strand of equivalent strength is rather fatter if it is made from silk.

The closest synthetic material to spider silk in terms of it’s strength per weight is Kevlar. Kevlar is processed using hot sulphuric acid under high pressure which as you might imagine is not very nice. Spider silk, on the other hand is made at room temperature and pressure from an aqueous solution of benign materials.  Not only this, a spider can eat the silk it’s already made and use it to make more silk. As scientists, this makes us more than a little bit jealous.

Not only is spider silk interesting of itself, but from a material scientist point of view, it really isn’t fun to make and use new polymers (you need to build expensive plant to make them, you need to work out your ingredient supply chain, you need to check for safety and environmental problems). If, on the other hand, you can get the properties you want from one of your pre-existing polymers by changing the microstructure then life is much easier. Spider silk may provide hints as to how this might be done.

The neat thing about this story is that it illustrates an important point: we can genetically engineer bacteria and goats to produce the protein in spider silk but not make nice silk-like stuff. Knowing the sequence of amino acids that a spider is making is not enough to make silk. In much the same way knowing the proteins that go up to make up a human is rarely enough to understand, let alone cure, a disease. 

Scientists have done research on the effect of different drugs on web spinning, filmmakers have made some fun of this experiment* (warning: contains spiders). Other interesting biomaterials include, mollusc adhesive and slug slime and I’ve already written about why butterflies are blue.

Update: Curtesy of @happymouffetard, the evolutionary origin of spider-silk spinnarets appears to be hair follicles, according to this article.


*Thanks to Stephen Curry for pointing me to the “spiders on drugs” video.