News Feed
Jobs Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Ian Barber's Blog:
Benford's Law
April 05, 2011 @ 09:12:46

In a recent post to his blog Ian Barber looks at applying Benford's Law in PHP to determine if the dataset you're working with is "real" or not.

Benfords Law is not an exciting new John Nettles based detective show, but an interesting observation about the distribution of the first digit in sets of numbers originating from various processes. It says, roughly, that in a big collection of data you should expect to see a number starting with 1 about 30% of the time, but starting with 9 only about 5% of the time.

He pulls data from the data.uk.gov site to illustrate and includes a simple PHP script to run through the data looking scoring it with a "Benford" rating. He plots these on a graph along side the data to show the (almost exact) match between the data and the Benford numbers. You can find more details on the law on Wikipedia.

0 comments voice your opinion now!
benfordslaw real fake data evaluate


Dagfinn Reiersol's Blog:
Real programming with PHP 5.3 (part 3) Links
April 13, 2009 @ 07:58:41

On his blog today Dagfinn Reiersol has posted the next part of his "real programming with PHP 5.3" series looking at links.

After the previous post in this series, additional independent implementations of the idea of JavaScript-style classes have turned up. So I'm going to list them and comment briefly on the differences. I hope this will be helpful to anyone who actually wants to use this in practice and needs to decide on the details of the implementation.

The previous article looked at Javascript-style classes that can be build with the new closures/lambda function support that PHP 5.3 will include. A few of the other examples of this method he mentions include this look from Ionut Stan's forum post and Andrea Giammarchi's blog post on making a Javascript object-like class.

0 comments voice your opinion now!
php5 real programming series javascript object class closure lambda


PHP in Action:
Real programming with PHP 5.3 (part 1) array processing
March 19, 2009 @ 11:18:20

On the PHP in Action blog, a new series has been kicked off with this first part looking at "real programming" in the upcoming PHP 5.3 release.

You may have heard of the new features that are scheduled for PHP 5.3, but who knows what they can be used for in real programming? I took the time for some experimental research, and came up with a few examples.

This first part focuses on the new lambda/closures functionality that will come with the new release. He compares it to the create_function syntax currently offered, specifically when it comes to sorting and manipulating arrays.

0 comments voice your opinion now!
php5 lambda closure array processing tutorial real


Community News:
No Starch Press Releases "Wicked Cool PHP"
February 13, 2008 @ 16:07:00

No Starch Press has officially released their PHP title "Wicked Cool PHP" (Real-World Scripts That Solve Difficult Problems).

Here's a bit from the press release:

Wicked Cool PHP [...] is a different breed of PHP book. It's made specifically for the developer who wants to know how to get things done without mucking around and wasting a lot of time. This is not a weighty PHP complete reference or bible that threatens to take down your bookshelf and the rest of the bookcase. This is a book for coders to pick up and use, not wade through.

It provides the reader with "76 immediately useful PHP scripts" that do a variety of things like send/receive email notifications, do some web scraping, track users with cookies and sessions and use web services like SOAP.

You can find out more about the book on this page on the O'Reilly website. The book will officially hit the stands February 15th.

0 comments voice your opinion now!
nostarchpress oreilly real script book release wicked


Jacob Santos' Blog:
Multitasking in PHP
August 19, 2006 @ 15:23:43

In his latest blog post, Jacob Santos takes a look at a common request PHP developers hit after a while - is it possible to multitask processes/actions in php?

The ability to run two or more commands in parallel is totally sexy, but the Web is a different playing field and it doesn't make complete sense.

PHP loses control, once the output is sent and the connection is closed. Multithreading would probably make sense in streaming, but PHP already handles that for you where it makes sense for the function. Furthermore, mulithreading has its purpose in applications that continue to run and not something that closes and cleans up everything after the last command is issued.

He continues talking more about what multitasking is, a more real life example, the goods, the bads, and some of the issues that can come along with it. Finally, he suggests a feature to be added to the core of PHP - an "internal multitasking mechanism" to help aid these kinds of processes.

0 comments voice your opinion now!
multitasking common questions real world good bad multitasking common questions real world good bad


The PHP Grind:
Get real about PHP4 vs. PHP5!
June 08, 2006 @ 14:48:46

From ThePHPGrind.net today, there's a new post with some opinions on the real differences between PHP4 and PHP5, including suggetions to just make the jump to the latest version.

I am repeated aggravated by so called "reputable" people in the PHP industry marginalizing and downplaying PHP5 in favor of the ever aging and antiquated PHP4.

And, I'm not talking about small applications. I'm talking about a complete online fantasy sports systems. Content and product management, e-commerce, integration systems and many custom modules for very large companies in the construction and industrial manufacturing industries. Company names that your kids probably know, but names that probably shouldn't be mentioned in my little rant here out of respect.

He makes the case that not only is it a pretty simple matter to make the move (usually) plus the fact that several large companies using PHP have already made the leap as well. I also like this great little "soundbite" quote he shares:

PHP5 is here already, and many of its' versions are completely stable for the vast majority of people. And, soon PHP6 will be here whether other people like it or not. So, why not get ready?
0 comments voice your opinion now!
get real php4 php5 versus upgrade large get real php4 php5 versus upgrade large


Sitening.com:
Getting Real With Databases in PHP
June 01, 2006 @ 06:11:58

This new post on the Sitening.com blog (written up by Tyler Hall) today takes a look at PHP and databases (MySQL specifically in this case) and "getting real" with them.

many of the ideas behind Ruby on Rails are spot on. I particularly like how well it abstracts database queries into separate objects for each table. That's very cool and can save having to write a lot of repetitive code. But having to run a Rails script to generate new files is a little too cumbersome for me. Like I said, I prefer to keep things simple. Can we do the same thing with PHP? Using just one file?

Yes.

He proceeds to show a class that can perform operations similar to those styled in RoR - creating the object, applying proterties to it and performing the action (inserts/delete/etc). It's all made possible through the use of the __get and __set functions offered in PHP5. From there, it's just a simple matter of defining the functions for the actions.

To bring the point home, he also includes some examples of how to use this kind of functionality with a bit more than the previous example - selecting, updating, deleting, and inserting a new record (including the action function for each). Lastly, he gives an example of extending this base class, as mentioned in his first example (creating an object like "Animal" or "User" to abstract out the connections even more.

0 comments voice your opinion now!
getting real databases rubyonrails class __get __set getting real databases rubyonrails class __get __set


NewsForge:
Real world control from a Web page
May 23, 2006 @ 07:20:11

If you've ever wanted yout scripts to do something more "outside the box" and out in the real world, you might want to check out this new tutorial from NewsForge for a good start.

In "Acquiring data from the physical world" we examined how to use a microcontroller to turn physical events (such as reading a switch) into data and send that data to a Linux box via the serial line. With this capability you can do things like counting people passing through a gate or recording how the temperature changes over time in a factory process. You can then send the data to a Web page. In this article, we'll do it in reverse -- from a Web form, instruct a microcontroller to perform some actions

The concept's pretty simple - the form they build submits back to the page and writes the input out to a file. This file is then read by the controller for the LED they have connected and, with the proper input, will turn it on and off. The code for the PHP/web side of things is included, but it might take a little work to get the rest of the hardware interfaced (as the author saw as well).

0 comments voice your opinion now!
real world control web page microcontroller led light real world control web page microcontroller led light



Community Events











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


release opinion introduction hhvm framework security podcast component application composer package overview language symfony2 install unittest facebook hack code series

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