 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
NetTuts.com: Create Instagram Filters With PHP
by Chris Cornutt March 26, 2012 @ 10:07:37
On NetTuts.com there's a new tutorial showing how you can create Instagram-like filters in PHP using the ImageMagick library/extension.
PHP comes bundled with GD (GIF Draw/Graphics Draw), which is a library for the dynamic creation of images. It can be used for simpler image operation, such as resizing, cropping, adding watermarks, creating thumbnails (Jeffrey wrote about it), applying basic photo filters - you've probably used it before. Unfortunately, if you want to create something more complex with GD, like Instagram effects, you can't. Luckily, though, we have ImageMagick!
He starts off by comparing the two graphics libraries and talks briefly about how to downliad and install Imagemagick on your development platform. Included is a PHP class to help you use it, coming complete with functions for changing the color tone of the image, adding a border and adding a vignette to the image. Also included are some "presets" represented in a few simple functions:
- Gotham
- Toaster
- Nashville
- Lomo
- Kelvin
There's also a few links to other resources you can use to find out more details on what Imagemagick has to offer.
voice your opinion now!
instagraph photo imagemagick filter tutorial image
Sameer Borate's Blog: Building a adjacency matrix of a graph
by Chris Cornutt February 17, 2012 @ 09:19:12
Building on the graphing tutorial in his last post Sameer continues on looking at graphs in PHP with this new post showing how to create an "agency matrix" of a currently built graph.
Building a graph is not enough; we also need the ability to search through it. To make it easier to build search algorithms, it is useful if we can represent the graph and its connections in a different way; adjacency matrix being one such representation. An adjacency matrix is a means of representing which vertices (or nodes) of a graph are adjacent to which other vertices.
He includes some sample code to extract the data from a graph (built with the PEAR Structures_Graph package) and create a basic "table" of information about each nodes' connections.
voice your opinion now!
agency matrix tutorial graph structuregraph pear
Sameer Borate's Blog: Building a Graph data structure in PHP
by Chris Cornutt February 15, 2012 @ 09:35:15
In the latest post to his blog Sameer Borate takes a look at using the Structures_Graph package from PEAR to create data structures in PHP with linked nodes for directed and undirected graphs.
The Pear Structures_Graph package allows creating and manipulating graph data structures. It allows building of either directed or undirected graphs, with data and metadata stored in nodes. The library provides functions for graph traversing as well as for characteristic extraction from the graph topology.
After sharing the one-line install, he shows how to create some instances of the package's Nodes and how to connect them to a graph and link them to other nodes. He includes a few examples - a simpler one with multiple nodes joined in a directed graph, another showing how to associate data with a node and how to query the graph for node connections and testing to see if the graph is acyclic.
voice your opinion now!
graph node structure structuregraph pear package tutorial
Kurt Payne's Blog: User register_tick_function to profile your code
by Chris Cornutt February 07, 2012 @ 13:26:23
Kurt Payne has a new post to his blog showing how to use register_tick_function with a callback to help benchmark and profile your application to find its pain spots.
A profiler gives you the ability to trace the performance of your code through every function call and create an overview of your system's performance over a certain time period and helps you make intelligent decisions about where to look for problems. [...] But what if you're in an environment where you can't install [the xdebug or xhprof] extension? Luckily, php has a built-in function called register_tick_function that gives you a way to hook in to every user function that's called. With this, you can write a profiler yourself.
A bit of sample code illustrates his method - it defines a "do_profile" function and assigns it with the register_tick_function call. This function generates a debug backtrace and echos out the function path it took to get to that spot (output is included). He provides code for a bit more useful profiling and points out that it could easily be graphed to help visualize the problems. Also included are a few caveats to watch out for when using this method of profiling.
voice your opinion now!
registertickfunction profile graph performance xdebug xhprof
XPertDeveloper.com: Get Facebook Page Detail Using Graph API and PHP
by Chris Cornutt January 03, 2012 @ 11:06:04
New from the XPertDeveloper.com blog there's a tutorial showing how to use the Facebook graph API to get page details via a simple cURL request (cURL PHP support required for the example).
Here is the technique to get the detail of the Facebook page with Graph API and PHP. This is the very easy method to get the Facebook page detail. So Let's see how to get this done. With this method you can get details of any Facebook page [inluding] name, picture, link, website, products, description and if the user can post to it.
The sample code is only a few lines - it uses the Facebook page ID (easy to grab from the URL) and fetches a URL with it as a parameter. The output is returned as a standard PHP object with all of the properties attached (decoded from JSON). This is just one of many methods the Facebook graph API has, so check out their documentation for more methods and details on returned values.
voice your opinion now!
facebook graph api curl request tutorial
PHPMaster.com: Watermarking Images
by Chris Cornutt January 02, 2012 @ 12:43:44
PHPMaster.com has a recent tutorial showing how to use the built-in Imagick extension to watermark your images effectively. It talks about what makes a good watermark and how to superimpose one on your images with a bit of sample code.
Imagine a friend of yours approaches you one day and would like you to build her a website so she can showcase her photography. She wants to be able to easily upload her photographs and have them watermarked so that people can't easily steal them. "Don't worry!" you tell her, because you know there are functions provided by the Imagick extension that makes watermarking images a breeze in PHP.
He talks about things like watermark transparency, the size of it (how much of the image you want it to cover) and the contrast of the watermark image to make it stand out from the image enough to be useful. Their example image and script puts the PHPMaster.com logo over the center of the image and includes a bit of code showing how to scale the watermark image to fit the image (this versus this.
voice your opinion now!
watermark image tutorial superimpose
PHPMaster.com: Charting with pChart
by Chris Cornutt December 05, 2011 @ 08:50:07
On PHPMaster.com today there's a new post highlighting the use of pChart to graph out the data from your PHP application. pChart provides an easy interface to draw graphs with GD, supporting alpha transparency, shadowing, spline/cubic curves and much more.
Created and maintained by Jean-Damien Pogolotti, a systems engineer based in Toulouse, France, pChart is a library that creates anti-aliased charts and graphs using PHP. It's object-oriented code has been recently redesigned and makes it easy to add beautiful, eye-catching data. The library is free for non-profit use and for inclusion in GPL distributed software; licensing plans for other uses start at just 50 Euro. In this article I'll take you through installing pChart and using it to generate a basic chart, line chart and plot graph.
He walks you through the download and installation of the tool as well as showing the code you'll need to include to get started with a first script. Their examples show how to create both single- and three-series charts with some sample data and some screenshots of output.
voice your opinion now!
pchart tutorial library gd graph
NetTuts.com: Wrangling with the Facebook Graph API
by Chris Cornutt December 02, 2011 @ 13:37:09
On the NetTuts.com site today they have a (very complete) guide to help you wrangle the Facebook Graph API and make it useful for your application. It makes use of the official Facebook PHP SDK to interface with the Graph API.
Have you ever wanted to learn how to make your applications more social with Facebook? It's much easier than you think! In this tutorial, we'll be building an application that reads and publishes data to and from Facebook using Facebook's Graph API.
The tutorial helps you get signed up on the Facebook developer site, create a first sample application, set up the SDK and make a simple page (with an added bonus of using the Twitter Boostrap for look/feed). There's a section covering permissions, what kind of data you can expect publicly for both users and posts. They wrap it up with an example of posting back to Facebook though the API and updating the status on your account. The complete code for the tutorial is also available for download.
voice your opinion now!
facebook graph api tutorial sdk permissions
PHPBuilder.com: Talking to Facebook's Social Graph with PHP
by Chris Cornutt November 21, 2011 @ 11:26:54
On PHPBuilder.com there's a recent post showing you how to connect your application with Facebook's graph API and grabbing the current user's public profile information.
In recent years, [Facebook's] influence has dramatically grown thanks to the Facebook Platform, a set of APIs which third-parties can use to create or extend applications which tightly integrate with Facebook.com's features and users. [...] PHP-minded developers are particularly fortunate, as the Facebook PHP SDK doesn't only provide users a powerful solution for interacting with the social graph, but because it's actively maintained by the Facebook development team is often the first of several available APIs to offer the latest features and bug fixes.
He points out the github repostory for grabbing the Facebook SDK, the information you'd get (at a minimum) from the API and the sort of detail you can expect from a user logged into your application. Sample code is included for this last example.
voice your opinion now!
facebook social graph api tutorial public information
DZone.com: Creating a virtual server with Vagrant a practical walkthrough
by Chris Cornutt November 18, 2011 @ 08:18:45
On DZone.com there's a new post from Giorgio Sironi looking at how to automate a build of a virtual server with Vagrant, setting up a LAMP-based development instance.
Vagrant ia a tool for building virtual machines (in VirtualBox's format) that conforms to a specification. It's written in Ruby, but it makes really no assumptions over the environments that you're gonna build; in this article, we will setup a virtual server for PHP applications running inside Apache.
The end result is a virtual machine based on VirtualBox images and can be built in a few easy steps:
- install the vagrant gems on the build system
- add a new virtual box instance pointed to a .box file
- create the Vagrant config (including the commands to run post-create)
- set up a little port forawrding
- creating a phpinfo file and starting up Apache
One suggested place for grabbing images (some with pre-defined software) is Bitnami's "Stacks" repository.
voice your opinion now!
vagrant ruby gem install tutorial virtualbox image build
|
Community Events
Don't see your event here? Let us know!
|