About this site

Danny's Weblog

2009 Nov 08 [ Sun ]

Review: DHTML and CSS - 3rd Edition

I have been using css for many years, but I kept running into basic things I didn't know, so I wanted to go all through a book instead of just looking up details on the web.

This book is out of date, but well written and with copious examples, so I went through and made the following notes. Unfortunately I cannot find the code online – the author seems to have pulled it from his site. Possibly it's too severely out of date.

1. p19 Setting your DTD - The DOCTYPE Strict means all formatting in the doc is handled by CSS, so no formatting tags are allowed. Transitional allows a mix of regular HTML formatting and CSS. Frameset means "used with HTML documents used to create framesets". I don't really know what the last one means.

2. p21 Kinds of HTML and XHTML tags - There are 3 types of tags, inline like the bold tag that has no line breaks around it, block tags that do have line breaks like the paragraph tag, and "replaced tags that have set or calculated dimensions".

I must admit I can't remember seeing that term "replaced" tags before. These include the br, img, input, object, select and textarea tags. See "5" below.

"Although the paragraph tag <p> is often used without its closing </p> tag in HTML, the closing tag *must* be included if you want to define something using CSS."

"Although the break tag <br> does not have a closing tag, you can add styles to it. However, tremember that in XHTML, the break tag becomes <br />(with a space in between the br and the /) so that it is self-closing."

3. p51 Creating drop caps with pseudo-elements: the solution shown involves applying a special class to the first paragraph of a section of text. It seems to me this is no easier and somewhat more opaque than just applying a class to the first *letter* and avoids using pseudo-elements.

4. p112 Changing how an element is displayed - You can use the display property to set the element to various options, eg setting "display:inline" in CSS.

Considering how fundamental this property is, I find it a little weird that you are allowed to set it.

I'm actually not sure what this feature is good for except surprises. It occurs to me it might be nice to use "code" as a block element, because actual code sections normally need block-style formatting and it's more semantic to call them "code".

5. p119 Setting the width and height of an element - "Although you can set the height of any element, only elements with replaced tags will use it. Other tags ignore a height value unless you define what should happen to the overflowing content of the element. (See "2" for what "replaced tags" are.)

6. p154 Setting an element's position - "To position an element using the left and top properties, you have to include the position property in the same rule." Eg,

{position:relative; top:1cm; left:1cm; }

It seems slightly strange to me that it really has to be in the "same rule". That seems to make it an exception to the general cascading feature of CSS.

7. p160 Stacking ojects (3-D positioning) - I have to admit I was left confused about what the z index is of elements that you do not explicitly set. The text refers to "sibling" elements, suggesting that they all have the same z index, but the text also says "positioned elements are assigned stacking numbers automatically, starting with 0 and continuing incrementally with 1,2,3 and so on in the order in which the lements appear in the HTML and relative to their parents and siblings".

I will need to experiment with this I suppose.

8. p219 Using the DOM - The text rather labors the point about assigning the string "60px" to a parameter.We already know that we have to set the CSS to "60px" not just the integer 60, so what is strange about that?

9. p254 Finding an object's 3-D position - "There's a catch. Browser's can't easily see the z-index until it's set dynamically. To get around this little problem, you have to use JavaScript to set the z index of each oject when the page first loads."

This seems to make the ability to read the z index not very useful, because your Javascript must *already know* what it set it to, right? Or am I missing something?

10. p264 Detecting which event type fired - The JavaScript includes some code like this:

var object = document.getElementById(objectID);
object.onmousedown = findEventType;

This looked like nothing remarkable at first, but then it looked weirder and weirder – at least if you don't know JavaScript. It looks like you're creating a *new* variable called object, and then setting a handler for that new variable. But actually what you're doing is getting the *address* of the existing object called "objectID" , and using that to set the handler for that existing object.

This is actually defined on p218: "(the var object = syntax creates) a variable called object, to store the address for the object".

Btw, why do authors persist in using misleading names for variables? It would be much clearer if they used "banana" as the variable name instead of "object".

11. p387 Creating sliding menus - This section just has a sidebar on Access Keys, but I think they're more interesting than the section topic. You can use the HTML accesskey attribute to allow a user to navigate the page with the keypboard, like this example:

<a href="index.html" accesskey="h">Home</a>

It's funny I've never noticed this in an HTML book.

