I am a software developer and author of computer books. I also work on some problems in theoretical physics. For more information, please visit my personal Web site at http://www.vttoth.com/.

Apr 182017

I sometimes take pictures of our cats.

Very rarely, the pictures are actually interesting. (I am no photo artist.)

This morning, I snapped a picture of our cats Kifli and Rufus, as they found a place on top of some Amazon shipping boxes.

What I didn’t expect is the effect of light, filtered through the blinds, on their fur, especially Rufus’s.

 Posted by at 6:56 pm
Apr 082017

Remember what radio used to be like, especially shortwave?

Many stations had an interval signal. This signal, usually just a few musical notes, was played whenever the station would otherwise be silent (e.g., between the end of a program and the time signal at the top of the hour.) I remember many an interval signal fondly.

But one of them, I just cannot identify. Namely this one:

Bugs the devil out of me.

 Posted by at 7:59 pm
Apr 062017

My current phone is a Nexus 6P.

I picked this phone for one all-important reason: It is a “pure Android” phone, directly supported by Google. Which means that instead of being at the manufacturer’s mercy when it comes to updates, I receive monthly security updates from Google. In this day and age, this is a deciding factor for me.

I got the phone in September. Sometime in the winter, I noticed that a speck appeared in photographs taken by the phone’s main camera.

Its appearance suggests that it is a small dust particle stuck between the camera visor and the camera itself, or inside the camera optics perhaps. Others apparently encountered the same issue. Some were able to shake the phone until the speck vanished. I tried to do the same but to no avail. Obviously I do not want to damage or destroy the phone.

I was trying to decide whether or not to live with it. A friend of mine suggested that I should contact the manufacturer since the phone is under warranty. I decided to do just that. Here is the exchange of e-mails that followed:

From: Viktor T. Toth
Sent: Tuesday, April 4, 2017 10:24 PM
To: ‘SupportCanada@huawei.com’ <SupportCanada@huawei.com>
Subject: Nexus 6P warranty issue


I obtained a Nexus 6P from Rogers Canada in September 2016.

A few months ago, I noticed that its camera developed a speck (see attached, lower right corner; the picture is of a uniformly illuminated white sheet of paper). Researching online, I found out that it is not an uncommon problem, and may be due to a loose dust particle inside the camera. Some people had luck shaking the speck lose. I tried gently tapping/shaking the phone, to no avail.

I also learned that this issue may be covered under warranty.

Please enlighten me if this is the case and, if so, how the warranty process works.


Viktor Toth

Attachment: IMG_20170404_221736.jpg

From: Huawei Device Support [mailto:supportcanada@mail01.huawei.com]
Sent: Wednesday, April 5, 2017 2:41 PM
To: Viktor T. Toth
Subject: Nexus 6P black spot

Dear Mr. Toth, receive a warm greeting.

We widely appreciate the information you provided us, and gladly inform you that on the attachment you can find information concerning your inquiry.

We are at your service.

Best regards.

Attachment: Black spots on camara.pdf

From: Viktor T. Toth
Sent: Wednesday, April 5, 2017 3:17 PM
To: ‘Huawei Device Support’ <supportcanada@mail01.huawei.com>
Subject: RE: Nexus 6P black spot

Dear Huawei support,

I thank you for your response but I find it quite unacceptable. If you had looked at the image that I sent to you, you would have seen that the “impurity spot” is actually about 100 pixels in diameter and very prominently noticeable in every picture that I take (attached enlarged, cropped image should also appear below):

If this is an acceptable impurity to you, I pity your customers. (This a crop from an actual photo of a white sheet of paper taken by the phone; I did not enlarge or manipulate it in any way.)

I also wonder if you perhaps misunderstood my inquiry and thought that I was referring to the display of the phone, as opposed to its main camera.

I’ll probably learn to live with this speck or attempt a repair. Your response as well as what I read online about your Canadian warranty support gives me little confidence that I can seek help from you.

However, I thank you for reminding me that when it comes to my next phone purchase, I should take into account the manufacturer’s support policy as well as the quality and capabilities of the device when I make my decision. The Nexus 6P may be a premium quality device, but your support perhaps isn’t.


Viktor Toth

From: Huawei Device Support [mailto:supportcanada@mail01.huawei.com]
Sent: Wednesday, April 5, 2017 6:55 PM
To: Viktor T. Toth
Subject: Huawei Mail Support

Dear Mr. Toth.

