comment 0

All It Takes to Win an Election: Scare 270,000 People in Pennsylvania

Disclaimer: this is a highly speculative, controversial-on-purpose post. Historic events and data is mostly fact. Predictions and forward-looking analysis are mine, based on gut feelings and what-if thinking, not based on fact.


This is just a friendly reminder that in September 1999, a few months before the presidential election that brought him to power, Putin staged “terrorist attacks” in multiple cities across Russia in which 298 people lost their lives. The Chechen rebels were blamed for the bombings. Putin, campaigning on a hardline approach to the war in Chechnya won the election in March 2000 and the rest is history.

Oh what are you saying that the leader of the second more powerful nuclear power in the world killed hundreds of his own people to tip the outcome of presidential elections get out of here!


Putin has since been at the helm for 16 years and counting but that’s not our problem, our problem is right here, right now:

I would argue that the outcome of the 2016 U.S. Presidential Election can be easily swayed with one strategically placed and timed “act of terrorism” on U.S. soil or against an American target. See, it’s not that one candidate or the other is the “better anti-terrorism candidate”. All you need is for a not-too-large (see below) group of voters to be temporarily affected by a dramatic news event and vote for the candidate whose rhetoric is more plainly and one-sidedly “against terror”.

Oh but you’re being funny this is America not Russia that stuff doesn’t happen here what are you talking about we have rule of law and folks who prevent that kind of thing!

Really? Like nobody would hack a major party’s emails to influence public opinion in favor of an outspoken Putin sympathizer? No way! Don’t forget, this is the kind of stuff presidents used to quit their jobs over.

Listen there buddy, hacking emails is one thing, blowing up people is another.

Don’t forget, the potential for real terror acts is out there constantly. The reason there’s not a bombing taking place on U.S. soil every day is because the terrorists, as a whole, are much less competent and worse funded than the government agencies combating them. And that’s a good thing. But what if a serious, professional organization, skilled in international sabotage, decides to intervene on behalf of the terrorist and just help them a little tiny bit? That’s a different story. You do remember Putin is a Lt. Colonel in the KGB.

But that’s cool, when tens of millions of people vote, reason will surely prevail over any temporary outbursts of anger.

