Friday, September 18, 2009

Getting GSM + Internet while visiting Taiwan

I have a Palm Centro phone, not SIM-locked, so I can obtain local phone numbers when I travel. Of course, it doesn't make sense to try to sign up for a contract if you're only in the country for two weeks, so a pre-paid phone card is really the best choice.

I recently made one of my frequent trips to Taiwan to visit family there. While there, I wanted a local phone number so people could reach me, and I also wanted to be able to use my phone's web browser and Google Earth, meaning I needed Internet access.

This may not be the only way to do that, and may not be the cheapest, it just happens to be the way I did it. I went to a few cell-phone company shop fronts. FarEasTone had not yet opened for the day, so I went to Aurora. The Aurora staff told me they could give me a pre-paid account, but not with Internet access. So the third stop in my quest was Chunghwa Telecom (中華電信). It's one of the larger companies. Here, I was able to get everything that I was looking for.

You will need:
  1. An unlocked GSM (or G3) cell phone.
  2. Two pieces of photo ID. I used my Canadian passport and my Ontario driver's license.
  3. A local address in Taiwan. A hotel address is fine.
  4. The ability to communicate with the staff.
I can speak Mandarin, and could carry out the transaction in that language. Don't assume that the employees can speak English - if you cannot carry on conversations in Mandarin you should bring somebody to interpret for you.

I signed up for a pre-paid G3 card. While my phone is GSM, the G3 cards are backward compatible to the older format. I paid NT$300 (about C$10) up front, and got the full amount in credit on my account, there are no setting-up fees, all the money goes toward pre-paid airtime minutes. The transaction took only a few minutes, and I was able to make test calls from my phone before getting up from my chair. The SIM card comes with a 4-digit unlock code, you have to enter this every time you turn on the cell phone. You can set up voice mail, but I didn't bother.

I was actually a bit surprised that I could set up a new phone number for only C$10. I would have expected that the administration costs would make it impractical to offer such a low-price entry. In the end, I used only about C$23 in air time charges in the almost three weeks I was there.

Calls are billed by the second. After each outgoing call, a text message is sent to your phone telling you the number you called, the time spent on the call, the amount charged against your account for the call, and the expiry date of your account. The account expiration timer is 180 days, reset every time you add funds to your account. To add funds to your account, you simply walk into any 7-11 and tell them you want to buy a recharge for your Chunghwa Telecom (zhong1 hua2 dian4 xin4) phone. Recharges cost NT$300, and again, all of the money you pay goes into pre-paid airtime minutes, without anything held back for "access fees" etc. To use the recharge, follow the directions printed on the card. Basically, you call 928, go through a couple of menu options, then type in the PIN revealed by scratching the back of the recharge.

The employee who set up my account warned me that Internet use was expensive, but I didn't find it so. Of course, I wasn't watching television shows on my cell phone, just visiting a few websites in the morning to read the news from home. The price quoted for GPRS is NT$0.005 per "packet". A GPRS packet is about 1 kB, so that would make the price about NT$5 per megabyte.

You should probably ask that your service be set for English. If you don't do it at the counter, you can change your language preference at any time by calling the number 928. While I can read Chinese, my phone, bought in North America, doesn't have Chinese fonts, so the text messages sent after every outgoing call are unreadable unless you've set your language preference to English.

EDIT: returning to Taiwan this year, the same SIM card in the same cell phone couldn't log onto the Internet.  After a bit of discussion between their customer service staff and their IT support, it was determined that we had to edit the network settings on my cell phone, specifically assigning an APN string of "emome".

Saturday, July 4, 2009

Musings on the "Impact" miniseries

I watched that 4-hour television miniseries, "Impact", yesterday. I'm now going to set down some of my observations, from a physics and astronomy viewpoint. Even a broadcast like that can teach you something, if it is used as a starting point to explain the things the writers got wrong. And there is a lot of teaching available here, even in the first ten minutes.

OK, we start off with people observing this "biggest meteor shower in 50000 years". It is seen starting up, so we know the observations were simultaneous. There were groups in New Mexico, the East coast of the US, and in Germany, all watching the meteor shower begin. Sunset times between those locations are as much as 9 hours apart, and in the summer time (when this movie appears to have been set) there aren't 9 hours of full darkness. This is a common mistake, movies and television shows will often show two participants in a phone call sitting half a world apart, both in full daylight.

