SitePoint PHPCreate a Movie Recommendation App with Prediction.io – Implementation (15.9.2014, 16:00 UTC)

In part one, we covered the basics of Prediction IO and installed its dependencies. In this part, we’re going to build the app.

Importing Data from TMDB

We will be importing the data using the Prediction IO SDK, so we first need to tell Flight to use it. In the beginning of your index.php file add the following code:

<?php
session_start(); //start a session
require 'vendor/autoload.php'; //autoload dependencies

use PredictionIO\PredictionIOClient; //import the prediction IO client

Next, register the Prediction IO Client to Flight so that we can use it throughout our app:

Flight::register('prediction', 'PredictionIO\PredictionIOClient');

While we’re here let’s also register the MongoDB class so that we can query MongoDB later on:

Flight::register('mdb', 'Mongo', array('mongodb://localhost'));

Next, we map the factory method to a Flight method and call it prediction_client. We will be using this later on to make calls with the Prediction IO client.

Continue reading %Create a Movie Recommendation App with Prediction.io – Implementation%

Link
PHP ClassesPHP and JavaScript Innovation Award Report September 2014 Edition - June 2014 nominees (15.9.2014, 10:34 UTC)
By Manuel Lemos
The Innovation Award is an initiative that aims to distinguish developers that publish innovative packages since 2004.

Starting this month, Manuel Lemos and Arturs Sosins are recording a dedicated video hangout and audio podcast to comment about the outstanding features of all the past month nominees and winners PHP and JavaScript packages, the prizes that the authors earned, starting with the nominees from the month of June 2014.

Listen to the podcast, or watch the hangout video, or read the transcript to learn why the nominated packages were considered to be innovative.
Link
SitePoint PHPCreate a Movie Recommendation App with Prediction.io – Setup (13.9.2014, 16:00 UTC)

In this tutorial, I’m going to walk you through Prediction IO, an open-source machine learning server. It allows you to create applications that could do the following:

  • recommend items (e.g. movies, products, food)
  • predict user behavior
  • identify item similarity
  • rank items

You can pretty much build any machine learning application with ease using Prediction IO. You don’t have to deal with numbers and algorithms and you can just concentrate on building the app itself.

Installation

The tutorial assumes your base OS is Linux. If this is not the case, please consider using Homestead Improved for a standardized and easy to use Vagrant box which gets you up and running with MySQL, PHP 5.6 and Nginx in under five minutes.

The first thing that you need to do is to install Prediction IO. You can download Prediction IO from their downloads page. Once you’ve downloaded it, you can extract it to your preferred installation path. Prediction IO is now installed, but it needs the following dependencies to be installed first before you can use it:

  • Java (Version 6+)
  • MongoDB

You can install these prerequisites through the provided setup script. Navigate to the root of your prediction IO installation path and execute the following command:

bin/setup-vendors.sh

That will install all the dependencies for you.

Continue reading %Create a Movie Recommendation App with Prediction.io – Setup%

Link
SitePoint PHP18 Critical Oversights in Web Development (12.9.2014, 16:00 UTC)

Oversights

Over the past years I had the opportunity to work on some interesting projects, complex in nature with an ongoing development, constantly upgrading, refactoring and adding new features to them.

This article will cover the biggest coding oversights most PHP developers make, when dealing with medium and large projects. Oversights such as not differentiating between development environments or not implementing caching and backup.

The examples below are in PHP, but the idea behind each problem is generic.

The root of these problems lies mainly in developers’ knowledge and experience, especially the lack of it. I’m not trying to bash anybody, I do not consider myself the perfect developer who knows everything, so bear with me.

In my experience we could categorize these problems in three main groups: design level, application level and database level oversights. We’ll break down each one separately.

Application Level Oversights

Developing with error reporting off

Error Reporting

The only question I can ask is: why? Why do you not turn error reporting on when developing an application?

PHP has many levels of error reporting, and it ALL should be turned on in the development phase.

If you think errors will never occur, you are coding for the ideal scenario, which only happens in an ideal world.

Error reporting and displaying those errors are not the same either. error_reporting() sets the level of errors (e.g. notice, warnings, fatal errors) and display_errors controls whether these errors will be outputted or not.

Error reporting should always be at the highest setting in development: error_reporting(E_ALL); and ini_set('display_errors', true);

Note: E_ALL is the highest since PHP 5.4+, because E_STRICT errors became part of E_ALL in PHP 5.4. If you use an older PHP version than 5.4 use error_reporting(E_ALL | E_STRICT); to include strict error warnings too.

Continue reading %18 Critical Oversights in Web Development%

Link
Ross TuckTips on Speaking (11.9.2014, 23:22 UTC)

Earlier this evening, I was a guest on NoCapes, a new web series about sharing advice and encouraging folks to engage in the PHP community. It’s a great initiative, you should check it out. There’s also a video of my interview up as well.

But as we begin The Autumn of a Thousand Conferences, I thought I’d follow up by taking a moment and write up some tips on speaking. Bear in mind, I only began a couple years ago so this is just what works for me. I try to focus on the more practical and less glamorous bits of the speaking experience so you know what to expect.

Ultimately, the #1 rule is this: speakers are the same as any other type of performer. It isn’t about talent, it isn’t about luck, it’s about work and practice. So, don’t beat yourself up if you’re not amazing at first and don’t expect to be well respected until you pay your dues.

I would also ask yourself what is more important. Personally, I’d rather be known for being a good engineer than a great speaker. That said, speaking has helped me make some amazing friends and grown my career considerably. You can (and probably should) try it as well.

Getting Accepted

  • It’s cliché but starting off small: user groups, local meetups, etc. When submitting to a bigger conference, mention your experience. Include links to joind.in, reviews, etc.
  • Just like any type of writing, you’re going to get rejected. A lot. Even when you’ve got some talks under your belt, you’re still going to get rejected on a regular basis.
  • If you have no recorded experience, a 2 minute demo of you covering a small topic can make a huge difference. Many conferences are trying to add new speakers but they’re also risk adverse, so show that you know your stuff.
  • If you’re submitting to a conference that requires traveling, always submit multiple talks (at least 3, maybe more). If they’re going to pay for a flight and hotel, they’re probably going to want 2 or more talks from you.
  • If you’re attending a conference you’d like to speak at, rock it hard at the uncon and then tell the organizers you’re going to submit next year. They’ll remember you. Some conferences even give away guaranteed speaker slots to the best uncon speakers of the year.
  • It’s perfectly okay to submit talks you haven’t written yet, provided you have time to write them. Shoot in a few ideas and let the organizers sort out which ones are good. Likewise, don’t be afraid to reuse talks at other conferences.
  • It’s okay to pick subjects you need to do further research into. In fact, it’s often a great motivator to do so. Just don’t pick subjects you know absolutely zero about, people expect some experience or credentials from their speakers (unless your talk is “How I Stumbled Through Putting X into Production” which is also valid as an intro tutorial).
  • Sad to say but it’s still often about who you know. Find out who the influential speakers or groups in your area are and go out of your way to meet them. 90% of them will already want to help.
  • It’s all about getting that first talk. Once you have that done, you can use it to get the second and the third and…

Writing

  • Start writing with lots of time. Literally, at least a month out.
  • The #1 tip: If you have bullet lists, break each bullet point up into an individual slide.
  • If you do have lots of text on the same slide, use the appear animation to stagger the lines. Otherwise, people will read ahead and not listen to you (or worse, become bored).
  • There is no right number of slides. I’ve seen great speakers use anywhere from 20 slides to 280 slides for 45 minute slots.
  • Don’t start writing slides at the beginning of the talk, skip to the cool technical part you want to talk about. Get that section right and then build the rest of the talk around that.
  • When writing, I often sketch out 30-60 seconds of talking, then backtrack and create the slides for that. Then I do that part again with the slides, adjust or scrap, then write the next 30-60 seconds of talking. Repeat until done.
  • It’s good to have an About Me intro but keep it under 45 seconds.
  • Anticipate the questions your audience will have at any given moment in a talk and then address them immediately. If you don’t, they’ll stop listening to what you’re saying until its question time while they mule this over or wait for you to address it.
  • Don’t ever be afraid to rewrite but don’t make major rewrites in the days leading up to the conference, you will forget and goof them.
  • Your talk doesn’t need to have a story, but build it like one. It should have a lead-in, build up, a climax and a resolution. Emotion has a pla

Truncated by Planet PHP, read more at the original (another 17180 bytes)

Link
SitePoint PHPPHP News You May Have Missed – August, September 2014 (11.9.2014, 16:00 UTC)

By now, you should be familiar with this post type. Every few weeks (months?), I do a summary of all the “popular but not popular enough” news from the PHP world that I think you should know about, and I link to sources containing more information. Some of those might be things we’ve already talked about on SitePoint but warrant a repost, others may have been swept under the rug by more popular news (like, I dunno, PHP 5.6 being released).

Let’s see what’s new.

Continue reading %PHP News You May Have Missed – August, September 2014%

Link
Anna FilinaShould I write a code of conduct? (10.9.2014, 20:50 UTC)

Without concrete actions to eliminate harassment and other bad behavior, a code of conduct for your event is quite meaningless. Some companies use this as a lazy way of dealing with harassment.

“See? We have a code of conduct. We care about inclusivity. Moving on.”

You can write one, but don’t pretend like it will actually solve anything. Well-behaved people don’t need a reminder and bad-behaved people won’t bother reading the code.

Codes of conduct aren’t a bad thing, it’s just that on their own they don’t do anything. Here are concrete steps for you to implement before you write a CoC:

  1. Make sure that you have adequate surveillance at both the main venue and social outings. Watch for bad behavior and be visible in case somebody needs to complain. Uniforms and training for staff is highly recommended, even if they are volunteers. Always be the last to leave.
  2. Control the alcohol at your events. Don’t ever have an open bar. If you want to provide free alcohol, use coupons to control how many drinks each person can get.
  3. Explicitly tell your sponsors and speakers about what kind of language or imagery is inappropriate in their materials.
  4. Plan your event so that you’re not 100% busy. You need to be available to manage any potential conflict.
  5. Make sure that everything you say and do is in good taste and inclusive. Set a good example: provide alcohol-free/vegetarian alternatives, gender-neutral entertainment, smoke-free environments, accessible venues, avoid stereotypes in all forms of communication, etc.

That’s a good start. Once you do these, write a document that will shed light on what you have done to make your event safer and more inclusive. This will reassure your audience. Any more tips?

Link
Anna FilinaConFoo 2015 is looking for speakers (10.9.2014, 18:10 UTC)

ConFoo is a conference for web developers. We are looking for professionals to share their skills and experience at the next event. Submit your proposals between August 25th and September 22nd.

  • ConFoo 2015 will be hosted on February 18-20 in Montreal, at the Hilton Bonaventure Hotel.
  • We take good care of our speakers by covering most expenses including travel, accommodation, lunch, full conference ticket, etc.
  • Presentations are 35min + 10min for questions, and may be delivered in English or French.
  • ConFoo is an open environment where everyone is welcome to submit. Are you skilled and friendly? Come join us.

If you would simply prefer to attend the conference, we have a $290 discount until October 13th. You can also rate any proposal and help shape the content of the event.

Submit or rate proposals
Buy tickets

Link
SitePoint PHPGenerate Excel Files and Charts with PHPExcel (10.9.2014, 16:00 UTC)

After my article “How To Make Microsoft Word Documents with PHP” (using Interop capability under Windows), there were quite a few comments urging a pure PHP implementation, i.e., only using a universal PHP library to manipulate Office files.

In this article, we will see how to use a PHPExcel library to provide an “Export to Excel” function in a web app so that the user can export the data into an Excel 2007/2013 file for further analysis.

NOTE: There are a few PHP libraries that can provide Excel (and Office) file manipulations. The lib we use here is called PHPExcel, a subset of PHPOffice, which can be cloned here.

Objectives

After this tutorial, we will get:

  • A sheet showing the game information (date played, teams, score, win/lose status) of my favorite NBA team - LA Lakers, in its 2013-14 season.
  • A button that will export the data into an Excel 2013 file.
  • That Excel file will be populated with some additional analytic data and a chart also generated by PHP and Excel.

Let’s get started.

Continue reading %Generate Excel Files and Charts with PHPExcel%

Link
Pascal MartinAugust 2014 on internals@php (10.9.2014, 05:00 UTC)

Cet article est aussi disponible en français.

I’ve been quite busy in August (and I’ve taken some holidays, during which I pretty much had no Internet access, which doesn’t help), and I haven’t been able to write my digest of internals@ for July 2014 in due time. Instead of writing it now and keeping getting late for August’s one, I’ve chosen to skip my digest of July — and to write August’s one, which you can read below.


August 2014 went back to a reasonable number of 700 messages on PHP’s internals@ mailing-list, after a busy month of July with 1144 mails.

As a graph representing the number of mails per month for the last three years, we’d get:

Johannes Schlüter started this month of August 2014 annoucing the first Release Candidate of PHP 5.3.29. Two weeks later, he announced the release of PHP 5.3.29, which marks the End Of Life of PHP 5.3 : no other new release of PHP 5.3 is planned (which means there won’t be any bug fix anymore — or even security fix).


As PHP 5.3 has reached its End Of Life, Jan Ehrhardt asked what would become of PHP 5.4. According to the Release Process, PHP 5.4, published in March 2012, should have gotten bug-fixes for two years. Still, like Stas Malyshev mentionned, it would be fair for PHP 5.4 to switch to “security fixes only” mode after PHP 5.6 is released — and maintaining two stable (5.4 and 5.5 — or 5.5 and 5.6) releases in parallel should be OK.

A few days later, Stas Malyshev announced that PHP 5.4.33 should be the last version of branch 5.4, except for possible security-fixes.


In the middle of the month, Ferenc Kovacs said the release of PHP 5.6 was getting close. And, a few days later, on August 28th, he announced the release of PHP 5.6.0!

In another thread, he explained why PHP 5.6 was two month late (according to the initial planning): several intermediate versions (alpha, beta, RC) have been released one or two week late, for different reasons — and, in the end, it adds up to two months.


Andrea Faulds noted it might be interesting to have one last 5.x version before the release of PHP 7 — which would mea

Truncated by Planet PHP, read more at the original (another 13245 bytes)

Link
LinksRSS 0.92   RDF 1.
Atom Feed   100% Popoon
PHP5 powered   PEAR
ButtonsPlanet PHP   Planet PHP
Planet PHP