Tuesday, January 27, 2009

An interesting resource on martial law in the US.

Friday, January 23, 2009

The Wisdom of Jean Rostand:

Falsity cannot keep an idea from being beautiful; there are certain errors of such ingenuity that one could regret their not ranking among the achievements of the human mind.

In order to remain true to oneself one ought to renounce one's party three times a day.

In politics, yesterday's lie is attacked only to flatter today's.

Stupidity, outrage, vanity, cruelty, iniquity, bad faith, falsehood - we fail to see the whole array when it is facing in the same direction as we.

Science has made us gods even before we are worthy of being men.

It is sometimes important for science to know how to forget the things she is surest of.

There are certain moments when we might wish the future were built by men of the past.

Think? Why think! We have computers to do that for us.

Truth is always served by great minds, even if they fight it.

It takes a very deep-rooted opinion to survive unexpressed.

Never feel remorse for what you have thought about your wife; she has thought much worse things about you.

A few great minds are enough to endow humanity with monstrous power, but a few great hearts are not enough to make us worthy of using it.

The divine is perhaps that quality in man which permits him to endure the lack of God.

A man is not old as long as he is seeking something

Thursday, January 22, 2009

How to debug a C program.

1] If at all possible, don't. Let someone else do it.
2] Change majors. (Win.)
3] Insert/remove blank lines at random spots, re-compile, and excecute.
4] Throw holy water on the terminal.
5] Dial 911 and scream.
6] There is rumour that "printf" is useful, but this is probably
7] Port everything to CP/M.
8] If it still doesn't work, re-write it in assembler. This won't fix the
bug, but it will make sure no one else finds it and makes you look bad.

PASCAL is not a language. It was an experiment combining the flexibility of C with that of a drug-crazed penguin. It is also the 'language' of choice of many CS professors who aren't up to handling REAL programming. Hence, it is not a language.

C is almost a real language. (see assembler) Even the name sounds like it's gone through an optimizing compiler. Get rid of all of those stupid brackets and we'll talk. (see LISP)

ASSEMBLER is a language. Any language that can take a half-dozen keystrokes and compile it down to one byte of code is all right in my books. Though for the REAL programmer, assembler is a waste of time. Why use a compiler when you can code directly into memory through a front panel?

How to program in C
1] Use lots of global variables.
2] Give them cryptic names such as: X27, a_gcl, or Horace.
3] Put everything in one large .h file.
4] Implement the entire project at once.
5] Use macros and #defines to emulate Pascal.
6] Assume the compiler takes care of all the little details you didn't quite

If you put garbage in a computer nothing comes out but garbage. But this garbage, having passed through a very expensive machine, is somehow enobled and none dare criticize it.

Any sufficiently advanced bug is indistinguishable from a feature.

Wednesday, January 21, 2009

Dethroning Python? Brief Words On Haskell.

Python had long been my favorite programming language -- its power and ease of use made for short, elegant, and readable code. But then, a year or so ago, I started messing around with Haskell. And even though I've yet to use it for a practical purpose, I loved it. So subtle! So sophisticated! And it gets better with age. If programming languages were men, I may have met James Bond.

Tuesday, January 20, 2009

American Atheists, Agnostics, and Nonbelievers celebrate: Obama just made us citizens.

"We are no longer just a Christian nation; we are also a Jewish nation, a Muslim nation, a Buddhist nation, a Hindu nation, and a nation of nonbelievers."

This sentence from Obama's inaugural address is buzzing all over atheist blogs, twitters, and status messages. I got three text messages quoting it within 30 seconds after it was spoken. Already, "nonbelievers" feel justified -- this is, after all, the first time we've been recognized in an inaugural speech. In fact, it's one of the first times "nonbelievers" were mentioned in politics without being followed by, "...aren't citizens," or "...are ruining Christmas," etc. And we think this is progress.

However, Rick Warren's "prayer" (which felt more like an empty, obligatory political manifesto) was a tragedy to be laughed at. Half-hearted, insincere, and startlingly lame. He didnt even register in my brain as an adversary -- as most atheists would expect him to. He came of as pitiful, stupid, confused -- so distanced from reality it was almost sad. This article might be relevant.

It does seem, at least on paper, that Obama is also paying lip service to the Constitution. Have a look at the (shiny new!) whitehouse.gov's technology page. Is there still hope for civil liberties in America? Let's hope so. Good luck, President Obama!

Sunday, January 18, 2009

Saturday, January 17, 2009


Upon learning that it's a federal offense to boycott Israel, I immediately wondered what products would be boycotted. After a quick search, there seems to be a myth floating out there that says Israeli products can be recognized by a barcode that starts with 729. This doesn't seem to be true, according to this Bar Code FAQ:
Does the barcode number indicate the country of origin of a product?

