Donnerstag, November 30, 2006

Anticipation

I just bought a UK import of the Collectors' Pack of Family Guy (Seasons 1 - 5) from Amazon. I now am feeling the painful sting of waiting. On the plus (or neutral, cancelled out) side, though I paid 20eu more than I would have had to if I simply bought all of the DVDs individually, I will get them all at once sometime next week. Had I bought them separately, one would've come next week, two would've come in 4-6 weeks, and the others would have come in an unknown amount of time due to not being in stock. I figured it was worth the extra money to get all 5 "auf Lager" rather than mess with this. Not to mention the shipping was free, whereas with different ship dates sometimes Amazon.de will split the shipping costs among the items based on availability thus disqualifying you from the free shipping promotions they're always running.

In other news, I've finished the first stable version of my full-featured playing card library written entirely in ISO Standard C++. I'm working on a separate graphical version using SDL to speed up the process of writing graphical card games (as the card games available in the FreeBSD ports collection for the most part leave something to be desired). Well, let's face it. The games section of /usr/ports in general leaves a lot to be desired. And that time I installed PySol just because it claimed to have "Tarock" only to turn out to be "solitaire with Tarock cards" left me feeling a little burned. My kingdom for a free version of Zwanzigerrufen. It wouldn't be that hard to write, actually, it's just that Zwanzigerrufen (and other forms of Tarock to an even greater extent, but I prefer XXrufen because it has the fewest rules to have to memorise) has a lot of strategy that changes depending on the type of game you're playing.

If you're wondering why I didn't just write a graphical version to begin with, or alongside with the standard version, that's simply because the base library is 100% portable to any compiler that supports the 1999 C++ standard. It doesn't use any non-C++ headers except for two, which are only necessary for randomised shuffling and as they are part of the C standard, there should likewise be no portability problems there. Also there are some cases where it pays to have an object-oriented card handling library, but the actual implementation of those cards is either irrelevant or is better left to the developer. As an illustration of some of its uses in the normal console, the source includes some examples that do simple things such as a Faro Shuffle, the Hi-Lo card counting method that people used to use in blackjack before casinos got wise, and a simple, automated implementation of the children's game War. I'm also working on some examples for the SDL version as I find the best way to test the maturity and stability of a library is to work on actual programs that are built alongside. It's only in that way that one can try something and say, "Hm, that's not working the way I expected," or "Man, I wish this had feature X" or "You know, on second thought I really don't need function Y in this class." One of the benefits of putting all of the card handling into a library is that I don't need to worry about it now when developing a game. If I want to create a standard Go Fish table I just have to do something like the following:

const unsigned int uiHandSize = 5; // number of cards per hand
const unsigned int uiNumberofPlayers = 4;
cards::Deck deckGoFish; cards::Pile pileGoFish;
std::vector vGoFishHands(uiNumberofPlayers, new cards::Hand);
deckGoFish.shuffle();
deckGoFish.dealOut(&vGoFishHands, &pileGoFish, uiHandSize);
...blah blah blah...

As you can see, I've shuffled, dealt out the cards, and am ready to establish the rules of the game after only 6-7 lines of rather easy to read code. The aforementioned War game example took me perhaps 20 minutes to write, produce a Makefile for, and debug.

Freitag, November 17, 2006

A Hilarious Youtube Video.

http://www.youtube.com/watch?v=gg5_mlQOsUQ
Having fun with the (mostly intentionally) misheard lyrics.

Dialog Between Spammers?

Recently in our siteburg forums: http://friendy.siteburg.com/phpBB2/viewtopic.php?t=140 I wonder if it's the same spammer or just a coincidence.

Donnerstag, November 16, 2006

The Deborah Mystery

The past week or two I've become more and more puzzled by the fact that almost all of the spam I receive is a variation of the first name "Deborah" (or "Debora"), some last name, and a domain name. Whether it's "deborahwillis@cahuet.com" or "deboraminheirinha@buranet.com" or "deborahsallywobktc@bweiss.com" or "deborahrovai@bytedev.com" or one of the other 4,000 Deborah-related spams, the "From" name is always something random, male or female, but the username is almost always Deborah. Obviously they're probably all coming from the same spammer, or spambot, but I wonder why the script doesn't bother to generate a different first name for the fake e-mail return address. Peculiar.

Sincerely,
Deborah

Mittwoch, November 15, 2006

More news about Charles de Gaulle airport

