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

Thursday, July 31, 2014

Enough is Enough!

For how long are our governments going to put up with Israel's annihilation of Gaza?

The Israeli Army has hit UN refugee camps, schools, and hospitals, but the governments of Australia, the USA, and who knows how many other countries don't make a pip.

For how long political alliances and lobbying-driven expediency are going to justify our leaders' acquiescence?

Gaza has been blockaded since 2007.  This is inhumane and it should stop.  But now the situation has deteriorated past beyond that.  More than 1300 Palestinians have been killed, against 60 Israeli.  Every death is a tragedy.  Every death deprives a family of a loved one.  But most of the 60 or so Israeli deaths are of soldiers who entered Gaza to bring destruction, while the majority of the Palestinian deads are civilians, including hundreds of children.  Those with bloodied hands are Benjamin Netanyahu and his government.

How can anybody call such a massacre of innocent lives an assertion of Israel's right of self-defence?  Hamas should stop firing rockets into Israel.  There is no doubt about that.  But even if Hamas's deadly game were a disingenuous attempt to stoke the conflict in order to score political and diplomatic sympathies, it couldn't possibly justify Israel's response.

Gaza is one of the most densely populated regions on Earth, and now Israel has declared a No-Go zone covering 30% of the whole territory.  Additionally, Israel has destroyed the only power plant in Gaza, causing a permanent black-out in 80% of the strip.  Without electricity, the fridges don't work, and most Palestinians are then forced to go out to buy food every day, further endangering their lives in the process.

Self-preservation justifies a lot, but I am sure that many Israelis will be as horrified as I am at what is happening in Gaza.

During the second half of 1978, I was in Israel twice, for a total period of about two months.  During my first trip there, I was for a month in Degania Aleph, the first Kibbutz established in Israel, were I met the young lady who was to become my wife.  I have very fond memories of my staying in Israel and the last thing you could say about me is that I am an anti-Semite.

The resentment that is growing inside me is therefore not centred on the Jewish people, but on the criminal policies of the Israeli government.  I am a pacifist and don't condone violence, especially when applied to the weak and the disadvantaged.

Obviously, I don't only condemn the actions of Netanyahu's government, but also Hamas strategy of confrontation and, most of all, the suicide bombings that have become an almost-daily occurrence in the Middle-East.

But although I don't excuse the recourse to terrorism, I do understand it.  Perhaps more people should try to go beyong their one-way mindset and attempt to perceive the world from the point of view of suicide bombers.  Those young Muslims feel like cornered animals, and lash out in desperation.  The opulence of the Western world is for everyone to see on the TV screens, as is its moral decadence and its Hedonism, accompanied by hypocritical statements of values and virtues that have long be supplanted by greed and selfishness.  Of course an increasing number of young Palestinian (and Syrian, Egyptian, Lebanese, Iraqi, ...) are attracted to those who speak of honour, purity, and a sacred mission to rid the world of the sinners.  How can they resist that message, as misdirected and instrumentalised as it is?

We who live in rich western democracies should do our best to educate these youg people, give them hope, treat them with respect and compassion, not simply try to switch them off.  And we should, first of all, start work at home by electing full human beings to govern us, rather than puppets of multinationals or robots only capable of uttering slogans.

I am sick and tired of listening to politicians who never answer a question, who only follow the party lines, who treat human beings as if they were inanimate objects, and who don't listen to anyone when they are in government only to oppose everything when they are in opposition.  How I would love to be able to look at our elected representatives and feel proud of my country!

But I am digressing...

Wednesday, July 30, 2014

The struggle of making an EPUB on the Mac

EPUB (Electronic PUBlication) is an e-book standard by the International Digital Publishing Forum (IDPF).  Most significantly, Apple and an increasing number of vendors have adopted it for their e-readers.

The latest version of the standard is 3.01, but be warned: it is not easy to understand.

In essence, an EPUB consists of web pages plus some files that tell the e-reader how the pages are organised:
  • The file named mimetype contains the string application/epub+zip.
  • The folder named META-INF contains the XML file container.inf with additional general info.
  • XHTML (i.e., HTML conforming to the XML standard) documents contain all the text, with links to images and media objects.
  • A file with extension opf (which stands for Open Packaging Format) defines how the various documents fit together.
  • An XHTML document defines how the user can navigates through the e-book.
