Monday, September 29, 2008

Why face-to-face debates are wrong

When you debate honestly with a shameless liar, reality has already lost. Public debates are garbage if truth is not the first, last, and only goal for both sides. The deck is stacked from the beginning in favor of poor logic and outright falsehood.

I just got back from a debate about "whether gay rights should triumph over Biblical morals". It was a travesty, and entirely predictable. On one side was Hector Avalos, a reasonable and soft-spoken professor of Biblical studies. On the other side was some bigoted yahoo with a radio talk show, named Jan Mickelson. Can you guess who was on which side?

Avalos came out with pretty standard, solid arguments. There was some interesting material about the history of the times when the Bible was written. The problem is that he talked softly and used big words, and he was honor-bound to be reasonable. Mickelson talked several decibels louder, had a folksy manner about him, and cracked jokes to distract the crowd from the vacuousness of everything he said. He monopolized the time, he got most of the crowd cheering for him, and he used a tactic called the Gish Gallop.

The Gish Gallop (named after the creationist Duane Gish) is a simple and very effective debate tactic: if you hit the audience with lies and distortions fast enough, nobody will be able to distinguish truth from lies. It works great when you have the audience rooting for you, and it can only be used by people who don't care about reality.

And make no mistake, this guy was all about the lies. According to Mickelson, the earth was created a few thousand years ago and gay people are a hoax. This is not an honest man. And that's how he won the debate.

This is why debates should be done in writing. It may not be as theatrical, and it may require people to read (oh no!), but in writing the truth stands a chance. A deceitful debater can't rip off a bunch of lies and expect to get away with it in writing. Points can be explained as more than sound bites in writing.

Face to face public debates need to die, so that honesty has a chance.

Monday, June 23, 2008

Final exams, part 4: Asynchronous systems

At last, finals are over and the semester is complete! The last final was not really an exam at all. It was a presentation. We all had to do a final project, and then give a talk about it. And because this is my favorite class, I decided to overachieve like a bandit.

Instead of doing a final project, I did five final projects. One of them was writing a paper. One of them was modifying a program from the University of Manchester to work properly with Quartus II. Then I made a random number generator in hardware, and some more hardware for 16-bit cyclic redundancy checking. And a simulator for sets of production rules, which can also use IRSIM to do transistor-level simulations. You might say that I went a little nuts.

