Beware with flags!!

Você pode ler este post em português também. Hello! The first article of this year talks about data modeling. A situation that makes me angry for years is when you have attributes that work as flags inside tables. Think twice (or maybe three times) before create them because usually, they are unnecessary. And why? We create them to mark a state of a record, which can be done, many times, querying another attributes, generating duplicity situations (so much problematic, per si). Let’s see examples: mysql> SELECT - FROM tb\_orders LIMIT 5; +------------ ... +--------------+------------ ... +----------------+ | order\_id ... | sent\_method | sent\_date .

READ MORE

How to be a good IT professional

Você pode ver este post em português também. I’ll continue below this post of Elton Luís Minetto, complementing your ideas about everything I learned on IT environments. Here we go: Graduate yourself. I know people that leave the graduation behind and are going well, and I can garantee that this kind of people is rare. Different from @eminetto, I joined to the graduation at 2004 with some experience on IT (I started at 1997). And even tought the graduation expanded (better, it did try and applied) knowledge on fields which I had never heard before, and it was really valuable;

READ MORE

Load Balancing with DNS

Você pode ler este post em português também. Hello! The article of this month will show how is easy to balance the load of an application using your DNS. However, you must be able to do the following actions: Take from your web server the responsibility of storing the session data of your application; To have access to the DNS server that holds the records of your domain; To have more than one web server to holds the requests (obvious, but it’s good to say…). If your application is written in PHP, you can treat the first item above trough the session_set_save_handler.

READ MORE

MySQL: Copy only the structure of table

Você pode ler este post em português também. Hello! Last month I had to copy the structure of a table to a new one. More than two people were surprised with the way and ease which I did it, so I decided to post it here instead of another performance comparison inside PHP. Below is an example. Enjoy and feel free to share ideas about it. [arglbr@t64 ~]$ mysql -AD test Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 20 Server version: 5.1.47 Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

READ MORE

Excel/Calc workbook generator with PHP

Você pode ler este post em português também. I wrote a interesting function: Execute it with a given filename and an array in this format: Array ( [plan1] => Array ( [0] => Array ( [id] => 1, [name] => Adriano ), [1] => Array ( [id] => 2, [name] => Rodrigo ), [2] => Array ( [id] => 3, [name] => Manoel ) ) ) And the response will be: Cool! It’s a generic function, so you can use it with your helper class/functions, etc. This function use the Spreadsheet_Excel_Writer class from PEAR. The source code you can get in Github here, so you can be notified about updates.

READ MORE