Archive for November, 2006
“Ask Desktop Search” trouble

Dear Reader,

After some sucessful searching the web with the Ask Search Engine I thought about trying the “Ask Desktop Search” Software. I needed to index my pdfs, so I could do a full text search on them.

Apparently, this little program does not send my data out onto the web, like googles desktop search does. A big plus. Also, you can configure which directories should be indexed. So far, so good.

The whole experiment was a big mess:

The first annoying thing was, that when I downloaded it through Firefox and started it directly out of the firefox download manager, the installation programm complained I had to close all running instances of firefox.

The installation programm obviously wants to mess with my Firefox browser. Something I did not want. I want to index my local filesystem. That’s all.

askdesktop2.jpg

When I actually gave in and closed my firefox instances, it still would not proceed with the installation. Well, of course not, firefox could not be properly closed, because the setup process itself was spawned by firefox. So I restarted the installer. This time directly from the download directory.

Again no sucess, same problem. When looking at the processes running, there was still an instance of firefox.exe alive. The windows were gone however. Obviously firefox was not terminated even after its child process, the installer was dead. The only way is to manually kill the firefox.exe process from the task manager. A killer feature! (The same happens, when you try to uninstall :-) )

askdesktop1.jpg

So i had finally installed my little program.

I did not want to index my whole disk, just the pdfs. The program did not care much and started indexing happily. Everything! After doing some changes on the settings to restrict this behaviour, the indexing paused. There was neither a way to wipe the already started index nor to unpause indexing. By restarting my machine, indexing seemed to work.

Two days later, when I sat at my machine, all programs were crying and bleeding: No more disk space on drive C! I ran TreeSize to find out who caused the trouble. Guess what happend? Ask Desktop Search build up its index in C:\Documents and Settings\remote\Application Data\AskDS. Over 2 Gigabytes of space were already used up by it and there were 0 bytes left on the disk.

askdesktop3.jpg

Great! The developers assumed I wanted their program to index onto drive C. Furthermore they assumed, there is indefinite space to use up. Beginners usually don’t consider these real world constraints.

Before sending the whole thing to nirvana, I did some test searches. It found file names propertly. Full text, in-document search did not work!

This product has been realased a bit too prematurely. My advice: do not use it.

I will right now download the google desktop search program and try to block its “phone back home” behaviour with the firewall…

Google desktop: I could not even finish the install without internet access

askdesktop4.jpg

It stayed hanging like on the picture… I need the “spotlight” application that the mac users have… where is it?

Thank you.

The man who almost owed me the 243 Million Lottery Jackpot

Dear Reader,

Here in Europe, we have the weekly EuroMillions Lottery. As of today, 10th of November 2006, there were 243 Million Euros to win (That is USD 310′588′020, aka 310 Mio $). Of course everybody tried thier luck…

My lucky numbers for today were these:

14 22 35 38 44 - 3 7
01 13 21 37 40 - 7 8
21 25 36 47 50 - 2 3
18 23 43 46 47 - 4 8
03 21 25 43 50 - 5 7

lotto4.jpg

My little EuroMillion Random Number Suggestion Program (see below) got these numbers for me and I was very exited. I filled out the lottery ticket already on wednesday and was eager to get my ticket down to the lottery counter and check it in…

However, things went terribly wrong, as I relied on this man:

lotto2.jpg

This man was trying to get lucky too and also wanted to play the EuroMillion Lottery. But I should have been warned. That man is not quite a Michael Schumacher, nor does he own a Ferrari. In fact he is an “EL’ie”, a learning driver! He has one of these “L”’s on the back of his car and is only allowed to drive with experienced drivers in his passengers seat:

lotto6.jpglotto5.jpglotto3.jpg

We drove up to the lottery counter and tried to find a parking lot. Because my unexperienced driver had not yet learned to drive backwards, we had to circle around a spot, like a roundabout, that had a traffic light in it.

