The following AppleScript function renames a file. If you thought this to be a simple thing, try to write it without looking here below. I spend a lot time on this, I might not even use it, but here it is for other mortals wishing to lose weight exercising AppleScript: to renameFile(oldAlias, newFileName) tell application "Finder" set f to item (oldAlias as text) tell f set ext to its name extension set nFn to (newFileName & ".
MySQL Connector/Python and database pooling
MySQL Connector/Python is (or should be) compliant with the Python DB-API 2.0 specification. This means that you can use DBUtils’ PooledDB module to implement database connection pooling. Here below you’ll find an example which will output the connection ID of each connection requested through the pooling mechanism. from DBUtils.PooledDB import PooledDB import mysql.connector def main(): pool_size = 3 pool = PooledDB(mysql.connector, pool_size, database='test', user='root', host='127.0.0.1') cnx = [None,] * pool_size for i in xrange(0,pool_size): cnx[i] = pool.
Running MySQL Cluster without Arbitrator: don't, but if you have to..
This post explains how to disable Arbitration when using MySQL Cluster. It gives a case where this could be useful. First, a piece of advice: you do not want to run MySQL Cluster with arbitration disabled. But if you must, e.g. because of an oversight in your implementation, you can. Arbitration is very important in MySQL Cluster. It makes sure you don’t end up with a Split Brain situation: 2 halves working independently, continuing changing data, making it impossible for them to work together later on.
My first thurderstorm shooting
About 2 hours and more than 500 shots later I finally did it: I shot lighting! One needs patience, lots of nerves and luck. I didn’t readup on how to do it before, but in the end I pretty much figured it out. The full battery ran out, that much I was using the camera. Exposure time is not so important, especially when you are exposed to the light polution of the city.
Check how old your MySQL books are before usage
This is a friendly reminder to check the publication date and discussed version you MySQL books before starting out hacking or even posting about limitations. Lots of old books are still going around. Maybe it’s good to destroy them rather than giving them to students or newbies. Few days ago (28 May 2010), for example, we had a word-for-word copy of a book on a blog post (now removed) which was discussing MySQL Cluster limitations from years ago.