Not so fast. The predicted gap between Trump and Clinton has been steadily shrinking over the last two weeks. As of today (9/19, source:, Clinton is predicted to win 287 electoral votes, just a 37 vote lead over Trump:



A lot? Not really. In fact, if all else remains the same, all it takes is swinging just one state like Pennsylvania, wielding 20 electors, to tip the scale in Trump’s favor.

Pennsylvania has been polling strongly in Clinton’s favor:



But think about this: Pennsylvania has 8.3M registered voters. Assuming a very high 65% turnout rate (this is, after all, a highly engaging and controversial campaign), we can expect about 5.4M votes to be cast. Looking at the poll data above, a 5% swing can change the outcome of the vote in Pennsylvania. That’s just 270,000 people.

What if there’s a terrorist bombing with multiple casualties in downtown Philadelphia two weeks before election date? Can you imagine 270,000 people in Pennsylvania voting in anger, despair and fear? I can.

comment 0

Twitter Polls Should be a 3-rd Party App

Twitter is rolling out their polls feature.
How many normal Twitter users care about polls? That’s obviously not going to be a big deal in terms of solving “Twitter’s problems” of not growing fast enough and not generating a ton of revenue.

Twitter Polls is an ideal example of something that should just be a third party app. In a world where you can build apps on top of Twitter that seamlessly integrate into the Twitter UI and/or can live outside of it – this is an interesting product for a small team to build on top of Twitter. Everybody wins.
At the same time, their CEO is apologizing to developers.

I worked on a project built entirely on top of Twitter. It’s going to take a lot of time and effort to heal the Twitter-developer relationship but it’s worth it. I would not build a software business on top of Twitter right now, because if it’s any good there’s a good chance Twitter will just build the same thing themselves.

I think the only way for Twitter to succeed is to make it into the de-facto communication layer that allows both machine-machine, machine-human and human-human communication and regain developers trust enough for them to build real businesses on top of this layer.

And they should charge developers for it.

I think there’s “common knowledge” saying that you can’t justify a company the size of Twitter (~ 20B market cap) buy selling APIs. You must also sell higher order services, to larger markets (consumers, not developers). Maybe Twitter can be the one to break this mold.

comment 0

Oculus VR, the Age of Makers and Growing a Business that’s Already Huge

Beyond the usual hoopla over the Facebook acquisition of Oculus VR hides a truly spectacular feat of individual Making (capital M) and a huge milestone in the history of (crowd)funding and selling a business. In my mind, it even eclipses the acquisition of WhatsApp just a month ago, as well as the acquisition of Instagram (all by the same acquirer, more on that in a bit).

Palmer Luckey, the founder and inventor of the Rift, began working on the product sometime around 2009 as a student at USC. He posted about his little project on August 21st, 2009:

I am making great progress on my HMD kit! All of the hardest stuff (Optics, display panels, and interface hardware) is done, right now I am working on how it actually fits together, and figuring out the best way to make a head mount. It is going to be be out of laser cut sheets of plastic that slide together and fasten with nuts and bolts. The display module is going to be detachable from the optics module, so you will be able to modify, replace, or upgrade your lenses in the future!

This is 3.5 years before selling the company for 2 billion dollars: one guy, hacking together a product. Inspiring.

After creating a prototype, Oculus Rift was launched as a Kickstarter campaign in August 2012, with a modest goal of $100,000:

We’re here raising money on Kickstarter to build development kits of the Rift, so we can get them into the hands of developers faster. Kickstarter has proven to be an amazing platform for accelerating big and small ideas alike. We hope you share our excitement about virtual reality, the Rift, and the future of gaming.

It became one of the most successful projects on Kickstarter, raising $2.4 million.
Let’s repeat that for a second: 18 months before being sold for $2 billion, the product received its first funding of $2.4 million on a crowdsourcing platform.

And a final thought goes to the company that acquired all three companies (Oculus VR, WhatsApp and Instagram) mentioned. Mark Zuckerberg and his team deserve more credit than they’re getting. It seems that the common analysis is that crazy money is being thrown all around by companies who fear competition and fear missing out on the next big thing.

But there’s more business savvy going on: most of the value exchanging hands in the acquisitions of WhatsApp and Oculus VR (16B and 1.6B respectively) is in Facebook stock. Facebook is using the fact it’s a publicly traded company and its currently very highly priced stock in just the right way: to generate new business way into the future.

Traditionally, a company would sell stock to the public to get cash required for its operation. Facebook is using stock, a piece of paper that only has its current value based on the expectation of future profits, to acquire the very future profits in question. No cash needed.

Assuming no major economical disasters, Facebook stock is expected to remain strong. This means more “insanely” priced acquisitions of nascent and/or massively growing businesses in the near future. Exciting times.

comment 0

Apple Will Lose

As more and more sad details surface about Apple’s legal crusade, I keep thinking why I’m using the iPhone and don’t just switch to an Android.

Yeah, it’s not as good still, and I always told myself I’ll get an Android phone eventually, when they’re good enough.

But then it hit me:

It doesn’t matter. Apple is not going to lose only because eventually its customers will switch to the competitors’ products. Apple is going to lose because eventually its own employees, the people that make it the greatest company in the world, will leave.

Apple is the personal creation of a great man. Perhaps the greatest man of our time. But as such, Apple also has in it the seed of its own destruction. In it’s insatiable desire to being the greatest there’s also the insatiable desire to be worshiped and acknowledged as the greatest.

It’s not enough to win, to sell the most phones, tablets and laptops. It’s not enough to be the most valuable company in the world. Apple also wanted its competitors to bow before it, admit that Apple invented and created everything that’s good in the world, and commit a elaborate suicide ritual at Apple’s feet.

And when I say “Apple”, I mean “Steve”.

comment 0

Measuring The Alcohol Content of Beer

All booze has an “Alcohol by Volume” measure specified. It’s denoted as a percentage which is supposed to tell you “how much alcohol” there’s in the specific drink, or, alternatively “how fucked up are you going to be and how fast”. Beer is typically between 4%-10%, wine 12%-14%, vodka and whiskey 40% and so on.

But how do they measure this quantity? How do they know exactly how much alcohol is there in a bottle of beer?

General process

The alcohol in beer is created by fermentation. Yeast is eating up the grains in the beer, making alcohol (ethanol) in the process.

The density of ethanol is known, so in order to tell the amount of ethanol in the beer, we measure the overall density of the beer before and after the fermentation, and then deduce the amount of ethanol in the beer.


“Density” is a measure of how “heavy” something is for a given volume. Imagine two identical boxes, one with nails and one with flowers. The box with nails will probably be heavier, so intuitively we can say that nails are more “dense” than flowers.

We use “Specific Gravity” to denote the density of beer. Specific Gravity is a unit of how dense something is relatively to some kind of “standard” density. For liquids, the standard is usually water. So water has a specific gravity of “1”. Something that’s twice as dense as water has the specific gravity “2” and so on.

Measuring the density of beer

A tool called Hydrometer is used to measure the density of a liquid. It’s basically a tube with a weight at the bottom. You fill the tube up to a certain point with the liquid you’re interested in measuring and the hydrometer shows the density by measuring the weight of the liquid.

The calculation

Now, since we know the density of ethanol and we have the two measures of density for the beer – before and after fermentation, we can use a simple formula to tell the Alcohol by Volume:

( ( 1.05 x ( OG – FG ) ) / FG ) / 0.79 x 100

Where “OG” is “Original Gravity” – the density before fermentation, and “FG” is “Final Gravity”, the density after fermentation.

comment 0

Apache with PHP on a Windows Machine

The program can’t start because LIBPQ.dll is missing from your computer. Try reinstalling the program to fix this problem.

If you’re getting the above error when starting Apache after installing Apache and PHP on your Windows machine, go to your PHP install directory (e.g. c:Program Files (x86)PHP) and copy the file libpq.dll into the bin directory under the Apache install directory (e.g. C:Program Files (x86)Apache Software FoundationApache2.2bin).

comment 0

The Finnish Education System

A thought provoking article in the Atlantic about the education superpower Finland:

The small Nordic country of Finland used to be known — if it was known for anything at all — as the home of Nokia, the mobile phone giant. But lately Finland has been attracting attention on global surveys of quality of life — Newsweek ranked it number one last year — and Finland’s national education system has been receiving particular praise, because in recent years Finnish students have been turning in some of the highest test scores in the world.

The thesis is the egalitarian approach is the main reason for the success:

In fact, since academic excellence wasn’t a particular priority on the Finnish to-do list, when Finland’s students scored so high on the first PISA survey in 2001, many Finns thought the results must be a mistake. But subsequent PISA tests confirmed that Finland — unlike, say, very similar countries such as Norway — was producing academic excellence through its particular policy focus on equity.

Not sure if applicable to some other countries, but definitely mind blowing.

comment 0

Using Better Naming to Clarify Code

I’m a big fan of good naming in code, here’s a recent example:

Suppose you have a unique index in a database table and you’re trusting that index to enforce no more than one record with the key.

So you’re using an insert ignore into…on duplicate key update statement.

So you end up calling something like DataAccess.InsertRecord(data) or DataAccess.AddRecord(data). Looking at such code it’s very unclear that what really happens is an insert/update and you’re only left with one record.

You can go the way of making your code explicit my moving the logic into your app and doing something like

var record=DataAccess.GetRecord(key);
if(record == null)

But then you’ll be losing the power of using the database do that for you.

So what I’m suggesting is just making your naming better, for example: DataAccess.ReplaceRecord(data).

comment 0

Make the Ugly Scrollbars on your Facebook App Disappear

If you have annoying scrollbars around your Facebook app’s canvas, here’s what you need to do:

First, go to your app’s settings, click “Edit App” and then “Advanced” on the right.

Scroll all the way down to “Canvas Settings” and change “Canvas Height” to “Settable”.

Second, add a call to FB.Canvas.setSize() ( Make this call inside window.fbAsyncInit, after calling FB.init.

That’s it! Gorgeous app, no scrollbars!

comment 0

Adaptive Payments Error This transaction has already been approved

If you’re using the PayPal Adaptive Payments API in sandbox mode, redirecting the user to and getting the following error:

This transaction has already been approved

The problem may be that you’re using an incorrect sandbox user as the “sender” in the transaction.

You need to go to the sandbox ( and then to “test accounts” on the left.

You need to create a test account. Click “preconfigured” next to “new test account” and then make sure you select “buyer” under “account type”.

Now use the email of this account that you’ve just created as the “senderEmail” in the call to the “Pay” API operation.