 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
PHPMaster.com: Extract an Excerpt from a WAV File
by Chris Cornutt February 14, 2013 @ 10:44:25
In this new post to PHPMaster.com, Aurelio De Rosa covers an interesting use of PHP that could be handy in certain circumstances - extracting a section of a WAV audio file using the Audero Wav Extractor library.
Although PHP is well known for building web pages and applications, it can do more than that. I recently needed to extract a piece of audio from a WAV file on-the-fly and let the user download it through his browser. I tried to find a library that fit my needs but wasn't successful and had to write the code myself. It was a good opportunity to study in depth how a WAV file is made.
He starts off with an overview of what a WAV file is, how it's structured and how you can correctly figure out where in the binary data of the file the section you want is located. He then introduces the library and shows how to use it to extract "chunks" from the WAV file. He also includes an example of pulling out a chunk and saving it off to another file.
voice your opinion now!
extract wav audio file library tutorial
WebSpeaks.in: Extract the Content of Zip file Using PHP
by Chris Cornutt June 13, 2012 @ 10:44:44
On the WebSpeaks.in site, there's a recent tutorial posted showing how you can extract the contents of a zip file from inside a PHP application.
Sometimes you may want the users on your site to upload the zip file and then check what are the contents of that zip file. In this article I will tell you how to extract the contents of the zip file. I temporarily extract the zip files to a directory and then delete it afterwards. You can chose to keep the extracted content if you want.
The tutorial walks you through the code, showing you how to use their "ZipArchive" class to grab the file, extract the contents and display a list of the "child files" inside it. You can see a live demo of it in action or just download the source and dive right in.
voice your opinion now!
extract content zip archive list tutorial demo
PHPMaster.com: Localizing PHP Applications "The Right Way", Part 5
by Chris Cornutt November 25, 2011 @ 14:58:09
PHPMaster.com has posted the fifth part of their "Localizing PHP Applications 'The Right Way'" series, this time with a focus on extracting data from the .pot template files to define in your PHP. (This is the final part of the series.)
In Part 4 you learned how to use gettext for one of the most complex aspects of localization a developer can face, plural forms. In this, the final part of the five-part series, I'll teach you how you to automate part of the localization process by extracting msgids and generating a PO template file (.pot) from your application's PHP code.
They show how to use the xgettext command-line tool to pull out strings from your source and automatically make them into a domain template. They help you set up three sample PHP files and run the xgettext command on them to pull out messages defined in the text of the files to set up keys in the template. Screenshots are included showing how to use Poedit to use these templates for your new translations.
voice your opinion now!
localize xgettext tutorial gettext extract
Kae Verens' Blog: Extracting a sudoku puzzle from a photo
by Chris Cornutt 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.
voice your opinion now!
extract sudoku puzzle number grid photo solve textmessage
Sameer Borate's Blog: Refactoring 2 Extract Method
by Chris Cornutt January 12, 2009 @ 20:18:35
Sameer has posted the second part of his series looking at refactoring with a spotlight on the Extract method.
The 'Extract Method' is one of the most common refactorings you will ever do. It is also one you will frequently see implemented on the Refactor tool menu on various IDE's. What this method basically does is to take a group of related code and convert it to a function with a appropriate name that easily explains the purpose of the code.
He gives a code example - converting hotel room price to points based on the currency its requested in - both with and without the Extract method in use.
voice your opinion now!
refactor extract method example convert hotel price points
PHPImact Blog: Refactoring the Front Controller of the Zend Framework
by Chris Cornutt August 20, 2008 @ 14:04:01
The PHP::Impact blog has a new tutorial posted today with a look at a refactoring of the front controller of the Zend Framework to make it a bit more manageable.
One of the most fundamental decision in object design is deciding where to put responsibilities. No one, and I mean no one, gets it right the first time. That's why refactoring is so important. As Kent Beck puts it, refactoring is the process of taking a system and adding to its value, not by changing its behaviour but by giving it more of these qualities that enable us to continue developing at speed.
He follows the "extract" refactoring method that makes things simpler by removing unneeded parts of the code (in favor of an interchangeable external "extract class". He removes seven methods from the class and splits them off into their own. This reduces the controller down to a more manageable size and takes a lot of the complexity out.
voice your opinion now!
tutorial refactor extract class zendframework front controller
Developer Tutorials Blog: Extracting text from Word Documents via PHP and COM
by Chris Cornutt March 26, 2008 @ 12:02:06
In a recent blog post Akash Mehta showed how to reach into a Microsoft document (a Word file) and pull out the content inside via a PHP script.
Communicating via COM in PHP is easy as ever; especially for people coming from a VB background where executing complex tasks in MS-applications is a piece of cake, you will feel right at home in PHP. In fact, VB COM calls can be converted to PHP COM calls in just a few simple search and replaces.
He shows how to use the COM extension in a (Windows) PHP installation to access the text inside the document and manipulate the contents however you'd like (even writing them back out to another Word file).
voice your opinion now!
com document word extract content manipulate
Andries Seutens' Blog: Zend Framework, just get me started, okay?
by Chris Cornutt June 20, 2007 @ 12:03:00
Andries Seutens has created his own quickstart method for working with the Zend Framework and in his latest post, he shares the files.
If you are looking for a quick way to get started with the Zend Framework, then you should download this file. This download has a default setup for the Zend Framework, including: a conventional directory structure, a bootstrap file, configuration file with 2 stages: production, staging, an error controller, an index controller and more.
For course, you'll have to have the framework installed to get things up and running, but outside of that you'll only need to put the downloaded files above into the right place.
voice your opinion now!
zendframework quickstart download extract zendframework quickstart download extract
|
Community Events
Don't see your event here? Let us know!
|