Thursday, April 28, 2011

Software Patents and anti-trust

Some of my readers will know all about Software Patents, others less so or not at all.


The basic idea however is quite simple: patents protect processes or things that work. It's a matter of US patent lore that the US Patent & Trademark Office (USPTO) has received many patent applications for a back scratcher. One such patent description is here.

Most programmers, want to protect commonly used software techniques from patents -- i.e. make software writing impossible for the small developer because of patent issues.

The foremost voice for the "little guy" in this is the Electronic Frontier Foundation, and in particular its Patent Busting effort.


In general, in the face of a patent claim by a firm, a strong defense is prior art, i.e. previous work (by millions of programmers) before the patent was granted. But there is the cost and delay of lawsuits. Outfits like Google factor this is in as a price of doing business.

Microsoft has a different approach: it enters into cross licensing deals with other companies holding major portfolios of patents. Microsoft has many patents, not a single one of which is considered by open-source advocates to be an original contribution to software. This by the way is what patents are about. A patent is filed publicly and made available for all to use -- the concept is that this contributes to the common technology available, but you are compensated for a limited period (17 years average) for this contribution.

However, there are now tens of thousands of software patents in force, although many of them are vulnerable to prior art claims, or even conflict with each other. In any case, no one, either legal counsel or a programmer can possibly be aware of all the possible claims.

For the small programmer this means we have to rely on the Electronic Frontier Foundation, and to a lesser extent on Google to dismantle this situation. Google's contribution is that it has chosen to use open-source software, despite possible patent claims, but it has deep pockets to defend it self, and where necessary pay license fees.

Microsoft's approach, which includes buying pools of patents, has other issues, which the US Department of Justice has noticed. In another article, I read that Novell has been sold to Attachmate, and Microsoft will license instead of buy the patents concerned. Interestingly enough, Novell has a very useful attitude to patents from the point of view of the open-source community, as described in the article.

Monday, April 25, 2011

Classical scores online

CBC Arts reports that a Canadian composer, a graduate student at Harvard, is now managing an online library of musical scores.

The thing is, there is hardly the first such collection. Here is another, although definitely not as well organized. There is also the Choral Public Domain Library (Choral Wiki).

The other problem is that just because music is 300 years old doesn't mean there are no problems publishing the work.

First of all, nearly all of the editions and printing in the past 100 years still have copyright. The only clear way out of that mess, and also to take advantage of modern technology, is to publish the music in a 'source' form, comparable to a Word file for a book. There are two major formats in use: Sibelius and Finale. There are numerous issues concerning this
  1. Neither of these formats is "open", and thus publishing in these formats doesn't qualify as making music available to the public at no charge
  2. To address the previous point, both Finale and Sibelius have limited versions that the unwashed public can use as "viewers" for Finale and Sibelius files. They not only allow printing of scores, but allow the computer to produce an approximation of the sound. The problem is that Finale (the company) now wants some money for Notepad (its viewer), so it's no longer free. Fortunately, volunteers are creating PDF's of the Finale and Sibelius files.
  3. A huge amount of effort is needed to get people to create Finale and/or Sibelius files for major works.
  4. Many classical scores, especially "urtext" editions and manuscripts contain errors, i.e. notations that are improper. In actual use, performers and teachers make interpretations to resolve these issues. Computer notation programs, which are, among other things, designed to perform the scores, are (not surprisingly) intolerant of errors. There is therefore, a temptation of an editor creating a Finale or Sibelius file of a work to gloss over parts of the score that the program doesn't like, thus making editorial decisions which are not the role of an anonymous transcriber to make.

Concerning the CBC story itself, we can read in the New York Times, at least if you can get past their pay wall, that Mr Guo had his site up way back in 2007, but took it down after threats from publishers. He then elicited the support of an army of volunteers to verify the copyright of 15000 or so works on the site. The site was brought back on-line in 2008.

