That’s not a calf

Earlier Minke whales caught by Japanese ‘research ship’this morning I read that the Australian government released (graphic) pictures of the Japanese whale hunt in the Antartic seas. I thought this was quite unique: normally, I expect these pictures to come from organizations like Greenpeace (they released images of the hunt a week ago, actually). Then I read that Australia’s new Environmental minister is no one else than Peter Garrett: if you remember the band ‘Midnight Oil’, everything should fall in place (for completion sake, here’s the video of their hit song, ‘Beds are burning’). I assume that the previous Australian (conservative) government was also against the whale hunt, but I’m pretty certain not as public and openly as it did today. Australian papers were outraged about the (shocking) images of the hunt: for example, the Daily Telegraph is encouraging Australians to sign an online petition which they hope to present to Japanese authorities later this month.

So, what do the Japanese think of all this publicity? Well: the Institute for Cetacean Research claims that the Australian government is using emotional propaganda to get their message through: these two whales on that photo, they’re not a mother and her calf:

“The photographs taken by the Oceanic Viking and which major Australian newspapers published today shows two minke whales, but they are not a mother and her calf as claimed by the media. Our research program requires random sampling of the Antarctic population, and therefore there will be a range of sizes.”

Oh. Really.

Sarcasm aside, this reminds me of a game I played a couple of weeks ago: ‘Harpooned (‘Japanese cetacean research simulator’)’. It’s a shoot-em-up game which allows you to pretend that you’re in charge of whale research and use your harpoons to collect scientific data and, as an extra, produce whale burgers too. If you don’t think that whale hunting is mindless yet, maybe this game will change your mind.

Update: Oh yes, and this for the Trekkies among us.

1 The Australian Department of Environment, Water, Heritage and the Arts has an excellent website about marine life and endangered whale species..

Posted in We-reflect-news | Tagged , | Comments Off on That’s not a calf

Web traffic

Rightxsamplex webtraffic 2005-2007 in time for this year: the current statistics for this domain, which includes a chart with extremely boring colours (click the image on the right of this paragraph).

Last year, I didn’t list the individual page views: these are hits that come to this domain via any of the popular search-engines. Last year, the most popular search terms were ‘pico salax’, followed by ‘serialport c#’, ‘com0com’ and ‘the people are heroes’. Around March 2007, people looking for ‘tim hortons roll up the rim’ ended up at my yearly ‘Roll Up The Rim’ posting. ‘Kerongcong’ was consistently ranked within the top 10 too overhere and that was mainly because this entry (about the death of my father and the music that was played during the funeral ceremony) was ranked first on Google for a couple of months. On the overall, it looks like programming terms are going to rule this site this year: from November 2007 on, most of the hits came from fellow programmers looking for specific C# stuff (particularly the serial port story). Additionally, from what I saw in January, local news and topics are consistently ruling the top 10 too: plenty of people ended up here because of the adventures of this lady.

To summarize, we may hit the 100,000 pages per month this year, but if we don’t, it’s probably because we didn’t write about the US elections.

Posted in xsamplex | Tagged | Comments Off on Web traffic

Owner-draw (II)

Earlier, An owner-draw gridwhich is, almost a year ago, I was comparing owner-draw programming in Delphi and C# and concluded that it’s quite similar: basically you set any visual component in a particular mode (‘I’m going to take care of drawing the content’) and then you basically override the component’s OnPaint/OnDraw event. Drawing the actual stuff is the hardest part, but there’s pretty good API help for both Win32 and .Net platforms. If you have programmed graphics in Win32 before, this is going to be a piece of pie.

So, yeah: a couple of years ago, I did some fancy stuff in a Delphi Drawgrid component. The .Net framework has a similar ‘grid’ like component, which is called a ‘Datagridview’ and you probably guessed it: it has basically the same functionality and offers the (almost) the same features as Delphi’s DrawGrid component. This brings me to that earlier mentioned project I was working on: a Sudoku puzzle generator, which obviously needed to use a custom grid-like component with a lot of colours (Warning: if you’re not interested in programming, you probably don’t want to continue reading).

Continue reading

Posted in Programming | Tagged , , | Comments Off on Owner-draw (II)

Moo (and other stuff)

