Select methods in Rails
There’s three different ways of handling select methods in Rails and it always confuses me. It’s an old post but I found this old blog article that’s been quite useful.
There’s three different ways of handling select methods in Rails and it always confuses me. It’s an old post but I found this old blog article that’s been quite useful.
Ah now this is even more interesting. I regularly have to write quite technical documents and so this article on the use of pronouns in scientific documents is even more enlightening:
The Use of Pronouns
Pronouns are words that refer to a person or a thing which has already been mentioned by name. They are useful because they save us from having to repeat a noun. Without pronouns writing often appears clumsy and long-winded.There are a number of different types of pronouns that are frequently used in scientific writing. But because science is concerned with things rather than people there are also many pronouns that are rarely found in scientific writing.
* Personal pronouns are rarely used in science and include. I, you, he, she, we, me, him her. However, there are some personal pronouns that are used to refer to things, animals and plants. These are they, it and them.
* Possessive pronouns include mine, yours, his, its, ours and theirs. Only its and possibly theirs will be met frequently in scientific writing.
* Reflexive pronouns which include myself, yourself, himself, herself, itself, ourselves, yourselves and themselves are rarely found in scientific writing.
* Relative pronouns include who, whom, whose, which, and that. Which and that are extremely common because they refer to things. Relative pronouns are used for joining sentences. For example:Conductors are materials. Conductors allow electricity to flow through them.
becomes
Conductors are materials which allow electricity to flow through them.
* Interrogative pronouns such as who, what, whose, whom and which are used frequently in scientific writing to ask questions. These pronouns are often used as relative pronouns. However, it is uncommon for the pronouns whom and who to be found in scientific writing.
* Demonstrative pronouns. Like all pronouns, they replace a noun. These pronouns point out or demonstrate something. Examples are this and that and these and those. They can also be used as adjectives. For example,That tree is deciduous.
Those cells are damaged.The question then is: why do pronouns cause difficulties in scientific writing? There are a number of reasons for this. The main reason is that students sometimes have difficulty working out what the pronoun is referring to in a sentence. Consider the examples below.
1. The fashionable glasses had new lenses. They were not made from glass.
2. Food and oxygen is moved around the body by blood. It circulates around the body through three kinds of blood vessels.
The pronouns are in bold and the noun they refer to is underlined. It is easy to see why there could be confusion. In each example, the pronoun could be referring to something else. In the first example, they could refer to the fashionable glasses. In the second example, it could be misconstrued as referring to food or oxygen.
Some of the difficulties could be removed if the noun being replaced in each sentence was made the subject of the sentence. For example:
Blood moves food and oxygen around the body. It circulates around the body through three kinds of blood vessels.
But this is often overlooked and, even if it is not, sentences like these would still cause problems for students unfamiliar with English grammar. As mentioned above if pronouns are not used writing becomes clumsy. However, sentences without pronouns are certainly easier to understand. Consider the sentences above with the pronouns replaced by the noun.
The fashionable glasses had new lenses. The lenses were not made from glass.
Food and oxygen is moved around the body by blood. Blood circulates around the body through three kinds of blood vessels.
Whole paragraphs can seem long-winded and badly written if pronouns are not used. Consider the paragraph below.
When substances were put in water different things happened. Some substances disappeared. Some substances changed the colour of the water. Some substances floated and some substances sank.
Now if we use pronouns instead of the noun substances the paragraph becomes:
When substances were put in water different things happened. Some of them disappeared. Some of them changed the colour of the water. Some of them floated and some of them sank.
Students would have a bit more work to do in understanding this sentence because the only reference to the participants, the substances, is made in the general organising-statement which is in the first sentence.
The sentences can be made even more difficult by removing the pronouns altogether.
When substances were put in water different things happened. Some disappeared. Some changed the colour of the water. Some floated and some sank.
Finally, the sentences could be joined by changing the punctuation. The paragraph now is a single sentence which probably resembles the kind of sentences we are used to seeing in science. As you can see a number of steps have to be taken to get from the very clear, if not clumsy, example we started with. Students will have to mentally, fill in these steps if they are to understand the final sentence.
When substances were put in water different things happened: some disappeared; some changed the colour of the water; some floated and some sank.
Clever stuff. It’s from a website called “Primary School Science”. How big does that make me feel?
I love finding things in the streets. So I was happy to find this piece of scrap paper when I stepped out of the house this morning:

