Buzzword© is an online Word Processor created by Adobe©. This online flash application is free to everyone who has an adobe account, if not signed up then registration is as simple as creating an account using your email and selecting a password.

Adobe© Buzzword© provides all the key features of a standard word processor including lists, font styles, tables, and inserting of graphics. The real power of Buzzword© comes in it’s team collaboration functionality. As an online application the documents you create are not stored locally on your computer meaning you will not have to send the documents to others via email or by ftp, instead you simply grant an individual access to the document by typing in their email addresses. As adobe accounts are keyed on the email address this is all the information it needs.

When sharing documents with other team members or individuals you can grant various roles and permissions. The three roles currently allowed are co-editor, reviewer, and reader. These grant the individuals full edit capabilities, notation, and read access respectively. Again as the Word Processor application is online they can instantly see any changes made to the document.

The second key feature for team collaboration is the Document History. Adobe keeps the previously saved versions of documents. This allows you to roll back any unwanted changes and to also easily see what changes were made by a team member.

If you find yourself constantly emailing and merging documents then Adobe© Buzzword© is a free tool that may be of assistance. To learn more about Buzzword© you can access their online site, or to get started you can access the Buzzword© Online Word Processor directly.

, ,

In Flash there are a  multitude of tweening libraries available to developers from the built in tween engine, to libraries written by developers for both AS2 and AS3. Currently the TweenLite and TweenMax libraries (by Jack Doyle and avaiable on his website GreenSock) are the ones I currently use in my Flash projects for a multitude of reasons the main being that TweenLite has low overhead in file size, easy to implement, and has excellent performance.

Currently v11 is underdevelopment with the beta release available to Developers. The most promising new feature of this release are the TimelineLite and TimelineMax classes. These classes allow for users to easily create and manage sequences of Tweens. Enhancements have also been made to the TweenLite/TweenMax classes to allow the user to use frames instead of seconds for their tweening parameters allowing smoother animation in some scenarios.

To read the full details of the upcoming release visit the v11 Beta page on the official website.

,

While doing research into particle generators for a new Action Script 3 Flash project I am working on I came across the Flint Particle System. This library is an open source project with the goal of creating a base framework that is easily extensible by developers to create their own particle behaviors and effects.

I have just begun to utilize the Particle Framework but currently it appears to be very robust with built in support for both 2D and 3D particle systems. For 3D particle systems Flint has support for both the Away3D and Papervision3D libraries, making Flint a highly versatile tool that can be used across diverse projects.

The main power behind this particular particle system is the clean breakup of functionality into distinct elements. To begin we have 3 elements to a Particle System:

  • Particle
    Defines the individual particles within the system.
  • Emitter
    An emitter is responsible for the creation and management of the particles
  • Renderer
    As the name implies the Render is responsible for rendering of the particles.

With these 3 main pieces you are able to create and manage particles within the system. For further control and manipulation of how the system behaves over time actions, activities, initializers, and zones are used.

  • Actions
    An Action defines how the system is modified or how particles act within the system. Some available actions include Gravity, Random Drift, Follow Mouse, and Collision.
  • Initializers
    The Initializer is responsible for modifying particles upon creation which can include modifying their initial position, rotation, velocity, and color.
  • Activities
    Activities define how the emitter changes over time, the most commonly used one is to have the emitter move with the mouse.
  • Zones
    Zones  are used by various actions and activities to define a region of space.

On the official Flint website flintparticles.org you can find many examples and a brief tutorial on how to utilize the library within your own Flash Projects. Once I have  played around some more with the library i will also post some examples here for everyone to see.

, ,

Overview

Exceptions are a way to modify the flow of an application based on specific errors that occur during execution. They are used by developers to prevent invalid values or configurations from being executed.  There are 2 way to handle Exceptions in PHP by the user of Try Catch blocks or the use of a global exception handling method, in most cases you will want to utilize the Try Catch method. Below we will outline these 2 methods but first lets review the Base Exception class.

Understanding The Basics

The Base Exception Class

The built in Exception Class to PHP comes set-up with a lot of functionality to obtain information on where and why the exception occurred within the script or application. The main element to an exception is the message which if used properly should give the details as to why the exception was raised.  In addition the Exception class has a code variable for user defined values as well as providing handles to the line and file that the exception occurred in.  To instantiate a new Exception a user can simply instantiate the Exception by passing the message, code, and optional root exception all of which are optional.

$exception = new Exception("test", 304, $baseException );

Extending an Exception

The real power of extensions comes from the ability to extend the base class to define Custom Exceptions that contain more meaningful information.  Doing so allows for the handler to execute different code based on the Exception type.  In addition it allows for you to add properties and methods to the Exception that can be used by the handlers.  To create a custom exception one simply needs to extend off of the Exception class.

class CustomException extends Exception { }

When creating exceptions be sure that if you overwrite the constructor that you call the parent constructor so as to not loose any base functionality.

