Return of the Browser Wars… Literally

28 April 2006

Return of the Browser Wars… Literally in Monkey Bites (Wired) by michael calore.
So here is a new way to improve browser interoperability and standards : by reducing the number of tthe most used browser : http://explorerdestroyer.com/. Obviously it is a twisted way and really isn’t the “main” way, which is in the hand of the users. You just can use one of the non-most-used browser and send an email complaining to each site the isn’t standard compliant. That would change things, but few users do that.


Roundtrip dump MySQL and UTF-8

21 April 2006

The tables can be in CHARSET=latin1 or utf8 whatever.

– mysqldump export an UTF-8 encoded file. UTF8 is the default. (You could change it with option –default-character-set=.)

First of, don’t loose the encoding by editing the file with a non-UTF-8 editor.

The main problem comes when you inject the dump into MySQL.
– The documentation states that : “When a client connects to a MySQL server, the server indicates to the client what the server’s default character set is. The client switches to this character set for this connection.” (http://dev.mysql.com/doc/refman/4.1/en/character-sets.html)

But in fact :
mysql -h 1.2.3.4 -uroot
Your MySQL connection ... to server version: 4.1.18
mysql> show variables like "%character_set%";
| character_set_client | latin1
| character_set_connection | latin1
| character_set_database | utf8
| character_set_results | latin1
| character_set_server | utf8
| character_set_system | utf8

You have to state UTF8 :
mysql -h 1.2.3.4 -uroot --default-character-set=utf8
Your MySQL connection ... to server version: 4.1.18
mysql> show variables like "%character_set%";
| character_set_client | utf8
| character_set_connection | utf8
| character_set_database | utf8
| character_set_results | utf8
| character_set_server | utf8
| character_set_system | utf8

There is a danger with the pipe in mysql ... .
Check that your locale are UTF8. Eventually uses mysql -e "source dump.sql".


PostgreSQL grant limitations

21 April 2006

User management is very different in MySQL and PostgreSQL.
Generaly, PostgreSQL is superior (groups, no host dependencies …) But there is a really annoying point : you can’t grant rights on all the table in a schema !

For example you grant select on table Tone, Ttwo, Tthree TO Joe; OK Latter, you add a table “Tfor”. You will have to grant select on table Tfor to Joe;
The only solution to automate this would be to run a cron job every hours to add the missing rights !
In MySQL you simply grant SELECT on schema.* to Joe; Ok, maybe it isn’t ANSI SQL, but so usefull !

At least there are some scripts you can run to setup the right on many tables at once :

And here is an old thread about potential solutions : pgsql-hackers 2005


Why Rigorous Processes, Specifications and Estimations are a Waste of Time

16 April 2006

Can’t agree more. Heavy weight process (CMMI and the likes) aren’t the right tools for every kind of development. The point is that SSII just sells what they have : for somes it is CMMI ,for others it will be agile methods.
Sometimes, you must just admit that you don’t know because it has never been done and it would cost you to do the work to know how much it would cost … if it is possible. Sometimes, the client itself brings more surprise than the technical constraints.
Why Rigorous Processes, Specifications and Estimations are a Waste of Time
by Carlos E. Perez in Manageability


Apache documentation

11 April 2006

I found a nice PDF (100p) 2004-10-29 describing the Apache HTTP Server with many schema.

This web site offers results of the Apache Modeling Project. In this Project, research assistants and students of the Hasso-Plattner-Institute (HPI) have examined, modeled and documented the Apache HTTP Server.

I am still not convinced that FMC is more usefull than UML to describe high level concepts. But anyway, it is a great document.


Connection pooling with PHP : a growing problem ?

11 April 2006

I never realize that PHP has no connection pooling to Database. But that is a fact : it just open and closes the connection each time a user hit a page. (There are “persistent connection” but they really are a poor workaround, generally bringing more problems.)

The problem is that traditionnaly, PHP is used for “read-more, write-less” kind of application. Meaning MySQL/MyISAM whithout transaction support. In this case, the connection cost is low and you doesn’t notice it.

But as PHP is more widely used (IBM, Oracle), people begin to connect to, for example, Oracle wich is another beast :

eg: every single connection takes up 5MB in NT4 for Oracle 8i 816

This old (2002) PHP’s Creator, Rasmus Lerdorf interview tells why it hasn’t been done :

A pool of connections has to be owned by a single process. Since most people use the Apache Web server, which is a multi-process pre-forking server, there is simply no way that PHP can do this connection pooling …
If/when the common architecture for PHP is a single-process multithreaded Web server, we might consider putting this functionality into PHP itself, but until that day it really doesn’t make much sense. Even Apache 2 is still going to be a multi-process server with each process being able to carry multiple threads. So we could potentially have a pool of connections in each process.

There are solution :

  • SQL Relay is a persistent database connection pooling, proxying and load balancing system for Unix and Linux.
  • pgpool For PostgreSQL on Linux only. Note : his benchmark isn’t very encouraging.
  • Apache DBD API : the mod_dbd module
  • ODBC has connection pooling integrated.
  • steve roussey
  • memcached is a high-performance, distributed memory object caching system, intended for use in speeding up dynamic web applications by alleviating database load.

Final point is : where are the benchmarks !?
How to mesure and monitor the number of connections, the cost of a connection ?


OSX productivity tool : Automator

10 April 2006

Automator iconI recently discovered a great tool on Mac OSX : Automator. It has a nice icon and is really simple and usefull !
It allows you to create a program using mostly your mouse and actions provided by applications.
So you can easily create a (or download an existing) program (they call it workflow) to :

  • Send your iCal on a FTP server
  • Go to a web page, get the text, speak it, send it to you iTune/iPod

And there are many actions and workflow available : like the very usefull Upload to FTP from Automator World.