Well, I seem to be able to send cities between different instances of the simulator. My next effort is sending them between real devices (mixed mode is the real trick).
It works when the applications are open, closed, rinning and non-running.
August 2004 Archives
In response to an ntp query about how many servers you should have, someone commented that 3 was sufficient.
This is a (unfortunately) very common misconception. NTP requires *four* servers before avoiding a single point of failure. In reality, the times reported by servers rarely if ever match, so three servers are not sufficient since in all likelihood, none of them will actually match.
NTP gets around this problem by using intervals based on the offset and plus or minus a calculated error. A candidate interval is created using two servers, and any two servers can form such an interval. NTP uses the shortest interval which encloses at least half of the servers. With three servers, this can always be formed no matter how wildly the servers disagree by choosing the interval made by the highest and the lowest server offsets, since the third will always lie between them on the interval.
With four servers, however, if three servers are very close and one is far off the others, the shortest interval will consist of the three in agreement, thus cutting out the bad guy. Of course, since NTP servers often use each other as time sources, it is better to have more servers to avoid the problem of one server contaminating another and cascading failures. But to avoid clock jumps you should have at least four.
I was at my sister's 40th this weekend, and boy am I tired. She had her party in the lovely Carraig House, on Caragh Lake. A lovely location for having a nice quiet weekend. There was karaoke, and tunes for the aged. We didn't finish up on the Friday night until after 4am, and on Saturday night I was guiding people to their beds at 5.30 in the morning. The poor nun was woken up at 4.30 by some kids in the room next to her - unfortunately they have no concept of time. I think their parents got a sum total of 2 hours sleep. This morning I had to get up for a 6am flight back to sunny Dublin. I was in the office before 8am - which is way too early for anyone. I'm drinking coffee and trying to keep myself awake (shhhh... don't tell my manager).
I've just commited the first draft of the beaming code. I need to test it, but I'm too tired to try it out tonight.
Another one of those silly problems in C programming that occasionally crops up.
Depending on the compiler, declaring a char * variable pointing to a string constant can cause that string to go into the .text segment of the application. This segment is marked as readable and executable; but explicitly not writeable.
When you try to write to this address it issues a memory protection fault (SEGV on linux). Solutions are:
- copy the string using strdup before writing to it. This means you need to remember to free the memory once the function has completed.
- use alloca and strcpy to populate the string. This eliminates the need to free the memory, but adds a bit to the set-up overhead
Nontheless, you should never be writing to values obtained from a constant; you never know where it's been (poor blighter).
I've started work on beaming. Doesn't look too hard (famous last words).
I only need to save 2 of 8 bits from the world flags, so a small amount of compression is in order. The easiest thing to do is simply remove the other bits from the fields as it's put into the savegame database. turns a 10k structure into a 2.5k.
Dear God,
Who the hell makes up the news reports. I was listening to the news today and they help talking about ATM Machines! It really gets on my goat that they keep using this dire redundancy. It's an effing Automatic Teller Machine, stop using the extra machine at the end, otherwise It's an Automatic Teller Machine Machine, which sounds completely annoying.
Grr,
Pete.