MySQL does not support create user if not exists syntax as it does with create table and create procedure. This is pretty weird, as it just boils down to checking whether single row exists in the `mysql`.`user` table.
I encountered this today, and it took me some time to figure out what’s going on, as the behavior was so strange it shut off my reasoning.
Often “in the wild”, even in English texts, you meet both accented versions and non-accented versions of certain words, such as brand names.
You’re then facing two options – you can either work with both versions, or get rid of accents. The latter option bears advantage of cutting down the dimensionality of the problem, as you don’t need to presume that you support all existing versions of the spelling, but how to get there?
Quite annoyingly, I was unable to disable touchpad on laptop through the dedicated fn combination. Bit of googling brought results fast, here’s a simple script I use now for switching on and off.
After years of using VMWare, I suddenly had to migrate to VirtualBox; I’ve been using VirtualBox for quite some time now, but not in the way I use VMWare.
First I thought it will be a short-lived trip, but now I’m happily stuck. I still had the image of VBox the way it was in the version 1.x in the head. What a blow it was to fully explore 4.x, in my case 4.0.6!
Here are few optimization techniques that were handy to me recently; they mostly concern 2D graphics programming, where these patterns often emerge, but are helpful anywhere where you have to iterate and update data.
- don’t do if‘s
- map all you can
- don’t float
- cache your reads
I always forget this, thought it’s trivial.
To change the program you use for diff-ing, for editing of the commit logs, and much more, edit the ~/.subversion/config file, e.g.
editor-cmd = vim diff-cmd = meld
The file is well commented, so you should find your way around it easily.
Note: with update to Ubuntu 11.04, meld stopped to work as an SVN diff program for me (seems like support for ‘-v’ parameter has been dropped); this can be solved easily – just create a new script, e.g. /usr/bin/svnmeld containing:
#!/bin/bash meld "$6" "$7"
then chmod it as executable, and use diff-cmd = svnmeld in your SVN config file.