We appreciate your preference, and deeply regret any inconvenience that you are experiencing with your Huawei device, however in order to correct this situation, in the attached file you will find a detailed answer to your question.

We are at your service.

Best regards.

From: Viktor T. Toth
Sent: Wednesday, April 5, 2017 8.02 PM
To: ‘Huawei Device Support’ <supportcanada@mail01.huawei.com>
Subject: RE: Huawei Mail Support

I have not received an attachment in your response to my second inquiry.


Viktor Toth

From: Huawei Device Support [mailto:supportcanada@mail01.huawei.com]
Sent: Thursday, April 6, 2017 12:43 PM
To: Viktor T. Toth
Subject: Huawei Mail Support

Dear Mr. Toth, receive a warm greeting.

We widely appreciate the information you provided us, and gladly inform you that on the attachment you can find information concerning your inquiry.

We are at your service.

Best regards.

Attachment: Service Center Information. Toth.pdf


Somehow, in light of this exchange, I do not feel particularly confident that it is a good idea to send in my phone for repair.

FYI, Huawei: The long-distance prefix in North America is 1, not 001.

 Posted by at 2:34 pm
Apr 052017

I don’t often post pictures of my friends, but this time, I have my friend Perry’s permission.

Perry was flying west the other day. While waiting at the airport, he encountered a familiar face. The familiar face belonged to Canada’s Minister of National Defence, Harjit Singh Sajjan.

The Honourable Minister was probably flying back to his Vancouver riding, which he represents in Parliament.

Whatever the reason, the remarkable thing is this: Mr. Sajjan was traveling the same way most other Canadian would travel. On a commercial airliner, flying coach.

Let me repeat that, this time in boldface: Canada’s Minister of National Defence, traveling cross-country on a commercial airliner, flying coach.

I am so glad Mr. Sajjan allowed Perry to take this selfie, and that Perry kindly permitted me to repost it. This was not a moment designed for publicity. As far as I know, Mr. Sajjan does not publicize the manner in which he travels. He just… does the right thing.

And the other remarkable thing is that he can do this. It speaks volumes about our country and our government.

 Posted by at 12:37 pm
Apr 032017

Donald Trump told us that if necessary, the US will act alone on North Korea.

In a discussion on this topic, a commentator on CNN remarked on the dangers of having to deal with a madman armed with nukes.

If I were in Kim Jong-un’s shoes, I’d worry about that, too.

 Posted by at 3:07 pm
Mar 312017

Here is an old friend from the neighborhood that we have known for 12 years already, but whom we haven’t seen since October:


But today, he was outside, enjoying the warmth of the early spring sun.

Hello, MJ. It is so good to see you again.

 Posted by at 12:46 am
Mar 212017

Retired counterintelligence officers rarely give interviews. It is even more unusual for them to do so without anonymity.

Yet this is exactly what Ferenc Katrein, a former Hungarian counterintelligence officer did, when he was interviewed by the independent Hungarian news portal index.hu.

The full interview is available in English.

Katrein tells us of a secret service offensive that is waged by Russia against the European Union. He speaks of a corrupt Hungarian leadership that offered an opportunity for many Russian citizens to enter and even settle in the country in return for a modest investment with little or no effective background checks. He speaks of the role of Russia in far right movements in Europe, and their campaigns of disinformation.

All in all, it is a rare glimpse into how a counterintelligence service works on the eastern fringes of the European Union, and the extraordinary challenges that Europe faces in light of an aggressive (and in many ways, unrestrained) Russian foreign policy agenda.

 Posted by at 11:54 pm
Mar 202017

I saw this image of North Korea’s leader, Kim Jong-un earlier today on CNN:

The joy on these faces seems genuine. To think that an officer so forgot himself in that moment of celebration, he actually jumped onto the shoulders of the country’s all-powerful leader!

What they were celebrating was the successful test firing of a new rocket engine.

But what this picture reveals, the genuine joy on these faces, suggests something much worse: namely that North Korea’s leaders may truly believe their own propaganda. They may truly believe that governing via a totalitarian regime is the right thing to do. That sinking money into a gigantic but, in many ways, very backward military is the right thing to do. That pissing off the United States is the right thing to do.

And thus, self-fulfilling prophecies are born. North Korea may think that it is defending itself from US aggression. But they do not seem to realize that it is precisely their stance and their weapons program that make them a subject of US threats and sanctions.

