In the programming world there are quite a few well understood and explored data structures. Which are commonly used in tons of applications, still the only things PHP offered till 5.3 in regards to structuring data were arrays (more precise: hash tables) and objects. So people had to either abuse them for other structures or implement the structures themselves on top of these. Thanks to Etienne things now are changing and PHP's Standard PHP Library (SPL) extension will offer quite a few standard implementations of data structures. The implemented data structures are implemented using these classes:
* SplDoublyLinkedList
* SplStack
* SplQueue (SplPriorityQueue)
* SplHeap (SplMinHeap, SplMaxHeap)
* SplFixedArray
For more details head over at http://schlueters.de/blog/archives/90-Data-structures-in-PHP-5.3.html
Tuesday, December 23, 2008
Wednesday, December 17, 2008
Usage of IF condition in mysql
Scenario:
Suppose we have the field in the table lets say status which has the ENUM value ACTIVE,INACTIVE.Usually after getting the value of this field(through the query)
we used to write return ($result['status']=='ACTIVE')?1:0 in class methods.
Here we are getting the db result array and based on the check(ACTIVE/INACTIVE) we are returning the boolean value.Instead of that we can have that check in the query itself like below
SELECT IF(status='ACTIVE',1,0) AS statuscheck from table1
Note that in the condition we need to give single equal symbol
so the code return ($result['status']=='ACTIVE')?1:0 will be replaced by return $result['statuscheck'].
Suppose we have the field in the table lets say status which has the ENUM value ACTIVE,INACTIVE.Usually after getting the value of this field(through the query)
we used to write return ($result['status']=='ACTIVE')?
Here we are getting the db result array and based on the check(ACTIVE/INACTIVE) we are returning the boolean value.Instead of that we can have that check in the query itself like below
SELECT IF(status='ACTIVE',1,0) AS statuscheck from table1
Note that in the condition we need to give single equal symbol
so the code return ($result['status']=='ACTIVE')?
Tuesday, December 16, 2008
Google Turns its Back on Firefox
About a month ago, Google dropped StarOffice from the Google Pack, a downloadable package of free Internet and productivity software for Windows users. StarOffice is a desktop office suite based on the open source OpenOffice.org program and distribute by Sun, and we theorized that Google was laying the ground work for a future push to get users to dump their desktop software in favor of Google’s own web-based application offerings.
For more details head over at http://www.sitepoint.com/blogs/2008/12/15/google-turns-its-back-on-firefox/
For more details head over at http://www.sitepoint.com/blogs/2008/12/15/google-turns-its-back-on-firefox/
Friday, December 12, 2008
CodeIgniter - Open source PHP web application framework
For more details check it in http://roshanbh.com.np/2008/12/codeigniter-programmer-php.html
Monday, December 1, 2008
Introduction To Xajax
The Xajax library provides a useful and simple method of generating asynchronous requests with next to not knowledge of javascript. All the javascript code is generated internally and leaves the developer to simply implement PHP functions. This tutorials is an absolute basic beginners guide to getting started with xajax. Full source code is provided with an explaination of how the process works.
More details on this, check it on http://www.phpro.org/tutorials/Introduction-To-Xajax.html
More details on this, check it on http://www.phpro.org/tutorials/Introduction-To-Xajax.html
Subscribe to:
Posts (Atom)