News Feed
Jobs Feed
Sections



Recent Jobs

News Archive
feed this:

Gonzalo Ayuso's Blog:
Populating datagrid techniques with PHP
July 19, 2011 @ 09:25:46

In a new post to his blog Gonzalo Ayuso looks at the code required to populate a jQuery data grid with the records as pulled from a (MySQL) database.

Today I want to speak about populating datagrid techniques with PHP. At least in my daily work datagrids and tabular data are very common, because of that I want to show two different techniques when populating datagrids with data from our database. Maybe it's obvious, but I want to show the differences.

He uses "old school spaghetti code" rather than a framework to keep things simple and pulls the data from the database with a PDO connection. This information is then manually pushed into an HTML table and the data grid functionality is applied to it. The other method involves a little bit of JSON magic that the data grid library pulls in and populates for you, still appending rows to a table.

He notes that the second method seems faster to the user since the page and table are rendered first, but it also comes at the cost of more than one HTTP request.

0 comments voice your opinion now!
datagrid jquery technique preload ajax json



Eran Galperin's Blog:
Database Optimization Techniques You Can Actually Use
March 28, 2011 @ 13:15:57

Eran Galperin has posted a few helpful tips (ones you can "actually use") for optimizing your database and how your application uses it.

I understand the need for simplicity because of the wide audience of Smashing Magazine, but I'd wish they'd give something more than the absolute basics you could find in almost any other site out there [in their recent tutorial]. I also didn't like some of the methods mentioned there for profiling (or the code itself), so I here is my starter guide to optimizing database performance.

Tips included in his post center around a different set of questions:

  • When should you optimize the database?
  • Think about profiling first, optimizing last
  • How EXPLAIN can find the big problems
  • When caching should be used

Some code is included, but only briefly since his point is more about the server than the client (script) side of things.

0 comments voice your opinion now!
database optimize technique explain cache profile


Rafael Dohms' Blog:
Problem Solving technique #1 Taking a mental break
February 07, 2011 @ 12:08:44

Rafael Dohms has posted a new tip for developers (and really anyone else that has to concentrate on mentally challenging tasks all day) that could sometime help you break through that wall you've hit in your code - take a mental break.

Developers are modern day artists whose masterpieces are not hung on walls but stretched out thin on web servers all over the world, yes that is very poetic, but I really try to look at developers as artists and puzzle solvers. [...] A different activity, to most its the simple act of going to get coffee or water, taking a stroll outside in the fresh air, some like sports, some like games.. everyone has their escape valve.

He gives an example of a friend (Chester) who, when he hit a mark he just couldn't pass, turned to a set of lego blocks to help clear his mind. The subconscious mind kicks in as you preoccupy the conscious and a lot of times the answer floats up to he top with little or no effort.

0 comments voice your opinion now!
problem solving technique mental break developer


Simas Toleikis' Blog:
PHP data caching techniques
December 13, 2010 @ 08:45:10

Simas Toleikis has posted some caching techniques he's come up with to handle a few different situations including simple file-level caching and working with memcached.

Caching intermediate data is the most primitive and yet the most rewarding optimization technique where you don't need to fiddle with any complex algorithms or premature optimizations. If you are into PHP you should be aware of all the best practices and the right tools for this job to make your websites fly.

He covers a few different, though common, situations you may come across in your application where caching could be very helpful:

  • Static scope variables
  • APC shared memory functions
  • Memcached for large distributed caches
  • In-memory database tables
  • Simple file-level caches
0 comments voice your opinion now!
caching technique situation apc memcache file memory


PHPClasses.org:
Lately in PHP Ep. 6 - Unusual Site Speedup Techniques, Named params & Annotations
November 01, 2010 @ 08:29:46

On the PHPClasses.org site today they've posted the latest episode in their "Lately in PHP" podcast series - "Unusual Site Speedup Techniques debate, Named parameters and Annotations".

In this episode, Manuel Lemos and Ernani Joppert discuss several unusual site speedup techniques presented in recent articles of the PHPClasses site blog. They also discuss the (non-)inclusion of new PHP features discussed by PHP core developers like having named parameters in function calls and the support of Java-like annotations in PHP code.

