CakePHP is a good PHP MVC framework. You can study it easily and start developing web sites very fast. But it has some disadvantages, of course. One of them is strange rules for transformation variable name when it set in the controller. Statement
$my_var = 'Hello world!';
$this->set('my_var', $my_var);
will make the variable $my_var accessible in your view:
<?php echo $my_var; ?>
The phrase ‘Hello world!’ should appear on the web page. But if the same operation is done using function compact, the result is not predictable:
$my_var = 'Hello world!';
$this->set(compact('my_var'));
Instead of ‘Hello world!’ you’ll see the warning about undefined variable on your web page. It happens because cakePHP removes underscore and makes letter, followed by it, capital. So, instead of $my_var you should use $myVar in the view:
<?php echo $myVar; ?>
Note that this bug appears in the cakePHP version 1.2. It’s already fixed in the 1.3.
There are two ways (at least) to rebuild Ubuntu package from the source.
Using Ubuntu diff file and dpkg-buildpackage
Using .dsc file and debuild
In both cases the development packages should be installed first:
sudo apt-get install build-essential devscripts
Bluetooth handset Plantronics Discovery 925 can be a really good Christmas present for web workers. It’s stylish and elegant. The headset offers a hight quality voice and adaptive noise reduction. But the most interesting feature in my mind is ability to connect to the mobile and PC in the same time. So, you can make mobile or Skype call using one headset.
The handset Plantronics Discovery 925 is available in black, gold, cerise, royal blush and majectic purple colors. So, it’ll suit both men and women. Its price an expensive a bit – $149.95, but it’s good investments.
If I’d travel a lot I’d buy the ACER Aspire 1410 notebook. It looks like netbook and costs the same. But instead of Atom processor it’s equiped with stronger Intel Celeron. The rest spec includes 11.6-inch LCD display with 1366 x 768 resolution, GMA 4500MHD graphics, a 6-cell battery, 250 GB hard drive, and up to 4GB of RAM. The Acer Aspire 1410 offers a bunch of communication options – 802.11b/g/Draft-N Wi-Fi, Bluetooth, Gigabit Ethernet. Additionally it sports HDMI out (can be connected to the TV in hotel), integrated webcam (video chat with family, relatives and friends), 5-in-1 card reader and Dolby-optimized surround sound system with two built-in stereo speakers (have relax after meeting). It just misses optical drive but it isn’t so big deal I think.
The wight of the the Acer Aspire 1410 is just 1.35 kg, battery life is up to 6 hours and the price is €383. All of this makes that notebook the perfect choice for web workers who should travel a lot.
I just released a fresh version of IMDB::Film module to grub movie metadata from IMDB.com. There is not any new functionality in that release. Just bug fixes:
- fixed issue with plot retrieving;
- fixed retrieving of movie plot keywords;
- fixed parsing rating and top 250 or bottom 100 movie property;
- fixed issue with parsing AKA movie property;
- fixed bug with getting movie ID from cached paged;
- updated tests.
Many thanks for all who sent me bug-reports and patches. Grab that version and let me know if you find some problems there.
Thanks to Content Tabs now it’s possible to add into Thunderbird 3 some useful for you web tools. Here is a receipt from Quetzalcoatal how to integrate Google Wave in the Thunderbird 3. It’ll help to open Wave cleanly and conveniently inside one of tabs, and even keeps it open after restarting of Thunderbird.
[via Lifehacker]
I have two versions of LinuxMCE on my HTPC – stable 0710 and developer 0810. The 0810 was installed after 0710. So, the GRUB bootloader was placed on 0810 partition. A few days ago I decided re-install 0810 from the scratch and I deleted its partition including GRUB booloader. As result I couldn’t boot 0710 anymore. Thanks to GRUB power and flexibility I was able to fix that problem and watch Champions League
The solution is simple and clear: boot from any LiveCD, drop terminal and type following command there:
sudo grub
>root (hd0,0)
>setup (hd0)
That’s it. After booting from HDD the GRUB menu was found again.
To log Mysql console session use option –tee (two dashes!) with full path to the log file:
mysql -uroot my_db –tee=/tmp/mysql_console.log
As result the file /tmp/mysql_console.log will contains all commands and queries with result of their executions. That might be helpful to keep your queries for using next time or for troubleshooting.
The author of the post, where I found that useful info, said that each time the Mysql session is started with logging the log file will be replaced. In my case it isn’t. As I expected the new messages just are appended to the log file.