Archive pour la catégorie 'English'

Jeremy Zawodny on the New MySQL Landscape

Lundi 8 décembre 2008

The single most interesting and surprising thing to me is both the number and necessity of third-party patches for enhancing various aspects of MySQL and InnoDB. Companies like Percona, Google, Proven Scaling, Prime Base Technologies, and Open Query.

One the one hand, it’s excellent validation of the Open Source model. Thanks to reasonable licensing, companies other than Sun/MySQL are able to enhance and fix the software and give their changes back to the world.

Some organizations are providing just patches. Others, like Percona are providing their own binaries–effectively forks of MySQL/InnoDB. Taking things a step further, the OurDelta project aims to aggregate these third party patches and provide source and binaries for various platforms. In essences, you can get a « better » MySQL than the one Sun/MySQL gives you today. For free.

Jeremy Zawodny: The New MySQL Landscape

Ouch…

Lundi 8 décembre 2008


For all Stephen Harper’s handiwork, the performance of Stéphane Dion, who must resign now, was worse. The Liberals had the government on the run. They let the occasion pass them by – and won’t get another chance like it.

Through their ineptitude, they brought Gilles Duceppe, having said he wasn’t a coalition member, to the coalition-signing agreement.

For a critical national TV broadcast, they brought in an embarrassing video of their dazed leader. They kept star player Michael Ignatieff in the shadows. They let Stephen Harper set the terms of the debate.

In the Commons they were pitiful. When it was apparent that Mr. Harper would break his vote promise and cut and run to the Governor-General for mercy, they could have had him. Like the Conservatives who used most every question in the House to lambaste a separatist coalition, they should have used every question to label Mr. Harper a coward, a leader too scared to face the music, a leader who was indeed about to dip into Third World tactics – going beyond even his own dirty-tricks handbook – and shut down Parliament. They could have had him so embarrassed by week’s end that he would have looked shameful in running off, tail between his legs, to Rideau Hall.

Lawrence Martin: Our Robert Mugabe moment, and other unpleasant memories, theglobeandmail.com

PHP5: SimpleXML and xpath: What You See Is Not What You Get

Jeudi 2 octobre 2008

This is something that took me a while to figure out. The problem is related to the way SimpleXML handle a second xpath query made against the result of a first xpath query. Simply put, what happens is that if you do keep the result of a first xpath query, and then, you do another xpath query against this result, the second xpath query will not be made against this subset, but against the whole XML tree.

Here’s a simple example to illustrate what I’m trying to convey. Please consider this example of an illustration of the problem, and not as the best way to use a xpath query.

The XML Snippet

<?xml version="1.0" encoding="UTF-8"?>
<world>
  <continent name='Europe'>
    <country name='France'>Paris</country>
    <country name='United Kingdom'>London</country>
  </continent>
  <continent name='North America'>
    <country name='Canada'>Ottawa</country>
    <country name='United States'>Washington</country>
  </continent>
</world>

First, I know that there are more continents than Europe and North America :) .

What I want to do is:

1. Make an xpath query to get a result set for continent,

2. And then loop in this result set to get the result set country for each country.

The first iteration of the code will go like this:

$xml          = simplexml_load_string ($xmlstring);
$continents   = $xml->xpath ('//continent');

foreach ($continents as $continent) {
  $countries = $continent->xpath ('//country');
  var_dump ($countries);
}

If you do this way, the xpath query will not be against the result set $continents, but against the whole XML tree. What that means is that instead of having a listing of country by continent, you will get all the countries for all the continents two times.

To get only the countries by continent, what you have to do is to deference again the result set for $continents.

$xml          = simplexml_load_string ($xmlstring);
$continents   = $xml->xpath ('//continent');

foreach ($continents as $continent) {
  $continent_deferenced = simplexml_load_string ($continent->asXML ());
  $countries = $continent_deferenced->xpath ('//country');
  var_dump ($countries);
}

Now you will get what you are looking for.

Here’s the same example code made more clearer.


$xmlstring = <<<END
<?xml version="1.0" encoding="UTF-8"?>
<world>
  <continent name='Europe'>
    <country name='France'>Paris</country>
    <country name='United Kingdom'>London</country>
  </continent>
  <continent name='North America'>
    <country name='Canada'>Ottawa</country>
    <country name='United States'>Washington</country>
  </continent>
</world>
END;

$deference_xml  = 0;

$xml          = simplexml_load_string ($xmlstring);
$continents   = $xml->xpath ('//continent');

$counter        = 0;
foreach ($continents as $continent) {
  $counter++;
  echo "--------------------------------\n";
  echo "Loop# $counter: " . $continent['name'] . "\n";
  echo "--------------------------------\n";
  echo "\n";

  if ($deference_xml) {
    echo "--------------------------------\n";
    echo "\$continent is deferenced\n";
    echo "--------------------------------\n";

    $continent_deferenced = simplexml_load_string ($continent->asXML ());
    $countries = $continent_deferenced->xpath ('//country');
  } else {
    echo "--------------------------------\n";
    echo "\$continent is NOT deferenced\n";
    echo "--------------------------------\n";

    $countries = $continent->xpath ('//country');
  }

  echo "--------------------------------\n";
  echo "\$continent->xpath('//country')\n";
  echo "--------------------------------\n";
  var_dump ($countries);

}

