On Windows I had WinMerge, but on a Mac?
I’ve installed KDiff3, and it seems to work fine. Nonetheless it could be improved, with those WinMerge arrows that overwrite changes in parallel.
Andrea Ercolino, Software Engineer
I’ve been looking for a way to open a deeply nested file in Zend Studio 8 on an iMac.
Not an easy task.
The best I could do is
I’ve recently failed the application for a web developer job at Playfish. After a phone call between Kim and me, Kim made Marius send me a PHP / JavaScript test on Thursday. I sent my solution back the day after and began to wait. I waited 4 days, before sending a whatsup email. Then they came back to me saying that they decided to move on with other candidates. I’ve tried to get some feedback about what was wrong with my solution, but I’m still waiting. Here is the test and my solution.
Thanks for applying for the position and taking the time to talk to us.
Sending a practical test, as described by Kim earlier.
Practical test:
—————————
JavaScript / PHP
Read the data from attached example
PHP file into javascript. And represent the data in an HTML UI. Example
graphics attached.
Create a set of countdown timers from
the awards data. Each of the awards should count down to next_time.
Once the timer is completed invoke a animated UI presenting the user
with the award he has received.
On award acceptation the javascript
should post the the data back to a PHP page using AJAX and validate
that the award is ready for collection as well as validate the awarded
number. You can chose how to store needed data.
Once collected the users data should
update accordingly in the UI and the timer should restart counting down
based on the “interval” in the corresponding award array.
Layout:
The page should be scaled for view on
mobile devices ( iOs / Android )
Page loading and graphics should be
optimized for fast loading where possible.
You can use jQuery.
Attached files:
jQuery library, example main screen
and award graphics, as well as an example data file.
Feel free to use other graphics, and
data structure if you feel necessary.
—————————
If you have any questions regarding the test, just email me.
Thanks and best regards
Marius
style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex">Hi
Andrea,Thanks for taking time to chat today, was great to be
introduced!As agreed we will send you a practical tech test on thursday
morning which you can spend time over the weekend completing and then
send the code back to us on monday. I’ve CC’ed Marius runs our mobile
development efforts and who will be sending the test to you and
you will get to speak to about tech stuff next week 🙂if you have any questions in the meanwhile, feel free to
email.Cheers,Kim
webdev.zip 1154K Download |
{[ .data | 1.hilite(=php=) ]}
When I spoke with Kim I made it clear that I never work with graphics, so I was surprised to see graphics as an element of the test, but I thought that the test could be standard for them, so I didn’t complain but asked (twice) if they really wanted me to do graphics. I got no answer. So I simply didn’t do anything with the layout thing.
Before presenting the contents of any file of my solution, I’d like you to see a short screencast of a demo of my solution. It’s simpler than having a live demo on my server. Note that I made the screencast for this post, I didn’t send it to Playfish.
Nothing to notice here, except the template class (@25-27).
{[ .test-css | 1.hilite(=css,ln-1=) ]}
Elements initially invisible (@19-22, @25) have a style=”display: none;”. On the contrary, the reward popup template (@27-31) is explicitly identified by the template class.
{[ .test-html | 1.hilite(=html,ln-1=) ]}
The “on load” handler (@20-82) binds click handlers to two buttons: Start (@21-67) and Stop (@69-81).
The “on timeout” handler (@121-142) immediately exits (@122-125) if the game is over, otherwise sets the handler (@128-140) for the Accept action (playfish-test.html@30) in the reward dialog (playfish-test.html@27-31), and displays (@141) the dialog.
{[ .test-js | 1.hilite(=javascript,ln-1=) ]}
Nothing to notice here, except that user data is saved into the session.
(I’ve shortened times for speeding up testing)
{[ .data-php | 1.hilite(=php,ln-1=) ]}
If the awards were into an associative array with keys suitable for identifying them (like playing, winning, friends, completing) one could access them directly in PHP (and save the selection find) but in that case it would be more difficult to manage more or less awards, functionality that is now already implemented in the JavaScript code “for free”.
This code (@26-33) takes control of what the JavaScript code simply displays, thus making sure that the client cannot steal awards or just mess things up.
{[ .validate-php | 1.hilite(=php,ln-1=) ]}
Here are two consecutive logs that show validation input / output. The first log tells that a “Reward for completing” accept event has been generated in the client by the “Miho San” user, which currently holds 1483 coins. The second log tells that the award was ready for collection and now the user holds 2473 coins (= 1483 + 990).
46b6bab34d828616a0970222380bd180 - 2010-12-17T17:19:37+0000 - array ( 'request' => array ( 'text' => 'Reward for completing', ), 'user_data' => array ( 'user' => array ( 'coins' => 1483, 'name' => 'Miho San', ), 'awards' => array ( 0 => array ( 'next_time' => 1292606378, 'interval' => 25, 'reward' => 354, 'text' => 'Reward for playing', ), 1 => array ( 'next_time' => 1292606389, 'interval' => 18, 'reward' => 466, 'text' => 'Reward for winning', ), 2 => array ( 'next_time' => 1292606391, 'interval' => 19, 'reward' => 249, 'text' => 'Reward for friends', ), 3 => array ( 'next_time' => 1292606376, 'interval' => 25, 'reward' => 990, 'text' => 'Reward for completing', ), ), ), ) 46b6bab34d828616a0970222380bd180 - 2010-12-17T17:19:37+0000 - array ( 'response' => array ( 'ready_for_collection' => true, 'coins' => 2473, ), 'user_data' => array ( 'user' => array ( 'coins' => 2473, 'name' => 'Miho San', ), 'awards' => array ( 0 => array ( 'next_time' => 1292606378, 'interval' => 25, 'reward' => 354, 'text' => 'Reward for playing', ), 1 => array ( 'next_time' => 1292606389, 'interval' => 18, 'reward' => 466, 'text' => 'Reward for winning', ), 2 => array ( 'next_time' => 1292606391, 'interval' => 19, 'reward' => 249, 'text' => 'Reward for friends', ), 3 => array ( 'next_time' => 1292606401, 'interval' => 25, 'reward' => 990, 'text' => 'Reward for completing', ), ), ), )