Once you have all your files in place, you zip them together, change the extension from zip to epub, and read them as an e-book on your iPad.  The IDPF provides a validator that lets you check your document.  If you have done everything right, you are rewarded with the following message:

My test.epub was a trivial e-book, but it literally took me hours before I could work out how to put it together on the Mac.

To zip a folder on the Mac is easy: all you need to do is select the folder and then click on the "Compress" entry of the "File menu".  But if you do so, the folder itself will be zipped and you don't want that.  You want a single zip file with the content of the folder, without the folder itself.  In my case, I had a folder called test containing the file mimetype, the folder META-INF, and the folder EPUB with the rest (you can name most of the files as you like).

The Mac OS is Unix-based.  As such, it includes the almost universally present zip command.  But it took me a while to make my test.zip (then renamed test.epub) that would pass IDPF's validator.  After attaching to the test folder where all the e-book files were, I typed the following commands:

Giulios-Mac:test giulio$ zip test -X -0 mimetype

  adding: mimetype (stored 0%)
This first command created the file test.zip containing mimetype and nothing else.  The -X option ensures that no attributes are added to the file and -0 that the file remains uncompressed.  In this way, you satisfy the EPUB standard that mimetype be the first file in the package, naked, and uncompressed.  If you zip everything at the same time or without the options, the validator will fail.

Giulios-Mac:test giulio$ zip -r test * -u -n zip
  adding: EPUB/ (stored 0%)
  adding: EPUB/.DS_Store (deflated 95%)
  adding: EPUB/main.html (deflated 79%)
  adding: EPUB/nav.html (deflated 39%)
  adding: EPUB/package.opf (deflated 51%)
  adding: EPUB/util/ (stored 0%)
  adding: EPUB/util/ebook.css (deflated 71%)
  adding: META-INF/ (stored 0%)
  adding: META-INF/container.xml (deflated 34%)
This second command adds to test.zip the rest of the e-book (identified by the asterisk).  The -u option specifies that it is an update, and -n zip excludes from the compression the files with extension zip (necessary because test.zip is inside test/).

As you can see, my e-book only included one XHTML document (main.html) and a style sheet (ebook.css), with no images.  I have named my XHTML files with the extension HTML because I found it easier to work with and extensions don't matter.  Also notice that the folder EPUB/ contains a file named .DS_Store.  Mac OS freely sprinkles these files all over the place to store folder properties.  They are a hidden nuisance that causes problems whenever you access Mac folders outside the Mac universe.  But you can remove them with the following command:

Giulios-Mac:test giulio$ find . -name ".DS_Store" -depth -exec zip test -d {} \;
deleting: EPUB/.DS_Store
It searches the current folder and all subfolders for files named .DS_Store.  Whenever it finds one, it passes its location on to the zip command that removes it from test.zip.

Finally, the following command showed that all .DS_Store files had been removed:

Giulios-Mac:test giulio$ zipinfo test.zip
Archive:  test.zip   3176 bytes   9 files
-rwxr-xr-x  3.0 unx       20 b- stor 30-Jul-14 11:29 mimetype
drwxr-xr-x  3.0 unx        0 bx stor 30-Jul-14 16:47 EPUB/
-rwxr-xr-x  3.0 unx     1694 tx defN 30-Jul-14 15:03 EPUB/main.html
-rwxr-xr-x  3.0 unx      461 tx defN 30-Jul-14 15:05 EPUB/nav.html
-rwxr-xr-x  3.0 unx      836 tx defN 30-Jul-14 16:03 EPUB/package.opf
drwxr-xr-x  3.0 unx        0 bx stor 30-Jul-14 14:02 EPUB/util/
-rwxr-xr-x  3.0 unx     1996 tx defN 30-Jul-14 15:57 EPUB/util/ebook.css
drwxr-xr-x  3.0 unx        0 bx stor 30-Jul-14 11:29 META-INF/
-rwxr-xr-x  3.0 unx      259 tx defN 30-Jul-14 14:54 META-INF/container.xml
9 files, 5266 bytes uncompressed, 1822 bytes compressed:  65.4%

I tried to remove the bloody .DS_Store files before zipping, but without success.  I resorted to removing them from the zip file out of desperation, but it works just fine.

Monday, July 28, 2014

A World of Exibitionists and Voyeurs

