Archive for the 'Random Randomness' Category

Financial Bubbles

People are used to financial data being represented as plots of value against time. Other visualizations might provide a different understanding of what is going on. This is a soap bubble animation of the main composite indices of six major countries, based on weekly values between 2000 and 2010 that I stole from Yahoo! Finance:

  • Dow Jones
  • CAC 40
  • Footsie 100
  • DAX
  • NIKKEI 225
  • SSE

The radius of the bubble represents the value of the index: the scales have been arbitrarily chosen so that all the bubbles have the same size in January 2000.

Browser requirements: IE9, FF3.5, Chrome 5, Safari 5

Viewing the data as an animation instead of a plot really helps underline the meanings of «sudden» and «simultaneous» that would otherwise be lost with a static representation, especially around August 2002 and August 2008. The huge, screen-blotting Chinese bubble is quite impressive, too. In the end, most bubbles are as large as they were in the beginning, if not smaller.

For historical reference, these are the plots for the six indices:

indices

What are your opinions on this animation? Does it work on your browser? Are there any similar data visualizations you would like to see here? Is there a point in explaining the bloody technical details behind rendering this baby?

Noticed the [type Function] bug in the bottom left corner of the Yahoo Finance image? ;)

Hire or No Hire?

To help you decide whether a candidate is worth adding to your payroll, I’ve created this simple and practical flowchart:

Click to enlarge

Click to enlarge

If you liked this image, please consider sharing it with your friends (you can use the Facebook Like or Twitter buttons below, if you’re lazy).

Disclaimer: should you use this flow chart in a real-life situation, you will not hold me responsible for your obvious lack of common sense.

The Evil Overlord Name Generator

At this very minute, I’m bored. My train just left Lyon and the trip back to Paris will take two hours of internet-less boredom, lookalike green pastures and indistinguishable rural landscapes. So, I have nothing better to do that design a name generator for your arch-enemies, evil overlords and dark providers of antagonism.

Feel free to use this for your own fantasies, share it with your friends or anonymous internet readers, or suggest your own names, adjectives and name formats.

The Four Stages of Communities

Alison Bechdel is the author of the Dykes to Watch out For webcomic. One of the characters has three simple and apparently obvious rules to decide whether she wants to see a movie. These are known as the Bechdel Test, and look for movies that:

  1. have two female characters
  2. who talk to each other
  3. about something other than a man

They may sound obvious, but popular movies fail the test on a regular basis.

The same applies to communities led by a figurehead, such as blogs or fan pages.

Stage Zero happens when there are no participants. It’s a sad place.

Stage One happens when there are some participants who leave comments and interact with the figurehead, but mostly ignore each other.

Stage Two happens when the participants start interacting.

Stage Three happens when the participants, still interacting with each other, start going off-topic and discuss things beyond the original purpose of the community.

Most communities get to Stage One. Yet, even as they get hundreds of participants, getting them to interact together is harder. Hundreds of people go write “Great Post! I completely agree with you!” in the comments section of every article on 10k-subscriber blogs because this gets them some free back links. It takes a lot of spine and insight to actually write something original, contradict the author on his own blog or *shudder* go post on a brand new blog with only a few subscribers.

This blog is still in Stage One. I think Stage Two is a nice place to be, and my regular posters seem to be clever and decisive enough to go beyond the “Great Post! I completely agree with you!” wall. Stage Three would be even better ;)

The Evil Overlord Solution (2)

Not so long ago, the Evil Overlord Returned. Your job as a minion of evil was to help the Evil Overlord and the equally evil Empress Bing from Alpha Centauri pick a winner at random. The winner would then use a secret weapon to enslave mankind, because that’s what these kinds of people do.

Neither trusts you, so you had to find a provable way of offering each a 50% probability of winning. And the three of you can only communicate using one-on-one encrypted communication channels.

There were two interesting answers by Guillaume and Iftah, both of which should work (although Guillaume’s solution relies on instant communication, which is not necessarily available.

This is actually a common problem in cryptography. Let’s start with a traditional coin-flipping problem: one participant picks heads or tails, then someone else flips a coin. The participant wins if he chose correctly. The problem is that no one trusts anyone, so the “someone else” could easily be accused of cheating by the first participant (choosing an unfair coin, or even announcing heads or tails without flipping a coin).

In real life, one person flips the coin and hides the result, then the other person picks heads or tails, and the coin is revealed. The first person cannot manipulate the result even by using an unfair coin, and the other person does not know the result when they choose. This relies on the second person being able to verify that the coin was not tampered with while they were choosing. If one participant is on Earth and the other is on Alpha Centauri, this is impossible.

This is where hash functions come in. A hash function transforms a piece of text into a fixed-length text called a hash. For instance, the MD5 hash function turns HEADS into 7eb87d1ebe8f12eb105d00464a1eb496. The entire point of a hash function is that you cannot reverse it: if I gave you a hash, you couldn’t be able to find the original text.

So, the Evil Overlord would pick heads or tails with any method he wished (including, for instance, a fair coin toss) and write a long piece of text that indicates the chosen value, and compute its hash. For instance:

b5d3945edb299c8f54634b8c87c47a47

Then, he sends that hash to Empress Bing. She has no way of determining what piece of text this represents (because a hash function cannot be reversed). So she picks and announces either heads or tails. Suppose, for instance that she chooses “tails”.

The Evil Overlord then reveals the value he chose:

I chose tails. My clever choice will let me rule the world!

This lets Empress Bing win. The Evil Overlord cannot win, because that would involve finding a sentence containing “tails” that also results in the same hash, which is the same as reversing the hash and is therefore impossible. Of course, he could try tricking the Empress by providing a different sentence:

I chose heads. Really, I swear!

But that sentence would have a different hash, and the Empress would be able to find out very quickly by computing the hash herself:

bee5be82d96f76bffc07786c70cacb06

This means that his original choice cannot be tampered with in response to Empress Bing’s choice, without her knowing.

If any of the participants use a fair coin toss, then there’s a 50% probability of winning.

This reminds me… back in Computer Science school, I had to submit a paper by e-mail before midnight, but the paper was too big. So, I uploaded the file to my web server and send the teacher a link to it. However, this would have let me alter the file (since it was on my web server, I could spend the rest of the night working on it, and upload it a second time right before the teacher woke up and downloaded it). So, in order to prove that the online version was indeed uploaded before midnight, I sent the MD5 hash of the file to the teacher in the e-mail.

This only works for Computer Science assignments, obviously.

The Evil Overlord Returns

It’s time for another contest. There are no prizes this time, and the general concept is a bit different. If you wish to participate, please write a comment with your answer—they will not be posted until the contest ends on August 5, 2010. Comments containing questions will be published as soon as I can, along with an appropriate answer.

The Problem

Having failed to find the correct warehouse in the previous installment, the Evil Overlord is back with a new plan : he found out that a lamp post on a street corner in Arkansas is somehow imbued with mystical powers that could be harnessed to enslave mankind. Cue maniacal laughter.

However, Empress Bing, from Alpha Centauri, knows about the lamp post too. And she wishes to use it for her own mad schemes. The two masterminds cannot fight each other over the lamp post, because it would attract attention. And neither is willing to let go.

So they decide to randomly pick which one of them gets the lamp post.

You have been selected by the two masterminds to help pick one of them at random. They do not trust you, so you will have to actually prove that the process used to do the picking guarantees that each of them had a 50% chance to be picked. Neither is willing to reveal their location, so you can only communicate through an encrypted text channel — you can’t send them fair coins, dice or quantum states.

The Question

Propose a random selection process and prove why it’s fair. Remember that the two masterminds do not trust anything you say unless it’s purely deductive or they can verify it themselves.

 

What was that SPAM thing, again?

I found out this small new blog called Email Marketing City. No comments or trackbacks yet. No “subscriber count” gadget, probably because there are no subscribers yet. I feel like I’m Christopher Colombus discovering new virgin lands for his queen.

Anyway, since I’m a big hater of Email Marketing (especially when I’m on the receiving side), I went straight to “What exactly is Email Marketing” and found the following:

Of course, there are some disadvantages associated with email marketing.

  • SPAM – If your company constantly sends emails over and over again, some people might consider it spam and either personally boycott your company or file a civil complaint.  Obviously, this is not good for any company.

[Victor bangs his head on his desk. Repeatedly. Screaming bloody murder all the time.]

2mza8b8

SPAM has nothing to do with sending email repeatedly. Sure, if you send more mails, it only makes the situation worse. But should you smuggle even a single e-mail into my inbox without my consent, then it’s SPAM, and will be treated as such—with a flamethrower (ah, 2001 goodness).

Now, don’t get the wrong idea : Email Marketing City is quite well-written and provides useful information, especially if you need to do email marketing. In fact, even if you never intend to do email marketing, you should still go over there and read some articles to see what it’s like on the other side of the fence.

Still, they managed through sheer bad luck to poke me in the way nobody should ever poke me. So, back to my frothing-at-the-mouth angry rant…

I treat my e-mail as a communication tool. If you want to communicate with me, you can send me an e-mail. No, really, I mean it: just click on victor@nicollet.net and send me that e-mail you’ve been burning to write about how much you hate SPAM ever since it killed your family and your dog.

But communicating with me is not the same as communicating to me. If you send me something, it’s either a response to something I asked for, or something I can respond to.

Rule 1: never send me something with a no-reply@something address, unless I explicitly asked for it.

Seriously, you’re sending me e-mail that I didn’t ask for, but you won’t allow me to send you e-mail in return? An e-mail that spells out “We don’t care about you, just listen to us and buy our stuff” is precisely what you shouldn’t be sending.

Sometimes, you will ask me for my e-mail. That’s fine: I usually give it out to people when I need to hear from them. But you should make it extremely clear what you will use that e-mail for. A good example would be the Motley Fool, a financial information website or something like that. They offered to send me a report if I gave them my e-mail, which I did. Since June 25, 2009, I have received 174 different pieces of e-mail from the Motley Fool, and 173 of these were not the report I asked for.

Rule 2: if I give you my e-mail address because I want you to send me X, don’t use it to send me Y.

And, of course, should you give me the choice of receiving more mail from you…

Rule 3: if you have a “don’t send me informational mailings” checkbox and I uncheck it, respect my decision.

Again, an e-mail that spells out “We know you don’t want to receive this, but we sent it anyway because we only care about the money” is not a good message. And I don’t care if you’re Amazon-dot-freaking-com: if this happens even once, my business will be taken elsewhere.

The biggest mistake you can make with my address is to hand it out to someone else. There is no worse violation of my trust.

The second biggest mistake you can make is to send me something if you have obtained my address from someone else.

As a simple test, I signed up for a contest on planet 49, a business that revolves around collecting personal information about the contestants and selling their contact information. At no point the sequence did I actually accept to receive promotional information (which, by law, is opt-in on all French web sites). Then I watched as 1194 pieces of promotional e-mail ended up in my inbox from companies like UPS, Honda, easyJet, HSBC and Orange Businnes [sic]. All these companies are now blacklisted: I will only purchase stuff from them as a last resort.

Rule 4: should you ever get your hands on my e-mail, ask yourself whether the mail you send me will be received with feelings of anger and betrayal.

I’ve had the opportunity (for lack of a better word) to work for businesses that willingly ignored the first three rules above. I once asked why they’d break rule one—don’t they want to hear back from their customers?

I still remember the senior consultant’s answer on that one…

If we use a real address, it will be spammed by people angry about the mail we send them.

Related (but less angry) Posts

July 14, 2010

The fourteenth of July is the French national holiday, celebrating the Fête de la Fédération on July 14, 1790.

On the morning of that day, a military parade is held in Paris, consisting of at least 4000 troops on foot, in addition to the cavalry, the armored divisions, the air force and the support personnel.

And there’s a rehearsal the previous day.

This parade is a one-day event that costs 20 man-years.

Remember back in 2003, when they said the Red Had 7.1 Linux distribution was the equivalent of 8000 man-years? If they took all the troops that participate in the military parade, and taught them how to code, and they spent the day writing code instead of walking around in lockstep, it would take them 400 days of collective work to replicate the functionality in that distribution.

Shogun – Rise of the Renegade

The good folks at int13 have released a preview of their latest video game, Shogun – Rise of the Renegade:

It looks absolutely great—can’t wait to get my hands on it (I might even buy a smartphone so I can play it). It should be available next month on iPhone and Samsung Wave, shortly followed by an Android release.

Shogun was meant to be the follow-up project to Darklaga (the video game I developed with int13 back in 2004), but I had to leave the team without being able to start working on it seriously. It’s good to see that they managed to get the project out of the closet to develop and release it five years after its inception.

Plus, that’s a little bit of my own legacy right there— the “Shogun” part of the name was my idea!

More details available on the (french) int13.net website.

The Forces of Evil

Bad luck happens. There’s always an element of chance that you cannot control, no matter how many failsafes and backup plans you have.

A few years ago, my employer decided to move to new offices in downtown Paris. The power went out several times that week, as our new landlord ironed out the specifics of software engineers renting the space: our developement and CVS servers, and their air conditioning, used up a lot more power than the previous tenants.

For those of you unfamiliar with the software engineering world, the CVS server is the place where the source code is stored. You can live without it for a few hours, since you usually have a copy of whetever you’re working on stored on your own computer, but losing the data is the second worse thing that could happen to a software company (the first being that the entire development team gets hit by a bus).

Since the data was so critical, we had several layers of shielding to protect it. First, there was a daily backup. Second, weekly backups were kept for a year in a remote facility. Third, the data was stored on RAID drives, meaning that should one drive fail, it could be replaced without losing any data and without the users even noticing. Fourth, the RAID drives had their own backup battery power, so that they could finish writing whatever they were writing when the power went out. Fifth, there was a failsafe that prevented the drive from writing anything if the batteries were missing.

The bad news is that the failsafe did not work: the connector had been damaged during the move, and thought that batteries were present. The batteries were out of order, but the drives thought they were present, so they tried to finish writing the data, and ended up writing the correct data at the wrong location. These erroneous writes went unnoticed for a week, until people found C code showing up in Java source files. And by then, the daily backups were all corrupted. Oh, and the local copies several developers had kept were also corrupted.

We ended up using the previous weekly backup, losing several man-months in the process, and reapplying any modifications left on our computers.

Of course, we chose to move at a time where no critical deadlines were looming precisely because we were afraid something went wrong, so we could afford losing those man-months. We could reduce the impact of bad luck, but we couldn’t prevent it altogether.

Related Posts



693 feed subscribers
(readers who polled a feed this week)