From Euronews :
“A union representing workers at France's largest airport, Charles de Gaulle near Paris, have produced undercover footage which they claim shows a fake bomb being smuggled onto an aircraft. The images appear to feature men entering the section operated by Chronopost, the freight arm of the French postal service. A package is then handed through a hole in the fence from the non- secure area to the secure side, with direct access to aircraft.

"This route here can be taken by the Chronopost employees, whether management or workers, or even temporary staff that we don't know that well," said CGT union official Hazziz Faddel. "This passageway here is used by lorry drivers, people not employed by Chronopost at all."

The exposé comes as seven Muslim airport staff, including two from Chronopost, are appealing against a decision to withdraw their security clearance because they are considered a risk. A court decision is due today. The union claims the film shows lapses in security which constitute far more of a potential risk than any allegedly posed by the men whose passes have been revoked.

Union officials claim there have been repeated attempts at dialogue with management and the police over security concerns. Chronopost has declined to comment on the footage.”

Mittwoch, November 08, 2006

Paris: Facts, Impressions, Observations.

1) It looks like my French listening comprehension (though still bad) is better than my German listening comprehension. I wonder why.
2) I had some practice speaking French here, during my previous trip I almost had none.
3) This time I liked Paris (I mean, it's general appearance) more than the previous time. Previous time it reminded me of Moscow (especially the central part of Moscow) a lot, I guess this had to do with my arriving there straight from Germany, Paris looks rather dirty and gray compared to German towns I've been in, that makes it closer to Moscow :). Actually Paris is very different from Moscow. Unfortunately this time we walked only in the central part of Paris and I would like to walk in different parts of it but I couldn't separate from our group. I've been in metro several times but also only in the center and not for long, I took some pictures and even some videos of trains moving :).
4) People in our group didn't care about modern parts of Paris, personally I like modern buildings and modern architecture so I'm very sorry we didn't visit any of them. Previous time I visited "La Defense" - the part of Paris with modern building and skyscrapers.
5) Eiffel tower. Previous time I was near it but didn't go inside because it was to late at night and the third floor was closed and we (my cousin and I) didn't want to visit just the second floor so we decided to leave it till next time we're in Paris (of course neither of us knew when this next time was going to be). Because this time we were there during the daytime I had no doubt we will visit the third floor. But I was wrong. As we were standing in line for the tickets they wrote on the information board that the third floor was closed. However when we were buying the ticket (for the second floor) the cashier told us that at the second floor we could buy complimentary tickets to get to the third floor. At the second floor our group decided not to stand in line for complimentary tickets because we didn't know exactly if the third floor was open and even if it was it might close again by the moment we would have bought our tickets. Personally I would have waited as much as possible to get to the third floor but ... So again I’ll have to wait for my next trip to Paris to get to the tower’s top :).
6) Our hotel (Britanny Hotel ****, very close to Louvre) wasn't better than the Viennese one, in some ways it was even worse. The only noticeable thing which was better was the fridge in the room. Actually it was this hotel that was booked because there was not much time left, otherwise we would have stayed in a cheaper (and most likely not worse) hotel. Actually there are even 2 stars hotels in the center of Paris, btw the low number of stars doesn't necessarily means the absence of the bathroom inside each room, our director said that once he stayed in a 1 star hotel in Switzerland and it was no worse that ours either and costed 40 Euros a night. Now what I didn't like in Britanny hotel was that the bathroom had a bath but no place to hang the shower and no shower curtain either so to take shower you had to hold the shower in your hands and be careful not to pour much water on the floor, in Ibis in Vienna there was a shower cabin that could be tightly closed and this was very convenient.
7) Food. The breakfast was included and it was a buffet breakfast the choice was pretty much the same as in Ibis but of course there were some differences like in Normandy there were boiled eggs which was great because I like them but no melted cheese as in Ibis which was not great but there were some other kinds of French cheese that were interesting to try. In the afternoon and in the evening we ate at restaurants which I couldn't afford if I was to pay on my own (I guess they still were middle class restaurants, a dish costed 8-14 Euros there), it was interesting to see what it’s like, but it's not something really special. We usually had lunch in a self-service restaurant at the working place were it costed 19 Euros (the whole lunch) and in the evenings we ate in the city, usually near hotel, several times I missed the evening meal because the restaurant portions were too big for me and ate in the hotel the food I bought in the supermarket. If you order meat at a French restaurant it's always half raw and with blood, that was awful so after trying that once I preferred ordering something different, often I would order only a salad. Once I tried an oyster but wasn't impressed, our group also tried snails but I couldn't dare to :).
8) And now the time has come to speak about ... Charles de Gaulle airport. Well, it was not that awful but we still had our little piece of adventure :) Actually I found the staff rather nice (I understand that my experience is not representative since we interacted only with several people), the top of nicety was the woman standing at the departure board who asked if we needed help, first in French and then in English when we looked somewhat confuse, though I'm not sure if she was from the staff. What really sucks at Charles de Gaulle is their system of luggage distribution or whatever it is called and that was exactly the thing that caused our little adventure, as you probably have already guessed when we were back in Moscow we didn't find some of our luggage, to be more exact a box with some of the working stuff and my personal case that contained my clothes and other stuff including French wine and charging devices for both cellphone and pda. To have the lost luggage be looked for you have to fill in several papers and to have the luggage you didn’t lose weighted. That took a lot of time especially since we had to find the check numbers of the lost pieces of luggage and to whom it was assigned because since we were checking as a group some luggage wasn’t assigned to its real owner but to some other member of the group. Thankfully my lost case was assigned to me or otherwise it would be delivered to someone else and I would have had to pick it from there. Yes, having your luggage lost has its bright side because when found it is delivered strait at your address. This gave me an idea: if your bags are too heavy and you are lazy to carry them just ask the staff at the airport not to hurry putting them on the right flight or use some other tricks to have you bag lost. Actually there were a lot of people from our flight who lost their luggage and the woman at the lost luggage desk said that every flight from Paris (and some other cities) is like that, it’s because at Charles de Gaulle they first collect the luggage from different flights and sort them later. My luggage arrived (at the airport) the following day at 5 and something a.m. (my plane arrived at 17:20).
9)While we were filling in the forms next to me there was a French woman who also had her luggage lost but she spoke English with our agents and if I'm not mistaken she didn't try speaking French with them. I wonder if she did it because she thought it was useless to speak French with our agents or they really don't speak French.
10) Extra weight. When we were checking our luggage in Paris it turned out we had 6 kg extra. The agent said we had to pay at the Aeroflot stand a sum of ... I naively thought it would be something like 10 Euros ... of 72 Euros. So we went to the stand and gave her (she was a French woman who spoke very good Russian, I wonder if this is a requirement for all Aeroflot agents) the papers. She studied them thoroughly and asked how many persons there were in the group. For a moment I became scared that she was looking for a way to charge us even more but actually it was the other way round, she said that we don't have to pay anything. That was very nice and I wonder whether it's Aeroflot's general policy or just this woman's attitude.
11)My bag arrived to my appartment on Monday safe and sound, even the wine bottles weren't broken.