parent::__construct($message, $code, $previous);

Raising an Exception

Raising or Throwing an Exception is down by the throw keyword in PHP, when executed this will stop script execution and the Exception will be thrown up the processing stack until it is handled by the appropriate handler whether a global handle method or a catch block.

throw new CustomException("Invalid Value");

The Try Catch Block

The first method I will talk about in how to handle exceptions is the Try Catch Block.  The Try Catch Block is a construct used to surround code that could potentially throw exceptions and defines handlers for catching any exceptions that allow the developer to define how the script/app should continue in such an event. When an exception is raised the code stops executing within the try block and will resume in the appropriate catch block, after the catch block executes execution will resume after the last catch statement.  The basic format for this construct is defined as:

try {
...  // potentially dangerous code
} catch ( CustomException $e ) {
... // handle Exceptions of Type CustomException
} catch (Exception $e ) {
... // handle Exceptions of Type Exception
}

Reviewing the above construct you will see that we wrap any code that has the potential to raise an exception by the try clause. Then we define catch clauses for handling the Exceptions, an important thing to note is that you can define multiple catch statements so that you can handle different Types of exceptions in different manors. With saying that it is important to remember that the first catch block that matches the Exception Type will handle the exception so if you want to handle a CustomException different then other Exceptions it’s catch block needs to come first or the Exception catch statement will handle it as CustomException base type is Exception.

Using the above construct you will be able to catch exceptions thrown and handle them in the manor that best fits your application. Some examples used could be to display an error message to users telling them the functionality is defined, displaying alternate content, or quitting the application or script altogether.

Defining a Global Exception Handler

Unlike other programming languages such as Java and Flash, PHP allows the developer to define a global method that handles any uncaught exceptions. To define an exception handler you utilize the set_exception_handler function and pass it the name of the function to be used.

function handleException($exception) {
    print_r($exception);
}
 
set_exception_handler( "handleException" )

Conclusion

Exceptions can provide valuable information when both developing applications and during the execution of an application or script by an end user.  If used correctly Exceptions are a great tool that can be used to create bug free applications. For further information you can view the PHP Exception Class page or the set_exception_handler page

, ,

Regular Expressions or regex for short is a pattern that describes a set of strings. In their most general form they are used to define a set without listing out all the possible elements of the set. These expressions provide a flexible means for identifying text of interest including words, special characters, or character patterns. In programming we often use regular expressions to validate data or to manipulate information by use of delimiters.

Special Characters

Regular Expressions utilize the following characters [\^$.|?*+() therefore if you want to match any of these characters you will have to escape them by use of the \ character. For example if you wanted your pattern to match any . in your string you would use the pattern \.

  • [
    The [ character denotes the start of a Character Class. A Character Class matches a single character out of all the possibilities listed before the close of the Character Class with ]. Full details on a Character Class can be found within the Basic Syntax section.
    Example: [abc] => matches the chacters a or b or c
  • \
    The backslash character is used to escape a special character to surpress their special meaning it is also used in combination with other character to represent tabs (\t), newlines (\n) and other characters.
  • ^
    The carat denotes to match at the beginning of the string
    Example: ^start would match a string that begins with start
  • $
    The dollar sign denotes to match at the end of the string
    Example: $end would match a string that terminates with end
  • .
    The dot is used to represent any character
    Example: a.b would match any element that was of the format a character b e.g. aab, acb, arb, a.b
  • |
    The pipe character is used to represent the or logical operator
    Example: a|b would match a or b
  • ?
    The question mark is to make the proceeding character optional in the pattern.
    Example: ab? would match a or ab
  • *
    The star character is used to make the proceeding character repeat zero or more times.
    Example: ab* would match a, ab, abb, abbb, etc.
  • +
    The plus character is used to make the proceeding character repeat one or more times.
    Example ab+ would match ab, abb, abbb, etc
  • ()
    The parenthesis characters are used to group operations.
    Example a(b|c) would match ab and ac

Character Class

A Character Class matches a single character out of the set of characters listed in the set.  To make it easier to understand it acts as grouping of or statements where [abc] is the same as (a|b|c) with the benefit of containing special character to create additional patterns without having to list out the whole set. It is also important to note that any special character listed above that is not in the set -]^/ do not need to be escaped when used inside a Character Class

  • -
    A hyphen character is used to denote a character range except if it is placed immediately after the opening bracket
    Example: [a-z] would match all lowercase letters
  • ^
    A carat character immediately after the opening bracket is used to negate the Character Class so that it means the opposite.
    Example: [^abc] would match all charcters except a, b, and c
  • /
    The backslash character is used to escape any special characters within the Character Class
    Example: [\^\]] would match the characters ^ and ]
  • ]
    The left bracket character is used to denote the close of a character class

Summary

Utilizing grouping and character classes you can create powerful expressions perform tasks such as data validation and  search and replace. To get further information you can review the Regular Expression page on Wikipedia or the site regular-expressions.info

,