Earlier today, the WordPress developers released a fix for a security issue in the xml-rpc code. There’s no need to completely upgrade your installation: upgrading overhere is sort of painless and that’s not because of the fact that my host provides automatic upgrades. Bored as I ever am, I finished up a couple of update shell scripts, which, if I have time, I could poke online one of these days. This is actually so basic, that, well, maybe you just should stick to your command-line typing skills. If your host allows you to use wget via SSH, consider yourself extremely lucky.

Other stuff: over here, milk is getting a couple of cents more expensive a liter (70 cents 5 cents1 I believe, which is more than a couple). I’m not sure why I mention it here but maybe this is related to my hunt for moo-cows (I mean, my Internet hunt for the origins of the word moo-cow). I think I’ve mentioned ‘super cow powers’ before, haven’t I?

There were a couple of things that attracted my attention the last (couple of) days: First, I found this neat 3D animation of the replication mechanism of HIV (YouTube). And related to that, LiveScience reports that soundwaves can be used to attack (any) virus:

Normal cells should not be affected by the virus-killing lasers or sound waves because they have resonant frequencies much lower than those of viruses. Moreover, it is unlikely that viruses will develop resistance to mechanical shaking, as they do to drugs.

And last but not least is this Horizon episode (BBC/Video at Google): What on Earth is wrong with gravity? The documentary goes into details about the missing links between Newton’s (mechanical) laws and Einstein’s General Theory of Relativity.

1 I’m a bit confused here too: but I think the correct amount was actually 5 cents.

Posted in Hyperlinks | Tagged , , , , , , , | Comments Off on Moo (and other stuff)

Tango Habanero (‘Youkali’)

Tango Habanero (or ‘Youkali’) is probably the most popular music piece of the (musical) play ‘Marie Galante’ (based on a novel written by Jacques Deval). There is too much to tell about ‘Marie Galante’: first of all, the book was quite a hit and even attracted the eyes of a Hollywood studio which eventually adapted it for the American audience (and unfortunately, heavily changed the original storyline to include a happy end) [1934].

Because of the novel’s success, Weill was asked to compose the music for the upcoming play. Weill, short on time, eventually settled on combining newly composed tunes and earlier written pieces. To make things worse, the composer and Deval didn’t really get along very well. Weill wrote to his wife:

Deval is causing major headaches. He is absolutely the worst literary schwein I’ve ever met, and that’s saying a lot. [… H]e said he could concentrate on Marie galante 100%. So I call him today, and he says he is taking off in two weeks—for Hollywood! In other words, he has no intention of writing the play.

The play eventually premiered but closed within 2 weeks because of bad reviews. The music however survived, surprisingly: the song ‘J’attends un Navire’, for example, was adapted by the French resistance during the Second World War. And in 1946, the ‘Tango Habanero’ was set to words by Roger Fernay and transformed into the French song we now know as ‘Youkali’, to much acclaim, of course. Many critics agree that with the songs and music for ‘Marie galante’, Weill perfectly captured the French sentiment and identity.

So, ‘Youkali’ then (30+ second fragment), or rather, the ‘Tango Habenero’. The song itself has been sung by many sopranos and popular singers, most notably by Canadian soprano Teresa Stratas (perfect YouTube video), for the ‘September Songs’ project. The song is also part of Ute Lemper’s repertoire: Personally, I’m not a great fan of her voice and presentation though (but then, some people prefer modern versions of the song).

Update:
1. Excellent background on ‘Marie galante’.
2. I also see that the Roma Opera performed ‘Marie galante’ in 2007 (YouTube), starring soprano Chiara Muti (warning: Italian language ahead).

Posted in Past-the-bridge | Tagged , | Comments Off on Tango Habanero (‘Youkali’)

The driveway

I think it’s an understatement if I’d say that last week, we’ve gone through quite some weather. Monday, we started out with lots of rain which at the end made our driveway look like the perfect ‘slide and glide ramp’ for the Nova Scotian Winter Olympics of 2032. The situation in Nova Scotia wasn’t as nearly as bad as in PEI, of course: overthere, the storm turned into a freezing rain storm, eventually knocking out power in many regions on the island.

Then, Friday (and Saturday), Weather Canada called for another storm: Friday, the winterstorm hit Ontario and Quebec (which you can read about it on the Internationalist).