My driving apprentice managed to stop in from of the traffic light in such a way, that the metal detection, built into the street never detected anybody that was waiting for a green light… And because driving backwards was out of question for the reason just mentioned, we had to wait for some other car to stop behind us and eventually make the traffic light realize that we in fact needed to get out of that situation immediately.

It was three minutes after half past six when we rushed up to the lottery counter to try our luck. - Three minutes too late - Three minutes away of my 243 million Euros!

lotto7.jpg

Good bye my many Euros…

The guy who almost owed me the lottery jackpot did not get beaten up by me, just in case you think that that is why he looks so smashed up on the picture above. No, that happend three years ago, when he had an accident on his snakeboard. (Where he is professional at, I have to say here, just to stay fair).

lotto8.jpg

But how high was the risk of my “only-forward-gears-please” driver to actually “owe” me my 243 million Euros really? - Let’s have a look:

The folks among you who still remember their combinatorics lessons will quickly find out, that chances to win are terribly low.

For those who skived school at the time, here is how we can figure it out:

In the EuroMillions Lottery you have to choose 5 out of 50 plus 2 out of 9, called numbers and stars. For the first cross we put on the lottery ticket, we can choose out of 50 numbers. For the second cross, only 49 possible free numbers are left. This goes on down to the last cross, where 46 unchosen numbers are left to choose from. Same story for the stars: here we choose out of 9 on the first draw and 8 out of the second.

lottery10.gif lotto12.jpglotto9.jpg

Multiplying all those possibibilities gives us the total possible combinations of a fully defined lottery stake:

50 * 49 * 48 * 47 * 46 * 9 * 8 = 18'306'086'400

Now this is when the order of the draws matters, when 11 31 22 46 03 is different from 03 22 11 46 31 and so on. So there are some pairs that don’t have the same order, but the same numbers. How many?

1 * 2 * 3 * 4 * 5 = 120

for the first 5 numbers, and

1 * 2 = 2

for the stars and therefore 240 for all. By dividing we get

18'306'086'400 / 240 = 76'275'360

This number is represents all possible outcomes of the EuroMillion Lottery. Of course there is only one right answer. This gives the probability:

1 / 76'275'360

In a different notation this is equal to

1.311 * 10^(-8)

or

0.0000001311

or

NOTHING

We now know: the one and only correct answer tonight to win the lottery jackpot was: 14 21 27 30 36 - 2 3. But again, nobody won!

Well of course not, the probability to win this insane game is 0.0000001311 as we just found out. So why bother in the first place? How can anybody semi-intelligent throw his or her money away in such a game?

lottery13.gif lotto14.jpglottery11.gif

“Well - sometimes, somebody wins, right? So why not me?” you could argue…

Exactly! That’s just what my “almost debtor” and I thought as well. For professionals working with addicted people, this attitude is probably just about all it takes to be certain they are dealing with some serious cases… And in fact, if the lotteries jackpots were that high and were on every night, I truely think we would be bankrupt, stealing form ant Jenny, robbing kindergardeners and in jail by now…

lotto16.jpg lotto15.jpglotto17.jpg

Did I mention that in Germany, EuroMillions is illegal and the poor guys are not allowed to play in their country? Every German Hartz-IV receiver (that is almost everybody, cause you are better off that way than with actual work), who could somehow make it, took a trip into the coutries abroad where EuroMillions is allowed and spend all they had to play and hopefully win.

lotto1.jpglotto18.jpglotto19.jpg

More on german invasions and politics that give the wrong incentives in another blog…

Because filling out the lottery ticket is so difficult for standard human brains, I quickly wrote a little Java program to take the burden of me to choose “pseudo good” numbers.

When a human fills out the tickets, evenly distributed patterns emerge, very often prime numbers are chosen. Therefore, the more prime numbers a win contains, the more people will have to share it.

Even when an individual knows these facts and tries to do exactly the opposite or some “random” way, it still is almost impossible. - That is, when a possible win is involved…

Test question: Someone puts down the following numbers on a lottery ticket. Do you think he or she is insane?