The reason I did all this is because this class was actually very, very interesting. It was aimed at graduate students (and I think I'm technically enrolled as a grad student for some reason) and the material was only dumbed down slightly! This has some good points and bad points.

Let's get the bad part out of the way first: a lot of people had trouble. For example, a homework project might have been assigned a week or two in advance, but when it comes due I'm sometimes the only person to have it done. The class included practical work and reading real research papers, and I guess that can be a little intimidating.

The good part is that it's something useful and interesting that you can really sink your teeth into. Some research papers are remarkably accessible, and the practical work is at least manageable. Let me give an example.

Here's a paper on how we might be making computers in five years. It talks about a neat new way of fabricating electronics called a nanowire crossbar array, and while it's stupendously tiny it's also not suitable to the way we design processors today. Imagine electrical signals as water slowly spreading through wires, and you need to ensure that water reaches a thousand faucets at the same time, but you don't control the plumbing. How can you do it? You can't. This is similar to the problem of clock distribution: all conventional processors require that you send a really fast signal to all parts of the chip, keeping it all synchronized like a coxswain on a rowboat. And you can't do that on a crossbar array. But using asynchronous techniques, you can make a processor on it. The processor will just be very different from almost every other processor ever made. Exciting to be on the forefront of a big new thing, isn't it?

When I came here I decided that I would use some of my Copious Free Time to go overboard on something worthwhile. This is it, and I'm glad I put in the extra effort.

Thursday, June 19, 2008

Final exams, part 3: Integrated Circuit Technology

I just finished up the final exam for IC tech. It went okay. On the one hand, I was able to answer most of the questions in a decent way. On the other hand, I forgot my notes on epitaxy! No!


At the beginning of the semester I thought that this class would eat me. It started with a bang, talking about wave functions and Fermi levels and similar quantum crazy stuff. After a lot of very intense studying I managed to get a basic understanding of the early stuff.

And then the learning curve showed its true nature: you start off by banging into a brick wall with the semiconductor physics, and then it's smooth sailing. Later topics were things like oxidation of silicon, or doping. These are complicated subjects in their own right, but much easier to grasp. And to top it off, there aren't really that many formulas that you'll ever have to use, and they're all in the lecture notes, which you can use on exams.

Overall, I think that I now have a much better understanding of how transistors work, how chips are made, and what the big deal is with integrated circuit layout. Nobody learned more than a fraction of the material -- the professor knew a lot, but the information just came too fast and too disjointed to hold on to all of it -- but it was good stuff. I think we were tested not so much on our retention of the material, but on how good we were at understanding the lecture notes well enough to look up the bit of information that we needed. And that's actually a very clever approach to testing.

Three down, one to go.

Tuesday, June 17, 2008

Final exams, part 2: Operating Systems

I've finished the final exam for my Operating Systems class, and I must say, I'm glad to see the end of it. It wasn't a particularly difficult class -- while I probably got my lowest grade in this class, I would describe it as almost comically easy by engineering standards. The problem is that the class was poorly taught and I already knew most of the material in more detail than we were ever given.

I'll tell you an example: filesystems. A hard drive can be thought of as a bunch of blocks of data, and each block can be read sequentially. It can fetch any block for you, but switching to another block is much slower than sequential reading within a block. And since these blocks are small, we need to work out how to divide up files among them. It's as if you had a blackboard divided into small squares, and you needed to compose several essays on this blackboard. How do you use the little squares?

You could just start in the upper-left corner of the blackboard and use each square in order, and write down your essays. This is called contiguous allocation. It has problems, of course. What if you need to add something to the beginning or end of an essay? Maybe there will be extra space at the beginning or end; no such luck if you want to add a paragraph in the middle, and you have to recopy a bunch of words from one block to another -- in the worst case, you might even end up rewriting everything on the whole blackboard just to add a single word.

You could give each block a number and write the number of the next block on it. Then when you want to go to the next part of the essay you can just look to see the number of the next block, and go there. And so on: just follow the chain. This is called linked allocation. It makes adding paragraphs and such much easier: just change a few numbers around and add a new block to the chain. The same goes for deleting data. Finding an arbitrary place in your essays can be a little tricky, though: you have to follow a bunch of links, and each jump from block to block takes time.

Another strategy is to write the order of blocks on its own block -- a table of contents, if you will. This is called indexed allocation, and it's the most practical system of the lot. There are still issues with this, and they can be made faster by using something called a B+ tree. But we never got to that -- we spent too much time obsessing over minute details of broken implementations of things like linked indexing. I'm not kidding.

And if you ever asked a question, you would get an unrelated answer. Always.

So, as I said before, I'm very happy that this class is no longer a part of my life.

Final exams, part 1: Algorithms

I just finished the first of my final exams. This was for Algorithms, which has a reputation as a nasty class. I didn't find it to be particularly nasty, but I'm sure part of that is because I've had a book on algorithms for years and so already knew about half the material.

The really neat thing about spending this semester abroad is the way grades transfer over, or more accurately the way they do not. As long as we get passing grades, we get credit for the class -- and the classes don't affect our GPA. This is very pleasant. While I'm not going to neglect my education (perish the thought!) I love being able to shrug off the work that doesn't teach you anything.

For example, consider optimal matrix parenthesization: you want multiply a bunch of matrices together, calculating something like ABCDEF (where A, B, C, ... are matrices). Matrix multiplication is associative, so you can do the multiplications in any order and get the same result, but how much calculating you need to do depends very much on the order. Maybe A(B(C(D(EF)))) takes five minutes and (A(BC))((DE)F) takes five seconds -- this could be a very valuable thing to know ahead of time.

To simply go through and solve this by brute force and ignorance for n matrices requires going through something proportional to 2^n possibilities -- probably more trouble than it's worth. But there's a key observation you can make: any part of an optimal solution is an optimal solution to a subproblem. So in the example I gave above, A(BC) is going to be the optimal way to parenthesize ABC. The optimal solution for DEF is going to be (DE)F. And at the highest level, we just need to know where to split the multiplication into the product of two subproblems. This leads to a recursive solution, but it repeats a lot of subcalculations, so by remembering the solutions to problems and not recomputing them, we can make it dramatically faster.

Now, that's the high-level understanding. It's also sufficient to actually write a program to solve the problem, and it will be pretty simple and zippy. But for various (mostly historical) reasons, we have to learn to do this calculation using a system of filling in these weird triangle-shaped tables of numbers. This is more efficient if you really want to write a fast program, and I suppose it's easier to do on paper -- but it's completely unnecessary from the standpoint of understanding what's going on. Indeed, I don't think our lectures ever really mentioned that the whole point of the tables was just efficient memoization.

I never did learn exactly how to use those tables. My grades suffered a little because of it, but I understood the algorithm and managed to keep my morale up by avoiding the triangle tables. I consider that a good bargain.


There is too much emphasis, here and everywhere else I've been, on memorizing how to do some particular kind of problem that will be on the test. If you spend too much time focusing on the details of one particular implementation of one variant of the concept, you lose sight of why the textbook even gave you that example in the first place: as something concrete to generalize from. We had quizzes which ostensibly tested our knowledge of Quicksort, but the thing they tested was very different from what computer scientists mean when they say "Quicksort". Quicksort refers to a whole family of related algorithms, and the thing they all have in common is that they pick a pivot element, put everything smaller on one side and everything larger on the other, then recursively sort each side. This can cover everything from a simple textbook quicksort on up through complicated things like randomized median-of-three partitioning adaptive Quicksort that uses insertion sort for small subarrays and can revert to heapsort on perverse inputs. What we were quizzed on was an example program in the book, and we were expected to memorize everything about it, right down to how it rounded an insignificant number and the order of the arguments to the function. Anything slightly different from this was "wrong", even though this criterion would make a lot of other algorithms textbooks "wrong" as well. Such decisions have to be made in any implementation of the algorithm, but for learning how Quicksort works they are useless details.

Complaints aside, this was a pretty good class. The material was interesting, and it's a pity we didn't get to more of it. The textbook was friendly, or at least as friendly as a thousand-page clunker can be. The professor spoke English well and seemed like he would probably feel more at home in an American classroom. (For all the reputation Americans have for being dumb and lazy, engineering students in the US compare very nicely with our Taiwanese counterparts.) The homework assignments were few, although I hear that this is because homework solution copying is utterly rampant here.

In any case, it's nice to have this done. One down, three to go.

Saturday, June 14, 2008

McCain and habeas corpus (warning: polemic)

The Supreme Court has just ruled 5-4 that detainees in Guantanamo bay have the right of habeas corpus: they can not be held indefinitely without being charged with a crime, without legal representation, in military prisons beyond the reach of the law. Naturally, Obama is cheering about this and John McCain is vehemently against the decision. Forgive me if I get a bit polemic, but this deserves to be replied to paragraph by paragraph in an appropriately angry manner:

Read the article here. It's fairly short, but I'll only be quoting part of it.

I used to have some residual shred of respect for John McCain left over from when he was running as a less conservative opponent to Bush back in 2000, back when he seemed to have some principles.

That respect is gone. McCain is a pitiful excuse for a presidential candidate and an unprincipled shill for the Bush administration.
“We are now going to have the courts flooded with so-called … habeas corpus suits against the government, whether it be about the diet, whether it be about the reading material. And we are going to be bollixed up in a way that is terribly unfortunate because we need to go ahead and adjudicate these cases,” he said at a town hall meeting in New Jersey.
Frivolous lawsuits like "Stop holding me without trial." Frivolous lawsuits like "I've been in here for six years and have yet to be charged with a crime." Frivolous lawsuits like "Please stop torturing me."
McCain said he has worked hard to ensure the U.S. military does not torture prisoners but that the detainees at Guantanamo are still “enemy combatants.”
McCain has repeatedly defended and voted for torture and spouted the administration's "what we do is not torture because we're doing it and we don't torture" circlespeak. He's been lying about this for years now, in the most contemptible ways possible.
“These are people who are not citizens. They do not and never have been given the rights that citizens in this country have,” he said. “Now, my friends, there are some bad people down there. There are some bad people.”
No, you manipulative fascist, they are people. Ever heard of human rights? Hell, haven't you ever read the part of the Declaration of Independence that talks about "inalienable rights" and the "self evident" idea that all men are created equal?

Contrary to what McCain says, US citizens are not the only people who matter. US citizens not the only people with rights. The rest of the world is not filled with dirty subhumans who can be stepped on at the whims of fearmongering demogogues.

This paragraph is just so fractally wrong that I'm going to go back and quote parts of it again:
“These are people who are not citizens. They do not and never have been given the rights that citizens in this country have,”
PEOPLE ARE NOT GIVEN RIGHTS! Rights are not yours to give or take; they belong to every person, and they morally follow from personhood -- not from the mercy of the government. This is one of the fundamental principles upon which the United States was founded.
“Now, my friends, there are some bad people down there. There are some bad people.”
And I would sooner have all those alleged bad people go free than have a single innocent person detained indefinitely without charges in your illegal and immoral system of military prisons. There's a damn good reason that "Innocent until proven guilty" is so deeply enshrined in our legal system: without it, innocence and guilt cease to matter, and the "law" depends entirely on what the people in power want to do to you. Letting a few guilty people escape from justice is a small price to pay for this fundamental protection, because it is what lets us have rights at all.

And now McCain is desecrating all of our rights by declaring the prisoners guilty and claiming that his opinion on this is above the law. He is a natural authoritarian, a J. Edgar Hoover for the new millennium.

Sunday, June 8, 2008

New EE 185 lesson idea: debugging and testing

In fall semesters I have a TA gig for the introduction to EE class at ISU, EE 185. In the labs we have to teach the freshmen how to program a computer in Matlab and a little bit of C. It's a fun job, but very challenging: most of the students are complete newbies who have trouble with the simplest of programming concepts, and we've got to do whatever we can to help them out.

One huge meta-problem that always gives them grief is debugging. When their programs don't work -- and they usually don't work at first -- they don't know how to go through the program and figure out why it doesn't work.

I came across a fascinating article recently by Chris Okasaki, talking about program testing helping students learn. The idea is that, when you give out a problem for students to do, you also give them a program to test their solution. They write a solution, and the test code you give them runs their program on 50 or so test cases and complains when the solution fails on some of the test cases. This gives instant feedback on their mistakes, so debugging is reduced to squashing a series of bugs. He's had good results with this in the classes he teaches, and the students in EE 185 tend to have a lot of glaring bugs because they only use one or two makeshift test cases for their programs.

So I'm thinking of doing a lesson where we explicitly walk them through common debugging techniques: printf debugging and stepping through your program with a debugger. Both of these are absolutely basic techniques that would solve about 30% of the headaches I see in that class. So, mostly for my benefit, here's a lesson plan that I'd like to use in some form next semester. The prerequisites for doing this lesson are loops, arrays, and functions. So let's start with a title:

Debugging and testing

When the programs you write don't work, you need to find out what you did wrong and fix it. This is called debugging. There are some ways of debugging your code that can make it a lot easier. Let's look an a bit of example code. It calculates the sum of the numbers from 1 to 10:

n = 10;
sum = 0; i = 0;

while i < n
sum = sum + i;
i = i + 1;
end

disp(sum);

This code doesn't work. The result is supposed to be 1+2+3+4+5+6+7+8+9+10 = 55, but instead we get 45. How do we find the mistake?

Very simple debugging

The first method is to have your code print out the value of some variables while it's running. This can be as easy as taking away some semicolons:

n = 10;
sum = 0; i = 0;

while i < n
sum = sum + i
i = i + 1;
end

disp(sum);

This isn't very helpful so far, but it does show that the code seems to be stopping early. Let's try looking at the progress of another variable, by printing i each time through the loop:

n = 10;
sum = 0; i = 0;

while i < n
i
sum = sum + i;
i = i + 1;
end

disp(sum);

Run this and look at the output. What is the problem? Fix the code and include it in your lab report.

Stepping through your code

Another good way to find mistakes is to go through your program, line by line, and see what it's doing. Figure out what all the variables will be, and check if this matches your idea if what should happen.

Matlab has a way of doing this for you, called stepping. There's a "Step" command in the Debug menu, which you can also use by pressing F10. Try it out: open an M-file and step through it. Each time you step, Matlab runs one line of code. If you look at the variables in your workspace, they will show the values of the variables right now. This can really help you understand what a program is doing.

Here is more information on debugging M-files.


The assignment, part 1:

Write a function called splitfirst that will take an array and split it around the first occurrence of a given element. For example, if your function is given the array [3,1,4,1,5,9] and it told to split it around 4, then the function should return this matrix:

> splitfirst([3,1,4,1,5,9], 4)

ans =
3 1 0
1 5 9

Notice that the extra space was filled with a 0. Here's another example. If the function is given the array [1,2,3,4,5,6,7,8] and told to split it around 6, then it should return this matrix:

> splitfirst([1,2,3,4,5,6,7,8], 6)

ans =
1 2 3 4 5
7 8 0 0 0

The 6 has been removed, and everything after it has been moved into the next row. One final requirement: no empty rows! If you try to split at the beginning or end of an array, this should not produce a result with a row of all zeros. Instead, it should do something like this:

> splitfirst([1,2,3,4], 1)

ans =
2 3 4

Focus on getting your code working at all, then worry about this.

Writing the code for this problem is a little tricky, so you've been given a function called "above" in above.m which will help. The above function will take one matrix and put it on top of another, filling the remaining spaces with 0. To produce the first answer, you could do this:

> above([3,1], [1,5,9])

ans =

3 1 0
1 5 9

And for the second answer, you could do this:

> above([1,2,3,4,5], [7,8])

ans =

1 2 3 4 5
7 8 0 0 0

Above also works with arrays that have more than one row. For example:

> above([1, 2; 3, 4], [5,6,7,8])

ans =
1 2 0 0
3 4 0 0
5 6 7 8

Empty rows will be removed, which should be helpful:

> above([], [1,2,3])

ans =
1 2 3

Look at splitfirst.m and add code to do the splitting. Good luck.

Important note: you can test your code with the "testsplitfirst" function. Check it out:

> testsplitfirst
Testing splitfirst...
Failed: splitfirst([1,2,3,4], 1) should be [2,3,4]
Failed: splitfirst([1,2,3,4], 4) should be [2,3,4]
Passed 4/6 tests.

Your goal is to get it to pass all the tests. Include your test results in your lab report.

The assignment, part 2:

If you got this far, then congratulations on completing part 1. Part 2 is to split an array by every occurrence of a given element, not just the first one. For example:

> splitevery([3,1,4,1,5,9], 1)

ans =
3 0
4 0
5 9

Here, every time a 1 appears in the sequence, everything following it is moved down another row. As before, extra space is filled with zeros. Here's another example:

> splitevery([1,2,3,4,5,6,7,8], 4)

ans =
1 2 3 0
5 6 7 8

Since the 4 only appears once, this has exactly the same effect as using splitfirst. Here's an even more extreme case:

> splitevery([1,2,3,4,5], 9)

ans = 1 2 3 4 5

Since 9 doesn't occur anywhere in the array, it doesn't get split.

As in part 1, there should be no rows filled with just zeros. Here's an example that illustrates what's supposed to happen:

> splitevery([5, 4, 3, 5, 5, 5, 5, 1, 2, 5], 5)

ans =
4 3
1 2


Look at the file splitevery.m and add code. You can test it with the "testsplitevery" function:

> testsplitevery
Testing splitevery...
Passed 4 out of 4 tests.

Include your test results in your lab report.

Monday, June 2, 2008

Earthquake!

The ground started to vibrate! Nothing major, just a little alarming. And very, very cool.

I'm glad I wasn't asleep when it happened. I've never felt an earthquake before.

Thursday, May 22, 2008

Hakka food and culture festival

"Move a little to the left," said a photographer, and I scooted over a bit.

Joyce picked up a vaguely peanut-flavored lump of food with chopsticks. "Say 'aah'," she told me, and put it in my mouth. As I chewed, the assembled cameras flashed.

Today, I was used as photo-op fodder.



This afternoon, Tatung university summoned all the foreign exchange students to go to a Hakka food festival that was being held in the main hall. I was confused when I got there, because I wasn't sure what was going on. But while I'm frequently dopey, I'm not stupid -- after a few minutes I realized that there was a reason that they were inviting the American students to use a mortar and pestle, or eat some rice noodles, and taking copious photographs of us. We were being used as some kind of publicity device. Smile for the cameras.

That was certainly novel. Tatung had taken pictures of us before, apparently to illustrate what a fancy multicultural place they were, but this was over the top. I'm still not sure what the reason for this was. Generic publicity? Novelty? Giving the appearance of public validation and international acceptance of the historically-downtrodden indigenous Hakka people of Taiwan? Your guess is as good as mine.


The food was pretty neat, though. The first thing we did was make a kind of Hakka tea. This is not a conventional kind of tea. In regular tea, it's a well-known formula: take tea leaves and put them in hot water for a few minutes. If you're feeling British then you may put milk, sugar, or possibly even lemon juice in your tea. Hakka tea isn't like that. First you take some dried green tea leaves and grind them into powder with a very large mortar and pestle. Then you add sesame seeds and grind them up. Then add peanuts and grind them up into powder too. Then add sugar and hot water, and put some puffed rice on top for texture. Stir and serve. It's a surprisingly tasty concoction. It looks like something a witch would brew in a cauldron, but without dodgy, unappetizing ingredients like "Adder's fork, and blind-worm's sting, Lizard's leg, and howlet's wing". Here's the recipe:

Hakka green tea
  1. Green tea leaves
  2. Sesame seeds
  3. Peanuts
  4. Sugar to taste
  5. Hot water
Grind ingredients 1-3 to powder with a mortar and pestle, then add the other ingredients and put the freakish concoction in cups. Refer to it as a "concoction". This is mandatory, I think.


There was also a food made of some squishy substance that people assure me is rice, somehow. It's sweetened and rolled around in some powder that was probably made from ingredients similar to those in the tea. It seems to be a fairly popular snack in Taiwan. That's the food I was talking about in the introduction of this story; I was photographed being fed some of this by another person, which is not really something I would have done were it not for the cameras.

Another food is bamboo soup. They take bamboo and turn it from wood into something that only looks like wood but is actually a kind of food. It's a little bitter for my taste, but most people in Taiwan really enjoy chowing down on their heavily cooked wood.

Probably my favorite thing there was the noodles. The noodles were made from rice, which is not very unusual -- rice is big here. But they were nicely seasoned, with some cabbage and meat and carrot, so it was pretty tasty. The photographers loved it; nobody with a camera can resist a close-up shot of someone eating noodles with chopsticks.


I'm still confused by the whole thing, but hey, free food.

Saturday, April 26, 2008

A trip to Danshui

This weekend our Asian history, culture, and politics professor invited all four of us American exchange students to visit his home in Danshui and spend the night. We did, and it was wonderful.

Danshui is a smaller city near Taipei, and it's a popular tourist destination because of the old European architecture, the docks by the sea, and the fact that you can get there by the MRT.

Most of the evening was spent talking, and our professor is an interesting guy to talk with -- he has a very international perspective from living in Taiwan, getting a degree in England, travelling in Europe and Central America, and doing various international relations jobs. It's fascinating to hear that kind of international perspective, because it's surprising.

We also learned the differences between numerous different kinds of tea, and tried warm sake. One thing I've definitely learned by coming here is that there really are major differences between teas -- even very similar teas.

We slept in a Japanese-style guest room. When I say "Japanese style", I don't just mean that the decor was modelled after that of Japan. I mean that the floor was a raised hard wood platform, and that's where you sleep. Making a bed consists of laying down some duvet and a pillow. Very traditional, and very foreign to most Americans -- us included. We didn't have particularly soft mattresses because we didn't have mattresses. We had a wooden floor. It was surprisingly comfortable, and had the handy side-effect that you could turn over in bed without making a horrible racket and bothering the other people in the room. I actually think that, if you want to get several people sleeping in the same room, Japanese-style bedding arrangements are one of the best possible ways to do it.

In the morning we went for a walk around scenic Danshui. When the British empire was active in the area, they used Danshui as a port. It was used for similar purposes by some other colonial powers, and it was the destination of the Canadian missionary George Leslie Mackay. That makes for a very pretty town, with some foreign-looking architecture.

Here's a gallery of the photos I took.

We had lunch at the red castle, which used to be a Dutch fort, then a British consulate, and now is a restaurant with a good selection of seafood. I liked the oysters.

Danshui has got to be one of the prettiest places I've seen near Taipei -- right up there with Keelung, but with better weather.

Sunday, April 6, 2008

More talking about food

I've discovered some more kinds of good food here. So, time to update the list:

There's a weird thing where a guy takes a pattie of some kind of mostly grain-based substance and cooks it on a griddle, then fluffs it up with a spatula, fries an egg under it, puts some sauce and maybe some herbs on it, and the folds it up like some kind of vaguely omelette type of thing. US$1.00 per thing, and each is about the same size as a McDonalds $1.00 hamburger but a lot tastier and more nutritious. It's good.

There's also a stall at the market which sells "water-fried Baozi". That's pronounced something like "Bao-Tzuuh", and it's a kind of Taiwanese dumpling with a meat and vegetables stuffing. They're good. Some of them seem to be filled with some sort of very concentrated chicken soup.

There's a stall which sells a dinner-sized container of pretty good sushi for US$2.50 in the evenings. I had one of those recently, and it was good stuff. I didn't recognize half the ingredients, but that's par for the course when it comes to eating in Taiwan.

Another really tasty way to get a fairly small amount of food (for lunch or something) is a fried chicken place. They have several different kinds of breaded chicken, and you pick one and they add some leaves and fry it for you. Then they add some salt and pepper and unidentified red spices.

A funny thing about eating in Taiwan is that you get used to meals being at least a little weird. For example, the standard way of serving fish for groups of people is to give them a dish containing a whole dang fish. Gutted and scaled, of course, and cooked -- but then they set it in the middle of the table, head and all, and expect you to just start chowing down. The usual way is to carefully remove some meat with a very large spoon, and put it in your rice bowl. I'm actually used to this. Hell, I enjoy this. Fish is tasty, and you get used to looking it in the eye while you cut it up. The same goes for shrimp, which are served with the head still attached. I don't know why they do this, as it seems to have nothing but disadvantages. You have to take the head off manually, which is easy but tends to result in shrimp brain juices squirting at you.

Another interesting thing about Chinese dining is the traditional family-style method of serving food. Each person gets a rice bowl and some chopsticks, and several dishes are put in the middle of a circular table. When you want some food, you take a bit of it from one of the communal plates and put it in your bowl of rice (held in your non-dominant hand) and then eat it with some rice. Then you go back for more. There are obvious sanitation issues with this approach, but after a little while you stop thinking about them. After all, I've been here for a while and the worst Taiwan has been able to give me is a mild cold.

If I may digress from food here, I'd like to gloat about my victory over the cold I came down with recently. A few days ago I got a bad sore throat, but I perservered with the aid of hard candies and water. Then it morphed into a stuffy/runny nose, and our enmity got serious. I got plenty of sleep, drank lots of water, ate nutritious food, and got chummy with diphenhydramine hydrochloride. I beat that cold like a dirty rug. I celebrated today with vigorous exercise. I AM VICTORIOUS!

Back to food. There's another place which sells a sweet bean soup. The price is reasonable and it sure tastes good. It contains some sort of maybe-rice-based balls, pieces of taro root, some kind of tuber, peanuts, and various kinds of beans. It's indigenous to Taiwan -- a regional specialty of the town of Jio Fen -- so I had better enjoy it while I still can! Because I don't think it's coming to America any time soon.

Saturday, March 15, 2008

I am now an English teacher.

I never figured I would be teaching an English class. I never figured I would be teaching any kind of class. That would require getting in front of a class several times a week and speaking semi-extemporaneously for an hour at a time. Terrifying!

Well, I've been doing it for two weeks now. And I think I'm actually getting used to it.


My job is to stand in front of a class of about seven students and talk with them, and try to get them to talk. In English. The actual class size varies dramatically. I've had as many as 13 students, and as few as two. And it's hard to get them to talk! Most of the time it's like talking to a bunch of brick walls. I can ask a simple yes or no question, and get complete silence.

I'm trying to figure out how to deal with this. I figure one way is to point to people who haven't talked in a while and direct questions to them in particular. This tends to lead to long, uncomfortable silences -- but at least this way someone else is motivated to say something.


Above all, I've discovered that stage fright wears off remarkably fast. Who would have guessed?

Thursday, March 13, 2008

Attention, Taiwan: the cold is a viral disease

I keep hearing people saying that if you get a cold you should go see a doctor. I may have a skewed impression from my small sample size, but it's still weird. So everybody, listen up: the cold is a virus, not a bacterium. The doctor can't give you magic get-better drugs for the cold yet.

I'm sure everybody's heard of the wonders of antibiotics. But antibiotics attack bacteria. Viruses are different, and are not affected by antibiotics. There are at least two companies working on antiviral drugs that target the most common kind of cold virus, but that's part of The Future. At the moment, all a doctor can do is listen to you list off symptoms, tell you that you have a cold, and tell you to drink lots of liquids and get plenty of sleep and maybe buy some Benadryl if the symptoms are really getting you down. And wash your hands so you don't give other people the disease.

That's it. Just the same things your mother told you when you were little. That one paragraph is all you really need to know about dealing with the cold. Just remember the symptoms and remember some simple instructions, and you can avoid unnecessary doctor visits. This is easy, Taiwan.

Tuesday, March 4, 2008

Some important notes on semiconductor physics

Integrated circuit technology is easily my most difficult class right now -- it manages to use up every IQ point I can throw at it and still want more -- so I'm going to write down some of the essential stuff to get it straight in my own head. This isn't really intended to entertain readers, but hopefully it will help me. And not be too wrong.

The first thing to understand is how current flows in a semiconductor. I'll focus on a (possibly doped) crystalline silicon lattice here, rather than slightly weird stuff like III-IV semiconductors, for simplicity -- but most of the same stuff applies universally.

The Si atoms are covalently bonded to four of their neighbors in a regular pattern. Remember all that stuff about energy levels in the good ol' Bohr model of hydrogen? Well, forget that; in a crystal like silicon, those energy levels bifurcate and get all crazy, turning into energy bands. There are two big ones: the valence band and the conduction band. The valence band is the lower one, the energy levels that are filled at 0 degrees Kelvin. Those are the electrons that stick to the atoms or are shared between neighbors. The conduction band is higher energy; electrons there are free to move around through the crystal. If you want to ignore all the quantum stuff and stay far away from Schrödinger's equation, then you can think of those electrons as being little charges balls bouncing around.

But how do electrons find their way up to the valence band? There is a gap between the bands, creatively named the bandgap, which contains states that electrons cannot occupy. To get from one band to another, they have to jump across by either gaining or losing energy. Fortunately we're not operating at a temperature of absolute zero, so thermal fluctuations will kick electrons back and forth across the bandgap all the time. Don't trouble your beleaguered head about "phonons"; just think of the crystal as being kind of vibratey.

Since electrons are always going back and forth across the bandgap, how do we determine how many electrons we have in the conduction band, ready to do useful things? The answer is Fermi-Dirac statistics. Don't ask me to derive it, or even to explain it, but you can use a simple formula for the concentration of electrons in the conduction band in a pure ("undoped") semiconductor at a given temperature. This is called the "intrinsic concentration of charge carriers ni".

The concentration of charge carriers determines how well a material conducts electricity. If there are lots of carriers (as in a metal, with no bandgap), then current can flow easily. If there are a tiny number of charge carriers (as in an insulator, with a big bandgap), then current has a deuce of a time flowing at all. But for semiconductors, the bandgap is middling thickness and the conductivity could go either way.

I should probably mention something about charge carriers now. The term refers both to electrons and to "holes", which are not really particles at all. Holes are gaps in the valence electrons. They move by being filled with electrons, thus leaving another gap in the electrons nearby. They're bubbles, essentially. Bubbles are just gaps in water, and they bubble up by being filled with water. If holes are moving then it also means that valence electrons are moving the other way. Both are perfectly valid ways of transporting charge. In undoped silicon, the number of holes is the same as the number of free (i.e. conduction band) electrons. This is because of the way that both are created: thermal fluctuations knock an electron out of the valence band, and this leaves a hole behind.

This isn't the whole story, though. To do useful things, we need to add small concentrations of impurities to the silicon, called doping. This can be done quite precisely, so let's not worry about how they manage this feat. For now, just consider what it does to the lattice. The impurities in silicon have either one more or one less electron in the outer electron shell than silicon. In other words, they come from one of the two neighboring columns of the periodic table. Once one of these impure atoms (like Boron or Arsenic) bonds to the crystal lattice, it either has an extra loosely-bound electron or a hole for an electron to fall into. These are called donor and acceptor impurities, respectively.

When you go introducing holes or weakly bound valence electrons into the lattice, you're going to play hob with that "intrinsic carrier concentration" stuff I talked about above. Since impurities are so much more likely to donate or trap conduction electrons than silicon, just a tiny dash of impurity comes to dominate the carrier concentration. The doped silicon becomes filled with either free electrons or with holes, and whichever dominates is called the majority carrier. Doped silicon in which electrons are the majority carrier is called N-type (the N is for "negative"), and where holes are the majority carrier we call it P-type. The carrier concentration in doped silicon depends almost entirely on the net concentration of donor or acceptor impurities. That is, donor and acceptor impurities cancel each other out and whichever side is left standing contributes the vast majority of the charge carriers.

At this point it's worth explaining how to visualize current in a semiconductor. If you're using my favored silly-bouncing-balls model of how charge carriers behave, then this should be fairly easy. Electrons and holes are always bouncing around like a bunch of flying bumper-car Pokémons or something. If there's no electric field, then this random movement does not make them go in any particular direction on average. It's a random walk. But when you put a voltage across, and there's an electric field pushing carriers in one particular direction, then they tend to shuffle and bounce more in one direction than the other. This produces motion of the electron cloud, though very slow. Think of it as being like water pressure in pipes: the individual water molecules don't have to move very far for an increase in pressure to be felt several meters away.

Charge carriers in doped silicon do this too. There's a key difference, though. In wires, you have a sea of electrons and that's how your current flows. In doped silicon, it's pretty much all electrons or holes. This only really starts to matter when we stick P-type and N-type silicon right next to each other, as we do in transistors and diodes. When that happens, the free electrons in the N-type silicon start filling the holes in the P-type silicon, and there forms a thin layer of silicon without enough charge carriers to conduct. This is called the depletion region. It stops current from flowing across the p-n junction (where the P-type and N-type silicon touches), but the depletion region can be made to shrink by putting an electric field across it.

This is how diodes work: they put P-Si (P-type silicon) next to N-Si, which creates a depletion region and shuts off current. But if you give the P-Si a positive voltage with respect to the N-Si, this pushes the electrons and holes closer together and makes the depletion region so narrow that charges can move again! This is why, after you put a voltage of about 0.6 to 0.7 V across a typical diode, it becomes essentially a conductor -- but it needs that voltage drop. And if you put the voltage across in the other direction, it doesn't make the depletion region narrower, so it doesn't lead to current flowing.


(Corrections will be welcomed with open arms.)

Some good music: The Crane Wife by the Decemberists

I've really been enjoying listening to The Crane Wife by the Decemberists. It's their newest album, and it's a lot more musically complex than their earlier stuff.

The Decemberists are a band with a knack for poetry and a staggeringly large vocabulary. I'm not sure why anybody would want to rhyme "Sycorax" with "parallax", but they did it. And somehow they managed to make it sound good.

Their songs tend to sound like something particularly gritty yet flowery from the 1800s or thenabouts, with all their talk of chimney sweeps and sailing ships and the landed gentry. And for some reason they seem totally incapable of making a purely happy song. If they sing anything perky and optimistic then they have to set it in an air-raid shelter during the London Blitz or something. They still manage to create some beautiful songs, as well as some that are just plain cool.

For an example of the latter, consider The Mariner's Revenge Song, a rather long mini-epic about an orphaned boy who becomes a sailor and gets revenge for something with the aid of a giant whale and a priory. It's got some of the best accordion playing I've ever heard, and manages to get the spooky sea shanty sound just right. If there is anything more creepy-cool than the premise of this song, I have yet to hear it in musical form.

For an example of the Decemberists making something lovely, Yankee Bayonet will do nicely. It contains such phrases as "Look for me when the sun-bright swallow sings upon the birch bough high", sung in pleasant voices with pleasant instrumental accompaniment. Never mind that it's technically supposed to be a sad song; it's still a pretty image.

A list of all the songs, and what I think of them

Yes, I'm going to list every song on this album and talk about each of them in turn.

The Crane Wife (1, 2, and 3): This is a three-part series of songs. It tells one version of the old Japanese tragedy called "The Crane Wife". I think it was just an excuse for the Decemberists to try their hand at rocking out. They manage to make regretful lyrics sound bouncy. I'm not sure how. Or why.

The Island: Come and see / The Landlord's Daughter / You'll not feel the drowning: this song has a ridiculously long name because it has three different parts in one twelve-minute song. The music here is some of their best, both haunting and toe-tapping. I still don't know what the lyrics mean, but it's probably my favorite song on the album.

Yankee Bayonet: Imagine a beautiful, poetic love song in which one of the two main characters died in the Civil War. This is it.

The Perfect Crime No. 2: I don't know what the number one perfect crime was, but I don't really care that much. This is the weakest song on the album. They try to get funky (really!), but it doesn't work out quite as well as they'd hoped.

When the War Came: This is probably the only song ever written about Soviet botanists during World War 2 trying to protect experiemental high-yield crops during a famine. This actually happened. The song uses the word "caterwaul" to great effect.

Shankill Butchers: one of the spookiest songs since "Mister Tinkertrain". This is a slow, quiet warning to children about a militant group in Northern Ireland that used to go out and murder Catholics at random. It sounds like something that Roald Dahl would have written.

Summersong: This song sounds pretty cheerful. I haven't really listened to the lyrics because they're hard to make out and I just know they'll probably involve shipwrecks or something.

Sons & Daughters: You remember how I mentioned that the Decemberists couldn't make a song that's really happy and cheerful and optimistic without setting it during the London Blitz or something? This is the song I was talking about. It's bouncy. It's happy. It's set in a bomb shelter during the London Blitz.


All in all, a good album. Very unusual and different, and good to listen to.

Saturday, March 1, 2008

Obama

Recently I went and thorougly read through Barack Obama's policies -- where he stands on issues. Yesterday I was skeptical about Obama: he seemed like a good candidate, much better than John McCain and somewhat better than Hillary Clinton, and more charismatic than any of the other candidates. Today, after comparing policies, I've realized: Obama is not the lesser evil. He's a genuinely great candidate, someone I can truly support, and he'll probably be the best president we've had in my lifetime.

This is an extraordinary claim in a country that's used to politicians being incompetent and corrupt. After eight years of Bush, who could blame us for being wary? But Obama's policies are big things, important things, and his specific positions on them are surprisingly smart.

Economy

For starters, take a look at Obama's positions on science-related issues. He supports doubling federal funding for basic research! He wants to make permanent a tax credit to encourage companies to do research and development in the US. He supports stem-cell research, embryonic and otherwise. And he says that he'll continue his track record in Illinois of making math and science education a bigger priority (and backing this up with funding, unlike No-Child-Left-Behind Bush).

This kind of thing is crucially important to our country. China and India have huge masses of people willing to work cheaper than Americans are legally allowed to work. Other countries are even cheaper than they are. Our big advantage is that we have a large educated population, combined with lots of money and land and resources and the world's best university system. Under the Bush administration we've been squandering the biggest advantage the US has in the global economy: science and technology. For example, our broadband Internet infrastructure is pathetic compared to that of more population-dense developed countries, when by rights we should have municipal wireless networking and fiber to the home in cities, with really fast Internet connections cheap and widely available. This is every bit as important today as universal telephone access was in the last century -- probably more important, actually, since the Internet is a gateway to a huge amount of ever-growing useful information, and can do long-distance telephone calls with Voice over IP.

Obama wants to do some major improvement of our Internet infrastructure, allocating a bunch of money to get cheaper, faster Internet access to everyone. He's a little vague on the specifics, which is good; even if he had a perfect plan today it would soon be outdated as new networking technology is introduced. For example, by using a combination of special high-tech light fixtures and broadband over powerlines, we could get Ethernet-speed wireless networks in our houses with a connection to the Internet that's about the same speed as DSL in the simplest configuration. Even an ideal plan would have to change once this technology becomes commercially available. Lack of flexibility is part of what gave us the incredibly clunky telephone system we have today; I think we can do better with the Internet.

He also supports Net Neutrality. For those of you who somehow escaped hearing about this last year, I'll explain what it's about. Some of the telecommunications companies that have local near-monopolies on Internet access want to introduce stratified service, charging web sites extra for the priviledge of being fast and pleasant for the telecoms' customers to use. The consequence of this would naturally be that the big companies that can afford to pay extra will be able to tilt the playing field toward themselves, stifling the small companies that are the Internet economy's lifeblood. And the telecoms would make a bundle, at our expense. Net Neutrality is one of those big issues where it really is about as simple as "the people versus the big companies", and Obama is on the right side. The fact that he gets his advice on intellectual property law from no less a hero than Lawrence Lessig (the guy who came up with the Creative Commons) completes the trifecta: Obama is a great candidate for technology development.

He's a great candidate for infrastructure in general, actually. Have a look at his transportation policies. The quick summary: rebuild our crumbling roads and bridges, both now and over the long term; commit to long-term funding and reform of Amtrak; build new passenger and freight rail; change city planning to focus more on pedestrians and bicycles; increase access to cheap public transit for lower-income workers who spend too much of their money on gas and car maintenence. The stuff about railroads is more important than it sounds. Ignoring subsidies, rail is the cheapest, most energy-efficient way of transporting huge amounts of goods over land. Our rail infrastructure has been slowly decaying for decades, but the good news is that building it up again will be easier than you might suppose. We still have large tracts of railroad-owned land where railroad tracks used to be and could be placed again, thus saving us the cost of massive earthmoving and land purchasing. There are old unused railway trestles that seem to be basically sound. We can do it.

An advantage of high-speed passenger trains in cities is that the density of passengers is hard to beat. A train packs a lot of people into a fairly small space and sends them quickly down a narrow track without needing to worry about stoplights or rush hour traffic. This does wonders for city planning. It's also cheaper all-around than cars, and pollutes less, and is not particularly sensitive to the cost of oil. If you electrify the tracks, you can power a city's trains using nice green power sources like wind, nuclear, and solar. I've often wished that more places in the US had something like Taipei's Mass Rapid Transit system, which can get you anywhere in the city, usually faster and always cheaper than driving.

Social issues

Obama's web site doesn't mention this very prominently, but he has a good record of supporting gay rights. About the only thing he doesn't publicly support is outright gay marriage -- he's going the separate-but-equal route by supporting civil unions. That's still an immense improvement over the typical Republican response, as illustrated by John McCain: oppose both while shouting non-sequiturs like "PROTECT THE SANCTITY OF MARRIAGE!" and "KEEP FAMILIES STRONG!". Obama's position on gay rights is pretty much identical to Hillary Clinton's, but I have more confidence that Obama would try to actually do something about it. (I strongly suspect that Obama is a good deal more liberal than he says. But Kucinich tried being honestly sane and liberal, and look how well that worked out for him.)

Moving on: while the mention of the words "religion" and "politics" in the same sentence always makes me nervous, Obama seems to have the best possible politically-feasible position on it. He somehow managed to support separation of church and state in front of an evangelical audience and not get shouted down from the podium. The fact that he actually came out and said the right thing without pussyfooting around it is very impressive, as is the way he managed to make this go over well with evangelical Christians. I think we could all use a change from the kind of extreme pandering to the Religious Right that made the Bush administration even worse than it would otherwise have been.

Education

Senator Obama's voting record on education has been good, and it looks like his record as a president could be even better. Near the top of the list of issues is fixing No Child Left Behind: fund it, somehow change the tests so that teachers don't spend huge amounts of time teaching the test, and when schools do badly, help them instead of punishing them. This sounds like it has potential for abuse -- schools looking for extra funding might try to artificially lower their test scores -- but I'm pretty sure that will be hashed out somewhere along the line to get a system that mostly kind of works. At this point, just about any change to NCLB would be an improvement.

I'm still very skeptical about how much Obama could improve our horrendously broken K-12 education system, but as usual when you look at higher education things get less grim. He has two big proposed improvements for higher education, and both of them are intensely excellent. First off, he wants to ditch the FAFSA. Filling out the FAFSA is a huge pain in the bum every year, and it could be eliminated by taxpayers "checking a box on their tax form, authorizing their tax information to be used, and eliminating the need for a separate application." There are an enormous number of people who miss out on financial aid because they don't fill out their FAFSA. This is an easy fix.

Second, and even bigger, he wants to create something called the "American Opportunity Tax Credit". This is a $4000 per student per year tax break, for which everyone is eligible if they or a dependent are going to college. With college tuitions spiralling ever higher and debt becoming a bigger and bigger issue, we really need to do something if we're to stay an educated and solvent society. The page I linked to neglects to mention, though, that there's a string attached: in order to get the $4000 tax credit, the student must complete 100 hours of some kind of voluntary public service each year. That's equivalent to $40 per hour in untaxed cash. Not bad for a student job.

Of course, this leaves us with thousands of college students needing to do something with those 100 hours a year. Obama has some ideas about that as well: he has plans to dramatically expand the number of public service opportunities and make them more attractive. He wants to make a Classroom Corps to help improve education (especially in poorer areas that can't afford to spend a reasonable amount on schools), a Health Corps to help improve public health (thus potentially saving billions on medical bills down the road), a Clean Energy Corps to work on building up our clean energy infrastructure and make buildings more energy efficient, a Homeland Security Corps to make sure we're organized the next time an emergency like Hurricane Katrina or 9/11 comes along, and several others. These will also be available as part-time jobs for college students, in an effort to move work-study students away from traditional library-and-cafeteria campus jobs.

I really like the fact that Obama is planning to make public service one of the big causes of his presidency. It's been way too long since we could feel good about our country. Wouldn't it be nice to have a president who asked you not just to feel good about your country, but to make it better? I would love to have a president who seriously asks us to donate our time and energy to make our world better! I would love to have a president who tells us that we can make a difference, and then hands us opportunities to actually go and make a difference. If the mark of patriotism is putting one of those "Support Our Troops" bumper stickers on your car, then patriotism is nothing more than a particularly hollow word. But if the mark of a patriot is freely choosing to serve your country and your world, then we can feel some pride again.

I miss the kind of idealism that made people volunteer en masse for the Peace Corps in the 60s. Incidentally, Obama wants to double the size of the Peace Corps by 2011 and "
work with the leaders of other countries to build an international network of overseas volunteers so that Americans work side-by-side with volunteers from other countries."

Obama also has plans to use public service as a way of helping people out of poverty. Take the YouthBuild program, for instance: the idea is that "disadvantaged young people" can build public-works housing to get some decent income while completing high school and learning marketable skills. Now, construction jobs are not the best-paying -- they tend to get filled by Mexican immigrants willing to work for low wages -- but it's a darn sight better than dope dealing or picking up aluminum cans. And as a bonus, you get affordable housing. I helped build a couple of cheap houses in high school, and they were some of the sweetest little domiciles ever made. It's pleasant, rewarding work.

Government Openness

I really like one acutely underrated part of Obama's plans: make the government more transparent by making all its information available to the public: who voted how on what bills, all the govenrment documents, videos of meetings -- the whole thing. That's nothing new; people have been pushing for this sort of thing for years, with some success. The new thing, the big idea, is that he wants to make this stuff freely available over the Internet in machine-readable open formats. This has two subtle points going for it:

  1. That bit about "open formats" means that anybody can read the information without needing to shell out a bunch of money for the software to read it. It's more important than it sounds.
  2. The "machine readable" part is crucial. The sentence "Representative Hidebinder voted for HB2718" is easy enough for humans to read, but computers have trouble understanding arbitrary English. If all such information is in formats that computers can handle, then we could have web sites that track exactly what's going on in the government, as it's happening, with the full text of bills and recordings of debates and discussions in the news just a few clicks away. It's inevitable, if Obama's plan is put in place.
It would be the most effective government oversight system ever. Realpolitick is hard when you have thousands of eyes watching the politicians and news of shenanigans can explode in a matter of hours.

And now, a look at the competition

The primaries will be over soon enough, so I'l pass over Hillary and focus on the guy who's almost certainly going to get the Republican nomination: John McCain.

After looking through Obama's list of policies, McCain's platform was a sulfurous blast of Republican more-of-the-same. He tries to look bold and tough, panders shamelessly to social conservatives of every stripe (even toadying up to prominent nutcase televangelist Jerry Falwell), pushes more tax cuts as the omnisolution, talks about staying in Iraq until we "win" an ultimately unwinnable conflict, and essentially positions himself as being the guy who's probably not quite as bad as Bush. In his defense, he would probably get the government to mostly stop torturing people. He might even reinstate habeas corpus. Faint praise indeed!

If McCain is elected, it'll be Bush part 3. It's too horrifying to contemplate, so back to cheerier things:

Political feasibility of Obama's plans

The great thing about most of what I've mentioned is that they're not one-party issues. They're not even exclusively liberal issues, although liberals tend to focus on them more. Most of the great things Obama wants to do are things that can get bipartisan support.

Sure, Republicans aren't going to be too happy about Obama's liberal views on social issues like gay rights and stem-cell research and abortion and not being afraid of everything all the dang time. And there's still a minority of people who'll get mad at him for pulling our troops out of Iraq. Building railroads and maintaining our highways, on the other hand, is something both parties can support. And the public service? Republicans claim to be all about honorable sacrifice for your country! They pay lip-service to it every day! How could they possibly be against someone having the guts to actually straight-up ask Americans to serve their country? And everyone claims to support more government accountability, so Obama's brilliant machine-readable government information reporting plan has a good chance of going through in some form. The same goes for his No Child Left Behind reform, streamlining FAFSA, tax cuts for families sending students to college, and most of his other good ideas. These major improvements can actually happen, with broad bipartisan support!


I believe that Barack Obama will be a truly great president. He's the first candidate I've ever been able to honestly support. Ever.

Friday, February 29, 2008

A place to go hiking

I've found a place in Zhongshan district (where I live) that has decent hiking trails. I've been wanting something like this for a long time. It's even better than what I've seen of Yangmingshan national park.

To get there, you go from the Tatung University campus along Zhongshan north road toward the Minquan west road MRT station. A little bit after you come across the huge hotel, you'll see an entrance to a wooded area with big hills. Follow the signs that say "Hiking Trail", and soon you'll be in the woods.

I don't know how far the trail network extends. The first time I discovered this place, I had already been walking up and down a lot of hills by the time I decided to see how far the trails went, and I was tired. That in itself wouldn't have stopped me for another kilometer or so, but I kept seeing these rather disconcerting signs. They had what seemed to be warnings in Chinese. I wouldn't have been able to discern what they were talking about except that they had alarming drawings. One of them said something like "[blah blah Chinese characters blah blah] COBRAS!". I went on cautiously, talking to myself in full street-lunatic mode to let any possible cobras know that I was coming, when I saw another sign with a big picture of a bee on it. That wasn't a huge thing either; after all, what harm are a few honeybees?

Then I got to thinking: while the Japanese giant hornet is most common in the mountains of Japan, they can sometimes be found in Taiwan. I didn't know what kind of bees the sign was talking about, but you don't really want to chance it with the suzumebachi (literally "sparrow bee", because it's the size of a sparrow). These things are a lot nastier than the bees we're used to. A single giant hornet can shred 40 honeybees per minute with its mandibles of death, and its sting not only contains a neurotoxin that can be deadly in large enough doses, but it can also eat through cell membranes. The venom also contains chemicals which attract more hornets. And it can sting repeatedly; none of this "sting once then die" nonsense for them! A few of them can wipe out a colony of European honeybees in minutes, and the Japanese honeybees manage to narrowly avoid this by swarming over the hornets' scouts and killing them with their own massed body heat. These monsters are basically the Bolos of the insect world, only evil. And that's why I turned back from my exploration.

It's a nice place anyway. Lovely woods, and all within walking distance.

Tuesday, January 29, 2008

A plan for clean air

In this city, the pollution is pretty bad. There are just so many cars and motor scooters going around the city that the air quality ranges from decent to terrible. The problem is endemic to dense cities: with streets so close to everything else, there isn't enough room for the ghastly exhaust from highways and streets to dissipate before it hits your precious lungs. The good news is that we can lick this problem in about a decade.

That's an optimistic prediction, but I really think we can do it. If not in ten years, then in fifteen or twenty. But it will happen, and we'll live to see it. And smell it.

The first ingredient: some new technology

The first big thing we'll need is plug-in hybrid cars. These are like regular hybrid cars, with an engine and a battery that can power the car for a while, with one little difference: the battery is more powerful, and you can plug it into an electrical outlet overnight to charge it up. The result: effectively an electric car for city driving, which miraculously turns into a gasoline-powered car when you drive for longer than the battery can support. Powering a car on electricity costs (in California, where the electricity can be pricy) about a fourth of what it would cost to run on gasoline. That's some pretty impressive savings, especially considering the fact that oil prices just keep going up but our electrical power costs will be more stable for the next few decades at least.

Imagine one of those pollution-heavy streets minus the pollution. And imagine that the cars are dramatically quieter than they are now, so there's less noise. If plug-in hybrid cars become common, then that's exactly what will happen.

This bit of technological speculation is not as radical as it sounds. The major automobile companies have been announcing production dates for their plug-in hybrids. The Chevrolet Volt is scheduled to begin production in 2010, with an all-electric range of 40 miles. They've designed the car so that it can switch to other fuels or go all-electric as battery technology improves. GM is also going to be making a plug-in version of their Greenline Vue hybrid for release in 2009, with a smaller electric range of 10 miles. Ford is lagging behind, saying that they'll do it in about five years once battery technology gets better. Aptera Motors is going to start production in late 2008 of the most awesome-looking car in the world, which will get between 130 and 300 miles per gallon depending on how it's used. It will be able to go for 120 miles before the engine kicks in, so it's also going to be sold in an all-electric configuration. It looks odd, but they're selling it for $27,000 to $30,000 with a long list of pre-orders, and that gas mileage is bound to look pretty good to people suffering from high petrol prices.

It's not just cars, either; electric motorcycles will only become more practical as battery technology improves. I realize that a lot of motorcycle owners in America probably ride it for the noise and power and would be affronted by the notion of switching to an electric motorcycle. But in countries like Taiwan, you see motorcycles everywhere because they're so useful. There, where pollution from motorcycles is more important, people tend to use motorcycles more as practical transportation devices than as toys.

The second ingredient: some of that hippie "green power" we hear so much about

Batteries just store energy. That energy has to come from somewhere, and right now that usually means coal. It would be nice if we could improve the situation a bit. Guess what: we can!

Environmentalists are always talking about how "renewable" energy (wind, solar, tidal, etc.) can be a huge thing if we just paid the premium to implement it. Well, guess what: that premium isn't so big anymore.

Photovoltaic panels (which convert sunlight directly into electricity) get cheaper to produce every year. The old expensive things that people had in the 1970s are a thing of the past. Modern solar panels cost less, use much less silicon, and can often be printed in rolls like sheets of paper.

Google has found it profitable to cover their headquarters with solar panels recently, and their plan makes sense. Not only do they get warm happy feelings and good PR, but it's also insurance: they're saving money on electricity now, and in the future as demand for electricity continues to rise, they'll still be paying the same amount for their solar power. More businesses should follow suit -- and so should individuals. We've reached the point where installing solar panels atop a new house in sunny climates really does make economic sense. Especially in places like California, with power woes and real estate so expensive that the cost of solar panels is lost in the noise, people need to supplement their homes with solar.

Wind power is also showing some promise. It's competitive in cost with solar power, but requires bigger blocks of investment. The same goes for tidal power, and some of the other "renewable energy" technologies.

One big problem with this green power is that it can't provide a constant supply of power. Solar power only pays out when the sun is shining, windmills only turn when the wind is blowing, and so on. Good news: car batteries can soak up excess power when it's cheap. In fact, green power and plug-in hybrid cars have other good effects on our power grid that aren't immediately obvious, and aren't talked about much in the news.

Power use varies over the course of every day. The coal plants that make up the bulk of our power supply (and the nuke plants than can do it cleaner) are hard to start up and shut down. You can run the generators at higher or lower capacity, but there's an optimal range of power output where the generators are most efficient. Outside that range, things go progressively more and more wrong. So we use other ways of meeting the peak power demands around noon, like running hydroelectric power in reverse at night, or using natural gas peaker plants that can be turned on in a hurry.

One of the things that's pretty nice about solar power is that it tends to have its peak power output at the same time the peak demand hits: the middle of the day. This has the effect of smoothing out the power demands on the rest of the grid. Since we can charge up electric cars when power is plentiful (usually at night), this will also smoothe out the demand.

Having a smoother, more constant demand for electricity has lots of beneficial effects. We won't need to worry so much about intermittant problems with overloaded power lines, and more importantly we can meet more of our energy needs with the more efficient baseline sources. That buys us more improvement than just the difference between the efficiency of a car engine versus the electrical grid. I'm not sure how much improvement, but it should be significant.

The third ingredient: better batteries (mostly optional)

One big problem with electric cars and plug-in hybrids is that our batteries aren't cool enough. Sure, they mostly work, and all the miracles that I described above are possible with current battery technology, so I should be more appreciative -- but batteries seriously need to get better. They add thousands of dollars to the cost of hybrid cars, and more to plug-in hybrids and fully electric cars. They run out too fast. Some kinds wear out after several years, or too many cycles of charging and discharging. It can be hard to draw a lot of current from a battery all of a sudden for a sudden burst of acceleration, which is why electric cars have (until recently) been sluggish laggards. The usual way of dealing with this is to add supercapacitors, which also cost money, but will give snappier performance and recharge faster -- good for hybrids that want to recapture energy when they brake.

The battery situation is changing for the better. All of the technology I'm going to talk about in this section is still in the research phase: we have prototypes, but moving it into mass production will take time and (relatively small) investments from car companies. Still, you can be pretty confident that some of this will be commercially available in the near future. Remember: this is just a sample of the exciting new developments that have been happening recently. There's a lot more.

First, we have a way of increasing the battery capacity of the batteries we put in cars: Stanford university's nanowire lithium-ion batteries. These use essentially the same mechanism as existing lithium-ion batteries, but part of the structure has been changed to use a particularly hairy kind of silicon structure. This lets the batteries store 10 times as much energy in the same space. They still need to make sure the battery lasts long enough, that it's rugged enough for a car, and that it's engineer-friendly. They also need to get mass-production going, but once they do it should be about the same cost as existing lithium-ion batteries.

Some other scientists have taken advantage of the cool properties of carbon nanotubes to make some particularly unusual batteries. They're very light, they're thin, they're flexible, and they're biodegradable. They're paper. More precisely, they're paper infused with carbon nanotubes in a particular arrangement. They can behave as both a lithium-ion battery and as a supercapacitor. Make a battery with these, and you can get the long-term power draw you expect from conventional batteries, and the short bursts of energy for which supercapacitors are so useful. Right now, they're trying to figure out how to cheaply print this stuff into giant rolls of paper. Then they can stack the paper to make cheap batteries.

The third fascinating new thing in better batteries isn't really a battery at all: ridiculously advanced supercapacitors. Some people are calling them "ultracapacitors" in an attempt to make them sound almost as cool as they actually are. They store energy in an electric field, and they're increasing in energy density. A company called EEStor claims that it will soon be selling ultracapacitors with a higher energy density than conventional lithium-ion batteries. This doesn't sound overwhelmingly exciting -- after all, I just finished talking about new batteries with several times that energy density -- but capacitors can go through vastly many more charge-discharge cycles without dying, they're environmentally friendly, and they can charge and discharge mch faster. The company is even claiming "4-6 minute recharging", if you have beefy electrical cords and you can provide a ridiculous amount of current without blowing a fuse. (They don't talk about that last part much. Oh well. It's still some awfully nice technology, and gas stations could give you a quick recharge with some special equipment.)

So it looks like the hybrid cars (and even the all-electric cars) will soon have very nice performance -- and they'll have it cheaper than today. Which brings us to the last topic: money.

The final ingredient: economic incentives.

Look around any American city and count the number of unnecessary SUVs, and it will quickly become obvious that the desire to be environmentally friendly and socially conscientious doesn't pull much weight around here. Before more fuel-efficient cars will be widely adopted, we're going to need to make it an obviously good deal financially. (Or a hotly desired status symbol. But I'm a straightforward guy, with no gift for the mildly disgusting business of adversising, so I'll stick to talking about economic incentives.)

A lot of the really hard work here is being done for us by the economics of oil: gasoline prices are painfully high, and they'll get higher. People will happily switch to something with better gas mileage if it has good handling and they don't pay too much extra for it. The plug-in hybrids that will be coming out soon meet both requirements, and they'll only get better as the technology improves.

We can make the gas prices even higher by raising gas taxes. We could use the extra money to subsidize the purchase of more fuel-efficient cars. This scheme has some problems, though. For one thing, a lot of our society's infrastructure needs gasoline. Raising gas taxes will have ripple effects through our economy, making other goods more expensive. Do we really need to penalize diesel-electric locomotives for using fuel? Or buses? Or police cars? And gas taxes are regressive, affecting the poor more than the rich. If you need to get to work or take your kids to school, and you can't afford a better car and public transit isn't a viable option, then you're pretty much stuck paying for too much gas.

One answer to this is making important services and lower-income people exempt from some of the gas taxes. The potential for political lobbying and corruption is horrendous, of course, but with only average amounts of luck we should be able to get a system that kind of mostly works.

We also face another problem in trying to get people to be more fuel-efficient: a few lousy cars use a remarkably large amount of gas. And for some reason their owners don't get with the program and get better cars. If we offer incentives to replace those old fuel hogs with newer vehicles (and later maybe even ban them), they will eventually go away.

If my fellow environmentalists want to lobby about something, this would be a good thing to start talking about. I think we have the political ability to make this happen in some key states like California, and that's too big a market for the car makers to ignore.

Conclusion: This is going to happen!

Even if we somehow don't get the shiny new technology that we're going to have soon, even if we don't get the help of the politicians, we're going to convert to plug-in hybrids and electric cars on a wide scale in the coming years. Ten to fifteen years from now, I fully expect to be able to breathe much cleaner air even in the heart of a big city. It'll be cheaper in the long run, too, and it will improve our economy. This is the kind of thing that everybody can get behind, liberal and conservative and libertarian and communist -- everybody.

Except the oil industry, of course. But what they think about it ultimately won't matter.

Monday, January 28, 2008

The Chinese language is evil and wants us to suffer

It turns out that the Chinese language is every bit as difficult to learn as people claim. It's not even the tones that are bothering me the most (I can hear the tones now, and reproduce them) nor is it the weird phonemes that most westerners can't pronounce (which I've figured out how to pronounce). No, the thing that trips me up is that everything sounds totally different from every other language I've heard. Take Spanish, for example: words like "comida" (food) and "avión" (airplane) sound like they're just a couple more oddly-pronounced English words to add to my vocabulary. A lot of Spanish words even have the common decency to be cognates of semi-obscure English words. When I hear "comida" I think "comestibles", and I'm home free! Even languages which aren't related to English, like Japanese, are dramatically easier to remember words for. More examples: "shojo" (girl) and "kaze" (wind, as in "kamikaze") certainly don't sound similar to English, but they're enough alike that you can get past the differences fairly easily and remember the words. Plus, Japanese has a fairly simple, easy romanization.

Chinese is different. There's a lot more syllable separation in Chinese, and the words just sound weird. I'd be teasing you if I didn't give examples. A phrase that means "eat something" sounds vaguely like "chr dong shi", all pronounced with a level tone. But my keyboard can't really get across the true pronunciation. For one thing, "chr" is a sound that most people in America have never, ever made. Imagine a typical growly "rrr" sound from deep in your throat, then move it way forward to the front of your mouth and cross it with an "oo" sound, with just a bit of "lll" thrown in for good measure. And stick a "ch" in front of it, and try to get a smooth transition from the "ch" to the weird buzzing that I just described. It's harder than it sounds, and it sounds pretty hard.

And then there's the subtle difference between "tsu" and "tzu", and the way the language makes you sound like you're speaking in a voice that's not your own. And the characters! The writing system was invented hundreds of years ago by people who figured that the logical thing to do was to make pictures to denote words or concepts. So they made pictograms. But they weren't content with that, since it has some obvious problems: how can you tell apart the pictures for dogs and wolves, for example? They make characters for numbers (like 一, 二, 三, 上, 下,etc.), and characters for sounds based off other words that sound similar (yes, ancient Chinese puns), and combined them in crazy ways, and then gradually changed them over time so that they look nothing like the original pictures. Check out how the character for "bird" changed from its birdlike origins to something that looks nothing like a bird:



And just look how crazy some of these Chinese characters are:

鄭眾

Fancy! And ubiquitous, too: Chinese civilization has been around for a long long time, and they've been using some kind of Chinese characters for almost as long.

But the ubiquity of Chinese characters has one problem, one hugely fatal problem: the Chinese writing system sucks. It's a lot more complicated than it needs to be, and the thousands of characters that everybody has to laboriously memorize offer precious little hint to their pronunciation. Sure, you might be able to read partial meaning of a symbol that you've forgotten, by recognizing some of its components. But you might run across a word that by rights you ought to know, like "knee", and have no idea what the character means. In America, well-educated people do not forget how to read and write "tin can". In China, it happens routinely.

It doesn't have to be this way! It's pretty easy to come up with a sensible alphabet for writing Chinese words. In Taiwan, children first learn something called the "Chinese Phonetic Alphabet", which consists of 37 simple symbols. Each symbol represents a single vowel or consonant, and together they denote every phoneme in Chinese. By composing two or three characters from this alphabet with a little slanted line or checkmark denoting tone, we can form syllables. It's shorter and faster to write than the full Chinese character set, and vastly easier to learn. Mainland China has something similar called Pinyin, which uses the Roman alphabet in some rather counterintuitive ways to get a mostly one-to-one mapping onto the Chinese language.

A lot of the younger generation has grown so accustomed to typing on a computer or mobile phone that they've almost forgotten how to write Chinese characters. See, on a computer keyboard there just isn't room for the thousands of symbols that everybody has to memorize. So on a keyboard you just type the word phonetically and choose from a list of symbols that are pronounced that way. This is much easier and more sensible than writing the characters by hand, and it's backwards compatible, so it's been widely adopted by "kids these days".

Now, everybody who's not hugely tradition-bound can see that the Chinese writing system is a problem. Mainland China has switched over to a somewhat less awful system called "Simplified Chinese", which has simpler characters, but still has the same old problems that we inherited from China's ancient history. They've also standardized on the Pinyin romanization system. That's more progress than Taiwan has managed to make; over here, people are still using the traditional Chinese characters, and there are a bunch of nonstandard romanization systems and a phonetic alphabet that no other country uses (and which children are supposed to stop using once they've learned how to obfuscate their writing like everybody else).

Whoever said that Chinese is a difficult language is absolutely right and deserves a biscuit.

Note: after I wrote this, I found an article explaining in detail and with fantastic wit why Chinese is so damn hard. That's its title. It does a better job that I ever could.