Yesterday, that storm hit our region and, yes again, it brought too much wind and too much rain, which (in turn) made our driveway look like the perfect place for hosting the 2056 Nova Scotian Driveway Marathon.

Posted in Truro NS, We-reflect-news | Tagged , , , | 3 Comments

Is that a fractal?

The CBCThe cast of ‘Untraceable’ has an excellent slideshow (with audio) about the movie industry’s obsession with evil machines. The slideshow uses the new movie ‘Untraceable’ (starring Diane Lane) as a reference and the columnist narrates us through other examples of evil machine movies. Excellent stuff this (Earlier: Onstad’s slideshow on 2007 movies).

There were a couple of things I forgot to mention in an earlier entry: The first thing of note is that IE8 story. I think it started with this (A list apart) article: “Beyond DOCTYPE”. Basically, for IE8 to render webpages correctly, web developers are asked to add an extra meta declaration to their webpages. Hundreds of comments later, the majority of WaSP members (the so-called Web Standards Project) decided to support the not-so-standard move. Who cares about standards, right? Haakon Lie (CTO Opera software) gave his perspective on the latest IE8 development and the most remarkable part of his article is the following jab:

A third scenario could be to hard-code the Web address of Acid2 into IE 8. This way, the page is given special treatment to make it look like the browser is passing the test.

Maybe now it’s a good time to throw out compatibility for the sake of following standards.

The second thing you may have heard about, is that a group of anonymous people who appropriately call themselves ‘Anonymous’ have openly declared war on the Church of Scientology (Google News link). The group has produced several videos (which currently are hosted on YouTube, so you obviously need Flash). The videos feature an anonymous person speaking in a digitized voice: or rather, it sounds like they’ve used Windows Narrator to bring across their message. (See also: XenuTV comments on Anonymous [also YouTube])

Update: A reasoned response to X-UA-Compatible (via Burningbird)

Posted in Hyperlinks, We-reflect-news | Tagged , , , | Comments Off on Is that a fractal?

18 characters and counting

Via nu.nl, I found out that the countries that form the EU our slowly moving forward with the introduction of the Single European Payments Area (SEPA). SEPA is a framework for a unified payment system that (should) make European cross-border payments easier for businesses and citizens. According to the SEPA site (ECB):

The goal is to turn the individual national retail payment markets into one pan-European market. For customers, SEPA means that payments to any person in the euro area will be quick and uncomplicated.

Notice that the European banking industry is in charge of the project and they have set a list of time lines and milestones for the next couple of years. Milestones include (for example) changes to account numbers and deprecation of the PIN (number) system for bank cards. Account numbers will now adhere to the IBAN standard and include a country code, the bank number and a checksum number. (You can apparently test your new bank number right at the IBAN site1). So, if your ABN AMRO bank number was 123456789, your new number will be NL69ABNA1234567892.

The SEPA site also offers detailed migration plans from all EU nations. Interestingly, the Dutch migration plan is listed here (PDF). Also, of interest is the country’s ‘migration concerns’ document which lists 10 points of concerns including the inevitable question that there’s a need for ‘guarantees that prices will not go up’.

Update: Google News link on latest SEPA news, or if you’re technologically inclined, a Google alert.

1 Quoting from a movie here: IS IT SAFE, IS IT SAFE!

2 This bank number example came straight from the Dutch migration plan.

Posted in Hyperlinks, We-reflect-news | Tagged , , , | Comments Off on 18 characters and counting

Noche de Jaranas

I read Silvestre Revueltasthat Alfons recently visited a performance of La Noche de Mayas, so hey, why not add the composer Revueltas to the ‘Past the bridge’ category. I have a couple of sound samples from the Mexican composer but the only ones I actually like are either ‘Sensemaya’ and the ‘Noche de Jaranas’, which is this entry’s sample pick (30+seconds ‘Noche de Jaranas’).

What can I say about this piece: it’s dynamic, up-tempo and, yes, unmistakably Mexican:

[De Jaranas] refers to a quick dance derived from the Spanish fandango. The meter alternates here between rapid 5/8 and 6/8 time, which the strings, sometimes reinforced by winds and percussion, spin out as a sparkling perpetual motion, against which brass instruments occasionally play heroic phrases—typical of the sort of “primary color” orchestration Revueltas favored. As in the first movement, the opening music returns at the end of this movement, which dies out in sudden quiet.