On 2014-07-25, the Los Angeles Times reported "Google reportedly finalizes deal for live stream service Twitch".

In case you don't know, Twitch Interactive offers live streaming of people playing video games.

Google paid 1G$ (1 billion US dollars) to gain control of Twitch.  It sounds outragious to me, perhaps because I stopped playing wideogames when PacMan and Pong were the rage of the time.  But it makes sense: Twitch has 45 million unique viewers per month (up from 3.2M since the site was launched three years ago).  "Twitchers" spend daily an average of 106 minutes watching somebody else play video games, and 58% of them do it for more than 20h a week.  And when Google will merge Twitch into YouTube, you can reasonably expect that more live activities will be added.

OK.  I admit it: all the craze of the past decade to post selfies and videos has never excited me.  I don't have this urge to show myself to the world.  What motivates me to publish this blog is the hope (dare I say knowledge?) that, among all the chaff I write, there is something that people will find useful or at least entertaining.  Buried among the postings about how to fold toilet paper (Toilet paper woes) and those containing micro-fiction (e.g., Being a Toad), there are more serious articles.  My most-viewed top three (perhaps not surprising, about programming) have so far collected 11,484 page views (OO - UML Behavior Diagrams, OO - UML Structure Diagrams, and Fortran and Eclipse on the Mac).  Very far from the millions of hits of successful videos, but it still gives me a warm and fuzzy feeling to think that I helped thousands of people in a practical way.

Humans are social animals.  We have to give credit to people like Mark Zuckerberg to have recognised it and to have been able to capitalise on it.  It is, in a sense, the logical evolution of the tabloid magazines.  A major difference though is that now everybody can feel a bit like a celebrity, especially if [s]he agrees to bare body and soul to the world!

FaceBook, YouTube, Flicker, and the rest of the "social" web sites let everyone give in to exibitionism and, at the receiving end, voyeurism.  I don't understand how people can spend hours reading and writing gossip.  I only like YouTube because it lets me see old TV programs in B&W and performances of my favourite singers.

The success of Twitch is just one more confirmation of this exibitionism/voyeurism compact that drives the Internet (besides porn, of course).

Tuesday, July 22, 2014

Authors' Mistakes #30 - Nigel Cawthorne

I just finished reading The History of the Mafia, by Nigel Cawthorne.  I found it quite interesting, although after a while, the endless list of killings began to become monotonous.  There is no list of bibliographic references, which means that the book cannot be really considered a reliable source of historical information.  But it is a good starting point for learning about the Italian Mafia. Unfortunately, as it systematically happens when a non-Italian writes about Italy, it contains several mistakes.  Actually, there is also a bad mistake of English grammar...

The Mafia code of silence, "omertà", is spelled "omèrta".
The word "pentiti" means "repenting ones", not "penitent ones".
"Goodbye to the Mafia protection money" is written as "addiopizzo", while it should have been written as "addio pizzo", with two separate words.
"Organisation" is spelled the Ameriacn way ("organization"), although in the same page you can read "honour", which is a British/Australian spelling of what the American would spell "honor".  This is not a problem of Italian (and it is not the English grammar problem I mentioned above), but it is an annoying inconsistency.
"Fontana Nuova" means "New Fountain", not "New Source".
The plural of the Italian word "capo" (I.e., "chief") is written as "capos", while it should have been "capi". The same mistake is repeated on page 200.
Somebody belonging to the Neapolitan equivalent of the Sicilian Mafia is called "camorrista", not "camorristo".  It is the same with other words that end with "sta".  For example, "artista" is used in Italian for both male and a female artists (but the undefined article gives away the gender, as a male artist is "un artista", while a female artist is "un'artista").
Wrong spelling of a preposition: "di Vigilanza" (which means "of Vigilance") is spelled "de Vigilanza".
The Italian royal family was originally from the Alpine French region of "Savoy", which is "Savoia" in Italian, while "Sovoia" is not an Italian word.  Therefore, I cannot imagine that an Italian restaurant in Manhattan in 1908 was called "La Sovoia".
An error similar to #7: "another Brooklyn camorristi" is wrong because "camorristi" is plural.  It should have been "camorrista".
"Gaetono" should have been "Gaetano".
"Raimondo" is the name of a man.  It should have been "Raimonda".
The Italian for "corps" is "corpo", not "corpe".
"Borgata" is not the Italian word for "village" and it can mean "hamlet", not "slum". It can indicate a group of houses along or near a main road or, in Rome, a working-class suburb at the edge of the city.
Rebibbia is in Rome, not Palermo.
"Scarpa" does mean "shoe", but in Italian, not in Sicilian dialect.
"Corleonisi" should be "Corleonese".  The name of the Sicilian town is "Corleone", and the ending in "i" is plural.
The murdered General of the Carabinieri was "Dalla Chiesa", not "Chiesa".  The same mistake is repeated on page 150 and twice on page 180, but ion page 180 the name is also written twice correctly.
"Cessation" should be "Cassation".
Here is the mistake in English grammar: "After running his brother's campaign, John made Robert attorney general".  The subject of the main clause is John ("John made..."), but it was Robert who ran his brother's campaign.  Something like "After Robert ran his brother's campaign, John made him attorney general" would have been correct.
The sentence "Chi l'ha visto?" should have been translated as "Who ha seen him?", not "Who has seen it?".
There is no town named "Duisberg" in Germany.  Its name is "Duisburg".

