Last week I was struggling to find an easy way to simulate a troubled *Data Node* (ndbd process) using MySQL Cluster. It’s as simple as pancackes: using the kill command! To freeze a process you just need to kill the process using the SIGSTOP signal. To let the processes continue, use SIGCONT. Here’s an example shell script showing how you would use these two signals on a data node:
MobileMe is still useless
Today I tried MobileMe again registring for the 60-day trial. I cancelled it 15 minutes later. Expensive and useless. If you ask 99 EUR per year for a service, you would imagine a personal domain for your e-mail. But no, Apple thinks it’s doing it correctly, but it’s laughable. I’m sure they don’t lack the tallent to do it, just the balls at management level. Lets hope Apple puts it in soon, I might consider paying for it.
Simulating server-side cursors with MySQL Connector/Python
Last week, my colleague Massimo and I discussed how to handle big result sets coming from MySQL in Python. The problem is that MySQL doesn’t support server-side cursors, so you need to select everything and then read it. You can do it either buffered or not. MySQL Connector/Python defaults to non-buffered, meaning that you need to fetch all rows after issuing a SELECT
statement. You can also turn on the buffering, mimicking what MySQL for Python (MySQLdb) does.
Multiple result sets in MySQL Connector/Python
Latest code of MySQL Connector/Python on launchpad has support for multiple result sets when you execute a stored procedure. We also changed the way the actual result of the routine is returned to conform to PEP249. Here is some example code: it creates a stored procedure which generates 2 result sets. You can get the result by calling next_resultset(), which is returning a MySQLCursorBuffered. cur = cnx.cursor() cur.execute("DROP PROCEDURE IF EXISTS multi") proc = """ CREATE PROCEDURE multi(IN pFac1 INT, IN pFac2 INT, OUT pProd INT) BEGIN SELECT 1,'a' as FooBar; SELECT 2; SET pProd := pFac1 * pFac2; END""" cur.
The wrapped jumbo prawns
The USA is not particulary famous for its cuisine. I must admit that it has been quite good the past 10 days. The Angus Burger at Hyatt, with mushrooms? Yummy! Today I saw KFC advertising a new sandwish. All chicken, with cheese, with bacon in the middle. That’s right: bacon. This evening I went for pasta at the restaurant. I started with chowder, which was great. Then the entree (maindish in US, go figure).