News Feed
Sections




News Archive
feed this:

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

Davey Shafik's Blog:
The Closure Puzzle
January 16, 2012 @ 09:52:38

Davey Shafik has posted about an interesting find with closures in PHP revolving around an update to add "$this" access inside the closure.

However, it didn't stop there; there was also the addition of Closure::bind() and Closure->bindTo(). These methods are identical except one is a static method into which the closure is passed, the second an instance method on the closure itself. These methods both take two arguments (on top of the closure for the static version): $newthis and $newscope. What this means is that unlike the regular object model the concept of $this and lexical scope (what is in scope for the function with regards to private/protected methods inside objects) are completely separated.

He also mentions that you can change the "$this" to a different object (complex) or swapping out the object the closure is bound to while keeping "$this" the same (simpler). He mentions that it could be useful for unit testing but can have its drawbacks. He's included code to illustrate the breakage it can cause in the PHP OOP model (with an explanation).

0 comments voice your opinion now!
closure puzzle bindto bind oop object


Josh Holmes' Blog:
Toughest Developer Puzzle Ever
June 02, 2010 @ 11:11:36

If you're looking for a challenge to keep you occupied for a while and want to flex those developer skills, check out the Toughesst Developer Puzzle Ever as created by Jeff Blankenburg.

For the second year in a row, my friend and colleague Jeff Blankenburg has created what is quickly proving to live up to it's namesake - the Toughest Developer Puzzle Ever. Some of the puzzles are technical, some are not but all require that you understand the web, development and technology to solve. Even if you don't get in on the fantastic prizes that Jeff has lined up, there's great bragging rights in being able to solve the Toughest Developer Puzzle Ever.

Josh Holmes (whose blog is linked above) was the creator of three of the levels of this difficult puzzle. Give it a try if you're looking for something to really stretch your knowledge!

0 comments voice your opinion now!
developer puzzle tough game


Kae Verens' Blog:
Extracting a sudoku puzzle from a photo
February 04, 2009 @ 12:57:18

Kae Verens has posted a cool little application of how to pull information out of a photo and parse it with the GD library. His example is a visual sudoku solver (part one, at least).

The plan for this one is that, if you're doing a sudoku puzzle in the pub or on the train, and you get stuck, you just take a snapshot of the puzzle with your camera-phone, send the photo to a certain mobile number, and a few seconds later the solution is sent back as an SMS message. The solution costs you something small - 50 cents, maybe.

The script looks at a picture of a sudoku puzzle, converts it to b&w and tries to find the squares surrounding each position of the board. With these measurements, the next step is to grab the numbers already in the puzzle and hand those off to the puzzle solver to be processed.

2 comments voice your opinion now!
extract sudoku puzzle number grid photo solve textmessage


Sebastian Bergmann's Blog:
SQL Puzzle
December 05, 2007 @ 08:46:00

Sebastian Bergmann has figured out half of the puzzle he was working on but is still a bit stuck on the second half. He knows how to mine information from Subversion, but not they queries to ask the database for the info he needs.

I have written a small PHP script (the initial version of the script can be found here) to import the relevant data from a Subversion repository into the following tables of a relational database. [...] What I need now is two queries to ask the database

There's already been tons of comments in an effort to help him out, but it doesn't look quite like he's resolved the issue just yet.

UPDATE 12.06.207: Seems he's found a solution that'll work for him - here's the script.

0 comments voice your opinion now!
sql puzzle subversion relational database mine information query sql puzzle subversion relational database mine information query


Codewalkers.com:
Flickr Puzzle Mashup
November 14, 2006 @ 07:03:25

A new tutorial has been posted over on the Codewalkers.com website today looking at creating a "first mashup" - a Flickr Puzzle (by Timothy Boronczyk).

I'll take you through a sample project in this tutorial'"a mini-mashup if you will'"that will take a photograph, break it up and present it to the user as simple puzzle.

They use a picture from Flickr, the drag & drop feature of the Yahoo UI Library, and some PHP 5 (including GD) to create a simple, fun little application. It shows how to integrate content from one location, use functionality from another, and combine them into one seamless application.

0 comments voice your opinion now!
tutorial flickr mashup yahoouilibrary puzzle javascript xml tutorial flickr mashup yahoouilibrary puzzle javascript xml



Community Events





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


api project code laravel list podcast interview library release configure introduction threedevsandamaybe wordpress community series language framework developer bugfix application

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