P.S. Mike, at Charles de Gaulle I saw the signs showing directions to smoking places, where the people you asked unaware of that or it's something that remained from the past when smoking policy was different?

Mittwoch, November 01, 2006

Blowing Up Prolog

Inspired by terrible movie and television plots involving robots that self-destruct through the superior (or rather, illogical to the point of being superior) wit of human beings, this afternoon I decided to try and make GNU Prolog blow itself apart. After about an hour of typing in the following code and formatting it, I succeeded. The beauty of the program is not that it serves any rational purpose, or that it's particularly well-crafted or even clever, but rather that it a) is based on one of the shittiest songs of all time; b) it will, ceteris paribus, run forever on its own circular logic; and c) will not run at all on most systems due to the fact that it will cause a stack overflow and make your Prolog interpreter crash. If it is useful for anything serving mankind, it is only that it proves once and for all that "There's A Hole In My Bucket" deserves all the scorn it is capable of receiving. If you're really curious what the output looks like were it finite and able to execute, remove the logical checks for "(advises(liza, bucket) ; needs_bucket(henry)) ," in the first complaint from Henry and query the program for any other declaration. To see the entire song once, query "advises(liza, bucket)." With the original grammar, the song would in theory repeat infinitely, however due to the circle of dependent logic, it actually executes never, repeatedly filling up the memory of the interpreter until it chokes. Even computers hate this shitty song, apparently.



boy(henry).
girl(liza).
container(bucket).
owns(henry, bucket).
needs_bucket(henry).
has_hole(bucket).
hole_filler(straw).
too_long(straw).
cutting_tool(knife).
too_blunt(knife).
sharpening_object(stone).
too_dry(stone).
liquid(water).

action(mending).
action(cutting).
action(sharpening).
action(wetting).
action(fetching).

quality(bluntness).
quality(length).
quality(dryness).

has_container_problems(X) :- container(X) , has_hole(X).