Revueltas was actually a trained classical violin player who eventually ended up in the middle of the Spanish Civil War: If I’m not wrong, during his stay in Spain, he dedicated many pieces to the Spanish poet Federico Lorca (something that’s amiss in the composer’s Wikipedia entry).

I was introduced to Jaranas in late 2000 and it appears that Revueltas music is slowly becoming more popular: I was (for example) extremely surprised (and pleased) to hear that his ‘Sensemaya’ was featured in the graphic novel movie ‘Sin City’. If you have that movie on the shelf, you can’t miss it: it’s played during the movie’s finale/climax.

Posted in Past-the-bridge | Tagged , | 4 Comments

Rambo vs. Norris

The more I watch the US primaries, the absurder it gets. You’re probably familiar with the fact that Chuck ‘I’m on the Internet too’ Norris is a supporter of Huckabee (actually, the other day, even the local paper published a photo of them). But hey: Sylvester Stallone supports John McCain! It’s like, uh, the return of bad 80s movies where, uh, good is good and bad is evil. USA! USA! USA!

It’s not that the Democrats are doing better either: Earlier this week Obama and Clinton, well, you have to see it for yourself. Can you say messy? I must say that I think that Bill Clinton lost a lot of credibility the last couple of weeks.

And last but not least, I read the parts about the US’s economic stimulus package too: it mentioned sending people cheques (600 dollars per adult, I believe) and I thought by myself that this was just another short-term solution to keep the US economy afloat until the elections. The problem, of course, is much more complex.

Posted in We-reflect-news | Tagged , , | Comments Off on Rambo vs. Norris

The sound of

This morning, I woke up with the sound of snowplows driving by our house, which to me, is the first hint that it’s time to do some shoveling outside. So, I guess, that’s something I’ll be planning for later.

We’ve been having our share of snow and unpredictable weather this month though: more so than the previous years. Additionally, after every dump of snow, temperatures have gone up way above the zero degrees mark (Celsius). For example, when I was writing this entry a couple of days ago, it was pouring rain outside, which (of course) took care of the snow that was dumped on us earlier last week. So that’s our start of the winter: plenty of snow and then slush that freezes up the next morning. Excellent weather to make glide and slide ramps. Not so much fun for dogs.

It may not surprise you that I frequently visit Weather Canada’s site, but mainly for statistical data, which is available for everybody who is interested in this kind of stuff. Their online Climate Data site is right here and is food for people who love numbers and that. Online weather data can be shown in different formats: for an example, try to click this link for this month’s weather data at the Debert weatherstation. Notice that Debert also keeps track how many centimeters of snow is still on the ground (which is obviously not really scientific, but nonetheless entertaining). If you go back in time on this weblog, you can probably find some similarities between the weather data and my writings.

Weather Canada also provides complete datasets on a CD-ROM, which can be freely downloaded from their site. The software, however, is completely DOS-based and the data is written in some kind of B-Tree-type file format (it’s not even written into their own specific standard file format). Setting it up on your computer can be a pain, but it works good: it comes with tools to export data to CSV, plain text and that silly format I mentioned in the previous sentence. Hopefully, the government will bring this product to more feasonable1 fashionable platforms.

1 I, uh, heh. I thought I wrote feasible.

Posted in Hyperlinks, Truro NS | Tagged , , | Comments Off on The sound of

Lyperhinks

There were some considerable announcements made this week and last week:

First of all, there was a buzz on the Postgres list that Sun was going to buy up MySQL. The official announcement at MySQL mentions that it went over the counter for the price of 1 billion US dollars. And then, at the same time, I was thinking of the US president’s last ditch effort to kickstart the troubling US economy.

Apple had some news too: they announced the newest MacBook Air, which they claim is the thinnest laptop ever made. Uh, notebook. Or whatever the current fashionable name is for ‘compact computer’. The announcement eventually had me end up at this comic, which explains how the MacBook Air can save the world.

Via Burningbird, I found out that the US’s Library of Congress has a blog, plus, that they are working together with Flickr to bring pictures and photos to the public domain (let me rephrase this cautiously: they’re going to publish pictures with no known copyrights restrictions). For now ‘only’ 3,000 pictures have been made available, more may come in the future. This is good news for hard-drive manufacturers!