When will authors who write about Italy and Italian ask a bilingual editor to check their texts?  I could do it (for a reasonable fee!)

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)
Jack Greene & Alessandro Massignani
Peter James
P.Warren & M.Streeter

Monday, July 21, 2014

Legalise them all

For years I have been of the opinion that we should legalise all drugs, light and heavy.  I don't use any drug and only drink a little, perhaps a beer a week. That wouldn't change if cannabis, narcotics, and what-have-you became available legally.  I just don't understand why the state should prevent people from smoking or injecting what they want.  They do it anyway.  If drugs were legally available, the cost, both in terms of suffering and in terms of dollars, would be significatly reduced.  And the thefts, spreding of diseases, and violence that surround the drug trade would disappear.

What the state should do is ensure that intoxicated people do not endanger other people's lives.  And they are failing on that, because drunks cause many fatal car accidents and street fights.  The issue is not whether somebody is drunk or high on dope.  The issue is whether that person can sit behind a steering wheel or punch somebody on the nose. In this sense, alcohol is far more dangerous than, say, heroine. And yet, nobody (fortunately) is speaking of outlawing alcohol.

Can you imagine how much money would be freed if we stopped preventing people from buying drugs or growing marihuana plants in the backyard?  By legalising drugs, we would undermine most of the trafficking and the associated criminality and would save the lives of those who now die for overdose because they inject badly cut drugs.  And the government could tax drugs as they do now with alcholic beverages.

Obviously, these considerations are not new, and I am sure that somebody will find counter-arguments for any argument I can bring, but we only need to look at history to know what we should do, because humans have not significantly changed since recorded history.  In fact, we only need to go back less than one hundred years.

I am reading the book The History of the Mafia by Nigel Cawthorne, and have just arrived to where he writes about Prohibition and Al Capone.  This is how that chapter begins:

         When the Volstead Act banning the manufacture and sale of alcoholic beverages was passed in 1919, organized crime in America went mainstream. [...] it is estimated that 75 per cent of the population of the United States became client of bootleggers. It was big business. There had been 16,000 saloons in New York before the Volstead Act. These were replaced by 32,000 'speakeasies' (illegal drinking establishments). Britain's alcohol export to Canada rose six-fold and it was said that more intoxicating liquor was sent to Jamaica and Barbados than the population could possibly drink in a hundred years. During five years of Prohibition, 40 million gallons of wine and beer were seized. In 1925 alone, 173,000 illegal stills were impounded. This did nothing to stem the supply. And with the price of alcohol first doubling and then climbing to ten times what it had been before Prohibition, there was plenty of profit for the bootleggers.

Can you imagine how much effort and money it took to discover and seize millions of gallons of beverages and to close hundreds of thousands of illegal stills?

And it didn't really work.  It only gave to organise crime a new market.

Perhaps not many know that Prohibition, besides in the USA, was tried in several countries (Russia, Finland, Iceland, Norway, to name the most significant). And it didn't work there either. It only helped organised crime.

You know what?  I am optimistic.  I believe that in a decade or two, at least in the western democracies, governments will realise that they have been mistaken in banning drugs.  Cannabis Sativa is a lovely leafy plant and I would love to grow it in my garden.