And they especially don’t seem to realize that with a genuinely unhinged leadership in the White House, further provocation may achieve the exact opposite of what they want: Instead of being able to preserve the regime, they might see it come to an hasty end as Washington decides to intervene after all, leading to a tremendous loss of life no matter the outcome.

 Posted by at 9:33 pm
Mar 172017

Recently, I answered a question on Quora on the possibility that we live in a computer simulation.

Apparently, this is a hot topic. The other day, there was an essay on it by Sabine Hossenfelder.

I agree with Sabine’s main conclusion, as well as her point that “the programmer did it” is no explanation at all: it is just a modern version of mythology.

I also share her frustration, for instance, when she reacts to the nonsense from Stephen Wolfram about a “whole civilization” “down at the Planck scale”.

Sabine makes a point that discretization of spacetime might conflict with special relativity. I wonder if the folks behind doubly special relativity might be inclined to offer a thought or two on this topic.

In any case, I have another reason why I believe we cannot possibly live in a computer simulation.

My argument hinges on an unproven conjecture: My assumption that scalable quantum computing is really not possible because of the threshold theorem. Most supporters of quantum computing believe, of course, that the threshold theorem is precisely what makes quantum computing possible: if an error-correcting quantum computer reaches a certain threshold, it can emulate an arbitrary precision quantum computer accurately.

But I think this is precisely why the threshold will never be reached. One of these days, someone will prove a beautiful theorem that no large-scale quantum computer will ever be able to operate above the threshold, hence scalable quantum computing is just not possible.

Now what does this have to do with us living in a simulation? Countless experiments show that we live in a fundamentally quantum world. Contrary to popular belief (and many misguided popularizations) it does not mean a discretization at the quantum level. What it does mean is that even otherwise discrete quantities (e.g., the two spin states of an electron) turn into continuum variables (the phase of the wavefunction).

This is precisely what makes a quantum computer powerful: like an analog computer, it can perform certain algorithms more effectively than a digital computer, because whereas a digital computer operates on the countable set of discrete digits, a quantum or analog computer operates with the uncountable infinite of states offered by continuum variables.

Of course a conventional analog computer is very inaccurate, so nobody seriously proposed that one could ever be used to factor 1000-digit numbers.

This quantum world in which we live, with its richer structure, can be simulated only inefficiently using a digital computer. If that weren’t the case, we could use a digital computer to simulate a quantum computer and get on with it. But this means that if the world is a simulation, it cannot be a simulation running on a digital computer. The computer that runs the world has to be a quantum computer.

But if quantum computers do not exist… well, then they cannot simulate the world, can they?

Two further points about this argument. First, it is purely mathematical: I am offering a mathematical line of reasoning that no quantum universe can be a simulated universe. It is not a limitation of technology, but a (presumed) mathematical truth.

Second, the counterargument has often been proposed that perhaps the simulation is set up so that we do not get to see the discrepancies caused by inefficient simulation. I.e., the programmer cheats and erases the glitches from our simulated minds. But I don’t see how that could work either. For this to work, the algorithms employed by the simulation must anticipate not only all the possible ways in which we could ascertain the true nature of the world, but also assess all consequences of altering our state of mind. I think it quickly becomes evident that this really cannot be done without, well, simulating the world correctly, which is what we were trying to avoid… so no, I do not think it is possible.

Of course if tomorrow, someone announces that they cracked the threshold theorem and full-scale, scalable quantum computing is now reality, my argument goes down the drain. But frankly, I do not expect that to happen.

 Posted by at 11:34 pm
Mar 152017

Chemistry is weird. Even in inorganic chemistry, there are some really strange compounds. There is, for instance, phosphotungstic acid: \({\rm H}_3{\rm P}{\rm W}_{12}{\rm O}_{40}\). Never heard of it until today.

And then there is this one (if it exists at all):

Somebody posted this on Google+. They wanted to know what its properties are. And now, so do I. There are a few tungsten compounds listed in online databases, but this is not one of them. Does it even exist? I don’t know. For some reason, I expect it to have properties not unlike those of tungsten carbide, but I could be completely off the mark.

 Posted by at 11:40 pm
Mar 072017

There is a piece of North American technology that was responsible, among other things, for the “most successful failure” in the history of America’s space program, the successful return of Apollo 13 after a major explosion on board.

A few weeks ago, when chatting with a family member from Hungary who happens to be a proud, freshly minted engineer, I learned, much to my astonishment, that this technology is still not commonly used (if available at all) in Europe.

And today, much to my delight, I found out why: Perhaps it’s because it is still manufactured domestically, in my case right here in Canada.