No it doesn't. The 3-digit prefix code indicates which GS1 numbering organization has allocated the block of numbers to the company. Once the company has been assigned the block of numbers, they self assign each individual number in the block to a given product. For example, a company may have it's headquarters in South Africa. The GS1 organization in South Africa has the code "600", but all the products of the company may be manufactured in England. The English-made products would still have the "600" prefix code. The prefix code is a way to have 70-plus GS1 member organizations issuing numbers without having to worry about duplicate numbers. The 3-digit prefix indicates the country of the GS1 organization that issued the block of numbers, not the country of origin of the product. GS1 (the international organization that administers UPC and EAN) has a clear statement that the prefix DOES NOT indicate the country of origin of the product. A list of country codes can be found on the UPC & EAN Page.

If you're outside of the US, and/or don't mind breaking this federal law, you might wonder how one might spot a product exported from Israel.

The answer is to download a database that matches all UPC product codes (barcodes) on the market as of yet to their respective manufacturers. You can actually download such a database as it is free and distributed under the Creative Commons license (here). Then, simply do a search for "Israel" to find which companies market products which are made in Israel.

Good news: A user named Toshibu has already done the work for us!

  • Here is a comprehensive spreadsheet of all companies exporting products from Israel.
  • Here is a comprehensive chart of all Israeli products registered by UPC to date.

To recreate the above results, the following commands may be used:

$ wget >
$ tar zxf upcdatabase-2009.01.01.tar.gz
$ cd upcdatabase-2009.01.01
$ grep -i "israel\"" glns.csv | awk -F, '{ print $1 }' | cut -c 8- --complement | awk '{print "^"$0}' | grep -f - items.csv > items-israel.csv
$ cat items-israel.csv | awk -F, '{ printf( "%s %*s %s\n", $1, 36, $2, $3 ) }'

That said, maybe Israel doesn't deserve a boycott. After all, the point here isn't the mass slaughtering of innocent civilians in a brutal, racist manner -- oh, wait. After the Holocaust, didn't we all swear it, "Never Again"? Glad to see we haven't forgotten.

Maybe it's genuinely self-defense. Maybe Israel has no choice here. Maybe it's because the Palestinian rockets are so powerful compared to Israeli airstrikes? Oh, wait. Can you guess which is which?

Or maybe it's because Israel can do no wrong. Maybe they are teaching their children to learn from the past, preaching tolerance and love instead of violence and hate? "With love, from Israel." Yeah. I can see that. Good job, guys, you killed the terrorist.

The worst part is, when the UN made a plea for the violence to cease, nobody listened. Because we all expected them to listen, right? Right?

Thursday, January 15, 2009

Happy Birthday, Wikipedia!

It's funny because that's how it's pronounced... [citation needed]

Wednesday, January 14, 2009

Lasantha Wickrematunge, a Sri Lankan journalist for The Sunday Leader, wrote an editorial to be published in the event he were assassinated. He was assassinated. Here is the editorial: And Then They Came For Me.

Even if the middle paragraphs are obscure, the last few paragraphs are very worth reading.

Since access to this site has been sketchy, here is the text:


And Then They Came For Me

No other profession calls on its practitioners to lay down their lives for their art save the armed forces and, in Sri Lanka, journalism. In the course of the past few years, the independent media have increasingly come under attack. Electronic and print-media institutions have been burnt, bombed, sealed and coerced. Countless journalists have been harassed, threatened and killed. It has been my honour to belong to all those categories and now especially the last.

I have been in the business of journalism a good long time. Indeed, 2009 will be The Sunday Leader's 15th year. Many things have changed in Sri Lanka during that time, and it does not need me to tell you that the greater part of that change has been for the worse. We find ourselves in the midst of a civil war ruthlessly prosecuted by protagonists whose bloodlust knows no bounds. Terror, whether perpetrated by terrorists or the state, has become the order of the day. Indeed, murder has become the primary tool whereby the state seeks to control the organs of liberty. Today it is the journalists, tomorrow it will be the judges. For neither group have the risks ever been higher or the stakes lower.

Why then do we do it? I often wonder that. After all, I too am a husband, and the father of three wonderful children. I too have responsibilities and obligations that transcend my profession, be it the law or journalism. Is it worth the risk? Many people tell me it is not. Friends tell me to revert to the bar, and goodness knows it offers a better and safer livelihood. Others, including political leaders on both sides, have at various times sought to induce me to take to politics, going so far as to offer me ministries of my choice. Diplomats, recognising the risk journalists face in Sri Lanka, have offered me safe passage and the right of residence in their countries. Whatever else I may have been stuck for, I have not been stuck for choice.

