I use this blog as a soap box to preach (ahem... to talk :-) about subjects that interest me.

Tuesday, January 28, 2014

Authors' Mistakes #27 - Jack Greene & Alessandro Massignani

This time I want to report a case of appalling copyediting (and proofreading).   When I read The Naval War in the Mediterranean 1940-1943 by Jack Greene & Alessandro Massignani I couldn't believe my eyes.  An otherwise interesting and obviously well researched book was spoiled by so many mistakes that I almost gave up marking them.  But I didn't, and you will find their list below the cover image.



#
Page
Description
1
8
"then vice-versa" should be "than vice-versa"
2
18
"Britian" should be "Britain"
3
26
"Baleri" should be "Baleari"
4
26
"ot" should be "of"
5
35
"Pri-colo" should be "Pricolo"
6
36
"hangers" should be "hangars" (we are taking about airplanes, not wardrobes!
7
44
"Albatross" should be "Albatros", because it refers to the name of an Italian ship.  This mistake occurs twice.
8
45
"lead" shoul be "led"
9
46
"diffrence" should be "difference"
10
54
"would named" should be "was named"
11
72
"from in Sicily" should be "from Sicily"
12
74
"Boliano" should be "Bolzano"
13
77
"a air" should be "an air"
14
93
"decided inside" should be "decided instead"
15
96
"maiali was" should be "maiale was", because "maiali" is plural
16
104
"the two of" should be "two of"
17
117
"mading" should be "making"
18
121
"crusiers" should be "cruisers"
19
127
"While touring the port large crowds had turned out" should be "while he was touring the port large crouds had turned out", because it was Cunningham who was touring the port, not the crowds.  I would have also inserted a comma after "the port", but let's not be too picky...
20
131
"withdrawl" should be "withdrawal"
21
141
Very bad grammar.  It could be fixed for example by replacing  "and they promised the Italian" with "and their failed promise to the Italians to provide"
22
144
"Marinkommando" should be "Marinekommando"
23
156
"It has always taken" should be "It has always been taken"
24
159
"commision" should be "commission"
25
165
"approachs" should "approaches"
26
170
"Calcutta, Calcutta and Carlisle" should be "Calcutta and Carlisle"
27
192
"Guilia" should be "Giulia".  This is an example of the common mistake made by English speakers when they write "Guiseppe" instead of "Giuseppe" and "Guilio" instead of "Giulio" (my name...  sigh...)
28
199
"They was" should be "They were"
29
200
Bad, bad grammar: "Four freighters were at sea, three in a convoy escorted by six destroyers that had left Taranto on the afternoon of the 16th, and the other by a destroyer and a torpedo-boat."  Grammatically, this sentence means that the six destroyers escorting three of the freighters had left Taranto, leaving unclear where the three escorted freighters were coming from.  But I believe that the intention was to say that the three freighters had left Taranto together with their escort of six destroyers.  At the very least, the sentence is tortuous and ambiguous.  I would have said: "Four freighters were at sea.  Three had left Taranto on the afternoon of the 16th with an escort of six destroyers, and the fourth freighter was escorted by a destroyer and a torpedo-boat."  Or something like that.
30
204
"nearly being colliding" should be "nearly colliding"
31
204
"such just an attemp" shoud be "such an attempt"
32
204
There are two consecutive "that"s, one before a quotation and one at the beginning of it.  One of the two should not be there.  I'm not sure whether the quoted text contained the opening "that", but I would have removed it anyway.  it doesn't seem nice to start a quotation with "... that".
33
204
The authors inserted a "[sic]" within a quotation after the word "neutralising".  They should have not, because they were quoting admiral Cunningham, and in British English "neutralise" is correct.  It is only in American English that the word would have been spelled as "neutralize".  They were not quoting Nimitz, were they?
34
206
"try and convince" should be "try to convince".  To use "and" after "try" is a colloquialism and should have no place in a History book.
35
206
"Ricarrdi" should be "Riccardi"
36
206
"shipbuilding capacity was not sufficient to replace losses of warships and particularly merchant ships which were being sunk by the Allies in increasing numbers".  First of all, "particularly" is out of place, because "merchant ships" are not a subset of "warships".  Secondly, which should be preceded by a comma.  I would have said: "shipbuilding capacity was not sufficient to replace losses of warships and of merchant ships, which were being sunk by the Allies in increasing numbers".  It would still remain a somewhat awkward sentence, but at least it would be correct.
37
206
"liaision" should be "liaison"
38
207
"the supply situation to North Africa" should be "the supply situation in North Africa"
39
210
"the need to chose" should be "the need to choose"
40
211
"took place at Bremen" should be "took place in Bremen"
41
211
"(known as Ra.Ri from Radiodetectortelemetri)".  First of all "Radiodetectortelemetri" is not Italian.  This term refers to rangefinders that Ugo Tiberio developed for the Regia Marina, but it was written "Radio-Detector Telemetri", or "RDT".  The abbreviation "RaRi" (without any period in between) was used to abbreviate the word "Radiotelemetri", which was introduced later.  Unfortunately, I have not been able to determine the meaning of "Ri", although I suspect that it might refer to "Ritorno", which means "return".  "Radio Ritorno" would make sense, as a radiotelemetro measures the distance of an object by determining how long it takes for a radio wave to come back to the generating antenna after being reflected by the object in question.
42
212
"would be pass" should be "would be passed"
43
213
"Ammirglio" should be "Ammiraglio"
44
227
"less agricultural land then" should be "less agricultural land than"
45
235
"Stormos" should be "Stormi".  The authors built the plural of the Italian "stormo" as if it were an English word.
46
236
"Gioherti" should be "Gioberti"
47
240
A "pearl" of grammatical beauty: "The German 3rd Motor Torpedo Boat Flottilla under Lieutenant-Commander Kemnade operating against the retreating British fleeing Tobruk and sank the South African minesweeper Parktown and some small craft."  MMmmm... "operating and sank"?
48
240
"'Fingerspitzengefühl' ('gut feeling')".  Here there are two mistakes.  First of all, Fingerspitzengefühl literally means "feeling with the tips of the fingers" and is used in German to indicate an attention to a finely tuned intuition.  I would translate it as something like "finely tuned intuition".  The translation ("good feeling") would be in German the simpler "Gutes gefühl".  Secondly, "gut" is not English, is it?
49
241
"on other hand" should be "on the other hand"
50
262
"Of these, 10,932 of them" should be either "Of these, 10,932" or "10,932 of them"
51
263
"'Soldatis'" should be "'Soldati'".  "Soldati" means "soldiers" and is already plural ("soldato" being the singular form).  In any case, the plural in Italian is not done by appending an 's' to the singular.  "Soldati" was the name of a class of destroyers.
52
268
"had to taken" should be "had to be taken"
53
269
"took nearer 60 seconds" should be "took close to 60 seconds", or perhaps "approximately 60 seconds"
54
269
"also played apart" should be "also played a part"
55
273
"they was" should be "they were"
56
273
"but they along with Vichy were fooled".  OK.  Commas are out of fashion, but if they didn't want to write "but they, along with Vichy, were fooled", they could have said "but they were fooled along with Vichy".  Or not?
57
278
"MFP of 200 tons (there were three types, A, B, and C)".  they should have said that MFP stands for Marinefährprahm (naval ferry barge).  Also, there were several types of MFPs, not just three.  And, in any case, why write a comma after "types" instead of a colon?
58
281
"losees" should be "losses"
59
284
"were the PT boats which" should be "were the PT boats that"
60
285
"attack transports which" should be "attack transports, which"
61
288
"Pantellaria" shoul be "Pantelleria"
62
289
"partol" should be "patrol"
63
290
" the where" should be ", where"
64
294
"afetr" should be "after"
65
294
On the same line: "oi" should be "of"
66
294
Again, a few lines below: "oi" should be "of".  How can it be?  'I' and 'F' are not even close on the keybord...
67
296
"as these" should be "these"
68
298
"south of the Appenines".  Two problems here.  Firsly, "Apennines" is the correct spelling in English.  Secondly, the Apennines are a mountain chain that stretches from the Ligurian Alps in northern Italy to Reggio Calabria, at the tip of the Italian peninsula.  Therefore, "south of the Apennines" is close to meaningless.
69
303
"disagreeded" should be "disagreed"
70
306
"Abdeil" should be "Abdiel".  The Royal Navy had over the years three ships named Abdiel.
71
306
"Guilio" should be "Giulio".  Again...
72
307
"It flys" should be "It flies".
73
309
"the Germans had effectively air superiority" is preceded by a comma.  It should be preceded by a full stop or, at least, a semicolon.
74
311
"and were often had not been" ???
75
312
Another "try and" that should be "try to"
76
314
"which was within their means" should be ", although it was within their means"

To top it off, there are even two mistakes in the captions of the images inserted in the middle of the book: Another occurrence of the infamous "Guilio" instead "Giulio" and a wrong date (they wrote 1950 instead 1940).

Almost a mistake every four pages of text.  Even MS Word would have detected many of them.  And what I have is the 2011 edition, not the original edition of 2002.  There has also been a US edition...

Now, I have probably made mistakes in this article.  But this is just bloody me, not the Frontline Books in London.

This is a real shame.  I'm seriously considering sending the list of mistakes to the publisher...

For your reference, here are the links to all past “Authors’ Mistakes” articles:
Lee Child: Die Trying
Colin Forbes: Double Jeopardy
Akiva Goldsman: Lost in Space
Vince Flynn: Extreme Measures
Máire Messenger Davies & Nick Mosdell: Practical Research Methods for Media and Cultural Studies
Michael Crichton & Richard Preston: Micro
Lee Child: The Visitor
Graham Tattersall: Geekspeak
Graham Tattersall: Geekspeak (addendum)
Donna Leon: A Noble Radiance
007 Tomorrow Never Dies
Vince Flynn: American Assassin
Brian Green: The Fabric of the Cosmos
John Stack: Master of Rome
Dean Crawford: Apocalypse
Daniel Silva: The Fallen Angel
Tom Clancy: Locked On
Peter David: After Earth
Douglas Preston: Impact
Brian Christian: The Most Human Human
Donna Leon: Fatal Remedies
Sidney Sheldon: Tell Me Your Dreams
David Baldacci: Zero Day
Sidney Sheldon: The Doomsday Conspiracy
CSI Miami
Christopher L. Bennett: Make Hub, Not War
CSI Miami #2 (Robert Hornak)

Friday, January 17, 2014

Yet another (stupid) email scam

A fourth article about Internet scams.  This time, I want to show you how stupid an email scam can be and, once more, how easy it is to recognise it.  Here is a snapshot of the email I received a couple of days ago:



It is a scam in Italian because it was sent to an Italian email address of mine (which you can actually see at the bottom of the image).  It says that I have exceeded the PayPal limit (never heard of such a thing; have you?) and that, according to a new Italian law (?!?), unless I update my profile information, the account will be suspended.  To update my account, I should click on the link.

When I took the snapshot, I hovered with the cursor over the link, so that the actual link could be captured at the bottom of the email client's window.  The text of the link indicates a secure link to paypal.com, but the page it is pointing to actually is on davidserra.es.  Either this David Serra from Barcelona is so stupid that he shows his real domain name, or somebody has highjacked it.  In any case, it is clear that the email has nothing to do with PayPal.

Furthermore, why should PayPal send an email from admin@webbergrp.com?

In any case, any Italian with a minimum of brain would have dismissed the scam even without checking the link, because the text is not grammatically correct.  You cannot possibly believe that PayPal would send emails with grammar mistakes, would you?

The worst mistake is that the email addresses the customer in three different ways: with "voi" (a plural "you" also used in the past as a form of respect), "lei" (a singular "you" with people you don't know), and "tu" (an informal singular "you").  There are also at least four adjectives that do not match gender and/or number of the corresponding nouns.

I wonder whether this David Serra (or whoever the scammer is) has managed to obtain with this email credit card or banking information.  If he did, I am almost inclined to say that those "customers" deserved to be scammed because of their stupidity!

Monday, January 6, 2014

Earlobes? Go figure!

A couple of days ago, I checked which ones of the more than 200 articles in this blog had attracted most page views.  Here is what I discovered:


Entry
Labels
Pageviews
Freq
OO - UML Behavior Diagrams (Sep 6, 2010) Computer Science 391898
Fortran and Eclipse on the Mac (Jan 4, 2011) Computer Science 331992
OO - UML Structure Diagrams (Sep 5, 2010) Computer Science 328082
Earlobes (Mar 19, 2012) Science, Me 3000140
Sudoku - A Handsome Samurai (Jan 19, 2011) Computer Science, Games & Puzzles 107530
Board Games (Feb 26, 2012) Games & Puzzles 49322
GLUT in C with Eclipse on the Mac (Feb 6, 2011) Computer Science 47413
KenKen Strategies (Mar 5, 2011) Games & Puzzles 46814
Homo Novus (Jul 24, 2010) Computer Science, AI 42010
Dismissive people, power, and all that (Jun 4, 2012) Society 32816

Computer Science, which actually includes everything concerning programming and software development, seems to be the clear winning subject, with six presences and the first three positions, followed by Games & Puzzles.

But, the longer an article is online, the more opportunities it has to attract viewers.  I have no fun to go through all the articles and divide each number of page views by the corresponding time since publication, but I did it for the top 10.  The column Freq is the approximate result when time is measured in months.

Again, Computer Science, at least in the limited scope of the sample, comes out as the winning subject, but look at Earlobes!

To be completely sure, one should check that there are no very recent articles with proportionately many views.  For example, a two-month-old article with 300 page views would not appear in the top 10 but would still rate 150 page views per month, higher than Earlobes.  Well, I checked out all articles with at least 100 page views, and they were all older than a few weeks.

It could still be that a very recent article will shot to the top, but to determine that we will have to wait.  For example, the article before this one, published two days ago, has been viewed so far 12 times.  Six views per day correspond to 180 views per month, but it is too soon to tell.

In conclusion, for the time being, my most viewed article is a 300-word article on different types of earlobes and how I need sometimes to flatten them up when I lay in bed.   MMmmm...

I know...  You might be thinking "What do I care about what a handful of people like to read in Giulio's blog?"  You are right.  But then, why have you read till here?   :-)

Saturday, January 4, 2014

Scary AFP Scam

This is my third article about Internet scams.  The previous two (on 2011-09-12 and on 2012-03-07) were about email scams.  This time, I want to talk about a web scam.  Somebody must have highjacked a URL.  As a result, while attempting to access a web site, I was confronted with the following page (if you cannot read the text, right-click it and select View Image):


Scary, isn't it?

But:
  1. The Australian Federal Police would never issue a fine via a web page.  And, if they wanted to seize your computer[s], they would come to your place in force and without notice, wake you up early in the morning, and take your computers to their labs.

  2. The domain name, although it starts with "aft.gov.au", is in fact the domain k318843.com, which was registered in China through http://www.bizcn.com/.  No way that the AFP would operate via a Chinese registrar.

  3. If any part of the Australian Government wanted to fine you, you would receive a letter through the mail, and they would not ask you to pay via Ucash within 12 hours!
My advice is therefore always the same: even if the graphic presentation is impressive and at first sight convincing, before taking any request seriously, regardless of whether it is for money or for personal information, check the originating email address or web domain very carefully.  Then, if you are still unsure, seek confirmation from the requesting organisation via a contact number or address that you have obtained via a public and independent source (e.g., telephone directory or their public web site).

Tuesday, December 31, 2013

Reflections on Faith and Science

I haven't written a single article during this month of December.  It is today or never.

I am an atheist.  No doubt about it.  I don't believe that some all-powerful, self-conscious entity is interested in our lives or even that it exists.  There are no reasons for believing that a God exists, but neither are there reasons for not believing that it exists.  Therefore, the most logical position is to be an agnostic, not an atheist.  I should be able to say: I neither believe nor disbelieve.  And yet, I don't believe.  For somebody like me, who has a scientific formation, this is not completely satisfying, because I am asserting something that can be neither proven nor disproven.

In any case, the existence or non-existence of God doesn't affect my life in any way.  At least not directly, as what believers manage to impose on everybody else does have an influence on me.  Religious fervour has resulted in laws prohibiting abortion (like in Malta and Chile), traditions keeping girls out of school (like in Afghanistan), and regulations forcing restrictive dress codes on women (like in the Orthodox Jewish quarter of Tel Aviv, where women must cover their arms).  Obviously, I will never need an abortion, I have been able to attend school, and I am allowed to wear short-sleeved shirts wherever I want.  Nevertheless, these rules, often directed at women, are deeply annoying.

This distinction between atheism and agnosticism is just another way of placing people in boxes.  A more important distinction is whether people have doubts or not.  Certainties are dangerous.  Certainties make possible for fanatics to strap around their waists belts full of explosive and blow themselves up in public places.  Certainties have caused over the whole recorded history of Humanity persecutions of entire ethnics groups and tortures of millions.

In fact, I believe that certainties are responsible for most of the problems we have today.  There are too many faithfuls and not enough scientists.

What many non-scientists have difficulties in grasping is that no scientific statement can ever be proven to be absolutely true.  For example, Newton's theory of gravitation worked flawlessly for a long time and is still used every day.  But it was discovered that it couldn't fully explain the orbit of the planet Mercury.  Einstein's theory of gravitation solved that problem and has been confirmed by countless measurements.  Does it mean that Newton was wrong?  Not at all.  It only means that Newton's theory is an approximation of general relativity or, if you prefer, that Einstein's theory can explain a wider class of phenomena and with more accuracy.  Does it mean that Einstein's theory will always be right?  Again, not at all.  It only means that, so far, it has never been proven to be at fault (although, truth be told, general relativity has not been successfully integrated with quantum mechanics; but that's another story).

Scientific statements, therefore, are a never-ending work-in-progress.  They can be proven wrong in some cases, but the proof of their correctness never ends.  Despite of their intrinsic uncertainties, all these temporary laws of Physics can still be used to discover further laws that explain our universe.  It is a bit like crossing an infinitely wide mountain creek on wobbling stones: scientists keep stepping on the same wobbly theories and, as they progress, the older theories become more and more trustworthy; more stable paths are identified.

People who insist that Intelligent Design (ID) should be taught at school in Science classes as an alternative to Evolution by Natural Selection (ENS) can only do so because most people don't know what I have explained in the previous two paragraphs.  The ID people state that ENS is an unproven theory.  But there is no scientific theory completely proven.  It is impossible.  The key issue is that ENS can be disproven, while ID cannot.  That is why ENS is a scientific theory and ID is not!

The same problem pops up with the hoopla about climate change, levels of CO2, and whether the changes are anthropic or not.  People ignorant in Science would like to have clear, unambiguous, and final answers, and confuse scientific results with beliefs.  But certainty has no place in Science.

My attitude towards God is scientific: if, after asking me whether I believe that a God exists (to which, as I said, I would reply no), you asked me whether I'm sure, I would have to answer with another no.  Of course I'm not sure.  How could I?  But I don't need to introduce an "ad hock" entity that explains everything Science cannot [yet] understand.  For centuries, the Catholic Church was a drag on Science because it wanted to cling to what its revealed truth (actually, it still is).  It was (is) a problem caused by certainties (not "misplaced certainties", because all certainties are misplaced).

All so-called proofs of the existence of God that come to mind rely on negatives: all this beauty of nature cannot be the result of random events; we don't know how our universe came into existence; it cannot be that our existence has no purpose; etc.  But how can one claim to prove anything on the basis of what one doesn't know?  It is baffling.

I know little about Judaism and Islam (of which I am somewhat ashamed), but I was taught the Catholic catechism.  I strongly encourage you to have a look at it, especially if you have never done it before.  It is an amazing construction of cross-linked concepts.  I have to wonder how many so-called faithfuls actually believe much of what is in there...

As Alain de Botton convincingly explained in his book Religion for Atheists, religion has its functions and its usefulness in society.  But it should be kept in check and not overpower everything else.

Christianity might have shaped morality and laws of the western world, but I don't need a priest to tell me that to contribute to a harmonious society I should behave with others as I would like them to behave with me.  Luke's do to others as you would have them do to you (verse 6:31) is only an expression of a Golden Rule that has been recognised and applied everywhere since antiquity.

I believe that ENS has resulted in the collaborative attitude of human beings.  A typical example of such a "social" attitude is shown by how people behave when confronted with the game called "the prisoner's dilemma".  From Wikipedia (look in particular to the last sentence):

Two members of a criminal gang are arrested and imprisoned. Each prisoner is in solitary confinement with no means of speaking to or exchanging messages with the other. The police admit they don't have enough evidence to convict the pair on the principal charge. They plan to sentence both to a year in prison on a lesser charge. Simultaneously, the police offer each prisoner a Faustian bargain. Each prisoner is given the opportunity either to betray the other, by testifying that the other committed the crime, or to cooperate with the other by remaining silent. Here's how it goes:

  • If A and B both betray the other, each of them serves 2 years in prison
  • If A betrays B but B remains silent, A will be set free and B will serve 3 years in prison (and vice versa)
  • If A and B both remain silent, both of them will only serve 1 year in prison (on the lesser charge)
It's implied that the prisoners will have no opportunity to reward or punish their partner other than the prison sentences they get, and that their decision won't affect their reputation in future. Because betraying a partner offers a greater reward than cooperating with them, all purely rational self-interested prisoners would betray the other, and so the only possible outcome for two purely rational prisoners is for them to betray each other. The interesting part of this result is that pursuing individual reward logically leads both of the prisoners to betray, when they would get a better reward if they both cooperated. In reality, humans display a systematic bias towards cooperative behavior in this and similar games, much more so than predicted by simple models of "rational" self-interested action.

It makes sense to speak of rules of ethics applicable to everyone, but, except for predispositions resulting from ENS, they ought to be based on rationality, with the aim of maximising our collective well-being, not allegedly inspired by a God invented to comfort us.  There is no need for a God to explain the validity of moral codes.

For millennia, religions played an important role in constraining some of human emotions that, if uncontrolled, would have resulted in chaos.  But, at the same time, religions also exploited those same emotions for their own purposes of expansion and control.  I say: let's get rid of them!

We must invest as much as possible in education, so that a secular, conscious morality will eventually replace the rules imposed by superstition, regardless of whether it is called witchcraft or religion.  One day, with the help of Science, we will be able to control our destructive emotions rationally, while still enjoying the positive ones.  Only then, we will have left behind the caves of our ancestors and be ready to explore the universe.

Wednesday, November 27, 2013

My custom tiles for Carcassonne

I have played so far 94 games of Carcassonne, of which 89 where with The River extension, and 86 with the additional extension Inns and Cathedrals.  Additionally, I also played 17 times Carcassonne's Winter Edition, which is almost identical to the standard game.



I have a couple of other extensions, but I like best the combination of the basic game plus The River and Inns and Cathedrals.

That said, I started thinking that a couple of tiles where missing, and decided to make them myself.  Note that I always play Carcassone by taking the tiles from a canvas bag (rather than from piles as recommended in the rules).  Therefore, it doesn't really matter to me whether the back of the tiles I make looks identical to that of the original set.  That is, to be playable, my tiles only need to feel like the standard ones.

I used PaintShop Pro to edit scanned images of existing tiles, printed them on matt self-adhesive paper, and stuck them onto the right type of cardboard.

The first tiles I added where two each of the following ones:



Then, I decided to extend Inns and Cathedrals by adding the following two:


And finally, I extended The River by adding a river branch, (which required an additional river end) and a straight section of river:



But there was a problem with The River: I usually play the 10 tiles (now 12) by simply turning them face down on the table.  To be able to keep doing that, I made my own source and both ends.  This allowed me to stick the new river branch and the new river section to the front of the original source and end.  This worked because the additional thickness of the tiles due to the adhesive paper is not enough to make the tiles distinguishable when they are face down.

If you want to reproduce the tiles, download the images in this articles and print them with the scale of 100%.  As they have a resolution of 600dpi, they look as good as the originals!

2020-04-01: I have updated this post, but only to ensure that all images were displayed correctly. As of today, 6y 4m after posting this article, I have played 317 different board games a total of 1246 times, but Carcassonne has remained one of my favourite, with 211 plays. Check out my page on BoardGameGeek for more.

Saturday, November 23, 2013

Everybody spies on everyone

The relationship between the two governments of Australia and Indonesia is currently strained because the Australian Signal Directorate (which corresponds to the American NSA) has been caught spying on the telephone calls of the Indonesian president, his wife, and more than half a dozen senior officials.  I allowed myself to copy from the ABC-Australia web site the following slide, which was part of a presentation disclosed by Edward Snowden.  I'm confident that the ABC will not mind, as it has been shown in other web sites.




The release of the list has caused an uproar in Indonesia, with Australian flags being burned and demonstrations being held before the Australian embassy.  But everybody always spies on everybody else.  President Obama has reassured Bundeskanzlerin Merkel that the NSA will not spy again on her phone, but who believes it?  I certainly don't.

So, now Mr. Yudohoyono, the Indonesian president, to save face with his constituents, demands explanations and reassurances from Mr. Abbott, the Australian Prime Minister.  And to excercise pressure, he has also recalled the Ambassador and suspended a series of bilateral agreements.

As everything happened on the public scene, the Indonesian president had to react, and our Prime Minister has shown to be wet behind the ears by not satisfying his friend's Susilo Bambang's demands.  How silly is that?  Come on, mate.  Tell Susilo that you will not spy on him and his entourage anymore, and make peace, like two good boys!

Friday, November 22, 2013

Authors' Mistakes #26 - CSI Miami #2 (Robert Hornak)

Another mistake in CSI Miami (see my post of three weeks ago for the first mistake in CSI Miami I reported).  This time, it is in episode 4 of season 8, In Plane Sight.



The CSIs ask a murder suspect to pop one of his contact lenses to compare it with the one they found on the crime scene.  The suspect pull the contact lense off his right eye, and it turns out to match the one left behind by the murderer.

Now, I have still to hear of somebody with identical corrections for the two eyes.  It is not possible to swap spectacle lenses by mistake, but contact lenses containers are always clearly mark L and R, precisely because they are different.

And yet, the CSIs ask to "pop a lense" and it turns out to be a match.  You might think that, failing the first attempt, they would have asked to pop the other one, but you would be mistaken.  In fact, they had already tested in the same way another suspect, and also in that case they had only checked one lense.

But it get worse: the episode shows the precise moment in which a contact lense falls off one of the murderer's eye, and it is the left one!

They really got it wrong.

For your reference, here are the links to all past “Authors’ Mistakes” articles:
Lee Child: Die Trying
Colin Forbes: Double Jeopardy
Akiva Goldsman: Lost in Space
Vince Flynn: Extreme Measures
Máire Messenger Davies & Nick Mosdell: Practical Research Methods for Media and Cultural Studies
Michael Crichton & Richard Preston: Micro
Lee Child: The Visitor
Graham Tattersall: Geekspeak
Graham Tattersall: Geekspeak (addendum)
Donna Leon: A Noble Radiance
007 Tomorrow Never Dies
Vince Flynn: American Assassin
Brian Green: The Fabric of the Cosmos
John Stack: Master of Rome
Dean Crawford: Apocalypse
Daniel Silva: The Fallen Angel
Tom Clancy: Locked On
Peter David: After Earth
Douglas Preston: Impact
Brian Christian: The Most Human Human
Donna Leon: Fatal Remedies
Sidney Sheldon: Tell Me Your Dreams
David Baldacci: Zero Day
Sidney Sheldon: The Doomsday Conspiracy
CSI Miami
Christopher L. Bennett: Make Hub, Not War

Friday, November 15, 2013

Authors' Mistakes #25 - Christopher L. Bennett

Christopher L. Bennett wrote many Star Trek books and articles, and I'm sorry to have to criticise a fellow Trekker, but in the novellette Make Hub, Not War, published in the November 2013 issue of Analog Science Fiction and Fact, he got something wrong.


Many will probably find that what I'm going to say is way over the top, but authors who use Italian names or elements of Italian cultures too often get it wrong.

In Make Hub, Not War, Bennett gave the name Andrea to an Italian woman.  The problem is that in Italy Andrea is a name for males.  With so many Italian names and so many web sites that list them, why had Bennett to use Andrea?  He clearly didn't do any research at all.  And Analog's editors didn't notice the mistake either.

By using an Italian mother, Bennett could name one of his characters David LaMacchia and have people sit around a table and eat pasta.  I wonder why so many English-writing authors have this fascination with everything Italian and French.  Anyhow, to be picky (and I certainly am) LaMacchia is not a valid Italian family name.  In Italian, it would have to be written "La Macchia" (which means "the spot") or possibly, although unlikely, "Lamacchia".  Actually, now that I think about it, no capital letters ever appear in the middle of a name in any language I know.

Am I excessive?  Certainly.  But these things annoy me a lot...

For your reference, here are the links to all past “Authors’ Mistakes” articles:
Lee Child: Die Trying
Colin Forbes: Double Jeopardy
Akiva Goldsman: Lost in Space
Vince Flynn: Extreme Measures
Máire Messenger Davies & Nick Mosdell: Practical Research Methods for Media and Cultural Studies
Michael Crichton & Richard Preston: Micro
Lee Child: The Visitor
Graham Tattersall: Geekspeak
Graham Tattersall: Geekspeak (addendum)
Donna Leon: A Noble Radiance
007 Tomorrow Never Dies
Vince Flynn: American Assassin
Brian Green: The Fabric of the Cosmos
John Stack: Master of Rome
Dean Crawford: Apocalypse
Daniel Silva: The Fallen Angel
Tom Clancy: Locked On
Peter David: After Earth
Douglas Preston: Impact
Brian Christian: The Most Human Human
Donna Leon: Fatal Remedies
Sidney Sheldon: Tell Me Your Dreams
David Baldacci: Zero Day
Sidney Sheldon: The Doomsday Conspiracy
CSI Miami

Wednesday, October 30, 2013

Authors' Mistakes #24 - CSI Miami (Marc Dube)

I confess: I am a fan of CSI Miami.  I don't like the CSI series located in Las Vegas and New York.  But the Miami series is bathed in warm colours and shows beautiful scenery.  I know that it was actually filmed in California and that the warm feel was obtained by saturating the colours, but who cares?  I also find the characters reasonably appealing.

Anyhow, last night I discovered a mistake in episode 16 of season 7 (Sink or swim).  I am not referring to the many licences that the authors take with the way CSI people operate in real life.  I understand that if our fictitious CSIs were confined to the labs and spend days to analyse a sample, the stories would evaporate.  What they did in Sink or swim violated the laws of Physics!



Here it goes.
An assassin kills a lady standing at the railing of a yacht by shooting her from underwater.
Do you see no problem with that?

There is one: when a ray of light crosses the boundary between water and air, it changes direction.  This phenomenon is called refraction (see for example the refraction page on Wikipedia).  Here is a nice diagram (also from Wikipedia) to describe it:


Suppose that the top side is air (with refractive index n1 = 1) and the bottom side is water (with refractive index n2 = 1.33).  Snell's law tells you that sin(θ2) = sin(θ1) * n1 / n2.  This means that light entering the water with an angle of, say 30°, is deflected to approximately 22°.  As a result of the deflection, the underwater shooter of CSI Miami saw his target 8° higher than it was.  With a target placed, say, 5 metres above the water, 8° roughly correspond to more than 80 cm.  Enough to shoot above the target's head instead of hitting her heart.  The effect increases when the angle increases.  So, for example, with θ1 = 45°, θ2 becomes 32°, which is 13° less than θ1.

Obviously, the positions of both the target and the shooter also play a crucial role.  For example, the 80 cm of the previous calculation are reduced to 49 cm if the target is only 3 m above the water instead of 5.

Now, refraction has no impact if the shooter is directly below the target, because both angles become zero.  But this is not what happened in CSI Miami, as the shooter had to be somewhat away from the boat in order to clearly see his target.

All in all, there is no way that the shooter could have made the kill.

Funnily enough, the Archerfish manages to hit insects one or two metres above the water by spitting at them from underwater.  A thorough study about that fish was published by Lawrence M. Dill in 1977 (Refraction and the Spitting Behavior of the Archerfish (Taxotes chatareus), Behavioral Ecology and Sociology, 2, 169-184).

For your reference, here are the links to all past “Authors’ Mistakes” articles:
Lee Child: Die Trying
Colin Forbes: Double Jeopardy
Akiva Goldsman: Lost in Space
Vince Flynn: Extreme Measures
Máire Messenger Davies & Nick Mosdell: Practical Research Methods for Media and Cultural Studies
Michael Crichton & Richard Preston: Micro
Lee Child: The Visitor
Graham Tattersall: Geekspeak
Graham Tattersall: Geekspeak (addendum)
Donna Leon: A Noble Radiance
007 Tomorrow Never Dies
Vince Flynn: American Assassin
Brian Green: The Fabric of the Cosmos
John Stack: Master of Rome
Dean Crawford: Apocalypse
Daniel Silva: The Fallen Angel
Tom Clancy: Locked On
Peter David: After Earth
Douglas Preston: Impact
Brian Christian: The Most Human Human
Donna Leon: Fatal Remedies
Sidney Sheldon: Tell Me Your Dreams
David Baldacci: Zero Day
Sidney Sheldon: The Doomsday Conspiracy

Tuesday, October 22, 2013

KenKen and CalcuDoku Revisited

Almost two years ago, I posted an article to this blog about KenKen and CalcuDoku.  In that article, I compared the 9x9 puzzles made available in the web sites kenken.com (® Nextoy LLC), calcudoku.org, and zambon.com.au (my own).  Like last time, I will use K to identify the puzzles provided by kenken.com, C to identify those provided by calcudocu.org, and Z to identify mine.

Of the three web sites, only the K site provides 9x9 puzzles of different levels of difficulty, but I have only ever solved the "tough" ones.

After solving more than 500 9x9 puzzles, I have a much better feel about the differences between the puzzles generated by the three sites.

K and Z are comparable in terms of difficulty and general "feel".  The C puzzles are different.

First of all, the C puzzles include many more single-cell cages.  Patrick (the developer of the C site) told me that he uses singles to remove ambiguities.  I understand why the singles are there, but I have always found it annoying that their average number exceeds 9.  K puzzles include very few singles (0 to 3), and I can configure my generator to limit the number of singles to whatever I like.  I normally set the maximum number of singles to 3, but I could also set it to 0 (I have tried it out) and systematically generate puzzles without singles at all, although it requires on average a longer time to generate each puzzle.

I don't think that Patrick's decision to "single out" the ambiguities was a good one.  I commented on the C web site that I didn't like to go through the chore of filling up so many singles when starting with a new puzzle, but other users replied that it didn't bother them.  Fair enough.

Another problem I have with C puzzles is that the difficulty of solving them is not uniform as you progress: invariably, it is easy to fill in a third of the cages or so without much need for reflection.  Then, you hit a wall and the cages suddenly become very difficult.  It might be connected to the fact that there are many single cages used for disambiguation, but I am not sure.

I have lived for almost two years with the two problems I have just mentioned, because 9x9 C puzzles also have an interesting feature: they can have divisions and subtractions in cages with more than two cells.  For example, an angled three-cell cage with "2:" as target admits 841, 822, 631, 421, and 211 as possible solutions.

But there is another problem that has finally convinced me to stop solving C puzzles for good: some of them are not solvable analytically, and I refuse to solve a puzzle by trial and error.  I find it very frustrating when I encounter a puzzle that cannot be solved without guessing.

I know what you are thinking: perhaps I'm not good enough.  It's possible, but, perhaps not surprisingly, I don't think so.

I believe that the problem is due to the fact that C puzzles sometimes have too many large[r] cages with sums and subtractions.  This can result in untameable combinatorial explosions.  Those angle cages with targets ranging between 13+ and 20+ and between -0 and -4 sometimes combines in ways that leave too many alternatives open.

Patrick calculates for each puzzle a difficulty level, which for 9x9 puzzles is in the range 100±30 (i.e., I haven't seen anything outside that interval).  I asked him how he arrives to those figures, but he refused to divulge his algorithm.  I understand that when he started his web site he went though several tests, but his calculations are not right.  Last June, I solved a puzzle with an alleged difficulty of 129.3, but in September I didn't succeed in solving a puzzle with a difficulty of 70.2.

Here are the statistics for the June puzzle:
#1-cell: 8
#2-cell: 16 (3+, 9-, 2x, 2:)
#4-cell: 4 (1+, 2x, 1:) all T-shaped
#5-cell: 5 (2+, 3x) 1 cross-shaped, 4 angled

And here are those for the September puzzle:
#1-cell: 9
#2-cell: 13 (2+, 3-, 8x)
#3-cell: 6 (1+, 4-, 1x) all angled
#4-cell: 4 (3+, 1-) 1 T-shaped, 2 squares, 1 lightning-shaped
#5-cell angled: 2 (1+, 1x) 1 cross-shaped, 1 tap/fawcett-shaped

Do you see what I mean?  The June puzzle, which was supposed to be among the most difficult ones, had no 3-cell cages, and of the 9 cages with 4 and 5 cells, only 3 had sums.  The September puzzle, which was supposed to be among the easiest 9x9s, had only two multiplications among the 12 cages with at least 3 cells.  In two adjacent columns, there were three 3-cell cages with 4-, 1-, and 0-, and arranged in such a way that they took up six cells of one column.

4- can be 941, 932, 831, 822, 721, 611; 1- can be 971, 962, 953, 944, 861, 852, 843, 751, 742, 733, 641, 632, 531, 522, 421, 311; and 0- can be 981, 972, 963, 954, 871, 862, 853, 844, 761, 752, 743, 651, 642, 633, 541, 532, 431, 422, 321, 211.  Yes, there were some crossings that reduced the possibilities, but the same puzzle also included two 4-cell 15+, a 4-cell 16+, a 4-cell 0-, and a 5-cell 32+.  No way that it could have been solved analytically!

All in all, I finally got fed up with the C puzzles.  That's why a couple of days ago I gave up on them.

The C web site has the best application to solve the puzzles online, but for the 9x9 puzzles (and I am not interested in the smaller ones), the best way is to print them out and use pencil and eraser.  Therefore, no loss there...

Tuesday, September 10, 2013

Converting UTF-8 to Unicode

To be stored digitally, each character of a piece of text is encoded into a particular bit pattern.

For exampe, according to the ASCII (American Standard Code for Information Interchange) standard, which has been around for half a century, the letter 'A' is encoded with the 7 bits 10000012 or, in hexadecimal notation, 4116, which I prefer to write with the Java/C syntax: 0x41.  With 7 bits, only 128 patterns can be encoded (i.e., 27), just enough for plain Latin characters, numbers, and a few special symbols.

Over the past couple of decades, a different type of encoding called UTF-8, based on a variable number of bytes, has established itself as the most common encoding used in HTML pages.

Often, UTF-8 is confused with Unicode, but while UTF-8 is a way of encoding characters, Unicode is a character set.  That is, a list of characters.  This means that the same Unicode character can be encoded in UTF-8, UTF-16, ISO-8859, and other formats.  You will find that most people on the Internet refer to Unicode as an encoding.  Now you know that they are not completely correct, although, to be fair, the distinction is usually irrelevant.

The Wikipedia pages on Unicode and UTF-8 are very informative.  Therefore, I don't want to repeat them here.  But I would like to show you a couple of examples taken from the UTF-8 encoding table and Unicode characters.

The charcter 'A', which was encoded as 0x41 in ASCII, is character U+0041 in Unicode and is encoded as 0x41 in UTF-8.  "Wait a minute", you might say, "what's a point of all the fuss if the number 0x41 stays the same everywhere?"

The answer is simple: the ASCII and UTF-8 encodings for all Unicode characters from U+0000 to U+007F are identical.  This makes sense for back compatibility.  But while ASCII only encodes 128 characters, UTF can encode all many thousands of Unicode characters.  To see the differences, you have go beyond U+007F.

For example, U+00A2, the cent sign '¢', which doesn't exist in ASCII, is encoded as 0xC2A2 in UTF-8.  Note that U+C2A2 is a valid Unicode character, but it has nothing to do with the 0xC2A2 UTF-8.  Don't get confused!  U+C2A2 is the character '슢' (a syllable of the Korean alphabet that, according to Google Translate, is called Syup...).  This is the first hint at why we might need to convert UTF-8 to Unicode although Unicode is not an encoding!

The problem arises when you want to work in Java with text that you have 'grabbed' from a web page: the web page is encoded in UTF-8, while Java strings (i.e., objects of type java.lang.String) consist of Unicode characters.  If you grab from the Web a piece of text, store it into a Java string, and display it, only the "ASCII-like" characters are displayed correctly.

For example, the Wikipedia page about North Africa contains "Mizrāḥîm", but if you display it without any conversion, you get "MizrƒÅ·∏•√Æm".

In the rest of this article, I will explain how you can correctly store into a Java string text grabbed from the Web.  There will perhaps/probably be better ways to do it, but my way works.  If you find a better algorithm and would like to share it, I would welcome it.

To help you understand my code, before I show it to you, I would like you to observe that when you match Unicode code points (that's how the U+hexbytes codes are called) and UTF-8 codes, there are discontinuities.  For example, U+007F is encoded in UTF-8 as UTF-8 0x007F, but U+0080 (the following character) corresponds in UTF-8 to 0xC280.  Another example of discontinuity: while U+00BF corresponds to 0xC2BF, U+00C0 corresponds to 0xC380.

One last thing: all bytes of UTF-8, with the exception of the first 128 (used for the good old ASCII codes), have the most significant bit set.  For example, the cent sign is encoded as 0xC2A2, which in binary is 110000102 and 101000102.
Here is how you can read a web page into a Java string:

    final int     BUF_SIZE = 5000;
    URL           url = new URL("http://en.wikipedia.org/wiki/North_Africa");
    URLConnection con = url.openConnection();
    InputStream   resp = con.getInputStream();
    byte[]        b = new byte[BUF_SIZE];
    int n = 0;
    s = "";
    do {
      n = resp.read(b);
      if (n > 0) s += new String(b, 0, n);
      }
    resp.close();

Pretty straightforward.  But if you do so, when you display the string, all multi-byte UTF-8 characters will show up as rubbish.  Here is how I fixed it:



  final int     BUF_SIZE = 5000;
  URL           url = new URL("http://en.wikipedia.org/wiki/North_Africa");
  URLConnection con = url.openConnection();
  InputStream   resp = con.getInputStream();
  byte[]        b = new byte[BUF_SIZE];
  int n = 0;
  s = "";
  do {
    n = resp.read(b);
    if (n > 0) s += new String(b, 0, n);
    }
  resp.close();

Pretty straightforward.  But if you do so, when you display the string, all multi-byte UTF-8 characters will show up as rubbish.  Here is how I fixed it:

  final int     BUF_SIZE = 5000;
  URL           url = new URL("http://en.wikipedia.org/wiki/North_Africa");
  URLConnection con = url.openConnection();
  InputStream   resp = con.getInputStream();
  byte[]        b = new byte[BUF_SIZE];
  final int[]   uniBases = {-1, 0, 0x80, 0x800, 0x10000};

  int n = 0;
  int[] utf = new int[4];
  int nUtf = 0;
  int kUtf = 0;
  int kar = 0;
  s = "";
  do {
    n = resp.read(b);
    if (n > 0) {
      i1 = -1;
      for (int i = 0; i < n; i++) {
        if (b[i] < 0) {
          kar = b[i];
          kar &= 0xFF;
          kUtf++;
          if (kUtf == 1) {
            if (kar >= 0xF0) {
              nUtf = 4;
              utf[0] = kar - 0xF0;
              }
            else if (kar >= 0xE0) {
              nUtf = 3;
              utf[0] = kar - 0xE0;
              }
            else {
              nUtf = 2;
              utf[0] = kar - 0xC2;
              }
            i1++;
            if (i > 0) s += new String(b, i1, i - i1);
            }
          else {
            utf[kUtf - 1] = kar - 0x80;
            if (kUtf == nUtf) {
              kar = uniBases[nUtf] + utf[nUtf - 1] + (utf[nUtf - 2] << 6);
              if (nUtf == 3) {
                if (utf[0] > 0) kar += ((64 - 0x20) << 6) + ((utf[0] - 1) << 12);
                }
              else if (nUtf == 4) {
                kar += utf[1] << 12;
                if (utf[0] > 0) kar += ((64 - 0x10) << 12) + ((utf[0] - 1) << 18);
                }
              s += (char)kar;

              // Prepare for the next UTF multi-byte code
              kUtf = 0;
              nUtf = 0;
              i1 = i;
              }
            }
          } // if (b[i] ..
        } // for (int i..

      // Save the remaining characters if any
      if (kUtf == 0) {
        i1++;
        if (i1 < n) s += new String(b, i1, n - i1);
        }
      } // if (n > 0..
    } while (n > 0);
  resp.close();

Clearly, I only need to process the incoming bytes that have the most significant bit set (i.e., those for which b[i] < 0).  First of all, I store the byte into an integer, so that I can work more comfortably with it.  When I encounter the first of these "non-ASCII" bytes (i.e., when kUtf == 1), I check its value to determine how many bytes the UTF-8 code requires (four, three, or two).  This tells me how many bytes I still have to collect before I can determine the corresponding Unicode character.

I accumulate the bytes into the utf integer array.  While I do so, I also do some pre-processing to remove the discontinuities.  When I have all the necessary bytes, I just shift them appropriately into the variable kar to form the Unicode character, which I then store into the Java string.