Here is what I am talking about:

Yes, the mundane duct tape. Proudly made in Canada, as the label on the inside informs me.

It is my understanding that duct tape was included in the emergency repair kit of every American spacecraft launched to date. On Apollo 13, it was with the help of duct tape that they were able to adopt CO2 filters, extending the time they were able to spend in the lunar vehicle, which was used as a lifeboat during the long trip around the Moon.

I am beginning to wonder if this technology should be placed on strategic export control lists. Who knows what duct tape can do in the wrong hands! Imagine Kim Jong Un with a roll of duct tape… or Vladimir Putin. Or Iran’s Revolutionary Guard. The world would be a lot less safe if every despot had free access to copious amounts of duct tape.

Oh well, enough ranting. I need to do something useful, like some vacuuming. Recently, the wand of my vacuum broke. Rather than ordering a costly replacement at a price higher than an old vacuum cleaner is worth, I fixed it and so far, the wand is working like new. As to what I fixed it with, you guessed it… it was duct tape. Works wonders.

 Posted by at 5:18 pm
Mar 062017

I just caught this on CNN. A statistic that shows that most Americans believe ISIS is the gravest threat to their country:

And this shows why populism wins votes. Because in actuality… first of all, there are only two countries on this list that represent an existential threat to the United States, Russia and China, and China only marginally so.

North Korea is a threat mainly because it is unpredictable, but even if they develop a nuclear tipped ICBM, the country remains a distant third on the list of real threats.

As to Iran and ISIS… they are no threat to the United States at all. ISIS has no capability other than inspiring some “lone wolf” attackers. Iran has no desire to engage in direct conflict with the US, nor do they have any serious capability to harm the United States; they may be “state sponsors of terrorism”, but their actual threat contribution is below the noise floor.

So I think in terms of the real threat they represent, the order should be more like Russia, China, North Korea, ISIS, Iran. That is, almost completely the other way around.

But when the commander-in-chief and his cabinet are blabbering about how they must protect America by shutting the doors on refugees, too many listen.

 Posted by at 7:54 pm
Feb 262017

In many ways, this is the most disturbing story I read in recent… days? Months? Maybe years?

The title is (relatively speaking, in this day and age) innocuous enough (if perhaps a little sensationalist): “Revealed: how US billionaire helped to back Brexit“. Yeah, sure. Billionaires are evil SOBs, we knew that already, and now a bit of investigative journalism dug up another reason why we should hate them. Big deal… you could be forgiven if you moved on to read something else, maybe the bit about Trump snubbing the White House Correspondence Dinner or Fox News using a phony “Swedish defense advisor” to curry favor with the President.

But if you choose to read this article, it reveals something else. It reveals how the Leave campaign in the Brexit vote received assistance provided by artificial intelligence software to build profiles of up to a million voters and create highly targeted campaigns on social media.

Back when the nightmare of the machines taking over was first discovered in the science fiction literature, it was usually envisioned as a clean break: First the humans are in charge, but then comes Judgment Day and the machines take over.

Reality is a lot messier, for both humans and machines. There is no clean break. The ever increasing power of the machines is harnessed by ever more reckless humans, manipulating humanity in unexpected ways. Machines manipulating elections or referenda at the bidding of sinister humans… in many ways, that is the worst of possible worlds.

It makes you feel helpless, for one: You realize that nothing you can do on social media, nothing you can say in your blog will amount to one iota, as the machines have an infinitely greater capacity to analyze data and assess outcomes.

And it also makes you fearful. AI (for now) has no compassion or conscience. It will lie or make up “fake news” without remorse. It will (for now) do its masters’ bidding, even if those masters are sociopaths.

So no, folks, don’t delude yourselves. Judgment Day may already be here. It’s just coming one little data point, one neural network, one deep learning algorithm at a time.

 Posted by at 9:03 am
Feb 112017

For the second time in a row, I am seeing a report on CTV about the protests against the Trudeau government’s decision to scrap electoral reform. Their coverage suggests that these are significant protests, representing widespread anger among Canadians.

They aren’t. Let me be generous: Although CTV’s cameraman did his darnedest best to make the crowd appear bigger than it really was, there were maybe a couple of dozen people, tops, behind this young gentleman leading the protest.

