October 30, 2007 § Leave a comment
Changes in php.ini:
- Around line:416: uncomment error_log variable, and assign it to your prefered logfile.txt. For example, on Windows box: error_log = “C:\log.txt”. Beware: make sure that PHP has permission to modify the log file on *NIX system.
- If you want to NOT displaying PHP error on the screen: Around line 360, make sure that: display_errors = off
Grunt work required to make sure that things are logged properly:
use if block:
//call this system function
error_log(‘the message why this is bad’);
use try catch:
//do something that’s possibly bad
error_log(‘Exception thrown: ‘.$e->getMessage());
October 11, 2007 § 1 Comment
What is setTimeout():
setTimeout(“do.something();”, 1000); //Execute do.something() 1 second later.
What is setInterval():
setInterval(“do.somethingElse();”, 2000); //Execute do.somethingElse() every 2 seconds.
Use clearTimeout() to cancel setTimeout(). Similarly, clearInterval() is used to cancel setInterval().
When calling “this” inside setTimeout() or setInterval(), it refers to window(global) as opposed to the object you are calling the function from.
July 30, 2007 § 1 Comment
is almost here.
David Golding is the author, and here is his announcement about it.
Update: December 29th, 2007
Couple of the chapters are available here.
There’s also discussion forum about the book.
If you cannot wait to get started on CakePHP, see Resources below:
July 30, 2007 § Leave a comment
July 30, 2007 § 2 Comments
In my previous post (here), I promised you about performance of Zend Framework.
Unfortunately, I cannot give you the result yet. Because it is still work in progress.
So here is the low-down:
First of all, I’m researching (learning) about Zend_Cache, which consist front_end and back_end. Don’t worry about the mumbo jumbo just yet. The front_end is nothing more than helper functions that can help you optimized specific parts of your application code. The back_end utilize different types of medium Zend Framework use (as of version 1.0, there are 5 different choices of storage: filesystem, APC, SQLite, memcache, or ZendPlatform). ZendPlatform is not free.
The plan is to implement caching and run stress/load testing on both before and after-cache. Then I can publish the result here.
Currently, the front_end confuses me on how to utilize it… It promotes sloppy code. Or is it me not finding the good tutorial online?
Here is an example from Zend_Cache_Frontend_Output (<– it’s 1 of 4 front_end Cache objects):
(assuming $cache object has been initialized using the factory pattern)
[you block of PHP code]
How in the world does this promote elegance? I supposed it should be fine if I enforce its usage strictly on View pages. But still…
Another thought would be to cache all public functions inside model classes using Zend_Cache_Frontend_Function. It’s the cleanest, most seperated (because hidden inside model classes), & has the highest impact (because of caching database calls made by the functions).
(Brain starts steaming up…)
So now y’all know why I’m so late in giving the performance report. Stay tuned for more tips on how make your Zend application… “enterprise-level”
July 10, 2007 § Leave a comment
As it is similar to almost many other languages,
== checks the equality of values on both sides.
While === checks the equality of values as well as data type on both sides.
null == undefined is True, but
null === undefined is False.
July 6, 2007 § Leave a comment
What it is not:
It is not Prototype Library (Toolkits for applying various DHTML effects)
What is it?
Why is it useful?
For example, If your object is called robot, then robot.prototype would contain var head, var limbs, var body, etc. etc.
May 23, 2007 § Leave a comment
When coding with new language, unfamiliar syntax & API might frustrates you a lot.
That’s what I felt with Python, thus to familiarize myself, I’ve compiled list of online resources that I (or readers) can download or read online.
- Data Structures and Algorithms with Object-Oriented Design Patterns in Python
- A Byte of Python
- Dive Into Python
May 16, 2007 § Leave a comment
April 22, 2007 § Leave a comment
Below are blogs, tutorials, and articles that help me configuring OS X to be the ultimate web development machine:
- Before doing anything, first execute command: “periodic weekly”. This allows you to use “locate” command.
- Fink! Before installing your favorite Linux tools/packages, get this one first. This app contains apt-get and much more.
- While you are installing Fink, why not FinkCommander?
- This guy presents dead-on tutorial on how to install Apache, MySQL, & PHP.
- This is my take on how to install Apache2 & PHP5.
- This guy shares us the joy of Python via this easy, breeze, beautiful blog.
- In case you have amnesia, or simply didn’t know SVN… Read this!
- What about Text Editor you say?
More is coming up, if only I could find some of yesterday’s online tutorials (del.icio.us hasn’t solved my problem yet).