01 02 03 04 05 - 01 02
06 07 08 09 10 - 03 04
11 12 13 14 15 - 05 06
16 17 18 19 20 - 07 09
21 22 23 24 25 - 01 02

…get the point? - It doesn’t matter. Anybody playing is insane… These numbers are just as probable as any other.

So here is my little program that has no brain of its own and will just give you random numbers. (Caution: If you are superstitious and believe in lucky numbers, this program is not for you. After the test question above, probably no one is in his heart).

package org.theyellowmarker;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Random;

/** from http://www.theyellowmarker.org - raoul */
public class EuroMillionGuesser {

private int[] computeLuckNumbers(final int howMany, final int max) {
if(howMany >= max || howMany < 0 || max < 0) {
throw new IllegalArgumentException("Get out of here, you jerk");
}
int[] numbers = new int[howMany];
for(int i = 0; i < howMany; i++) {
numbers[i] = getNextLuckyNumber(0, numbers, max);
}
inSituBBSort(numbers);
return numbers;
}

private int getNextLuckyNumber(final int offset, final int[] numbers, final int max) {
final int luckyNumber = new Random().nextInt(max) + 1;
for (int i = offset; i < numbers.length; i++) {
if(numbers[i] == luckyNumber) {
numbers[i] = getNextLuckyNumber(offset, numbers, max);
}
}
return luckyNumber;
}

private int[] inSituBBSort(int[] numbers) {
for (int i = numbers.length; --i >= 0;)
for (int j = 0; j < i; j++) {
if (numbers[j] > numbers[j+1]) {
int tmp = numbers[j];
numbers[j] = numbers[j+1];
numbers[j+1] = tmp;
}
}
return numbers;
}

private String results(int[] numbers) {
final StringBuilder sb = new StringBuilder();
for (int i = 0; i < numbers.length; i++) {
if(numbers[i] < 10) {
sb.append("0" + numbers[i] + " ");
} else {
sb.append(numbers[i] + " ");
}
}
return sb.toString();
}

public static void main(String[] args) throws IOException {
EuroMillionGuesser emg = new EuroMillionGuesser();
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String str = "";
System.out.print("hit enter for next draw..., control-c for quitting");
while (str != null) {
str = in.readLine();
int[] mainNumbers = emg.computeLuckNumbers(5, 50);
int[] starNumbers = emg.computeLuckNumbers(2, 9);
System.out.print("You win! - Well, if and only if (aka iff): ");
System.out.print(emg.results(mainNumbers));
System.out.print("/ ");
System.out.print(emg.results(starNumbers));
}
}
}

Download: euromillionguesser.zip
You can use this little code snipped for other lotteries with different number schemes as well. Just change the arguments in the computeLuckyNumbers methods inside the main method and recompile. To run it, unzip the file and hit the start.bat file. Hitting enter will give you a new draw each time:

lotto211.jpg

If you win with numbers from this little program, let me know and send some money over.

Nobody won this week. - Next week, 288 Million Euro will be in the jackpot. I will hand in my lottery ticket earlier this time. When blog entries about luxury goods and clever investment strategies start to appear here, you will know who has won it :-) .

Thank you.

“Ask” Search Engine

Dear Reader,

A friend of mine told my yesterday about the search engine Ask. I remembered today when starting to get my hands dirty with the Apache Axis Webservice Framework. I was reading through the User Guide and tried to run their TestClient application. However the URL for the Echo Webservice did not seem to be working. I got a connection error. So I tried googling the URL http://ws.apache.org:5049/axis/services/echo.

Zero Results!

I tried Goolge Code Search as well, - with the same result. That was when I remembered about the conversation yesterday about Ask.

ask3.gifask1.gifask2.gif

Ask gave me three result pages. I found out that there is an alternative link: http://nagoya.apache.org:5049/axis/services/echo. However, this one also doesn’t work. But at least I found out, other people had the same problem before.

I don’t know yet how well Ask performs on non technical searches. For technical searches however, it looks like a promising alternative.

Thank you.