Mr. Rae told his followers, by the way, that “Mr. Trudeau does not get to decide what is and what isn’t an issue for Canadians.” Forgive me Mr. Rae, but you are wrong. Mr. Trudeau, the duly elected prime minister of Canada with a majority government, does get to decide what is and isn’t an issue for Canadians. In turn, we Canadians do get to decide whether or not we wish to keep Mr. Trudeau and his government after the next elections.

Meanwhile, I am actually happy that Mr. Trudeau listened not to loud-mouthed protesters but to the facts and was willing to spend some of his political capital to make the right decision. While first-past-the-post has its shortcomings, it is not inherently worse than other electoral systems, and it is absolutely better than any system that involves, e.g., party lists, legislators that do not represent a specific constituency. And messing with the electoral system could very well have established a precedent that, in the long run, might lead to American-style gerrymandering.

But I still don’t understand what CTV’s game is, pretending that these protests are more significant than they really are. I am, in fact, questioning the journalistic integrity behind the decision to give these minuscule protests disproportionate coverage.

 Posted by at 6:17 pm
Feb 022017

“After a second notices he ran it on db1 instead of db2″… This sentence (somewhat shortened, to make a fitting title) describes the beginning of a colossally effed up night at GitLab.com.

In response to a spike in system load, which resulted in lag on a replication server, the operator thought that maybe restarting the replication server with a clean slate is a good idea. So he decided to wipe the replication server’s data directory.

Unfortunately, he entered the command in the wrong window.

I feel his pain. I did make similar mistakes before, albeit on a much smaller scale, and the memories still hurt me, years later.

I have to commend GitLab for their exceptional openness about this incident, offering us all a valuable lesson. I note that others also responded positively, offering sympathy, assistance, and useful advice.

I read their post-mortem with great interest. In reaction, I already implemented something that I should have done years ago: changing the background color of some of the xterm windows that I regularly open to my Linux servers, to distinguish them visually. (“Create issue to change terminal PS1 format/colours to make it clear whether you’re using production or staging”).

Of course similar incidents and near misses also changed my habits over the years. I rarely delete anything these days without making a backup first. I always pause before hitting Enter on a command that is not (easily) reversible. I have multiple backups, and tested procedures for recovery.

Even so… as Forrest Gump says, shit happens. And every little bit helps, especially when we can learn from the valuable lessons of others without having to go through their pain.

 Posted by at 10:13 am
Jan 312017

Here are two contributions from personal experience to the ever growing list of Internet pictures that go with the “You had one job…” meme.

First, a nice loaf of our favorite nine-gain bread, from a neighborhood Portuguese bakery:

Yes, you are seeing it right: It’s sliced lengthwise. Needless to say, the hapless employee who offered this stunning demonstration of human intelligence did not remain on the job much longer. (Regardless of how it was sliced, the bread was yummy.)

Next, one of my favorite deserts, an Austrian delicacy, a Mozartkugel (Mozart ball):

What’s wrong with it, you ask? Well… the portrait of Mozart is not supposed to be on the bottom of the piece, you know; it usually goes on top!

I know, I know, there have been much bigger fails on the Interwebs. Still, I found these funny.

 Posted by at 9:05 pm
Jan 312017

A short while ago, I turned on a computer. Like several of my other computers, this one is also configured to display a weather widget on the desktop. Here is what it showed:

If only it were true! Alas, the reason for this overly optimistic weather report had to do with the fact that the computer in question has last been turned on more than four months ago, back in September. In reality, this is what our weather is like right now:

And even that is a significant improvement over the −21°C that greeted me early in the morning.

Yup, this is Canada.

 Posted by at 8:52 pm
Jan 302017

It appears that we are entering the era of flawed democracies.

Our country, Canada, remains firmly in the category of full democracy. But that is no longer true south of the border. In an annual survey by The Economist, the United States slid down the list (and this is based on data from 2016, before Trump’s inauguration). It is now one of the leading flawed democracies, with a democracy score virtually identical to that of Japan.

And even as the number of full and flawed democracies, put together, remains roughly the same (80 in 2008, 75 in 2016 if I counted correctly), the number of full democracies is rapidly shrinking. There were 28 full democracies on the list back in 2008; by 2016, this number shrank to 19, a more than 30% decrease in just eight years.

Meanwhile, the examples of India and Mongolia demonstrate that democracy is not just a privilege for the rich. These countries are decidedly third world economies with GDP per capita roughly one tenth that of Canada or the US, yet they manage to maintain democracies no more flawed than the regimes on the eastern fringes of the European Union, such as Hungary or Romania.

 Posted by at 10:20 am