Posted in Hyperlinks, Ordinateurs, We-reflect-news | Tagged , , , | Comments Off on Lyperhinks

Is there a statistician in the house?

I downloaded the Visual Studio 2008 Express Edition ISO from the Microsoft site and discovered that specific stuff I was looking for isn’t supported in that special edition. I guess there is (or rather was) a huge difference between ‘Orcas’ and the Express Editions (Earlier at xsamplex).

That said, there was a time for looking through code and then I discovered that at Microsoft’s WPF site somebody had uploaded a Peer-2-Peer version of Sudoku (see also this post, or rather, this photo). This reminded me that a couple of weeks ago, I was asked to help with an algorithm that generates a complete filled out Sudoku puzzle. This I did and after that I moved on. So, that Peer-2-Peer version apparently has an algorithm that does the same, so when I opened the particular source file, I was shocked to find the following code (see my tag):

for (int iRow = 1; iRow < = 9; iRow++)
{
    for (int iCol = 1; iCol <= 9; iCol++)
    {
        iNum = rnd.Next(1, 10);
        while ((IsInColumn(iNum, iCol) 
                  | IsInRow(iNum, iRow) | 
                   IsInThreeByThree(
                      iNum, 
                      GetThreeByThree(
                         GetThreeByThreeIndexFromRowCol(
                             iRow, iCol)))) 
                  == true)
        {
            // Generate a number to be put on the grid..
            iNum = rnd.Next(1, 10);
            iAttempts++;

            // AH01 -- OH NOES...
            if (iAttempts == 100)
            {
                bStuck = true;
                break;
            }
            // AH01 -- Ends.
        }
        if (bStuck)
            break;
        iAttempts = 0;
        arrPuzzle[iRow - 1, iCol - 1] = iNum;
        if (iRow == 9 && iCol == 9)
            bDone = true;
    }
    if (bStuck)
        break;
}

Let me go back a couple of steps. In Sudoku, a 9 by 9 grid is divided in nine 3×3 grids: the numbers in each 3×3 grid MUST be unique and between 1 and 9. Additionally the same rule applies to each horizontal and vertical line in the grid. A fairly good description can be found at Wikipedia.

The main algorithm for filling out a 3×3 grid with 9 unique numbers, is a statistical routine that should have came up during math classes as the ‘coloured balls in a basket problem’. There’s 10, no, lets say 9 different coloured balls in a basket. What are the chances of (blindly) picking out the red ball in the second turn?

Back to that source snippet: Random generating a number from 1 to 9 The author randomly draws a number between 1 and 9, checks if the number has already been drawn. If so, he keeps generating a random number until he gets a number that fits the needs. Here’s where the problem starts: the more numbers you have picked, the less chances there are going to be that your random generator is going to pick one of the numbers that has not been drawn yet. Take a look at the example on the right (an animated gif, opens in separate window): If the stars are aligned right and your computer is in a bad mood, it may just take a while to randomly generate those last numbers. Certainly, you could throw in a 8-core computer to speed up the random number generator but the problem will still be there. The programmer knew this too hence the reason for that ‘jailbreak condition’ (“After 100 attempts I think I should break it off otherwise it looks like the program has crashed”).

Randomly drawing numbers from 1 to 9The right way to do this is, by actually drawing these numbers from either a list or an array as shown in the animated GIF (click on the image on the left). This effectively means that your randomize Next routine needs to adjust dynamically after each draw: after all, every time you draw a number, the amount of available numbers decreases by one. There’s a minor catch here, but that’s up for you to figure out.

So: what’s the point of bringing this up? The Sudoku Peer-2-Peer application is a great showcase of the latest and greatest .Net technologies but fails horribly on the basics: using math to solve a complex problem. I do (for example) have more respect for this guy who threw in a genetic algorithm to solve the problem. This is overkill for sure because it can take up to 10 minutes to fill out a complete grid. At least he understands (and showcases) how genetic algorithms work.

Update (01/21/08): Related: Who killed the Software Engineer?

Posted in Programming | Tagged , , | Comments Off on Is there a statistician in the house?