Joining sentences with relative pronouns
What’s even better is that the subject - “Joining sentences with relative pronouns” - has been one of those things that I’ve never known that I didn’t know?!? In the unlikely event that anyone reads this stuff you might realise that my grammar might not be the best. In fact it’s one of the reasons I’m writing this blog; I’m hoping to improve my writing skills.
So how do you join sentences with relative pronouns? When I looked at her (Sally’s?) homework, I’m fairly sure you don’t just stick a full stop between them and I’m almost certain that you don’t just capitalise the first letter of the second sentence. So what do you do?
A way of joining some pairs of sentences is by using relative pronouns
who, whom, whose, which and that.Here are two sentences that can be joined by using who:
⇒ Tim has a son aged two. Tim works for British Rail.They can be linked like this:
⇒ Tim, who works for British Rail, has a son aged two.POINTS TO NOTE:
1. The second Tim has been replaced by the relative pronoun who.2. The clause who works for British Rail is placed as close as possible to Tim, the person it refers to. This is an important point, as the sentence would be misleading if it were written as:
⇒ Tim has a son aged two who works for British Rail.3. Commas are used at both ends of a who clause when it comes in the middle of a sentence.
After prepositions (eg of, to, for, by, with, in, from, after and among), whom is used instead of who.
So two sentences like
⇒ Mrs Smith seldom goes out. Walking is difficult for her.
can be linked like this:
⇒ Mrs Smith, for whom walking is difficult, seldom goes out.Whose can be used to link two sentences like:
⇒ Paul bought a ladder. His house needs repainting.
So that they become:
⇒ Paul, whose house needs repainting, bought a ladder.The relative pronoun which is used to refer to things, not people.
So we can use it to link two sentences like this:
⇒ Tom’s flat has three rooms. He rents it from his employer.
which becomes:
⇒ Tom’s flat, which he rents from his employer, has three
rooms.The relative pronoun that can refer both to people and to things:
⇒ The couple that moved into the flat upstairs have left.
⇒ The chair that broke has been mended.
I’m not a big fan of language nazism but if it helps to make something more readable and easier to understand then I’m all for it. I wish it was made clear at school just how useful that particular bit of grammatical knowledge is. So, Sally?, thank you for dropping your homework.
WHat the fuck are the home office doing re-designing pint glasses!?
As someone who thinks of economics as a hobby. I found this video a lot of fun…
iptables -I INPUT 10 -p tcp -m tcp –dport 143 -m state –state NEW -j ACCEPT
I’ve noticed that there are many left leaning commentators who’ve recently been citing countries as examples of a libertarian society such as Saipan, Somalia, India and China??? (The last being so ridiculous that I actually laughed for a second as I typed it). A capitalist society does not equate to libertarianism and I’d argue that a society plagued with corporatism (such as Saipan) is almost the polar opposite.
Go take a look at the Nolan Chart (http://en.wikipedia.org/wiki/Nolan_Chart). Where would you put China 30 years ago and where would you place it now? I wonder how many of those who were getting so impassioned about China in previous comments. on both sides of the debate, would put dots in exactly the same place I would.
Go try it out and lets see if we can all agree on something.
(can I put some white space in here so that nobody cheats)
(nope. go try it)
(done it yet?)
Well I don’t know about you but I put China 30 years ago deep down in the the bottom left corner. Totalitarian. Then over the last 30 years it’s slowly crept along to the bottom right, increasing economic freedoms but still violating many personal liberties. Anybody else get the same answer?
I think India would probably take a similar route. My brother has recently returned from India where his company employs a team of 10 engineers. He’s got some great photos of the Indians that he works with. They all get on well and have rewarding jobs. The company outsources more work to India now that there is less bureaucracy and state intervention and they’re not the only ones. Since the early 1990s, India has cut its poverty rate in half. About 300 million Indians—equivalent to the population of the entire United States—escaped the hunger and deprivation of extreme poverty thanks to pro-market reforms.
A little later in the photo album he has some pictures of them at the beach. My brother pointed to one of the photos and said “That’s the fun police! The sea is dangerous on that beach and if you paddle in the water then the police will come along and beat you with a stick. They didn’t beat me and my English friend though because we’re Westerners.”
If you really want to pick a country as an example of a libertarian state then I’d pick one closer to home, much closer to home – the UK. Bare with me, I know that DK and CG would probably find that label ridiculous but it’s certainly a better example of a libertarian state than Saipan, China or Somalia. I don’t think that many would argue that the UK is, in general, capitalist and the smoking ban, however illiberal, pales into insignificance when you compare it to beach beatings and driving over citizens in tanks. So as a fairly economically and personally free society then I think it’s a fairly good example and much more appropriate than Saipan! (Wow. That made me laugh again. Saipan!?!? What were you thinking??, Flyingrodent)
A rare thing…
The excellent Tim Minchin ranting against irrational hippies with a fluency and succinctness I could never manage.
This is something that has bugged me for years. There’s an excellent blog post about how to stop this happening here: