 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Gaylord Aulke's Blog: Dumping MemcacheD Content (Keys) with PHP
by Chris Cornutt September 02, 2008 @ 12:58:59
In a recent blog post Gaylord Aulke illustrated a method for dumping the (key) content from a memcached cache in a friendly, formatted way.
When i did some optimization of a cluster based webapp lately, I was wondering how Memcache was speading my cache entries over the cluster. So i did some research for monitoring tools. [...] Inspired by [memcache.php], i wrote a small script that fetches all data from a memcache cluster, gets all keys out of it and then sorts and displays them in a list. Yes it it ugly and yes: the memcacheD is not answering other requests while doing a cachedump.
He includes the 22 line script in the post to spit back the data in a simple array. From there it can be styled whoever you'd like.
voice your opinion now!
memcached content key dump output memcachephp statistics
Zend Developer Zone: Using GnuPG with PHP
by Chris Cornutt August 04, 2008 @ 14:32:56
The Zend Developer Zone has a new tutorial posted today showing how to use the open source encryption tool GnuPG from inside PHP.
While GnuPG works very well as a standalone tool, it also plays very well with PHP. This integration is possible due to PHP's ext/gnupg extension, which provides a flexible and powerful API to access GnuPG functions for encryption, decryption, message signing and verification, and key maintenance. And your mission (should you choose to accept it) will be to accompany me over the next few pages, while I give you a crash course in this API, showing you how easy it is to integrate these functions into your next PHP application.
The tutorial walks you through some of the basic concepts behind the "lock and key" GnuPG implements and how to get the extension installed so you can follow along. His examples range from a basic encryption of a string out to a full encrypt/decrypt example, how to sign information with a key and even a method for sending an encrypted message.
voice your opinion now!
gnupg tutorial extension key message file crypt encrypt decrypt
Brian Moon's Blog: in_array is quite slow
by Chris Cornutt June 06, 2008 @ 09:36:47
Brian Moon had a problem - one of his cron jobs was lasting for much longer (hours!) than it should have been. He tweaked, tested and debugged the script and finally came down to a call to in_array, something he comments on as being "quite slow".
See, this job is importing data from a huge XML file into MySQL. After it is done, we want to compare the data we just added/updated to the data in the table so we can deactivate any data we did not update. [...] We then compared the two arrays by looping one array and using in_array() to check if the value was in the second array. [...] So, that was running for hours with about 400k items. Our data did not contain the value as the key, but it could as the value was unique.
He method, replacing the in_array call that had to do a full array scan for each time through the loop with an isset/unset combo on the unique key, changed the execution time down from about 4 hours to 0.8 seconds.
voice your opinion now!
inarray compare array unset isset unique key execution time
JSLabs Blog: How to use the facebook API
by Chris Cornutt October 05, 2006 @ 13:51:38
On the JSLabs blog today, there's a new tutorial showing how you (yes you) can use the Facebook Developer's API to pull information from their systems.
The facebook API allows you to access profiles, friends, photos, and events. To access the API from an outside server, you need to go through the following steps:
He uses the PHP library to make the connection - a simple call to the API (complete with API key, the location of the interface, a secret key, and a session key to provide a unique identifier. The request made logs a user in (much have a valid Facebook account) and grabs: the count of the messages waiting, the number of posts to your wall, and a list of available photo albums.
voice your opinion now!
facebook api library php5 interface account key facebook api library php5 interface account key
SitePoint Site Marketing Blog: Track Your Rank Using the Google API
by Chris Cornutt April 12, 2006 @ 07:24:27
Sitepoint, widely known for quality in content and tutorials, has a new post on its Site Marketing blog today dealing with tracking a site's Google ranking with the help of the Google API and the PEAR SOAP package.
Bernard Peh, the author, sets up what the Google API is and includes the way to grab your own API key (your pass into the powerful Google backend). The other two requirements for the project are the PEAR SOAP package and an install of at least PHP 4 or higher.
There's a list of input parameters for the functionality, with each described for what it does, and pley of code to help you integrate them into the API call. They give the example of the class grabbing the needed info (via SOAP), parsing out your URL from those results, and a simple form to make checking different URLs all the simpler.
voice your opinion now!
php google rank api key pear soap parameters php google rank api key pear soap parameters
|
Community Events
Don't see your event here? Let us know!
|