If you set the variable $deference_xml to 0, the xpath query will not be deferenced. So, you will get this result.

--------------------------------
Loop# 1: Europe
--------------------------------

--------------------------------
$continent is NOT deferenced
--------------------------------
--------------------------------
$continent->xpath('//country')
--------------------------------
array(4) {
  [0]=>
  object(SimpleXMLElement)#4 (2) {
    ["@attributes"]=>
    array(1) {
      ["name"]=>
      string(6) "France"
    }
    [0]=>
    string(5) "Paris"
  }
  [1]=>
  object(SimpleXMLElement)#5 (2) {
    ["@attributes"]=>
    array(1) {
      ["name"]=>
      string(14) "United Kingdom"
    }
    [0]=>
    string(6) "London"
  }
  [2]=>
  object(SimpleXMLElement)#6 (2) {
    ["@attributes"]=>
    array(1) {
      ["name"]=>
      string(6) "Canada"
    }
    [0]=>
    string(6) "Ottawa"
  }
  [3]=>
  object(SimpleXMLElement)#7 (2) {
    ["@attributes"]=>
    array(1) {
      ["name"]=>
      string(13) "United States"
    }
    [0]=>
    string(10) "Washington"
  }
}
--------------------------------
Loop# 2: North America
--------------------------------

--------------------------------
$continent is NOT deferenced
--------------------------------
--------------------------------
$continent->xpath('//country')
--------------------------------
array(4) {
  [0]=>
  object(SimpleXMLElement)#8 (2) {
    ["@attributes"]=>
    array(1) {
      ["name"]=>
      string(6) "France"
    }
    [0]=>
    string(5) "Paris"
  }
  [1]=>
  object(SimpleXMLElement)#9 (2) {
    ["@attributes"]=>
    array(1) {
      ["name"]=>
      string(14) "United Kingdom"
    }
    [0]=>
    string(6) "London"
  }
  [2]=>
  object(SimpleXMLElement)#10 (2) {
    ["@attributes"]=>
    array(1) {
      ["name"]=>
      string(6) "Canada"
    }
    [0]=>
    string(6) "Ottawa"
  }
  [3]=>
  object(SimpleXMLElement)#11 (2) {
    ["@attributes"]=>
    array(1) {
      ["name"]=>
      string(13) "United States"
    }
    [0]=>
    string(10) "Washington"
  }
}

If you set now the variable $deference_xml to 1, you will get what you expected.

--------------------------------
Loop# 1: Europe
--------------------------------

--------------------------------
$continent is deferenced
--------------------------------
--------------------------------
$continent->xpath('//country')
--------------------------------
array(2) {
  [0]=>
  object(SimpleXMLElement)#5 (2) {
    ["@attributes"]=>
    array(1) {
      ["name"]=>
      string(6) "France"
    }
    [0]=>
    string(5) "Paris"
  }
  [1]=>
  object(SimpleXMLElement)#6 (2) {
    ["@attributes"]=>
    array(1) {
      ["name"]=>
      string(14) "United Kingdom"
    }
    [0]=>
    string(6) "London"
  }
}
--------------------------------
Loop# 2: North America
--------------------------------

--------------------------------
$continent is deferenced
--------------------------------
--------------------------------
$continent->xpath('//country')
--------------------------------
array(2) {
  [0]=>
  object(SimpleXMLElement)#4 (2) {
    ["@attributes"]=>
    array(1) {
      ["name"]=>
      string(6) "Canada"
    }
    [0]=>
    string(6) "Ottawa"
  }
  [1]=>
  object(SimpleXMLElement)#8 (2) {
    ["@attributes"]=>
    array(1) {
      ["name"]=>
      string(13) "United States"
    }
    [0]=>
    string(10) "Washington"
  }
}

Interview of Evan Prodromou of identi.ca

Mercredi 24 septembre 2008

Fascinating interview from Phil Windley of ITConversations of Evan Prodomou which is the promoter of identi.ca, a twitter compatible platform. Beside identi.ca, what was quite interesting for me is the Laconica microblogging platform (PHP) which identi.ca is based upon. It appears that you can install this platform to start your own microblogging interface under your own domain, which can be a fine proposition under some circumstances. Last but not least, it seems that identi.ca is compatible with Twitterrific, a nice twitter client on OS X.

OpenDNS: Fast and Free

Lundi 25 février 2008

I recently came upon OpenDNS listening to the following podcast.

Technometria, Remaking DNS, ITConversations (MP3)

