James Tauber's Blog 2007/12
The Future Comes in Green and White
This week I received two significant packages: my "spit kit" to provide a DNA sample for 23andMe to analyze and my One Laptop Per Child XO-1.
I think both of these are landmarks. I'll report on both over the coming months.
Here are some more photos:
by James Tauber : Created on Dec. 21, 2007 : Last modified Dec. 21, 2007 : Categories olpc : 0 comments (permalink)
You Me Us We Named Top Song of 2007
Back in May, I wrote about the song You Me Us We which was originally an instrumental piano piece of mine to which Nelson Clemente later added vocals as part of our Nelson James collaboration. For Nelson's solo debut EP, I worked with producer Rob Agostini on an electropop version that was described by one reviewer as "the perfect blend of sparkly pop that will make you feel like the world isn't so bad after all".
The site ElectroQueer has always been a fan of the song but they just released their Top 120 Songs of 2007 and guess which song ended up at #1!
Thank you Nelson and Rob and ElectroQueer for making a simple piano piece I wrote as a 19-year-old into an international number one pop song!
by James Tauber : Created on Dec. 21, 2007 : Last modified Dec. 21, 2007 : Categories music_composition nelson_james you_me_us_we : 1 comment (permalink)
Quisition Hits 1000 Users
Yesterday, Quisition had it's 1,000th user registration, which was my target for this year. Admittedly, this was fairly easy to control because most of the new users come via Google Adwords and I could adjust the budget to keep things on track to hit 1,000 before year end.
Comparing the figures from the first 100 users:
- Only 71% activated their account (down from 89% in the first 100)
- Only 58% created a deck for testing (down from 72% in the first 100)
- Only 37% actually learnt any cards (down from 57% in the first 100)
I have a bunch of feature requests from regular users of the site and implementing those will now be my top priority. But I also want to explore why the percentages above are so low. I'm not surprised they are lower than those for the first 100 given most of the traffic now comes from Adwords rather than this blog. But it should be possible to get them higher than they currently are.
by James Tauber : Created on Dec. 20, 2007 : Last modified Dec. 20, 2007 : Categories quisition web_marketing : 4 comments (permalink)
Avoiding Recursion
Occasionally I implement an algorithm recursively then hit the recursion limit in Python.
For example, I just wrote this:
def clique(self, node, done=None): if done is None: done = set() done.add(node) for other_node in self.edges_by_node[node]: if other_node not in done: self.clique(other_node, done) return done
which hits a limit if the graph is too big.
So I rewrote it like this:
def clique(self, start_node):
done = set()
to_do = [start_node]
while to_do:
node = to_do.pop()
done.add(node)
for other_node in self.edges_by_node[node]:
if other_node not in done:
to_do.append(other_node)
return done
There's a simple relationship between the two, quite independent of the specific task at hand. Which got me thinking about abstracting the specific task out of the recursive versus non-recursive pattern.
I guess I was having an SICP moment :-)
by James Tauber : Created on Dec. 15, 2007 : Last modified Dec. 15, 2007 : Categories python algorithms : 1 comment (permalink)
Resizable Text Areas
Is it just me or are Safari 3's resizable text areas really really cool!
by James Tauber : Created on Dec. 15, 2007 : Last modified Dec. 15, 2007 : Categories web_design safari : 1 comment (permalink)
Stack-Type Vectors, Part III
Part of the Poincaré Project.
We've already been introduced to linear spaces and three different types of linear space: n-tuples, arrow-type vectors and stack-type vectors.
In the last post, I promised to motivate stack-type vectors from the perspective of physics.
Both arrow-type vectors and stack-type vectors (in contrast to plain n-tuples) exist in relation to a manifold. From the point of view of (at least pre-relativistic) physics, the manifold introduces a notion of position and distance, but not other quantities such as time or mass or electrical charge, which exist in addition to the structure of the manifold.
We've previously stated that displacement, velocity, acceleration, force, etc can all be modeled as arrow-type vectors. The reason is that they are all fundamentally about a change in position. If you do a dimensional analysis—L, LT-1, LT-2, MLT-2—you see that they all have a single length dimension: no length squared; no per unit length.
Arrow-type vectors can't be used for area, energy or power (all of which have L2). Nor can they be used for quantities that are measured per unit area (L-2) or per unit volume (L-3 e.g. density which is ML-3).
Finally, arrow-type vectors cannot be used for quantities that are measured per unit length (L-1) but this is where stack-type vectors come in.
Borrowing the example from Gabriel Weinreich's wonderful book, Geometrical Vectors (the first book to set me straight on this stuff), consider two plates 1cm apart with a potential difference of 30V. We can model the distance between the plates as an arrow-type vector d. The electric field E between the plates is 30V/cm. E is not an arrow-type vector, but a stack-type vector.
One way to see this is the different behaviour of the numerical values of d and E under a change of scale. If we change our measurements from centimetres to metres, the numerical value of d goes from 1 to 0.01 but the numerical value of E goes from 30 to 3000.
This difference can also been seen in the fact that, when stretched, the magnitude of an arrow-type vector increases whereas the magnitude of a stack-type vector decreases.
Arrow-type vectors are about position and rates of change of position. Stack-type vectors, on the other hand, are about rates of change of some other quantity as position changes.
If you are familiar with gradient vectors from vector calculus, it should start to become clear that gradient vectors are not of the arrow-type but rather the stack-type.
In conclusion, while arrow-type vectors and stack-type vectors both follow the axioms for linear spaces, their behaviour in relation to the manifold they get their geometric interpretation from differs. It could almost be said they are opposites. Notice that while the numerical value of d decreased and that of E increased in our scaling example, if you multiple them together, they stay constant.
Exploring this last observation will be topic of the next post in the series.
by James Tauber : Created on Dec. 15, 2007 : Last modified Dec. 15, 2007 : Categories poincare_project : 0 comments (permalink)
New Quisition Features
A couple of people requested a while ago the ability to delete decks of cards from my flashcard site, Quisition. This evening I finally got around to implementing that feature. I also got an email yesterday asking for the ability to export cards, so I implemented that while I was at it.
I still have a huge long list of things to implement in Quisition including OpenID, comments and tagging of packs, user rankings, email reminders and lots more.
I'm still on track to hit 1,000 users by the end of the year. Very few of those use the site regularly, though, so one of the things I want to do early next year is survey the users to find out what I need to improve to keep them coming back.
by James Tauber : Created on Dec. 14, 2007 : Last modified Dec. 14, 2007 : Categories quisition : 0 comments (permalink)
Numerical Representation of Pitch
A number of years ago, I started working on a Python library for music theory and composition called Sebastian and one of the first implementation decisions I needed to make was how to represent pitch. Assuming one allows for double-flats and double-sharps, there are 35 note names. What I was looking for was a way to represent these 35 note names in a way that was consistent with the relationships between them.
I ended up deciding to use the set of integers with D as 0 and each successor being a 5th higher. So A would be +1, E +2, G -1, Eb -5, F# +4 and so on.
This turns out to work quite nicely. Given one note, you can find the tone above/below by adding/subtracting 2 and the semitone (different letter) above/below by subtracting/adding 5. To augment/diminish (same letter) you can add/subtract 7.
You can determine if two notes are enharmonic by testing
(abs(val1 - val2) % 12) == 0
You generate the textual note name from this integer with:
modifiers = ((val + 3) - ((val + 3) % 7)) / 7 if modifiers == 0: m_name = "" elif modifiers == 1: m_name = "#" elif modifiers > 1: m_name = "x" * (modifiers - 1) else: # m < 0 m_name = "b" * -modifiers return "DAEBFCG"[val % 7] + m_name
and the reverse with
letter = name[0] base = "FCGDAEB".find(letter) - 3 if base == -4: raise ValueError mod = name[1:] if mod == "": m = 0 elif mod == "#": m = 1 elif mod == "x" * len(mod): m = len(mod) + 1 elif mod == "b" * len(mod): m = -len(mod) else: raise ValueError return base + m * 7
While it's true that moving the origin to F would eliminate some of those -3s and +3s, new ones would need to be introduced, so there's no really clear winner between an origin at D versus an origin at F.
Scales are easy to generate. The pattern for a major scale is [0, 2, 4, -1, 1, 3, 5] and so you can generate the scale for a particular tonic with something like
[tonic + i for i in [0, 2, 4, -1, 1, 3, 5]]
Another advantage of the system is it can be extended to 19-et and other tuning systems. I haven't given much thought to whether it's useful for tunings without a constant frequency ratio for the 5th, though.
I also haven't yet investigated how this system is inferior to Hewlett's base-40 system.
UPDATE: Okay, I've finally grokked the functional difference between Hewlett's system and mine. Mine can incorporate an infinite number of note names (triple flats, quadruple sharps, you name it) but it cannot express intervals of an octave or more. Hewlett's base-40 system can handle intervals of octaves or above but cannot, without change, handle more than the 35 note names of 12-tone chromatic music. My system (and others like it) require two numbers to handle more than an octave. Hewlett traded off infinite note-naming capability for the ability to include octave in a single number.
by James Tauber : Created on Dec. 13, 2007 : Last modified Dec. 14, 2007 : Categories python music_theory sebastian : 6 comments (permalink)
Man from Earth
Earlier this week, I read Graham Glass's description of the movie ''Jerome Bixby's Man from Earth'':
The Man from Earth looks like my kind of movie. It's shot entirely in a living room and revolves around a man who reveals to his colleagues that he has lived on Earth for the past 14,000 years. The rest of the movie is about how his colleagues try and disprove his confession via a question and answer session.
Well, it sounded like my kind of movie too so I ordered and, on Wednesday evening, it arrived.
It's a fascinating concept and, for the most part (see below), dealt with very well. It was written by the late Jerome Bixby, of original series Star Trek writing fame.
It was obvious early on that it wasn't shot on film—a lot of low-light noise, even more noticeable than Attack of the Clones, make it clear this was shot on video. IMDb says it was shot on prosumer-grade HDV, possibly an HVX200 judging by the single behind-the-scenes shot of the camera I saw on the film's website. But this was way better done than most films shot on video. Given that it was shot on video and all in one location, it must have been an amazingly cheap film to make.
The acting was generally good. The performances sometimes felt more like a play than a film (and I mean that as a negative—stage acting looks like over-acting on camera) and I wonder how much of that is because it was shot all in one location and probably only over a few days. The story would actually lend itself to a stage performance given that it is all in one location and entirely dialogue-driven.
The pacing was excellent. There was only one time where I started to lose interest and almost immediately, the drama of it picked up and I was hooked again.
I really don't want to say much about the content itself as it's fun just going on the journey. I will, however, raise one complaint.
The film presents a very controversial portrait of Christian origins, which in-and-of-itself doesn't bother me. What disappointed me, however, was that it was done in such a simplistic and naïve way. With just a little more homework, Bixby could have made it a tighter (and no less controversial) argument.
For example, he confuses the uncertainty of certain words of Jesus with the existence of multiple English translations, seemingly ignorant of the fact that the Greek underlying the translations is known and so the uncertainty has nothing to do with the English language translations. He could have expressed the uncertainty in a far more informed way by appealing even just to differences between the Synoptic Gospels let alone issues of textual and higher criticism.
I don't know enough archaeology, paleogeography or biological anthropology to know whether there were glaring errors in those areas, but I suspect not nearly as blatant.
It's a shame because, otherwise it's a nicely done film. I would recommend it to any fans of thought-provoking high concept science fiction. I didn't love it quite as much as Primer (although it's better acted) but it's up there. Certainly if you liked one, you'll like the other.
by James Tauber : Created on Dec. 7, 2007 : Last modified Dec. 7, 2007 : Categories filmmaking : 3 comments (permalink)
Dwarves vs Dwarfs
I've long known that Tolkien favoured dwarves to dwarfs as the plural of dwarf but, living post-Tolkien, it's easy to forget that dwarfs was ever the preferred spelling. Then it was pointed out that the Disney film (which came out the same year as The Hobbit) is Snow White and the Seven Dwarfs. I don't think I ever noticed that before.
It was pointed out by Aardy R. DeVarque's Sources of D&D page which is an interesting study of the origins of many terms in the original D&D (hint: they weren't all from Tolkien!)
UPDATE (2007-12-09): Mark Liberman talked about /-fs/ vs /-vz/ plurals back in 2004 in The Theology of Phonology with a followup specifically on Dwarves vs Dwarfs.
by James Tauber : Created on Dec. 5, 2007 : Last modified Dec. 9, 2007 : Categories linguistic_observations : 7 comments (permalink)