Then, that meteor shower was a disappointment. There are recent records of much more intense meteor showers. The Leonid showers of 1833 and 1966 were, from their descriptions, much more spectacular than the shower shown in this movie.

Two astronomers are observing the meteor swarm through telescopes, before it reaches the Earth. We see a field of rocks large enough to be seen through telescopes, and so densely packed as to block sight lines so that astronomers couldn't see another object at the back of the swarm. This isn't a meteor swarm, a meteor swarm is rocks smaller than pebbles, separated from one another by kilometres of empty space. This is an avalanche in space.

Next, we find out that an object, visible while it's still moving in space, was traveling with the cloud of meteors and is going to strike the moon. Seen from the ground, this object had a visibly different track across the sky, which doesn't make sense if the objects were all traveling together. But if it were traveling in the same direction as the visible meteors, it wouldn't stand out and so would be less desirable from a dramatic standpoint, so we'll let that one pass.

So, this mystery object. Let's forget about the "brown dwarf" babble, and just describe it as a super-dense, magnetized object with, as they say in the movie, a mass twice that of the Earth's. It hit the moon, and bad things happened.

Now, the science used to explain the effects on Earth is all nonsense, of course. The "levitating frog" experiment did not produce anti-gravity. It exerted a force on a frog. A string tied to the frog's leg would also exert a force. This was just like that, but it used a magnetic field to apply the force. Gravity was still affecting the frog, but the frog was being supported against the force of gravity by a force of magnetic origin, one related to the gradient of the magnetic field (how much the field changes over a short distance). So, starting from a misunderstanding of an old news release, the writers created weird fantasy effects where objects that are not too small and not too large levitate in spooky ways in random places on the Earth, then crash to the ground. Whatever, we're not going to talk about that anymore.

OK, back to "small, very heavy object hits the moon". Our astronomers mention that the moon has 1/6 the mass of the Earth. No, it doesn't. It has about 1/6 the surface gravity, but only about 1/80 of the mass of the Earth. This is a common mistake, believing that gravity is a function solely of the mass of the object, and ignoring the different sizes. To take a dramatic example, Saturn has almost 100 times the mass of the Earth, but the force of gravity exerted at the cloud tops is not much higher than the force of gravity at the surface of the Earth, because the cloud tops are over 9 times as far from the centre of Saturn as the surface of the Earth is from its centre.

The moon gets hit by something very small that weighs two Earth masses, and is traveling very fast. And they stick together. 160 times the mass of the moon smacks into it with a speed of, let's say, several kilometres per second. This object wouldn't stop. It would barely even notice the moon. If the entire moon got in its way, it would sweep it up and continue on its path practically unaware that it was now carrying a moon with it. Since the thing is small, only a bit of the moon gets in its way. It's a very small and extremely fast bullet striking a very large soap bubble. You don't expect the soap bubble to be carried away by the bullet, you expect to find a punctured bubble. You certainly don't expect the bullet to stop dead in the bubble.

160 times the mass. Imagine you're driving down a highway, and a raccoon is crossing the road. Just as your car is about to hit it, the raccoon jumps straight up and hits the front of your car. Your car stops dead as if it had struck a concrete wall, and the mid-air raccoon is barely pushed at all. Even cartoons don't try to get you to believe that.

That much mass, stopping all at once within the moon. Just the kinetic energy released is about the same as the total output of the sun over the space of 48 hours. Not the light hitting the Earth, the light leaving the entire solar sphere. The moon would vanish in a puff of gas. The Earth would vanish in a larger puff of gas.

OK, so suddenly the moon weighs twice what the Earth does. This would have some fairly obvious effects. For one thing, the tides on the surface of the Earth would go from a few metres to a few hundred metres in amplitude. That would have a serious effect on the coastal regions (and with those tides, Missouri is a coastal region).