Basically, you use their DNS instead of the DNS provided by your ISP to get a faster resolving DNS service (i.e. your web pages will load faster). You are not obliged to create an account to use their service. But, if you do get an account, you will get some features like anti-phishing, typo correction in the domain names, filtering of adult sites, and stats. All these options are opt-in.

After using the DNS from OpenDNS, I have the feeling that my web pages load faster. Where clearly OpenDNS makes a tremendous difference is with SafariMobile on my iPod Touch when I’m home and using my wireless network.

OpenDNS use a very interesting business plan to makes money. Listen to the podcast to see how. They have Ray Ozzie as their principal investor, which is not a bad reference. They are already profitable.

I strongly recommend that you try the DNS provided by OpenDNS. It’s free, and if you just want to use their DNS, you are not obliged to sign for an account. What more can you ask for?

Changer le drapeau du Canada pour le drapeau Québécois sur la barre des menus d’OSX

Jeudi 7 février 2008

Je préfère nettement avoir un drapeau québécois plutôt qu’un drapeau canadien sur la barre des menus d’OSX.

barredesmenus.png

Michel Fortin propose une solution très simple. Il a créé un fichier pour les claviers canadiens-français (CSA) en remplaçant le drapeau canadien par le drapeau québécois. Je l’ai installé il y a quelques jours et ça semble bien fonctionner. Par contre, je recommande de redémarrer la session après l’installation du fichier créé par Michel (qui peut-être aussi installé dans le dossier de l’usager à ~/Bibliothèque/Keyboard Layouts/). Il semble que sur Léopard, le Finder et Path Finder prennent en compte cette modification qu’après avoir démarré une nouvelle session après l’installation du fichier.

Open Source Podcast with Christopher Lydon is Back

Jeudi 29 novembre 2007

After a couple of months of hiatus, the Open Source podcast with Christopher Lydon is back at their new home at the Watson Institute. That’s way cool! This is one of the best podcast that you can get on a range of subjects covering culture, politics and art.

A New Co-Working Space in Montreal

Mardi 27 novembre 2007

A Montreal coworking space cooperative is in the process of being established. The coworking space will be available in the Plateau or Villeray neighbourhood for Spring 2008.

To be kept informed of significant updates of the project, join our mailing list.

Our coworking space is:

  • somewhere to work productively
  • in a quiet, functional and cosy environment
  • with internet, printing and photocopy services included
  • and equipped conference and meeting rooms
  • somewhere to work alone or with others
  • and easily network
  • drink coffee and socialise
  • and attend activities and events organised by the coop members
  • an eco-oriented environment
  • that’s more funky than drab
  • equipped with lockers to store your things
  • that extend into the virtual world
  • all at at an entirely reasonable tax-deductible rate
  • with flexible memberships plans,
  • like at they gym, according to your specific needs.

Everyone is invited to participate.

  • Maybe you will be in need of a regular or occasional work space, in which case you might think about becoming a member and using the service when we open in Spring 2008.
  • But maybe you want to have a say in how the regulations will be set up, in which case you should come to the General Assembly on January 2008.
  • And then maybe you are a real keener and wish to join the working group of the cooperative in which case you would need to read our wiki (http://www.percolab.com/ecto) and attend the founding assembly on Thursday November 29th, 2007 at 1498 Marie-Anne east (corner Marie-Anne and Fabre) at 7:00 PM.
  • Don’t hesitate to forward this message to people you know who could be interested.

Looking forward to seeing you.

Coop ECTO workgroup

Denis Béliveau
Julie Benoit
Emmanuel Décarie
Yves Otis
Samantha Slade
Stéphane Volet

Matt Neuburg on Spotlight and Leopard

Vendredi 2 novembre 2007

This is an eyes opening introduction on Spotlight on Leopard. Matt Neuburg digs deep in Leopard to show you how to use it. I was on the verge on buying FileSpot, but after reading Matt, I might reconsider since I didn’t know how much better the Spotligh interface is on Leopard when you compare to Tiger. A must-read!

Matt Neuburg, Spotlight Strikes Back: In Leopard, It Works Great, TidBITS.com

I think I will check again FileSpot when the new version will come out. (I’m especially interested by the « Menu bar item with global hot-keys »).

NYT: 24 hours to convert 11 millions images to PDF

Jeudi 1 novembre 2007

Derek Gottfrid of the New York Times on how they converted 11 millions TIFF images of the NYT archives to PDF using Amazon EC2/S3 services.

I had been using Amazon S3 service for some time and was quite impressed. And in late 2006 I had begun playing with Amazon EC2. So the the basic idea I had was this: upload 4TB of source data into S3, write some code that would run on numerous EC2 instances to read the source data, create PDFs, and store the results back into S3. S3 would then be used to serve the PDFs to the general public. It all sounded pretty simple, and that is how I got the folks in charge to agree to such an idea — not to mention that Amazon S3/EC2 is pretty easy on the wallet.

Derek Gottfrid, Self-service, Prorated Super Computing Fun!, nytimes.com