complains(henry, bucket) :- (advises(liza, bucket) ; needs_bucket(henry)) ,
has_container_problems(bucket) , owns(henry, bucket),
write('There\'s a hole in my bucket, dear Liza, dear Liza.') , nl,
write('There\'s a hole in my bucket. Dear Liza, there\'s a hole.'), nl, nl.

complains(henry, length) :- advises(liza, straw) , hole_filler(straw) , too_long(straw) ,
write('The straw is too long, dear Liza, dear Liza,') , nl,
write('The straw is too long, dear Liza, too long.'), nl, nl.

complains(henry, bluntness) :- advises(liza, knife) , cutting_tool(knife), too_blunt(knife) ,
write('The knife is too blunt, dear Liza, dear Liza.'), nl,
write('The knife is too blunt, dear Liza, too blunt.'), nl, nl.

complains(henry, dryness) :- advises(liza, stone) , sharpening_object(stone) , too_dry(stone),
write('The stone is too dry, dear Liza, dear Liza.'), nl,
write('The stone is too dry, dear Liza, too dry.'), nl, nl.

advises(liza, mending) :- complains(henry, bucket),
write('Then mend it, dear Henry, dear Henry, dear Henry.') , nl,
write('Then mend it, dear Henry. Dear Henry, mend it.'), nl, nl .

advises(liza, straw) :- inquires(henry, mending) ,
write('With a straw, dear Henry, dear Henry, dear Henry.') , nl,
write('With a straw, dear Henry. Dear Henry, with a straw.'), nl, nl.

advises(liza, cutting) :- complains(henry, length) ,
write('Then cut it, dear Henry, dear Henry, dear Henry.') , nl,
write('Then cut it, dear Henry. Dear Henry, cut it.'), nl, nl.

advises(liza, knife) :- inquires(henry, cutting) ,
write('With a knife, dear Henry, dear Henry, dear Henry.'), nl,
write('With a knife, dear Henry. Dear Henry, with a knife.'), nl, nl.

advises(liza, sharpening) :- complains(henry, bluntness) ,
write('Then sharpen it, dear Henry, dear Henry, dear Henry.'), nl,
write('Then sharpen it, dear Henry. Dear Henry, sharpen it.'), nl, nl.

advises(liza, stone) :- inquires(henry, sharpening) ,
write('With a stone, dear Henry, dear Henry, dear Henry.'), nl,
write('With a stone, dear Henry. Dear Henry, with a stone.'), nl, nl.

advises(liza, wetting) :- complains(henry, dryness) ,
write('Then wet it, dear Henry, dear Henry, dear Henry.'), nl,
write('Then wet it, dear Henry. Dear Henry, wet it.'), nl, nl.

advises(liza, water) :- inquires(henry, wetting) ,
write('With water, dear Henry, dear Henry, dear Henry.'), nl,
write('With water, dear Henry. Dear Henry, with water.'), nl, nl.

advises(liza, bucket) :- inquires(henry, water),
write('With a bucket, dear Henry, dear Henry, dear Henry.'), nl,
write('With a bucket, dear Henry. Dear Henry, with a bucket.'), nl, nl.

inquires(henry, cutting) :- advises(liza, cutting) ,
write('With what shall I cut it, dear Liza, dear Liza?'), nl,
write('With what shall I cut it, dear Liza, with what?'), nl, nl.

inquires(henry, mending) :- advises(liza, mending) ,
write('With what shall I mend it, dear Liza, dear Liza?'), nl,
write('With what shall I mend it, dear Liza, with what?'), nl, nl.

inquires(henry, sharpening) :- advises(liza, sharpening) ,
write('With what shall I sharpen it, dear Liza, dear Liza?'), nl,
write('With what shall I sharpen it, dear Liza, with what?'), nl, nl.

inquires(henry, wetting) :- advises(liza, wetting) ,
write('With what shall I wet it, dear Liza, dear Liza?'), nl,
write('With what shall I wet it, dear Liza, with what?'), nl, nl.

inquires(henry, water) :- advises(liza, water) ,
write('With what shall I fetch it, dear Liza, dear Liza?'), nl,
write('With what shall I fetch it, dear Liza, with what?'), nl, nl.


NB: I don't want to make it seem as if it's difficult to get Prolog into this sort of situation. In fact, almost any recursive predicate can do the same damage. But I figured a non-recursive demonstration would be easier to understand and the only thing worse than this song is the German version "Ein Loch ist im Eimer."