Archive for February 2009

Meningkatkan Leadership Skill

February 27, 2009

Beberapa langkah yang dpt digunakan untuk meningkatkan kemampuan memimpin : 1. self-esteem Orang akan memiliki keinginan bekerja yang tinggi apabila ia merasa dianggap penting. Untuk itu, seorang pemimpin harus mampu membuat pegawainya memiliki self-esteem yang baik. Pemimpin harus mampu membuat karyawannya merasa penting dengan berbagai cara, spt : memberi pujian, tepukan pada bahu untuk kerja [...]

10 PHP Mistakes

February 27, 2009

1. Single quotes, double quotes # $howdy = ‘everyone’; # $foo = ‘hello $howdy’; # $bar = “hello $howdy”; $foo outputs to “hello $howdy” and $bar gives us “hello everyone”. That’s one less step that PHP has to process. It’s a small change that can make significant gains in the performance of the code. 2. [...]

PHP Benchmark

February 27, 2009

1. For-loop test Cth. “for ($i=0; $i<$size; $i++)”  dibandingkan “for ($i=0; $i<sizeOf($x); $i++)” loop 1000 x, With pre calc – count()                               Total time: 117 µs Without pre calc – count()                           Total time: 49465 µs With pre calc – sizeof()                               Total time: 117 µs Without pre calc – sizeof()                           Total time: 48491 µs 2. Menggunakan [...]

Contoh script membaca file import (txt file)

February 20, 2009

<? /* File ini akan mengambil text files dan menampilkannya di layar */ if ($_POST[Submit]==”Import”) { $fd = fopen($_FILES["userfile"]["tmp_name"],”r”); while (!feof($fd)) { $buffer     = fgets($fd, 4096); $tmp_data    = split(“\t”, $buffer); for ($i=0; $i<count($tmp_data); $i++) { echo $tmp_data[$i].” – “; } echo “<br>”; } } ?> <form enctype=”multipart/form-data” method=”post”> <table> <tr> <td>Nama File </td> <td><input [...]

Follow

Get every new post delivered to your Inbox.