Increase the mass of the Earth-moon system, and the rotational period will decrease. A month would go from about 30 days to about 10 days. But in the movie, the moon was making complete orbits around the Earth on plot-driven timescales. Sometimes the orbital period was a few days, and toward the end of the movie the orbital period seems to have become about 90 days, because they had deduced that the moon would hit the Earth on this orbit, but they still had 40 days left to try to find a solution. And these weird, sudden "orbital shifts" don't make sense. Yes, an uneven mass distribution can result in smooth and gradual changes to orbits, but the moon didn't have an uneven mass distribution. It was a big mass travelling in orbit, with a light, insignificant, moon stuck to it like a bug on a windshield. The pre-impact mass of the moon isn't even an important perturbation on the mass distribution.

Good news, everybody! We just happen to have a lunar expedition fueled up and ready to go, prepared before the impact. Our heroes can fly to the moon and use some special technology to push the big new mass out of the moon. Well, the mass weighs 160 times what the moon does, so Newton's laws tell us that you're not going to push the mass out of the moon, you're going to push the moon away. The mass won't be appreciably disturbed. The plan is to push the mass out of the moon so it flies toward the sun, but really all you'd do is send the moon away at high speed while the big dense mass stays firmly in its orbit around the Earth.

Now, about this lunar mission. The good news is that you don't need as much fuel to cross over, because of the changes to the shape of the gravitational potential fields in the vicinity. The bad news is that the moon's surface gravity is at least 25 times that of the Earth. That assumes that the colliding mass is at the centre of the moon. In the movie, it's actually only partway down, and our heroes have to land near it, so they'll feel a gravitational force much higher than that. OK, they've been working out, they can walk and work in 25 gravities of force. But their lander was designed to land on rockets in 1/6 normal gravity. It would be like designing a parachute to land you safely, and then you decide that you'll change the parameters, the parachute will be used to land a bit more weight. You plus 159 of your friends, all hanging on the one parachute. You might reasonably conclude that the parachute was not designed for that kind of treatment. A similar argument can be made for the lunar lander and that little rocket jumper vehicle, whose engines certainly cannot supply the thrust to land under the new conditions. The lander would probably crumple under its own weight just trying to sit still on the moon, and taking off from the surface would be similarly difficult because of the changed conditions.

OK. Gravitation, tides, astronomy, orbital motion. If you learned something new from this movie, it's almost certainly wrong.

Friday, January 16, 2009

When your on-the-road ISP blocks your outbound mail

Now, we talked about allowing your computer to relay mail through the home machine when the ISP through which you're connecting has made it onto a block list. What do you do when the ISP simply blocks all outgoing connections on port 25? Now you can't even connect to your home computer to relay the mail.

The ISP does this to force you to pass email through their servers. The hope is that infected Windows computers will just try to open connections directly, and not forward the mail through the ISP servers. As noted in this story, that is not necessarily true.

So, now you find yourself unable to open connections on port 25, but you still want to send email. You could set up your computer to relay mail through the ISP's servers, as described in this earlier article, but that may not be convenient if, for instance, you're accessing the Internet at a relative's home, since they would have to give you their passwords for you to do that.

So, the first thing to do is to check that you can connect to your home computer on the ESMTP port number 587. Telnet onto that port number on your home computer, and if you get a response, then this technique will work for you.

First of all, you should already have set up relaying as described here. If you set it up a while ago, verify that your keys are still valid and haven't expired.

As we're discussing this in the spirit of a temporary work-around, we'll be editing the sendmail.cf file directly. First, of course, make a backup copy of your current sendmail.cf file, because you'll want to reset it to its former behaviour after you stop using this particular ISP.

Now, go into your sendmail.cf file and find the smart relay line. It will look something like this:
# "Smart" relay host (may be null)
DS

Change that line to indicate that you're sending ESMTP to your home machine. It will look a bit like this:
# "Smart" relay host (may be null)
DSesmtp:mail-host.example.com


Next, we have to tell sendmail that it is to use port 587 for outbound mail to esmtp smart relays. Locate the block in the sendmail.cf file that looks like this:
Mesmtp,         P=[IPC], F=mDFMuXa, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=990,
T=DNS/RFC822/SMTP,
A=TCP $h

and change the last line to read:
                A=TCP $h 587


That's it. Restart the sendmail program, and you should be able to relay all mail through your home machine using authenticated relaying on port 587.