But there is a calling that is yet above high office, fame, lucre and security. It is the call of conscience.

The Sunday Leader has been a controversial newspaper because we say it like we see it: whether it be a spade, a thief or a murderer, we call it by that name. We do not hide behind euphemism. The investigative articles we print are supported by documentary evidence thanks to the public-spiritedness of citizens who at great risk to themselves pass on this material to us. We have exposed scandal after scandal, and never once in these 15 years has anyone proved us wrong or successfully prosecuted us.

The free media serve as a mirror in which the public can see itself sans mascara and styling gel. From us you learn the state of your nation, and especially its management by the people you elected to give your children a better future. Sometimes the image you see in that mirror is not a pleasant one. But while you may grumble in the privacy of your armchair, the journalists who hold the mirror up to you do so publicly and at great risk to themselves. That is our calling, and we do not shirk it.

Every newspaper has its angle, and we do not hide the fact that we have ours. Our commitment is to see Sri Lanka as a transparent, secular, liberal democracy. Think about those words, for they each has profound meaning. Transparent because government must be openly accountable to the people and never abuse their trust. Secular because in a multi-ethnic and multi-cultural society such as ours, secularism offers the only common ground by which we might all be united. Liberal because we recognise that all human beings are created different, and we need to accept others for what they are and not what we would like them to be. And democratic... well, if you need me to explain why that is important, you'd best stop buying this paper.

The Sunday Leader has never sought safety by unquestioningly articulating the majority view. Let's face it, that is the way to sell newspapers. On the contrary, as our opinion pieces over the years amply demonstrate, we often voice ideas that many people find distasteful. For example, we have consistently espoused the view that while separatist terrorism must be eradicated, it is more important to address the root causes of terrorism, and urged government to view Sri Lanka's ethnic strife in the context of history and not through the telescope of terrorism. We have also agitated against state terrorism in the so-called war against terror, and made no secret of our horror that Sri Lanka is the only country in the world routinely to bomb its own citizens. For these views we have been labelled traitors, and if this be treachery, we wear that label proudly.

Many people suspect that The Sunday Leader has a political agenda: it does not. If we appear more critical of the government than of the opposition it is only because we believe that - pray excuse cricketing argot - there is no point in bowling to the fielding side. Remember that for the few years of our existence in which the UNP was in office, we proved to be the biggest thorn in its flesh, exposing excess and corruption wherever it occurred. Indeed, the steady stream of embarrassing expos‚s we published may well have served to precipitate the downfall of that government.

Neither should our distaste for the war be interpreted to mean that we support the Tigers. The LTTE are among the most ruthless and bloodthirsty organisations ever to have infested the planet. There is no gainsaying that it must be eradicated. But to do so by violating the rights of Tamil citizens, bombing and shooting them mercilessly, is not only wrong but shames the Sinhalese, whose claim to be custodians of the dhamma is forever called into question by this savagery, much of which is unknown to the public because of censorship.

What is more, a military occupation of the country's north and east will require the Tamil people of those regions to live eternally as second-class citizens, deprived of all self respect. Do not imagine that you can placate them by showering "development" and "reconstruction" on them in the post-war era. The wounds of war will scar them forever, and you will also have an even more bitter and hateful Diaspora to contend with. A problem amenable to a political solution will thus become a festering wound that will yield strife for all eternity. If I seem angry and frustrated, it is only because most of my countrymen - and all of the government - cannot see this writing so plainly on the wall.

It is well known that I was on two occasions brutally assaulted, while on another my house was sprayed with machine-gun fire. Despite the government's sanctimonious assurances, there was never a serious police inquiry into the perpetrators of these attacks, and the attackers were never apprehended. In all these cases, I have reason to believe the attacks were inspired by the government. When finally I am killed, it will be the government that kills me.

The irony in this is that, unknown to most of the public, Mahinda and I have been friends for more than a quarter century. Indeed, I suspect that I am one of the few people remaining who routinely addresses him by his first name and uses the familiar Sinhala address oya when talking to him. Although I do not attend the meetings he periodically holds for newspaper editors, hardly a month passes when we do not meet, privately or with a few close friends present, late at night at President's House. There we swap yarns, discuss politics and joke about the good old days. A few remarks to him would therefore be in order here.

Mahinda, when you finally fought your way to the SLFP presidential nomination in 2005, nowhere were you welcomed more warmly than in this column. Indeed, we broke with a decade of tradition by referring to you throughout by your first name. So well known were your commitments to human rights and liberal values that we ushered you in like a breath of fresh air. Then, through an act of folly, you got yourself involved in the Helping Hambantota scandal. It was after a lot of soul-searching that we broke the story, at the same time urging you to return the money. By the time you did so several weeks later, a great blow had been struck to your reputation. It is one you are still trying to live down.