Today's publishers point out (see the NYT article) that they no longer benefit from modern editorial markings, etc. They neglect to mention that the main benefits of Henle, a costly European publisher are the following:

  • REMOVAL of most of the critical comments of the past from the main body of the score, consigning them to appendices/prefaces
  • Using modern printing techniques on acid-free paper to make the page easier to see.
  • Modern binding so the books don't fall apart
  • Repute

Except for the last two items, this is nothing a modern laser printer can't manage -- given a PDF, Sibelius or Finale file of the work. So if you want to perform a Chopin Etude for an examination, you will have to an "official" edition, but if you want to explore the works of Buxtehude, online editions will be very useful, especially since Buxtehude is not readily available at any price in many cities.

Saturday, April 23, 2011

Peeking into bedrooms

Pierre Trudeau, internationally well-known former Prime Minister of Canada, is well known for the quote:
There is no place for the state in the bedrooms of the nation.
A follow-on quote is:
Obviously, the state's responsibility should be to legislate rules for a well-ordered society. It has no right or duty to creep into the bedrooms of the nation
However, in Malaysia, the attitudes seem to be different. First of all Anwar Ibrahim is being tried a second time for sodomy, in what is widely seen as a politically motivated prosecution.
The headline is clear Sex scandals obsess Malaysia: the country with a one-track mind, despite the clear images of Anwar with his wife and family.

World Series 1918 and OJ Simpson -- revised


If you're a baseball fan, or even if you're not, you probably know that there are two teams in baseball known as the Chicago White Sox and the Cincinnati Reds. In 1919, the Chicago White Sox played the World Series against the Cincinnati Reds, and lost 5 games to 3.

There were a number of things about this setup that are a bit odd to a modern onlooker. First of all, it was a 9 game tournament instead of the 7 game series used before and after.

The most famous thing about that series however, was the Black Sox incident -- the fixing of the game by gamblers. The players in those days were poorly paid, if they were paid at all, and under the thumb of the owners. One player on the Chicago team was pitcher Eddie Cicotte, who had a clause in his contract that would give him a $10,000 bonus if he won another game forr a total of 30). But the owner, Charles Comiskey had benched him for 2 games, despite Cicotte's undoubted skill, making him a good target for a bribe. But as Wikipedia reports, a combination of bribery and threats were used.

In the end, the players, including legendary player Shoeless Joe Jackson, escaped criminal penalty, but were banned from baseball for life (this happened in1920 after the criminal trial was over).

This is about the 1919 World Series.

Now the Chicago History Museum is showing a deposition by Cicotte on its website (see insert) that the 1918 World Series, which the Boston Red Sox won against the Chicago White Sox 4-2, was also tainted. See the Christian Science Monitor for details.

If you consult the Wikipedia page on the 1918 World Series, you find not only other suspicions about the 1918 Series, but suspicions about the 1917 series.

These days, of course, professional athletes, at least in baseball, are paid far more, even allowing for inflation. This is good, but not just to prevent fixing of games.

Cast your mind back, if you will, to the OJ Simpson trial, to the part where evidence was presented about Simpson making some low-impact exercise videos.

The evidence presented showed that Simpson, previously a star athlete, was unable to even do low-impact exercises designed for senior citizens and others who have never previously been athletic.

The impact of this evidence on his guilt or innocence in that particular trial is negligible since you don't need to be physically fit to have uncontrollable jealousy.

However, it was a rare display of how the rigours of being a professional athlete, particularly an American football player, can degrade your health -- and therefore make you need a lot of money -- you may not be able to earn money after you leave the sport.
Postscript: Simpson's armed robbery conviction in Vegas shows how even a football star may need money.

Friday, April 22, 2011

Breakfast in Hong Kong

My time in Hong Kong began almost 20 years ago, but there were no blogs then (although there were mailing lists).

So here is the entry I wanted to make then about eating breakfast there, compared to doing it here.

First all, here, in Canada, breakfast for me for the past 30 years has been cereal + milk. The cereal is Raisin Bran, either Kellogg's or Post.

First of all, if you go to Hong Kong, you discover that Canadian (or American) style breakfast cereal is not common, and an expensive type of breakfast.

Some points to consider
  • Supermarkets exist, but 7-11 stores are the usual place to buy food. 7-11 stores in Hong Kong are different from the ones in Vancouver in numerous ways: they sell liquor, everything from beer to Hennesey cognac.
  • As in 7-11 stores here, space is at a premium, and so they sell very small sizes
  • Perhaps 4 or 5 American cereals are readily available at 7-11's, all small, all at premium prices
  • The familiar waxed paper containers inside are not used -- aluminum is used instead (the tropical humid climate)
  • milk is expensive

When I say that milk is expensive, it's not exactly that expensive if you don't mind Kowloon Dairy, and the very small (about 1 imperial pint) glass bottles it comes in. In other words you need a bottle for every bowl of cereal. In addition if you don't live in Central, or another region frequented by ex-pats, the milk may close to the best-before date.

Finally, Kowloon Dairy's milk is not to the taste of the average Canadian or American. If you want that, you have two alternatives: Trappist Dairy, and imported UHT milk from New Zealand. The latter is undoutedly the best. It comes in room-temperature tetrapak from NZ and has a shelf life of 1 year -- but it's 2 or 3 times the price of Trappist milk, itself more expensive (and less readily available) than Kowloon Dairy.

All right, you quickly get the message -- if you want to have breakfast easily in Hong Kong, cereal + milk is not the norm. So what is?

Well, pastries of various kinds are widely available for sale by neighbourhood bakeries. These same types of pastries are available from places like Amy's Cake House here in Vancouver and other Chinese places. But Amy's has only a few locations -- in HK -- places like that are everywhere. So basically in HK it's very common to buy your breakfast -- not a restaurant -- but a bakery. In HK I lived in a seaside place known as Lido Garden, and it had a bank, Park N' Shop (now a 7-11), Bank, video store, and of course the bakery. This doesn't count a bunch of other businesses on the other (north) side of Castle Peak Road.

This of course is the habit of a single person.

Other people would prepare something in a wok.

OK -- where do you get something for a wok -- especially meat since frozen meat Canadian style is not that common? The short answer is a market -- not like a 7-11 at all -- but more like Granville Island Public Market -- to use Vancouver terms -- where you can buy individual oranges and strips of meat (beef, pork, chicken). Actually there is one type of frozen meat commonly sold there -- NZ frozen lamb in those vacuum packages. Anyway, I digress.

A family breakfast over there -- which I didn't have since I was single --- would typically consist of some kind of soup with leftovers from the previous day's evening meal -- many things common here like wieners, eggs, and things less common here like noodles.

However, all of the above impractical for the single person -- with one exception --- prepackaged noodles/soup. These are sold in many forms and with different qualities from almost worthless to rather nice.

Disassembling and reassambling a Jeep in 4 minutes

Here's a video link of Canadian Army engineers disassembling and re-assembling a jeep in 4 minutes. However, if you look at the site that has the video, then we discover that their interest is that the video has an irritating sound track. In other words, someone should have added some music? This link came to me via Jason Kottke's blog, one of the longest running blogs on the internet.

When a victory is a loss

The link here from the Frum Forum, an American right-wing blog, is about the "rebels" in Libya regaining (probably not permanently) "full control" of the city of Misurata.

I have not been following this very closely, but city has seen a lot of fighting over the past 2 months, and changed hands several times.

So, let's assume that the report is correct.

Before the fighting we had a regular city. Under Ghaddafi control certainly, but a city.

Now, the "rebels" have it. What has been the cost (so far)? How many dead? How many injured? How many buildings destroyed or damaged? Is this really a victory?

And what is known about the new guys in control? All we know for certain is that their own internal command structure is divided between two generals who can't stand each other. Ghaddafi says they are "Al Qaeda". If that is true, will this exercise make Al Qaeda more friendly to us? After all, when the Soviets were controlling Afghanistan, we were nomimally allied to Islamist forces, who then blamed the US (and the entire West) when they lost out after the Soviets withdrew.

Just some thoughts for the day, Good Friday, the one day in the Christian year when the mode is sombre, unlike Easter or Christmas when joyful hymns are sung.

Wednesday, April 20, 2011

Hong Kong Movie Awards


On Sunday, Hong Kong had their movie awards. A low-budget film called (in English) Gallants (see
poster to the right) won the top prize.

Chinese names for everyone


We're having a federal election, and election signs show, at a minimum, the candidate's name and party. Many candidates like to gain points with the Chinese community by showing a Chinese name, even if they're not Chinese. Consider Joe Peschisolido's campaign sign, shown on the right.

Joe's name is Italian, and in Italian peschi means fish. The Chinese characters shown are 稣立道 which (in Cantonese) sound like "su li do". It sounds like peschi has been ignored (there can only be 3 characters/syllables and Peschisolido has 5 syllables). However, looking at 稣 more closely, we see that it contains on the lower left the component character 鱼 which also means fish!

So this Chinese version of the Italian name is very clever indeed. The question is how many people actually know this, considering you have to know Italian and Chinese to find out.

Tuesday, April 19, 2011

Predictive encoding of Chinese characters

Readers of this blog will know that I spent some time in Hong Kong, specifically in 荃湾 (Tsuen Wan). Part, not all, of my job there was to help compress Chinese fonts, because they needed to be written to mask ROM, where every bit counts. These days, storage, even permanent storage that works when the power is off, is plentiful and dirt cheap but not then -- and not so long ago either!

Here's an idea I had. Suppose you have a Chinese character (or a western character for that matter), but emphasis on a large character set like GB2312 (GB stands for Guojia Biaozhun = 国家标准 = National Standard), China's original computer character set. It has around 7000 glyphs (characters) including 6763 Chinese characters plus assorted other characters, such as the Latin and Cyrillic alphabets, Japanese hiragana and katakana, and more.

Suppose you're a dot matrix printer and you are tasked with printing a glyph based on two pieces of data: a large table of probabilities of what a row of 8 dots will be based on dots that have already been printed. In particular, the zeroth (invisible) row, the row above the first row is all 0s (blank) and the actual first row is likely blank too. So let's set up the situation like this

xxxx yyyyyyyy
zzzz qqqqqqqq

Here, xxxx yyyyyyyy and zzzzzzzzz are parts of the character (glyph) that have already been printed. qqqqqqqq is the part to print next. If this part of the character is a horizontal stroke, then are two likely possibilities:
(a) yyyyyyyy and qqqqqqqq are the same
(b) qqqqqqqq is blank
In any case we imagine this.

We take all 7000 characters and we do a computation (on a big computer) of all possible values of

xxxx zzzz yyyyyyyy qqqqqqqq

For each case of xxxx zzzz yyyyyyyy we find the most likely value of qqqqqqqq and put this in a database. The database has 16 x 16 x 256 = 65536 entries.

In a printer from that era, a medium-resolution character set might use 32 dots in each direction, for 1024 bits in all, or 64 bytes of data. For each character, we print it in pieces. For each piece, we look up the values of xxxx zzzz yyyyyyyy If they match match the database entry, we write the single bit 0. Otherwise, we write the bit 1 and the actual values of qqqqqqqqq

So it's a game. We have already used up an extra 65536 bytes of data. For each 8 bits of character data, it takes either 9 bits (if the database doesn't match) or 1 bit (if we get a match from the database).

We can play the game a different way.

We can have 3 matches in our database for each row xxxx zzzz yyyyyyyy
00 01 10

So up to 3 values of qqqqqqqq are a match, but otherwise we have to write 11 + actual value.

So we have 3 chances to match the value, but we waste 2 bits every time we're wrong.

Techniques like this can be used quite successfully to compress simplified fonts, but less successfully for traditional fonts -- because there is less white space in these fonts. The Taiwanese character set has 11000 characters instead of 7000 for the Chinese set.

When I first told my boss about "predictive" encoding, he was suspicious about what happens if "predictions" are wrong. He's quite correct -- the process depends on characters being predictable -- on average -- from other information in the character. This is sometimes not possible -- even humans reading the character need to depend on feature recognition -- the complete stroke structure cannot be seen when the character is small.