Here is the Wikipedia article: en.wikipedia.org [http://en.wikipedia.org/wiki/Access_key]

Regrettably, you don't access the link with just the accesskey: you have to press some combination, like Alt-accesskey. Refer to the Wikipedia article for details. Browsers vary.

Remember to avoid assigning access keys that already are assigned, like alt-F for the file menu. Indeed not so simple: www.cs.tut.fi [http://www.cs.tut.fi/~jkorpela/forms/accesskey.html]

12. p478 Appendix D Browser-safe fonts - This is a nice table of font names and a font sample for each font, for the Microsoft Core Web Fonts, Mac OS, and Windows OS. I don't remember seeing such a comprehensive guide before. It certainly makes me wish every computer had the full Mac set.

I did a search for something similar and the first result was the actual PDF for these pages in the book, at the site of the book's author, Jason Cranford Teague: www.webbedenvironments.com [http://www.webbedenvironments.com/css_dhtml_ajax/downloads/BrowserSafeFonts.pdf]

He appears to have put the PDF on his site in 2009-05 in the hope of encouraging someone to help him extend it with MS Office 2007 fonts. It is well worth downloading. It is actually interesting just as a PDF because it includes crop marks.

2009 Nov 04 [ Wed ]

Still css layout problems

I have been tinkering with the css since my previous article: www.panix.com [http://www.panix.com/~dannyw/weblog/Chrome/csslayout02.html] and it is now looking somewhat better. I have a working liquid layout in Firefox, and it is not terrible in IE. It's also OK in Opera.

Still, the more I read about bugs and inconsistencies in css, the more I wonder what was really so wrong with tables.

The bicameral mind and spectator sport

Many years ago I read "The Origin of Consciousness in the Breakdown of the Bicameral Mind" by Julian Jaynes (referred to below as "BCM" ). It speculates – with an overwhelming collection of historical references – that the human mind worked in a fundamentally different way until just a few thousand years ago, so that people did not perceive that their own minds were functioning to produce plans, beliefs and judgements, but that spirits, gods or ancestors were supplying advice.

Wikipedia: en.wikipedia.org [http://en.wikipedia.org/wiki/Bicameralism_(psychology)]

I found the possibility fascinating but unproved and perhaps unprovable. However, I filed it away.

Recently I was wondering about rock concerts. Why do people bother going to them? They are very expensive, and the live version of music (even assuming it is actually live and not lip-synced) is almost always technically inferior to the recorded version. It occurred to me that a concert is very analogous to religious ceremonies as described in BCM. Jaynes speculated the experience of such a ceremony – immersed in sights and sounds designed to form a single experience, and surrounded by other devotees – amplified and solidified a shared belief into a shared fantasy. In the case of religious ceremonies, they culminated in the mass perception of gods and miracles. I have often heard reports of rock concerts which stress aspects which seem to me to involve supernatural elements, or at least aspects which have no rational basis: shared, synchronized emotions and perceptions.

But why would anyone *enjoy* this experience?

Jaynes saw the shift from bicameral consciousness as a gradual one. He believed that elements of it survived to today: for instance, in schizophrenics, or in the "general sense of need for external authority in decision-making". My own speculation is that many people still *enjoy* the experience of subjecting themselves to a shared hallucination – our minds are wary of *personalized* hallucinations, but when surrounded by fellow devotees our guard is let down. We can simultaneously perceive the internal certainty provided by the bicameral mind, and the external confirmation of everyone in our surroundings. And in the case of a hugely popular band, one is surrounded by tens of thousands who can be relied upon to largely support one's fantasies.

Still, if I were present at such a concert, even if it were by a band that I really liked, I know I would feel absolutely nothing of this shared consciousness. In fact, if I perceived it at all, I would find it creepy.

So, many people enjoy subjecting themselves to such shared experiences, and many do not. One can think of so many examples. For instance, there is a Monty Python sketch about Nazis who have gathered together in some quiet seaside town in England, and struggle to mobilize the local population; as the leader's incomprehensible harangues blare out, one of his confederates sidles up to one of the sparse crowd and says, "he's right, you know!". The local yokel stares at him, puzzled. Of course, it's easy to resist even a well-organized appeal to one's bicameral mind if only a handful of devotees are present. Once some critical mass surrounds the unwary, their innate vulnerability allows them to be overwhelmed.

So in one way my inability to respond is a strength. But viewed by the mass of people, it is a weakness. Most people *like* to behave like a mob; like "the madness of crowds". When I have watched programs about fashion, I am stunned by how ugly and tasteless the fashions are. There is one particular fashion presenter, Gok Wan: en.wikipedia.org [http://en.wikipedia.org/wiki/Gok_Wan]

Not only is his taste appalling, but his putdowns of the taste of the poor souls who he "advises" are brutally contemptuous. I could not imagine who would willingly subject themselves either to appearing on his show as a literal fashion victim, or to watching his show to pick up fashion advice. But now I realize that what he is doing is reinforcing the shared fantasy that fashion exists and is important, and that people who invest enough energy and time into chasing the phantasmic goals that Wan is pushing have bought their way into a shared fantasy. Whether they are the "winners" – the adequately fashion-conscious who meet Wan's capricious and inconsistent standards – or the losers that he ruthlessly derides, his devotees can feel the warm, close presence of their bicameral mind.

And once this shared fantasy – this "folie a la plupart" – has been built up, the devotees will fanatically defend it. If I wear clothes, or god forbid a hairstyle, that was popular in 1970, or 1930, or 2005, I can be identified as a rebel and rejected. I cannot escape this; I am allotted the role of "rebel" even if I have no idea of the "rules" and no intention of causing offence and exclusion.

Similarly, fans of organized sports seem to believe that the performance of "their" team has something to do with them, but in fact what they are responding to is a bunch of half-understood theatrical tricks essentially similar to those employed by Goebbels. And if I were to make that point to them, they would be as sympathetic as the SS.

My guess is that about 80% of humanity is still eager to hear the voice of its bicameral mind. This corresponds to Van Vogt's estimate that about 20% of men are what he calls the leader type. Even when I first read this many years ago, it was clear that this fraction is not actually particularly skilled at leading people. Instead, they are terribly unskilled at following. Many of the hobos one sees do not seem to be simply alcoholics or insane; instead, it's striking that they just do not want to engage with other people. Perhaps they have an inner voice, or perhaps they are tired of pretending to hear society's inner voice.

It must be wonderful to believe that you have supernatural powers. With the certainty of someone who is hearing his bicameral voice, you can believe, for instance, that you have perfect empathy with strangers, family members, or animals, when in fact people are collaborating on a shared narrative, and the animal has been socialized to play along. There was an old cartoon I remember, about a mole who lives in a beautiful fairyland until a wily fox sells him a pair of spectacles; when his eyes are sharp, he sees that he lives in a hovel in the middle of a garbage dump. At the end of the short, he kicks out the fox and throws the spectacles away so that he can live in paradise again.

But imagine how horrible it is when someone in the group does not play along. You can't just allow him to exist: everything about his actions makes it clear that your sparkly universe does not exist for him. You have to exclude and reject him, or he may actually break down your entire reality system. Apparently it's not unusual for many fans of soap operas to behave as if the characters are real: knitting clothes for newborns etc. Such people may be completely able to function in real life, but somehow have this one hole in reality. The fact that such a thing is possible suggests the existence of a larger mental system that is otherwise dormant, or invisible. Apparently early literature was normally presented as true; I wonder if it was normally accepted as such? tvtropes.org [http://tvtropes.org/pmwiki/pmwiki.php/Main/LiteraryAgentHypothesis]

What happens when two separate shared worlds collide? For instance, football fans from two teams? It's like Jaynes' picture of two competing city-states: both sides agree that what they are doing is good and important and worth dying for, when unconcerned observers are wondering what the fuss is about.

Here are a few notes on Jaynes' book. The page numbers refer to the Pelican (USA) 1982 edition. I include several example of weird English usage by Jaynes; I wonder if his book would have led to a real revolution in Western thought if he had not thrown away the version of his manuscript that the publisher's editor handed him.

1. Book 2 Chap 2 p176 (Literate Bicameral Theocracies): He states "writing proceeds from pictures of visual events to symbols of phonetic events". He asserts "writing of the latter type, as on the present page, is meant to tell a reader something he does not know. But the closer writing is to the former, the more it is primarily a mnemonic device to release information which the reader already has".

He intends this as support for his theory that men developed over this period from the bicameral mind to the conscious mind.

I note it however as relevant to a pet theory of my own: that writing developed before speech. I have never seen anyone else make this speculation because, I'm sure, everyone is used to children learning speech years before they can read and write. But imagine the situation in prehistory before *either* has developed. How much harder is it really to make pictogram notes *for oneself*, whose significance one *does not need to first communicate*, compared with making sounds, which are almost impossible to correctly identify, let alone emulate, without growing up in a society using that speech for years?

2. Book 2 Chap 5 p278 (Foolish Perses): "The often tedious recital... and without development".

I don't wish to reproduce the text here because my point is that his argument in some places, as here, is embarrassingly weak. If something fits his chronology he eagerly adduces it, and if it doesn't fit he insinuates that it must therefore be wrong! Similarly his chronology of the Iliad and the Odyssey.

3. Book 2 Chap 5 p290 (The Invention of the Soul): "According to the theory of the bicameral mind, hallucinations of a person in some authority could continue after death as an everyday matter".

I must admit I rather lost the thread of his argument. In his discussion of brain functions he seemed to be saying that audible hallucinations had a special relevance to bicamerality, but he also speaks of mass hallucinations involving all the senses, at least in earlier periods.

4. Book 2 Chap 5 p290 (The Invention of the Soul): "For there is nothing here of dead strengthless souls wailing about in a netherworld, guzzling hot blood to get their strength back..."

This note is not about bicamerality at all. I am simply struck by the similarity of this description "added into the Odyssey as book 11" to the modern vampire idea.

5. Book 2 Chap 6 p297 (Some observations on the Pentateuch): "Indeed, in trying to do so, whatever our religious backgrounds, we feel, if not blasphemous, at least disrespectful to the profoundest meanings of others".

I have noted that down because of the phrase "profoundest meanings". I just don't know what he meant by that phrase, and that usage is representative of hundreds of others that are at least as foreign. He may mean "profoundest opinions" (like "Meinungen" in German), or he may mean something like "profoundest semantic distinctions". It reminds me of a character in a TV play by Stoppard, who gives a paper at a conference on philosophy and asserts a distinction between "what we mean and what we want to say". Stoppard shows us the interpreters struggling with the simultaneous translation of that, and rolling their eyes at each other.

Jaynes several times in the book gives the impression that he can read classical Greek in the original. It may be that his usages have been colored by this. It may also be an affectation. I have certainly felt the urge many times to use a peculiar form of words in English for the sake of a pun in another language... however weak.

6. Book 3 Chap 2 p355 (Possession in the Modern World): "The vestiges of the bicameral mind do not exist in any empty psychological space... Instead they always live at the very heart of a culture or subculture, moving out and filling up- the unspoken and the unrationalized."

The most interesting part of Jaynes' theory for me is its relevance to the current world, and to current societies and systems of thought. It is a commonplace observation that people brought up in different societies not only believe different things, but interpret the same events in radically different ways.

Or to put it another way, as Gilbert and Sullivan did, isn't it strange that every Englishman born becomes a little Liberal or a little Conservative.

To what extent do the rulers of modern societies understand, or at least unknowingly emulate, the theatrics of Egyptian god-kings and Greek seeresses? When the spectators at a football match spend a hundred pounds to watch a game, grow hoarse with shouting, and then run through the streets scuffling with rival supporters, are they being watched by cold-eyed psychologists with stopwatches and spreadsheets?

7. Book 3 Chap 3 p368 (The Nature of Music): "Try hearing different musics on two earphones at the same intensity". "Musics"? This kind of usage makes me wonder if Jaynes was a native English speaker at all.

8. Book 3 Chap 4 p403 (Objection: Does Hypnosis Exist?): "We are learned in self-doubt, scholars of our very failures, geniuses at excuse and tomorrowing our resolves". Just another example of weird English.

2009 Sep 20 [ Sun ]

Review: TV: Terminator -- The Sarah Connor Chronicles

Presumably you are already aware of the Terminator movies, on which this series was based (although time travel allows it to wipe out the events of the third movie).

This series was cancelled months ago as a result of mediocre ratings. However I quite enjoyed it and want to comment on several aspects. I've been mulling over these comments until now, having just had a chance to see the second series again in recordings.

I'm going to refer to it as TSCC, to distinguish it where necessary from the movies.

Wikipedia link: en.wikipedia.org [http://en.wikipedia.org/wiki/Sarah_connor_chronicles]

As usual, this review contains many spoilers, so if you haven't seen TSCC yet, you may prefer to stop reading here. Anyway, much of this review will be hard to understand until you have seen the series.

SPOILER ALERT

1. Many people have already commented on the peculiarities of the creative process applied to a TV series, but I'll mention some:

-1. There is a huge commercial incentive to continue a successful series even if the original situation has already been played out. A good example is Stargate, where the creators ran out of ideas, believed the show to have been cancelled and made the charitable decision to wrap up all the threads, and then were told the show had been signed up for another season.

-2. On the other hand, the creators may plan a three-season arc, but the show gets cancelled prematurely. That seems to have happened with TSCC: the whole situation was left unresolved by the final episode.

-3. For these and many other reasons, many successful series are written so that the situation basically resets at the end of each episode. I think "Hill Street Blues" was the first major series to be planned with an arc, and it is still somewhat unusual. However, I enjoy as a viewer being able to appreciate plot and character developments more fully than can be squeezed into 45 mins.

-4. A series which is planned as an arc is distinguished from a soap opera because the latter is consciously planned *never* to end: there is never a true resolution. Not only that: events which *appear* to provide some sort of resolution to one of the story threads are frequently annulled when we discover that the person who died was actually an identical twin... etc,etc. I think you can tell that I do not approve of that format and the resolution of a story is very important to me.

-5. In a lengthy series, the actors are not always able to maintain their roles as required. This is particularly a problem in fantasy series where they are supposed to be immortal: a good example is Angel, where the actor playing the titular vampire aged and put on weight very noticeably over the several years from his first appearance on Buffy. Also of course, they may just die, quit, get pregnant or become drug addicts.

2. TSCC had the additional problem of trying to fit in with the movies. As well as having to introduce new actors in the roles we were already familiar with, it needed to be compatible with the general situation of the movies, which thanks to the muddled picture of time travel in the movies was very hard.

OTOH the most recent movie, released since TSCC began, does not seem to fit in with TSCC at all.

3. Because the show was cancelled we will never know, but I believe the show was struggling towards some sort of resolution for the entire situation of all the Terminator stories.

I think one reason why the show was cancelled was that the planned resolution was too close to the (horribly flawed) resolution of Battlestar Galactica: in other words, some sort of alliance between Skynet, or at least a faction of the terminators, and humans.

This was foreshadowed in several ways:

-1. There has always been a mystery about the future John Connor, but he was repeatedly described as surrounding himself with metal, including the Cameron-class terminator. (Although it's not clear that the Cameron we see in the future is the same physical unit that was sent back to protect John in our period.)

-2. In the final episode Ms Weaver, a liquid-metal terminator who has been shown killing several humans during previous episodes, saves John Connor from death and reveals that "John Henry", an AI she has been developing, may save all of humanity. In other words, she killed humans as Cameron does, in order to achieve the goal of preventing Judgement Day. (It may also be that she sees this entire timeline as transitional, so their deaths have no lasting significance.)

See also point 9 below.

4. I think a major reason why the show was cancelled was the overall structure. I believe it was planned to extend through at least three seasons, so major developments occurred very slowly.

The first time I watched most of these shows was on TV, and somewhat out of order – probably the same as most viewers. The impression I got was that the plot was moving far too slowly. The Wikipedia article seems to agree.

5. A secondary problem was that very major plot points were not underlined, and I missed them until a second or third viewing. For instance, Derek realizes that he has changed his own future when "his girlfriend" (Jesse Flores) comes back from the future and tells him that he was tortured by someone who never tortured him in his original timeline. In other words, she is not the same girl as the Jesse that he left in his own timeline. This seems like a major, major issue which affects everything our heroes – and Skynet – are doing.

I actually did catch that one, but a more subtle point – that Derek was rescued from suicide by different people in the two timelines – went right over my head.

Similarly, Derek, having realized that Jesse is not "his" Jesse, kills her for murdering Riley. But he is still stunned by the revelation that Cameron gives him: that Jesse was pregnant by him when he left her, but lost the pregnancy. This seems a little strange. He cannot even be sure that Cameron is from his own timeline, or from that of either of the Jesses. And the one thing he does know is that the Jesse he killed, even if she had been pregnant at all, was pregnant by a Derek from another timeline. Perhaps he is reacting to the probability that *his* Jesse had also been pregnant; but now *his* Jesse is lost on a no-longer-accessible timeline, which *he* destroyed.

What exactly is Derek reacting to? This was not made explicit at all. Are we supposed to stack up all these mysteries with zero current emotional payoff, in the hopes that the final resolution will illuminate everything that has gone before? Sometimes I get irritated when a show makes the points too obviously, but with TSCC I started to wonder if the makers had forgotten to make plot points clear at all.

...Hmm: the Wikipedia article suggests that it is not certain that Derek actually killed Jesse. It's true that the camera does not cut to Jesse after Derek fires at her. I have to say I would feel that it was a cheap trick, reminiscent of a soap opera, if Jesse turns out to be alive. (Nothing against Jesse, btw: if a Jesse *from a different timeline* were to show up, that would be fine.)

6. I was happy with all the actors. Lena Headey (Sarah Connor) was solid, but could do little with scripts that gave her no character development. Thomas Dekker (John Connor) was irritating for a long time, but mainly because of the script. In the last few episodes, where he was given much more powerful scenes relating to several deaths and Sarah's imprisonment, he was impressive.

Richard T. Jones (James Ellison) was especially irritating because of the poor writing. He kept seeing a terminator hand or whatever and then doing nothing whatsoever about it, and thus personified the sluggish plot development. Also, despite being a powerful-looking guy, the show never used that. For instance, we could have had a scene where he doesn't realize Cameron's a terminator, so he pushes her around, and when Cameron decides the time is right he gets a big surprise.

Derek had an oddly soft voice for what was supposed to be an action hero type, but then again, Derek was in that capacity because of Judgement Day, not because of his character. Also, I knew several guys in special forces who like him did not *project* what they could do.

7. I want to discuss Cameron (Summer Glau) separately for several reasons. One is that the "character" is *supposed* to be emotionless, so as an acting role it can't be compared to the others. Glau seems to have had a succession of such roles in her career, so that I can hardly evaluate her acting generally. What I can say is that the few occasions when Glau had an opportunity to show extra depth in TSCC, it really worked. For instance, when Cameron goes haywire, attacks John, and he is about to destroy her, she pleads for her life with oddly human desperation, crying out that she loves him.

Of course one reason why the scene is powerful is that none of the humans observing her were inclined to believe that the robot was capable of loving anybody, so it seems like an utterly crude final tactic that the robotic mind picked as worth trying despite the fact that it would only work if the humans were fools.

Another episode where Cameron/Glau is allowed to show a much wider range of emotions is "Allison from Palmdale". In fact, this one episode changed my opinion of the entire series. In this episode, Cameron's mind goes haywire, and she reverts to the personality of the human on which her design was based, "Allison Young". We see flashbacks of Allison's capture by the terminators, and of a Cameron-model terminator finishing the process by killing Allison.

This is the first time we have direct knowledge of Cameron's thoughts. Previously Cameron's motives/programming have been unknowable. Now we see, or at least glimpse, her own experiences. That entire personality had always been inside her. Perhaps Cameron herself, rather than a similar unit, had killed Allison, and that would have been a part of her memories too.

For a time, Cameron almost *was* Allison. When Cameron's main programming recovered, Allison was lost.

All through that episode, simple details were intensely poignant. Although there are very few action scenes, at least in the present, far more seems to happen than in most other episodes. For instance, Cameron, still remembering herself as Allison, calls the home number that is in her memories, but the woman who picks up says there's no Allison there. Cameron is disappointed and fearful. But we see that the woman is pregnant, and as she puts the phone down she says that Allison sounds a nice name. So Cameron has in effect provided the name for the as-yet unborn girl who will live through Judgement Day only to be simulated and murdered by the terminators. In a moment, we feel the entire tragic arc of Allison's life.

But of course we expect Cameron's programming to return at any time. Cameron is like the bomb under the table; the audience is in suspense over everything that happens while that bomb is ticking. A somewhat obvious general point is that the Cameron model is a slender, attractive young girl. (Glau is in her twenties, but is believable as a high-school student.) As well as providing eye candy, this works well as a counterpoint to the Schwarzenegger model in the movies. Also, it adds something to the general weird menace of the terminators. In the final episode, Cameron approaches John while he's sleeping, then removes her shirt and bra, climbs on the bed and makes him cut her abdomen open and insert his hand under her "breastplate", apparently to touch her atomic power unit to double-check that it is not leaking radiation. (I would not have guessed that this procedure would work, but I do not represent myself as an expert on micro-shielded reactors.) John is straddling her, with their faces close together. We are not told what he's feeling, but it has to be quite a mixture of emotions.

Very incidentally, that scene reminds me of a repeated problem with the depiction of all the terminators. We are repeatedly told that they are considerably heavier than humans, which is why they can't swim. I can't remember what Cameron is supposed to weigh, but I think it was probably over 100 kg (whereas Glau probably weighs less than 55 kg). But we never see objects reacting to that weight. When she lies on the bed, her narrow, heavy little body should press deeply into the mattress. When she gets in, anybody lying next to her should be bounced. Likewise, when she gets into a car or elevator it should bounce noticeably on that side. I don't think it would have cost very much to throw in that special effect, and it could have been used as a plot point once or twice. (Also, I think the show was inconsistent on whether terminators maintain human body temperature or not. Presumably they would be capable of it, as we are shown one male model who apparently sleeps with his duplicated victim's wife over several weeks.)

Another issue is Glau's appearance. As a terminator, her appearance presumably should not age, but I suppose it could, just like a Buick's. However, flashbacks, and time travel, mean that she, *and the other characters*, often need to be shown in younger forms, and I'm guessing that her beautifully-slim appearance may be more vulnerable to boring old-fashioned one-year-per-year time travel than some of the other characters. When we see her in the future, in the final episode, Glau looked distinctly older for some reason.

8. The final episode introduces several new threads. By the end, Cameron's chip has been removed, and her body is left slumped in the present as John Connor flees to the future. We are told that John Henry must have taken the chip, but why? It would have made more sense for him to do the opposite: dump his programming into her chip. (But he managed to leave all his hardware behind, even though we had previously been told that even disconnecting a fan would be a problem for him.) Presumably Cameron's chip, being from the future, was so advanced that it was easily able to upload the John Henry AI, so that the John Henry body would no longer need to be tethered, but why use that body instead of Cameron's? Perhaps Cameron's hardware was breaking down. We don't know what loading the AI would have done to Cameron's original programming or vice versa. If John Henry were to cry out "I love you, John!" it might not have the desired effect.

Also, we see that in John Connor's timeline, this future does not contain an adult version of him; also his father (Kyle Reese) is alive, having apparently not been sent back (which would make sense if there were no adult John Connor to be his commander); and a Cameron model is very obviously attached to Kyle.

This seems very odd. It would surely be very difficult to get back to the timeline where Cameron is together with John. Perhaps John has to make a decision to erase this timeline, and his own father. It would have been great if the show has used this opportunity to make clear what it thought was actually happening when the timelines were being changed. Or perhaps the Cameron of this future is the *same* unit who had been with John, and *never had to be reprogrammed*, but *has never told Kyle*, because she knows he will have to be erased again from the timeline.

Right at the end of the episode, we hear the characteristic crackle and see the blue flash of an arriving time traveller, and we hear Sarah's voice. It would seem that Sarah has travelled separately to join him. But I wonder whether she can logically be assumed to be from the same timeline. John, apparently by absenting himself over the intervening period, has created a totally different timeline, and one which would have "already" sent back *different* expeditions into the past (one assumes this timeline would have involved battles over Kyle's past instead of John's). So Sarah's original timeline would "already" have been wiped out, or at least disconnected from the one we see.

9. I didn't think the picture of time travel was very solid in the first movie. It got worse in the second, and the third movie seemed to be saying that the events of the first two were pointless.

However, I think TSCC was struggling towards a resolution of the entire issue which might have made sense of many problems both large and small.

For instance, in the movies we only see Skynet using time travel against John Connor. I don't recall any explanation of why Sknet restricts itself in that way (instead of wiping out thousands of other irritants as well). I think Skynet is just very limited in its ability to use time travel for some reason. But in TSCC Skynet is running many separate operations in different times.

It's possible that Skynet is very conservative in meddling with the timeline, because it's afraid of making a mistake which erases itself from the timeline. So it's forced to choose plans which seem relatively picayune, like the episode about the nuke plant.

On the other hand, almost anything it *does* do could have that effect anyway. Can Skynet actually *predict* what effects its meddling will have? The lamentable third movie introduced the idea that Skynet *in some form* is inevitable. That seems to be what the events of TSCC are confirming: when our heroes destroy some necessary element that was to lead to Skynet, it shifts the timeline, possibly postponing Judgement Day, but not eliminating it.

The mistake of the third movie is to conclude that what we do has *no* effect. That idea would make the events of the first two movies pointless. The conclusion should be that we should *try something else*. I believe that that plan underlies all the events in TSCC. My speculations follow.

John Connor, in the future, has realized that strong AI is inevitable, but also that it is *not* inevitable that it should immediately try to eliminate mankind. So he sends back the Cameron model, so that *his own younger self* will be affected by his growing companionship with it, and perhaps will be able to build some sort of alliance with terminators earlier. And perhaps also so that Cameron will *reprogram herself*. In the final episode, Cameron agrees that her mind and body were formed with the goal of killing humans, and that part of her still "wants" to do that; only the superficial reprogramming added by John in the future is preventing her. But perhaps she too will learn and change, like John Henry.

This basic idea also explains Catherine Weaver's actions (played by Shirley Manson). Her plan is not to convert a terminator, but to build an AI from a new start, one which can value human beings, and will not only not start Judgement Day itself, but which will take over dangerous AI as it develops, and will defend the timeline from attacks by Skynet. She is perhaps the same liquid-metal model that was on the submarine (in Today is the Day part 2) and answered "no" to John Connor's offer to form an alliance against Skynet. In analyzing that response, it's worth remembering that she herself was presumably based on the Skynet codebase, so not only would her survival be a threat, but it would presumably be wiped from the timeline if her own plan were successful. It's odd that she would not accept John's plan, when the existence of her own plan is proof that terminators can decide to coexist with humans. Perhaps she feels that it's too risky. Or perhaps her goal is to wipe out all the timelines except one, whereas John wants to protect them or repair them somehow. What made *her* change her mind about humans? Did she come back and immediately murder the human whose form she took, or had she been living as a human for many years?

One wonders what Skynet's attitude is: does it know what the other groups are actually aiming at? Perhaps it has a very exact grasp of time travel and what it needs to do, but is extremely restricted because it actually sees its own existence as *very unlikely* (despite the way it seems to keep coming back). Also, what does it feel about the terminators? If it realizes that they are not just reprogrammable but can actually develop their own goals, how would it react? Is it in communication somehow with other timelines, so that it has "always" been fighting more against the other AI than John Connor?

Perhaps the development of time travel has made the timeline extremely *unstable*. So terminators (and perhaps humans) from one far future – way after Skynet – are trying to create a stable timeline that will lead to them, and the only way to create that stability is to create a non-murderous AI, which will remove the incentive for subsequent timeline-changing travel. (It's worth pointing out that when a timeline is changed, all those people are effectively dead, just as much as if they had been nuked.)

Overall then, the resolution would be surprisingly similar to that of Battlestar Galactica: that the robots and humans are tired of war, and decide to make a new start. Let's hope it would not be as full of ridiculous errors and lapses in logic as BSG's.

10. Viewing TSCC as a product, I think the basic mistake of TSCC was worse than the sluggish development: we simply never got to see the heroes having and enjoying any successes. It's very wearing to get a constant stream of downer episodes where our heroes are put through hell and the payoff is bare survival. The first movie worked because humans apparently won at the end, and presumably the goal of the series was to end with some sort of victory, but it turned out to be too long to wait. However, I would have waited for two more seasons to see another episode as good as "Allison from Palmdale".

Huge problem with my new CSS layout in IE7

I just noticed that most of the links in the layout are not clickable in IE7. They *look* clickable, which is why I guess I missed this when I checked before. I had no idea this weird bug could exist, but now that I've searched for it it seems to be common with layouts including a negative width parameter.

As I don't run IE7 on my laptop I haven't been able to fix the original nifty layout, so I've gone to a rather dumber layout which hopefully won't show this issue when I get another chance to check in IE7. The new new layout doesn't resize as well.

I can check in IE6, which is clickable, but still has the problem of displaying the sidebar at the end of the file. That seems strange. Perhaps I can use the "* html" trick in the CSS.

2009 Aug 24 [ Mon ]

Creating a document with multiple page orientations in Open Office

I needed to make a simple booklet. Because I wanted it to be easy to copy, I designed it to use just one side of an A4 sheet, folded into 4 to provide 4 working A6 sides, with the inside 4 wasted.

I planned to create the document as a succession of A4 sheets and reduce to a single sheet later. The design involved two landscape-shaped tables as fill-in forms, each requiring a whole page (to be large enough to easily fill in with a pencil). But the remaining pages didn't need landscape orientation, and I wanted to lay them out as portrait orientation.

I thought I knew how to do this but I actually had to take half an hour to figure this out, so I'm posting this in case it saves anybody else some time.

I thought I could apply a different page format if I first divided the document into sections, but that didn't work. (Maybe that's the trick in MS Office, but not Open Office – I haven't checked.) In Open Office Writer, when I changed section 2 to landscape, it changed section 1 and 3 to landscape.

A webpage suggested it would work if you apply a page style (something MS Word doesn't allow), so I created a portrait and a landscape style, but that didn't work either: again, setting a page style to one section set the same style for the other sections.

Eventually I noticed an option in the Insert break... dialog. At the time you insert a page break, you can select a different page style. So if you have portrait and landscape page styles set up, you can set them at that time.

I don't understand why this does not seem to be doable *after* inserting the page break. I suspect that if you try saving to MS Word the results are disappointing.

Similarly, if OO decides to create a new page in the middle of the document – which was happening to me a lot as I adjusted table sizes – it was very tough to delete the page, even though it was apparently empty. I managed it in the end but I'm still not sure what the trick is.

I used the Java utility, Multivalent - Impose to lay out the four A4 pages on a single sheet, as described in a couple of earlier posts.

Command line used: /usr/lib/jvm/java-6-sun/jre/bin/java -cp /home/dannyw/java/Multivalent20060102.jar tool.pdf.Impose -paper A4 -verbose -margin 5mm -dim 2x2 -layout "1u,4u,2l,3l" /home/dannyw/PDF/form01.pdf

The margins used were adequate with my printer, including the margins that I had allowed on the original A4 pages in Open Office Writer.

Note that the Impose utility *forced* the landscape pages to fit inside the portrait-shaped spaces on the A4 page by rotating them. I had to put in the "-l" (that's an "L" for "Left") spec in the command line for those source pages to make it do what I wanted.

Incidentally, I have realized that when I print PDFs something in the print software chain is causing the page size to be forced to A4. I haven't figured out what it is, especially as that option appears to be turned off. Also, the way it works does not seem to be anything anyone would want, because the result is that the bottom of the page is actually outside the printable area in some cases.

2009 Aug 19 [ Wed ]

Irritating problem with Open Office Writer -- workaround

I'm running OO Writer version 2.4.1, but apparently this problem has been around for a long time so it's unlikely to ever get fixed. However, at least I figured out what's going on. I hope people who run into it will find this page and waste less time than I did.

I set up a document with headings and subheadings and wanted to set the headings to automatically show heading numbers (1, 1.1, 1.2, 1.2.1, 2, 2.1 etc). I set to work setting the required heading formats in the styles window. After a few minutes work I was surprised to find that no headings at all showed up in the Navigator.

I couldn't fix it and started the file over. After I cut and pasted all the etxt, including all the headings, into a new blank file, I could see the headings in the Navigator, and I breathed a sigh of relief. I started dinking with heading styles again. After a while I realized that the Navigator was never showing level 3 (that is, headings like 1.2.4). Indeed, if you demoted a level 2, it became a level 4, and if you promoted a level 4, it became a level 2 – bypassing level 3.

After another (long, frustrating) while I noticed that if you went to modify the heading 1 or 2 style, under the Numbering tab the Numbering Style showed *blank*, whereas Heading 3 showed as "Numbering 1". There was no way to set it back to blank.

However, when you click Tools - Outline numbering - Numbering - Level 3 - Paragraph style, the "paragraph style" showed as "(none)", whereas the other levels showed style "Heading 1", "Heading 2" etc.

After I set level 3 to show "Heading 3" in Tools - Outline numbering (and similarly dealt with level 5 which I had also dinked with), the Navigator showed and set the outline levels as expected. And all the heading styles showed *blank* in the Numbering Style dropdown.

This seems to be related to the fact that Open Office has two separate and incompatible systems for handling headings, as discussed here (which the writer of the article calls multi-style versus single-style outlining): www.linuxjournal.com [http://www.linuxjournal.com/article/7759]

In other words, when you set the format via one route, it silently zeroes out the other setting. So my advice is, only ever go via Tools - Outline.

However, the writer of the above article does not go into the peculiar behavior I ran into. I cannot imagine why anyone would want this behavior. The fact that the Navigator dialog silently skips a level when you try to promote or demote to a mis-set level suggests that someone in the programming team was aware of the issue and put in a brain-dead workaround.

Bugs with css in Internet Explorer

I normally use Firefox.

When I changed the layout of this blog over to CSS a couple of days ago from tables, I checked the appearance of the tables in Internet Explorer 7, but missed a couple of issues.

One was that IE6 does not seem to represent the css for the layout in columns at all: the navigation text is rendered at the end of the file, ie the same as it is in the html.

The other bug is something I should have noticed before. I use the overflow:auto setting in css for displaying programming code blocks in my postings. The result should be – and in Firefox and Opera, it is – that if the line length is longer than the available window width, the browser displays a slider under the line so you can view the whole thing. (I handle print mode differently).

But if the block happens to be a single line, it displays in IE just as a slider control, and you can't see the text behind it at all! I searched for how to fix this, but haven't been able to find a fix yet.

If the block is longer than a single line, the display is less broken.

2009 Aug 15 [ Sat ]

Moving this blog to css from tables

As I promised about five years ago, I have moved the layout to css instead of tables.

At the moment there is still some css in the head of the page, but I intend to move it into my main.css file when I finish dinking with it.

The main reason to do this – aside from the fact that all the web pundits have been demanding it for at least the last eight years – was to move the text of the sidebar to the end of the file. I've always been confused as to why Google returns a search to a phrase on every one of my pages with a single hit and "to find 1190 very similar pages..." Maybe it's because the *start* of the file has always been identical, and in the case of individual postings the actual posting itself has been a small fraction of the file.

[2009-08-17: Oops – the actual prompt from Google is as follows:]

In order to show you the most relevant results, we have omitted some entries very similar to the 2 already displayed. If you like, you can repeat the search with the omitted results included.

Also, there were several niggling little problems when the page resized that I put off dealing with for a long time because I was planning to redo in css. Hopefully I will now at least have different problems.

A further small reason is that I have started turning off css when I browse *other* websites. I've noticed it often makes them look clearer, but it's a pain to have to page down several times to get past all the header and sidebar material. So I thought I'd do it for the sake of people who are as snooty about my style choices as I am about a lot of websites. [2009-08-17: ie, I put the text of the sidebar at the end of the html so that if you turn off the css you don't have to page down to reach the actual content.]

One thing that held me up for several weeks was that Firefox had some sort of weird problem with my new css version of the layout that caused the page display to flicker [2009-08-17: ie, it started to flicker continuously until the page was expanded considerably, as if the rendering was hunting between two unstable sizes] if the window size was reduced beyond a certain width. It didn't happen in Opera or IE7, but I couldn't see why it was happening at all. I still haven't found anyone else reporting it as a bug, but I noticed after a recent Firefox update it stopped happening, so presumably it won't be a major issue for Firefox users.

Right now the only problem I see is that the nested lists that show the folder layout in the sidebar are not indenting. I should fix that promptly, as without indenting the listed number of posts in upper-level folders is even more confusing.

...I also fixed a couple of little problems relating to the picture of my late wife Joanna and the link to articles about her.

...Phew – I think I fixed the nested-list issue by setting the padding-left value to 0.3em. I haven't checked it in IE yet. I also fixed the way list bullets displayed to the left of the box. (Why would anyone want that as a default??) [2009-08-17: the nested list looks OK in IE7 according to netrenderer.]

2009 Aug 13 [ Thu ]

Thai tones and tone sandhi

In a couple of previous postings I talked about the "downdrift" which I had observed in Thai:

  • www.panix.com [http://www.panix.com/~dannyw/weblog/Asia/Thailand/Thai-language/thai-downdrift01.html]
  • www.panix.com [http://www.panix.com/~dannyw/weblog/Asia/Thailand/Thai-language/thai-downdrift02.html]

I also briefly referred to "the exact rules for downdrift, as a function of the sequence (or environment) of tones". Indeed, while trying to establish any rules for the pitch variations I observed, I assumed that it was the environment of each syllable which determined the tone (as opposed to the Thais trying to frustrate the foreigner).

Yesterday I ran into the standard term for this effect: "tone sandhi". The word "sandhi" describes the general phenomenon that speech sounds are affected by their environment – for instance, that "input" is often actually pronounced "imput". Tone sandhi of course means this phenomenon occurring in tones. It is well understood in Chinese and beginners are taught the rules as soon as they are taught about tones, but although the phenomenon is definitely present in Thai it is not well defined. Wikipedia: en.wikipedia.org [http://en.wikipedia.org/wiki/Tone_sandhi]

So far I have found no comprehensive description of the effect in Thai, even an unsatisfactory one. Again, it seems that the Thais themselves are not aware of it (eg NECTEC), except I suppose for their specialists at Chula.

2009 Jul 23 [ Thu ]

More on Thai downdrift -- measured pitch in "Thai for Lovers" phrases

A few days ago I described the phenomenon of downdrift and its relevance to Thai: www.panix.com [http://www.panix.com/~dannyw/weblog/Asia/Thailand/Thai-language/thai-downdrift01.html]

I have since run an analysis program on a few samples from the tape recording I have of the "Thai for Lovers" book (which I recommend): www.amazon.com [http://www.amazon.com/Thai-Lovers-Nit-Ajee-Jack/product-reviews/1887521666/ref=cm_cr_dp_all_helpful?ie=UTF8&coliid=&showViewpoints=1&colid=&sortBy=bySubmissionDateDescending]

You can click on the diagrams to hear the audio. I don't have permission to distribute these recordings and I hope this is covered by fair use. If Nit and Jack want me to stop they can email me.

I apologize for the poor phonetic transcription. I did not figure out how to use phonetic characters initially. The green curve is amplitude, on a log scale. The blue/cyan curve is pitch, on a linear scale (er – I think).

The following phrase means "you are very handsome" (spoken by a female). Note that the first syllable is middle tone, then low tone, then falling tone – that is, using the normal terminology. However, the actual pitch curve (shown in blue) shows that the pitch of the first syllable is steadily falling, with no clear break as it falls steadily into the next syllable.

Pitch in thai: khun laaw maak. Links to mp3 file

I naturally thought I had this tone thing all figured out. Then I looked at a couple more examples. Here's one for the phrase "you are very beautiful" (spoken by a male) (oops, I forgot to put the English in the diagram):

Pitch in thai: khun suay maak. Links to mp3 file

The first tone is middle, then rising, then falling (in normal terminology).

Note that the "s" sound at the start of "suay" doesn't have much amplitude and the pitch is rather poorly defined, so the tone really starts at the vowel where the amplitude is back up. In both these diagrams, the software doesn't try to define a pitch where the amplitude is below some threshold.

This sample doesn't really show downdrift, though, does it. However, it does seem to show that the low level of the low tone affects the pitch of the subsequent tone – perhaps some sort of "tone terracing": en.wikipedia.org [http://en.wikipedia.org/wiki/Tone_terracing]

But what's really striking is the pitch of the rising tone in "suay". Not much sign of rising pitch there, eh!

It's quite a lot of effort to analyze even brief phrases like this, especially when you don't know what you're looking for. Several times I thought I had a rule, only to find it broken. It may well be that female speakers, for instance, have downdrift, but non-katoey males do not.

It occurs to me that even the NECTEC guys, who are Thai themselves, may not have any insight on this, and may have simply averaged the tone samples, obscuring tone-terracing or similar effects.

Right now my picture is this:

1. My earlier insight that tones are largely *generated* by jaw movements is somewhat tangential to this, except in that it puts physical limits on pitch variation. That is, you can't utter a vowel and instantaneously change pitch during that vowel: you're limited by how fast you can move the jaw, so the pitch has to move fairly smoothly.

2. Clearly, Thai is not a "register tone" language, where tones are always at a particular pitch, even taking into account that different speakers have a different pitch range. Instead, tones are determined by the *variation* in pitch during the tone, although that variation itself seems to be strongly affected by the environment of the syllable.

3. In "Prosodic Features and Prosodic Structure" by Anthony Fox, as I quoted before, he says:

In checked syllables with short vowels, only high and low tones occur; in checked syllables with long vowels, only falling and low tones occur

It occurs to me that if I can put together a theory on how Thai tones are generated and perceived, it should be able to predict the above, if only by predicting that other tones cannot be reliably perceived.

If I can convince myself I have a theory, I'll post it. But I'm pretty doubtful. I wish I had access to a Thai with some phonological training that I could collaborate with.

2009 Jul 14 [ Tue ]

Thai tones and downdrift in "Thai for Lovers"

I have never felt satisfied with the descriptions I have read of tonal languages. For instance, I didn't understand how tonal languages conflict with following a melody when songs have to be sung in a tonal language. I would have commented much more forcefully if I was really sure I could utter and detect Thai tones with reasonable accuracy.

A couple of days ago I was listening to a recording of "Thai for Lovers – A complete guide to the romantic culture of Thailand" by Nit and Jack Ajee. This is a very well-made book, as I have commented before. I would recommend it to anybody who is interested in learning Thai conversation, not just to people who plan a physical relationship with a Thai person. I was using the recording to once again try to learn to distinguish Thai tones.

I was initially depressed by my inability to detect the "right" tones, but then I started to think there was something wrong with the tones themselves. In particular, I started to think that I was hearing "downdrift": en.wikipedia.org [http://en.wikipedia.org/wiki/Downdrift]

Downdrift is the tendency of the tones in a sentence of a tonal language to drift downwards. I had a vague memory of downdrift but only in connection with African tonal languages, not Thai. But when I started to look around, it turns out that there are sources which confirm that Thai is subject to downdrift.

For instance, here is a link to a NECTEC article (dated 2000) on text-to-speech synthesis for Thai text: www.cp.eng.chula.ac.th [http://www.cp.eng.chula.ac.th/~boonserm/publication/ijufks_tk2001b.pdf]

Btw, don't worry: all the articles I give links to here are in English, although the translations may be rather imperfect.

Downdrift is referred to several times as a feature which needs to be built into a speech synthesizer to improve the quality of the speech output. On page 5, there is a figure which shows a good example of downdrift: Example of downdrift in Thai

Here's another link. This one is a NECTEC article on doing speech recognition in Thai www.cp.eng.chula.ac.th [http://www.cp.eng.chula.ac.th/~boonserm/publication/ijufks_tk2001b.pdf]

Now this has an extremely interesting chart which contrasts the pitch as a function of time for each of the five tones: Tone contours of the five tones in Thai

However, it's followed by an even more interesting graph which shows how the pitch varies between the same words uttered as a complete natural sentence, and the same words uttered in isolation: Comparing tones for Thai words in isolation and in sentence

While searching for "thai downdrift" I also found this book "Prosodic features and prosodic structure" by Anthony Fox (accessible via Google Books) which confirms that Thai downdrift is not a crazy invention of those wacky lads at NECTEC. The following observation [2009-08-13: from that book] has nothing to do with downdrift but I found it quite interesting, and it might be easier to remember this than try to figure out the required tone from the spelling: Image of text from Google Books: only certain tones are possible in Thai

All of this stuff on how tones are actually produced is really contradicting what the books for foreigners say. That chart showing tone contours alone: none of those really matches the standard descriptions. Btw, that chart doesn't come from somebody's golden ear: those are based on actual, if averaged and smoothed, measurements of "F0", the fundamental frequency detectable for each syllable.

It also makes me think about the advice you would hear sometimes: "don't try too hard to get the individual tones right, just try to copy how the Thais say it". I think the real meaning of that was "we know our description is almost useless" – as I thought at the time. Also, I now feel quite a bit more sympathetic towards the Thai people who were unable to explain how to reproduce or recognize tones.

Anyway, I'm pleased that I correctly detected downdrift; it makes me think I may be able to make some more progress in correctly detecting tones. However, I cannot find a reference which specifies the rules for "assimilation", ie the exact rules for downdrift, as a function of the sequence (or environment) of tones, so I assume my progress will be limited.

I may get around to measuring the pitch on a couple of examples from the "Thai for Lovers" recording so that you can see what I mean.

This is a link to reviews of "Thai for Lovers" at Amazon; if you feel like buying it, make sure you get both the book and the CD – I couldn't be sure if the book was provided with the CD or not: www.amazon.com [http://www.amazon.com/Thai-Lovers-Nit-Ajee-Jack/product-reviews/1887521666/ref=cm_cr_dp_all_helpful?ie=UTF8&coliid=&showViewpoints=1&colid=&sortBy=bySubmissionDateDescending]

I had not looked at these reviews before and was quite interested in the comments. I can see why people would say that the tapes are too fast and are not set up to provide repetitive drill for learning phrases. On the other hand, tapes which are designed for that format tend to need 50 or 60 hours of content. I actually got the book years ago when no CD was available and transferred the audio from the tape (or was it tapes? I think there were two C60s) to my hard disk. That allows me to fairly easily repeat snippets, compared with having to struggle with a tape deck.

I wish MP3 players were available with a user interface that was satisfactory for learning languages. Most of them don't even have fast forward and rewind buttons. Even most computer software is clumsy. You can use a general-purpose audio program like Audacity; currently I'm playing with Transcriber: www.etca.fr [http://www.etca.fr/CTA/gip/Projets/Transcriber/]

Transcriber has quite a nice interface for adding text labels to segments of audio. I'd like to convert the transcription to subtitles or lyrics or something but haven't found an easy way yet. The Transcriber website leads to this survey of annotation tools and resources, which seems worth exploring: www.ldc.upenn.edu [http://www.ldc.upenn.edu/annotation/]

Some of the comments at Amazon on "Thai for Lovers" are allegedly from Thais who claim that the Thai is low-class. I wish my Thai were good enough to be sure of that. What I can say is that the Thai script appears to be correctly spelled, that the phonetic transcription is quite consistent, and that the translations appear to be idiomatic; for instance the translation for "I had a good time with you" was "yùu gàp kun sa-nùk mâak", ie "be-located with you fun much". In other words, at least one actual Thai must have okayed all this. (One of the comments at Amazon suggests that the "Nit" of this book is the same person as "Benjawan Boomsan Becker", who is credited with the "Thai-English English-Thai" dictionary from Paiboon Publishing, which I am very happy with.)

I invite any Thai who feels that the Thai in this book is low-class to produce a similar volume for dealing with middle-class Thais.

2009 Jul 12 [ Sun ]

How much money the British government is spending on the credit crisis

You see various headlines with widely differing numbers. In particular, the Congressional bailout plan had a widely trumpeted 700-billion USD bottom line, except that the bill actually allowed an unlimited amount of money to be spent and specifically kept the actual expenditures secret.

And anyway, the real sums were being spent by the Federal Reserve to prop up the financial institutions. The last time I saw an estimate for that I think it was 20 trillion USD. Some people talk about the Reserve as if it was spending its own money, but what it is actually doing is diluting the currency, just like the Weimar Republic.

But I now have a few current figures for the British government at least. See Daily Mail article "Bad omens for stock markets" (2009-07-10): www.dailymail.co.uk [http://www.dailymail.co.uk/money/article-1198934/SAM-FLEMING-COMMENT-Bad-omens-stock-markets.html]

It mentions:

1. The Bank of England has already bought bonds valued at over 100 billion GBP from financial institutions

2. The government intends to sell 220 billion GBP in gilts by the end of the year

It's unclear to me whether the first figure includes the 50 billion GBP spent on propping up the Royal Bank of Scotland.

But it's fairly clear that whatever the government does will need to fit into that 220 billion GBP borrowing figure, and some fraction of it will need to go to actual productive industry.

Although another intereresting figure in the article was this:

UK firms tapped investors for 32 billion of extra funds - a record high - according to Dealogic figures. That's up from 28 billion in the same period in 2008 and just 6.7 billion two years before.

I'm embarrassed to say that I don't actually understand what these companies were doing to "tap investors". I think it means that they sold more stock, diluting the value of stock held by current investors, although that always seems like straight theft to me and I don't understand why it's legal.

2009 Jul 11 [ Sat ]

How to make booklets using the Java utility Impose from Multivalent

It's much more convenient to carry a printout as a booklet instead of a sheaf of A4 pages, but it's quite clumsy and time-consuming to lay out the pages in the right order and orientation even with a powerful layout program. Btw, this kind of layout process is called "imposition". When you set up a layout so that the output sheet can just be folded to create a set of pages in the right order, the set of pages is called a "signature".

I did something similar a few years ago when I created my "Thaitones" booklet, doing the layout in Corel Draw: www.panix.com [http://www.panix.com/~dannyw/pdfs/tonechart.pdf]

It was very fiddly to do the layout, and a lot of work would need to be re-done to create a similar booklet. I had it in mind to find a better way which would make it easier to experiment.

If you are running Windows, you can buy the Clickbook utility. I bought a copy myself more than ten years ago, although I no longer have it. It doesn't seem to have added many features since then, but I remember it being quite convenient and stable, so I'd still recommend it: www.clickbook.com [http://www.clickbook.com/]

Clickbook works as a virtual printer. You lay out your document in a word processor for your normal paper size, print from your word processor to the quickbook driver, and then the driver gives you options for reducing and rotating pages to produce various types of booklet and so on. It's very nice, holding your hand with instructions for turning the stack of paper and so forth.

If you're running Linux, or Clickbook doesn't have the features you need, then you can download the PDF utility package Multivalent.jar from Multivalent: multivalent.sourceforge.net [http://multivalent.sourceforge.net/download.html]

You should probably check out the info on their website in addition to this article. I am mainly explaining just the Impose tool here, but there are many additional features in the Multivalent package. I hope my extra explanations save somebody some effort.

There are some limitations; for instance, for some reason links don't work. This is probably not a problem for a file intended for print output.

I'm running Ubuntu. Usually I like to install software via the Synaptic package manager. In this case, however, no Ubuntu/Debian package was available. But it turns out the install is not very difficult, although there were several gotchas which I needed to figure out.

The .jar extension on that file means it's a Java file compiled to bytecode. You can just put the jar file anywhere, but then you need to run the java processor on it in the shell, as in this example:

java -classpath ../Downloads/Multivalent20060102.jar tool.pdf.Impose -version 

Unfortunately, although the "-version" option to the Impose program seemed to work OK, almost everything else seemed to fail with this error:

java.io.IOException: incorrect header check @ 0

It turns out that Multivalent does not seem to like the Gnu version of Java which I was running:

java -version 
java version "1.5.0"
gij (GNU libgcj) version 4.2.4 (Ubuntu 4.2.4-1ubuntu3)

You would think this would be OK, as Multivalent specifies 1.4, but they also specify Sun as the provider, so I downloaded that:

sudo apt-get install sun-java6-jre

and then everything worked much better. Not only did the utilities work, but also they check the value of the environment variable CLASSPATH; the Multivalent website tells you that you can set that value in the shell so that you don't have to keep setting it as a parameter in the command line. That indeed works with Sun Java, but I could not make it work with Gnu Java.

Still, I hadn't uninstalled Gnu Java, so I needed to explicitly call Sun Java on the command line. When you install it, nothing tells you *where* it was installed, but I eventually found it. You then call it explicitly, like this:

/usr/lib/jvm/java-6-sun/jre/bin/java -version

I would have thought you would also need to tell Sun Java where its libraries were installed, but apparently not, or else it magically works with Gnu libraries.

You can then do something useful like this:

/usr/lib/jvm/java-6-sun/jre/bin/java -cp /home/dannyw/java/Multivalent20060102.jar tool.pdf.Impose /home/dannyw/PDF/danny02.pdf

This takes the input file danny02.pdf and produces an output file in the same directory as the input file, called danny02-up.pdf. The Multivalent site says the output file from running Impose is called danny02-im.pdf, but I never saw that happen. Without any parameters, Impose defaults to a 4-up layout.

I was afraid that a Java utility would be dog-slow, but it was actually gratifyingly fast. Also, the output file was only slightly larger than the input file.

I had a lot of difficulties optimizing the layout for a 16-page booklet on a single A4 sheet. I found the info on the Multivalent website to be a little unclear and misleading. Surprisingly, it was straightforward to make a dummy folded sheet to get the orientations of each page, and set them as required using the "-layout" parameter.

The following works well for me:

/usr/lib/jvm/java-6-sun/jre/bin/java -cp /home/dannyw/java/Multivalent20060102.jar tool.pdf.Impose -paper 210x284mm -verbose -margin 5mm -dim 2x4 -layout "16r,9l,1r,8l,4r,5l,13r,12l,10r,15l,7r,2l,6r,3l,11r,14l" /home/dannyw/PDF/long-test01.pdf

A few notes:

-1. In my original word-processor file, I set *zero* page margins on all sides.

-2. In this example I included the classpath spec, but you should probably set the CLASSPATH variable in your environment as suggested on the Multivalent website.

-3. The syntax for the "-paper" parameter took me a lot of experimentation to figure out. Note that using a "-paper-size" parameter does not work, and that there is no space allowed between "210x284" and "mm".

-4. The Impose utility does not seem to have enough options to absolutely maximize the use of the paper, given that many printers may be like mine in having different unprintable margin sizes on each edge, not to mention varying repeatability in the accuracy with which it locates an image on the page. My own printer seems to have quite good repeatability from side to side, but the main problem was that the unprintable margin was 13 mm on the bottom edge, much larger than the other edges. I found the best way to deal with that was to define a page size that was 13 mm short of the usual 297mm A4 height. You will probably want to experiment to get the command right if you use US Letter size paper.

-5. It is naturally necessary to cut the 13 mm spare edge off the bottom of the output page before folding; otherwise the fold lines will be slightly or significantly off.

-6. Given the various constraints, the Impose utility cannot arrange the source pages on the output page without some wasted space. It appears to deal with that with this layout by putting a gap down the middle of the page. When the page is folded, this gap fortunately winds up on the top of every page of the booklet, so it's easy to snip off. If you like, you can deal with this by creating the original document with a page size whose proportions match the proportions available on the output page, instead of using A4 (or letter).

-7. If you fold the output sheet in the wrong order, you will find that the resulting stack of four-page sheets is also in the wrong order, but that's easy to fix.

-8. Surprisingly, Impose seems to do the right thing if you have a document of fewer or more pages than the number specified with the "-layout" parameter. On the other hand, a 16-page booklet is already fairly bulky; I don't think it would make a lot of sense to try to bind multiple signatures together. If you are lucky enough to have an A3 or larger printer available, though, it might be quite nifty for producing say an 80-page book in five signatures.

-9. Naturally, it's worth using some sort of cutting machine instead of just scissors to provide a nice straight edge when you need to cut the folded sides.

-10. Here's a link to a test file I created. It's set up for my printer, so your printer may wind up cutting off one or more edges of the image; but it should give you an idea of how easy it is to produce a booklet by folding, compared with trying to cut pages individually out of a sheet (as you had to do for my "Thaitones" booklet).

The text in the file is just the current contents of Wikipedia for the Khmer Language page, slightly reformatted. I didn't check details: I just wanted to provide an example of what could fit in a booklet. The Khmer script size has wound up probably a bit too small for beginners to read, although it might look clearer on your printer than it does on mine.

The source document is actually 15 pages, so one page, which happens to be at the top left of the first output page, is blank.

www.panix.com [http://www.panix.com/~dannyw/pdfs/khmer-test01-up.pdf]

You need to print the first page of this pdf on one side, then the second page on the other side. Remember to cut off the bottom margin before folding. I can't think of a foolproof description of the sequence to fold it, but try folding the long side in half three times, while keeping page 1 of the booklet on top each time. Finally, cut off the sides at the top and right of page 1.

-11. You will probably need to dink with the parameters for a while to squeeze the maximum booklet size out of your printable page size. I produced a little diagram to give you some idea of how many things you need to deal with: Diagram showing various areas of a printed signature

It's kind of rough, and the size of the areas is somewhat exaggerated for clarity, although the "-margin" parameter actually sets a margin around each side of each source page, which the drawing shows rather badly. Also, the drawing is not intended to show an *ideal* layout.

If I were planning to deal with random source page sizes and printers, I suppose I would write some sort of wrapper which would take all the values, figure out the best compromise and shell out to the Impose utility. If I knew Java, it would be even better to add a full set ofprinter margin commands to the Java code.

The numbers designate source page numbers; there are eight source pages on this side of this sheet, matching my example file, although the dimensions are not intended to match. I believe it is true that in most cases a printer driver will start trying to print an input image at the top left corner, but I think in many cases Adobe Acrobat will try to *center* and rescale an image to fit on the printable page; check for this. There are so many steps involved that I'm not quite sure of what's happening on *my own* machine.

2009 Jul 03 [ Fri ]

Wonderful example of accent variations

In the following blog entry: micah-john.blogspot.com [http://micah-john.blogspot.com/search/label/Language] the blogger John Micah points to a very impressive example of an actress, Amy Walker, who has mastered multiple accents: www.youtube.com [http://www.youtube.com/v/3UgpfSp2t6k&hl=en&fs=1&rel=0]

As the actress actually comes from the Seattle area, I found myself particularly impressed by her mastery of the third accent, the old-fashioned RP, which I can no longer do myself. But all of the 21 accents seem quite good. I thought the German one was a little weak, but that might be because Germans try quite hard, so you often encounter Germans who have conscientiously studied phonetics and get many difficult things right, but then display one or two features that are gratingly wrong, like doing a superfluous release on an "-ing" ending. Of course each such German has a different combination of flubs.

Irritatingly Micah is apparently sixteen years old. He also points to the British Library's repository of British accent examples: www.bl.uk [http://www.bl.uk/learning/langlit/sounds/]

This is very good, although I would have appreciated more analysis, in particular a table comparing each feature with each accent. In the case of a Belfast accent I listened to, the most obvious feature relative to more standard accents was the upspeak, although I'm actually not sure that's what it was – it seemd to be lexical as well as syntactic – and it was ignored in the gloss; I wished there was a fuller explanation.

I am always impressed when a foreigner can spot an accent. A few days ago a Slovakian guy whose English is imperfect heard me say a few words in a Scottish accent: /ʔʌ fjy 'wʌrədʑ ən ə ɕko'ɔːtʔəʃ ʔɑːk'ɕentʰ/

He identified it immediately without prompting. I was impressed and envious: I have never been able to identify any accent in Cambodian, and even in French my ability to identify an accent is pretty much limited to "I can sometimes understand it" or "I can never understand it".



I hope this information was useful. There may be a great deal more information on this site that is relevant to what you need. Take a look at the "site map" display at left; you can click on a topic to see many recent items on that topic.

Copyright © 2003-2009 Alternate Worlds Publishing, Boston MA USA

Debug: hittotal: 1 startban: 0 dancookie: endbandate: banned: 0 tempdate: tert: jse: jsx jsh: 1