You have told me yourself that you were not greedy for the presidency. You did not have to hanker after it: it fell into your lap. You have told me that your sons are your greatest joy, and that you love spending time with them, leaving your brothers to operate the machinery of state. Now, it is clear to all who will see that that machinery has operated so well that my sons and daughter do not themselves have a father.

In the wake of my death I know you will make all the usual sanctimonious noises and call upon the police to hold a swift and thorough inquiry. But like all the inquiries you have ordered in the past, nothing will come of this one, too. For truth be told, we both know who will be behind my death, but dare not call his name. Not just my life, but yours too, depends on it.

Sadly, for all the dreams you had for our country in your younger days, in just three years you have reduced it to rubble. In the name of patriotism you have trampled on human rights, nurtured unbridled corruption and squandered public money like no other President before you. Indeed, your conduct has been like a small child suddenly let loose in a toyshop. That analogy is perhaps inapt because no child could have caused so much blood to be spilled on this land as you have, or trampled on the rights of its citizens as you do. Although you are now so drunk with power that you cannot see it, you will come to regret your sons having so rich an inheritance of blood. It can only bring tragedy. As for me, it is with a clear conscience that I go to meet my Maker. I wish, when your time finally comes, you could do the same. I wish.

As for me, I have the satisfaction of knowing that I walked tall and bowed to no man. And I have not travelled this journey alone. Fellow journalists in other branches of the media walked with me: most of them are now dead, imprisoned without trial or exiled in far-off lands. Others walk in the shadow of death that your Presidency has cast on the freedoms for which you once fought so hard. You will never be allowed to forget that my death took place under your watch. As anguished as I know you will be, I also know that you will have no choice but to protect my killers: you will see to it that the guilty one is never convicted. You have no choice. I feel sorry for you, and Shiranthi will have a long time to spend on her knees when next she goes for Confession for it is not just her owns sins which she must confess, but those of her extended family that keeps you in office.

As for the readers of The Sunday Leader, what can I say but Thank You for supporting our mission. We have espoused unpopular causes, stood up for those too feeble to stand up for themselves, locked horns with the high and mighty so swollen with power that they have forgotten their roots, exposed corruption and the waste of your hard-earned tax rupees, and made sure that whatever the propaganda of the day, you were allowed to hear a contrary view. For this I - and my family - have now paid the price that I have long known I will one day have to pay. I am - and have always been - ready for that. I have done nothing to prevent this outcome: no security, no precautions. I want my murderer to know that I am not a coward like he is, hiding behind human shields while condemning thousands of innocents to death. What am I among so many? It has long been written that my life would be taken, and by whom. All that remains to be written is when.

That The Sunday Leader will continue fighting the good fight, too, is written. For I did not fight this fight alone. Many more of us have to be - and will be - killed before The Leader is laid to rest. I hope my assassination will be seen not as a defeat of freedom but an inspiration for those who survive to step up their efforts. Indeed, I hope that it will help galvanise forces that will usher in a new era of human liberty in our beloved motherland. I also hope it will open the eyes of your President to the fact that however many are slaughtered in the name of patriotism, the human spirit will endure and flourish. Not all the Rajapakses combined can kill that.

People often ask me why I take such risks and tell me it is a matter of time before I am bumped off. Of course I know that: it is inevitable. But if we do not speak out now, there will be no one left to speak for those who cannot, whether they be ethnic minorities, the disadvantaged or the persecuted. An example that has inspired me throughout my career in journalism has been that of the German theologian, Martin Niem”ller. In his youth he was an anti-Semite and an admirer of Hitler. As Nazism took hold in Germany, however, he saw Nazism for what it was: it was not just the Jews Hitler sought to extirpate, it was just about anyone with an alternate point of view. Niem”ller spoke out, and for his trouble was incarcerated in the Sachsenhausen and Dachau concentration camps from 1937 to 1945, and very nearly executed. While incarcerated, Niem”ller wrote a poem that, from the first time I read it in my teenage years, stuck hauntingly in my mind:

First they came for the Jews

and I did not speak out because I was not a Jew.

Then they came for the Communists

and I did not speak out because I was not a Communist.

Then they came for the trade unionists

and I did not speak out because I was not a trade unionist.

Then they came for me

and there was no one left to speak out for me.

If you remember nothing else, remember this: The Leader is there for you, be you Sinhalese, Tamil, Muslim, low-caste, homosexual, dissident or disabled. Its staff will fight on, unbowed and unafraid, with the courage to which you have become accustomed. Do not take that commitment for granted. Let there be no doubt that whatever sacrifices we journalists make, they are not made for our own glory or enrichment: they are made for you. Whether you deserve their sacrifice is another matter. As for me, God knows I tried.