Philippe Back Interviews Nicolas Petton on Amber #Smalltalk

Google IO 2013 #io13 – Voice dictation and Chrome Android convergence.

Google IO logo Yesterday I was attending the Google IO event. Pretty interesting. Now I've been using some of the technologies that were presented. I am a pretty heavy user of Google applications and find them quite useful but they're still in need of more integration. I'm pretty sure convergence between Android on Google Chrome is the key for an advanced user experience. There's nothing as a single form factor that will please or be suitable for all needs and use cases.. I'm now sitting in front of a 24 inch monitor, there is also a 10 inch tablet and this 4.5 inch mobile phone (Galaxy s2 plus, why mention Samsung anymore, they are Android phones). Obviously you can do much more with some real screen estate than with any phone but the phone proved to be quite a reactive to capture events whereas the bigger boxes are useful for creating interesting deeper content. Mobes are useful to capture moments and record stuff. For exchanges and for crafting content in communityies these things are really useful. Still, my concern is that you need to learn and try these things. It is not sure that this provides you with a productivity boost because all the time your gain from using the tools if offset by the time you need to learn them. Just because of the nerve wrecking rate of change that is pushed pushed pushed on you. One cannot use all of the these things. I'm trying to type this by using the Chrome Speech API. Something like that is pretty neat but its not integrated so I have to go to a for a dictation application and copy paste in Google Drive, switch the language in Chrome to get it working well. I actually do know what to do to get it to work. But is anyone going through all of these moves to get things working? That’s a pretty wide chasm to cross if you ask me. So, I am now in the process of digesting all those new ideas and products. I wonder how they do monetize all of this as there wasn’t that much about ad placement. It is strange to me as Google is making money that way. What I saw was more competition kill moves. I am curious to know more about their strategy behind the scenes. One thing is clear, competition heats up for Google too. 2013 will for sure be very interesting to watch. Speaking of which, you can follow sessions at the live stream

Logging MySQL queries with MySQLProxy

In need of viewing what went on the wire

I have been struggling with figuring out why something was wrong in my SQL queries. I needed to see what was happening in real time and also keep a little log of things. My MySQL server has the logging enabled, slow queries and all. It even logs to TABLE. But this wasn't doing the trick.


Enters MySQLProxy. MySQLProxy mediates between your client app and the MySQL server (or servers, consolidating a bunch of servers into one, along with the ability to set a bunch of them as read sources, and another as a write source -- which for scaling appears pretty smart). More on the scalability ability for another time. What I wanted is to log the traffic.

Getting MySQLProxy

Easily enough, get it. I installed 0.8.3-Win32 as my dev box is a Windows 7 system (64bit).

Configuring MySQLProxy

First of all, MySQLProxy will listen by default to port 4040 and forward to 3306, the ususal MySQL port. What needs to be done is to provide the host details as a place for the thing to log its technical output (to figure out what goes wrong). I wrote a script for handling the startup: runmysqlproxy.cmd
set MYSQLPROXY_HOME=%programfiles(x86)%\MySQL\mysql-proxy-0.8.3-win32-x86
set MYSQLPROXY=%MYSQLPROXY_HOME%\bin\mysql-proxy.exe

"%MYSQLPROXY%" -b --log-file=E:\var\logproxy.log 
    --log-level=debug --proxy-lua-script=D:\Dev\tools\sqlproxy\logquery.lua

Logging queries

It happens that MySQLProxy can do pretty much everything you can dream with queries that do pass through. Okay, I just wanted to log queries to a file. How to? Lua scripting to the rescue! That's why logquery.lua is for. Let's check it out:
function read_query(packet)
   if string.byte(packet) == proxy.COM_QUERY then
     query = string.sub(packet, 2)

 function log_query(query)
 output = .. ";QUERY;" .. query
 local file ="E:\\var\\mysqlproxy\\queries.log", "a")
 file:write(output .. "\n")
I really never coded anything with Lua but it for sure will happen due to the power of that proxy.

Connecting to the proxy

Just a matter of using the mysql command line client (with my very secure credentials...):
mysql -hlocalhost -P4040 -uroot -proot
And then issue some queries. These are captured:
02/21/13 23:45:11;QUERY;SELECT DATABASE()
02/21/13 23:45:23;QUERY;select * from tiki_todo
And the file filled in. Hope it will help you get started with MySQLProxy.

Going further

There is quite a bunch of possibilities as you can see from the scripting reference. Happy MySQLProxying!

Kicking back into gear

Long time no see on this blog. Well, I've been cutting on the internet frenzy for a while in order to focus. Yesterday, I discussed just that with Markus Denker (Pharo Smalltalk engineer with a very impressive ability to deliver). His idea is to allow himself a trip to the usual internet timesinks (e.g. Facebook, Twitter G+, news sites, hackernews) only from his tablet. And when doing so, creating a physical change. I believe that it works. We need time to focus on complex issues and it is not by browsing that it can be done.

L’intelligence Stratégique – Prolongation #aisbe

Voici une interview qu'à bien voulu m'accorder Marina Aubert d'Orchestraaa à la Rue du Web. Trente cinq minutes de réflexions, d'échanges sur le thème, ainsi que des prolongations sur la culture d'entreprise.  

Download Episode

Stop it! Or you’ll end up buried in a box!

You wouldn't believe the number of people who do not understand this the first time they hear them.