To listen you can either use the in-page player, grab it from iTunes or just download the mp3. Complete show notes and transcript are also included in the post.

0 comments voice your opinion now!
podcast latelyinphp speedup technique named parameter annotation


Sebastian Bergmann's Blog:
Testing Code That Uses Singletons
February 12, 2010 @ 11:28:45

Sebastian Bergmann has written up a post for his blog recently that looks at unit testing singletons, something that's been rumored as being some of the hardest to test.

I frequently quote Miško Hevery with "It is hard to test code that uses singletons." And then my audience asks me... Why is it hard to test code that uses singletons? Lets have a look at the default implementation of the Singleton design pattern in PHP.

He defines a singleton first, showing how it's used to create single instances of objects and, because of this, cannot be tested easily because there's no way to know you're getting a clean instance every time. Dependency injection can help with the problem by allowing you to pass in a "mock" instance of the singleton class each time. He also mentions some variations on singletons that could make it easier to test in the future.

0 comments voice your opinion now!
singleton unittest technique dependency injection


Brandon Savage's Blog:
Why Coding Tests Are A Bad Interview Technique
November 02, 2009 @ 19:59:47

Brandon Savage has a suggestion for those interviewing developers for positions at their company - forget the coding test.

One thing I've noticed in hunting for a job recently is the number of companies that insist that you write them a code sample to spec. Not just any code sample, but a fully functional, complete application. This is absurd, for several reasons.

He suggests that, while submitting example code or taking a test as a part of the interview process can be a "first line" to be sure the person knows the language, they shouldn't be considered useful much beyond that. He likens it to people in other trades (like a plumber or electrician) to do their job before they can do their job...for you. Brandon suggests that the real key to a developer - how well they can learn - just can't be measured by a test like this.

0 comments voice your opinion now!
coding test interview technique opinion


PHPBuilder.com:
The ABC's of PHP Part 3 - Basic Script Building in PHP
March 26, 2009 @ 07:56:40

PHPBuilder.com has posted the next article in their "ABCs of PHP" series looking at some basic techniques for building your first scripts.

Welcome to part 3 of my 10 part series on PHP. In the first two parts I introduced you to the language and to what software you needed to run it. In this episode we will look at some simple PHP syntax, and we'll write a couple of small scripts to get our feet wet, and get a feel for the language.

Their first script mixes HTML and PHP together to make a "Hello World" web page. They also give the example of a phpinfo function call to get the settings for the current PHP installation.

0 comments voice your opinion now!
abc introduction first script technique phpinfo


Mike Willbanks' Blog:
PHP Performance Series Caching Techniques
February 27, 2008 @ 10:25:00

On his blog today, Mike Willbanks has started up a new series that will look at various caching techniques that are available to PHP developers now:

Welcome to the first edition of the PHP performance series, a new series that I will be explaining ways to gain efficiencies and squeezing more performance out of your applications. This first edition, caching techniques, focuses on ways to cache data to optimize your current sites. Some of the concepts here are fairly easy to implement while others may take strategic design in the architecture of your application.

The methods he looks at this time are:

  • Opcode Caching
  • File Priming
  • Caching Variables
  • File Caching
  • Memory Caching
  • Database Memory Tables
  • RAM Disk
0 comments voice your opinion now!
performance series caching technique opcode file database ram


The Bakery:
Advanced Pagination (1.2)
July 05, 2007 @ 08:58:00

From The Bakery, there's a new tutorial looking to help make pagination (more than just the basic stuff) simple on your site.

This tutorial will attempt to cover some advanced techniques of pagination. In large this will cover Ajax pagination. Hopefully we can also uncover some of the better practices and techniques to use with pagination.

They look at four different topics:

  • Ajax Pagination
  • Searching (use of pagination on the results page)
  • Other Techniques
  • some of the Known Weaknesses the method has

Code is included.

0 comments voice your opinion now!
advanced pagination ajax search technique tutorial cakephp framework advanced pagination ajax search technique tutorial cakephp framework



Community Events





Don't see your event here?
Let us know!


api community interview unittest framework development manifesto introduction test opinion release conference podcast phpunit application package language series symfony2 custom

All content copyright, 2012 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework