<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Dreamer&#039;s Blog</title>
	<atom:link href="http://sobujarefin.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sobujarefin.wordpress.com</link>
	<description>Welcome.... Feel The Breath Of My Dream</description>
	<lastBuildDate>Wed, 30 Sep 2009 06:07:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='sobujarefin.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/f64f16d36838f5672a157456c8951f4e?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Dreamer&#039;s Blog</title>
		<link>http://sobujarefin.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sobujarefin.wordpress.com/osd.xml" title="Dreamer&#039;s Blog" />
	<atom:link rel='hub' href='http://sobujarefin.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Rounded corners without the HTML mess using JQuery</title>
		<link>http://sobujarefin.wordpress.com/2009/09/30/rounded-corners-without-the-html-mess-using-jquery/</link>
		<comments>http://sobujarefin.wordpress.com/2009/09/30/rounded-corners-without-the-html-mess-using-jquery/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 06:07:12 +0000</pubDate>
		<dc:creator>sobujarefin</dc:creator>
				<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://sobujarefin.wordpress.com/?p=23</guid>
		<description><![CDATA[Fortunately, CSS3 has come out with a way to create rounded corners automatically without using images, but on the other hand, many popular browsers (such as Internet Explorer) may take a while before it fully/partially supports CSS3 W3C recommendations. Many designers know how to create rounded corners using CSS, HTML, and a bunch of images, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sobujarefin.wordpress.com&amp;blog=8727489&amp;post=23&amp;subd=sobujarefin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Fortunately, CSS3 has come out with a way to create rounded corners automatically without using images, but on the other hand, many popular browsers (such as Internet Explorer) may take a while before it fully/partially supports CSS3 W3C recommendations.</p>
<p><img src="http://images.sixrevisions.com/2009/08/13-02_roundedcorners.jpg" alt="Rounded corners without the HTML mess" width="550" height="300" /></p>
<p>Many designers know how to create rounded corners using CSS, HTML, and a bunch of images, but these techniques cause a lot of HTML/CSS clutter.</p>
<p>Below is an example of some cluttered HTML used to create  rounded corners.</p>
<pre>&lt;div&gt;
  &lt;div&gt;
  &lt;div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
  &lt;div&gt;
    &lt;div&gt;
      &lt;-- main content goes here --&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
  &lt;div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</pre>
<p>That’s quite a lot of code for one rounded box. Most designers know that it can be difficult to sift though HTML code like this, especially when trying to alter a page that use several rounded corners.</p>
<p>A solution to our problem is simple though – instead of  writing all of the extra HTML <code>div</code>s each time we need a new rounded box,  we can simply have jQuery do all the work for us (by way of DOM manipulation).</p>
<p>This useful technique is from <a href="http://15daysofjquery.com/wrap-it-up-pretty-corners/13/">Day 13</a> of  the <a href="http://15daysofjquery.com/">15 Days of jQuery</a> site. For a full  tutorial or more detail on how it works, head on over there.</p>
<p>By utilizing the script below, we can automatically add the  extra <code>div</code>s where needed.</p>
<pre>&lt;script type="text/javascript"&gt;
$(document).ready(function(){
    $("div.<strong>roundbox</strong>").wrap('
      &lt;div&gt;'+
      ' &lt;div&gt;'+
      '   &lt;div&gt;'+
      '     &lt;div&gt;'+
      '     &lt;/div&gt;'+
      '  &lt;/div&gt;'+
      ' &lt;/div&gt;'+
      '&lt;/div&gt;');
});
&lt;/script&gt;</pre>
<p>The use of <code>div.roundbox</code> in the snippet above is key.  Now, instead of writing out all of those <code>divs</code> every time we need to  create a new rounded box, all we have to do is use the class <code>roundbox</code>; jQuery  will traverse the DOM to find all elements that has that class value and will  automatically wrap it around <code>div</code>’s.</p>
<p>Here’s a sample <code>div</code> HTML structure:</p>
<pre>&lt;div&gt;
  &lt;-- main content goes here --&gt;
&lt;/div&gt;</pre>
<p>Of course, you’ll still have to use some CSS to get the rounded corner images to work, and Jack Born of 15 Days of jQuery provides you with a <a href="http://www.schillmania.com/projects/dialog/">downloadable  package</a> that includes the auxiliary source files you’ll need.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sobujarefin.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sobujarefin.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sobujarefin.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sobujarefin.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sobujarefin.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sobujarefin.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sobujarefin.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sobujarefin.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sobujarefin.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sobujarefin.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sobujarefin.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sobujarefin.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sobujarefin.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sobujarefin.wordpress.com/23/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sobujarefin.wordpress.com&amp;blog=8727489&amp;post=23&amp;subd=sobujarefin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sobujarefin.wordpress.com/2009/09/30/rounded-corners-without-the-html-mess-using-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a53dc64c8e98a0cf76830eedadf28174?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sobujarefin</media:title>
		</media:content>

		<media:content url="http://images.sixrevisions.com/2009/08/13-02_roundedcorners.jpg" medium="image">
			<media:title type="html">Rounded corners without the HTML mess</media:title>
		</media:content>
	</item>
		<item>
		<title>Five common PHP design patterns</title>
		<link>http://sobujarefin.wordpress.com/2009/09/17/five-common-php-design-patterns/</link>
		<comments>http://sobujarefin.wordpress.com/2009/09/17/five-common-php-design-patterns/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 05:13:52 +0000</pubDate>
		<dc:creator>sobujarefin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://sobujarefin.wordpress.com/?p=20</guid>
		<description><![CDATA[Jack D Herrington (jherr@pobox.com), Senior Software Engineer, Leverage Software Inc. The factory pattern: Many of the design patterns in the original Design Patterns book encourage loose coupling. To understand this concept, it&#8217;s easiest to talk about a struggle that many developers go through in large systems. The problem occurs when you change one piece of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sobujarefin.wordpress.com&amp;blog=8727489&amp;post=20&amp;subd=sobujarefin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a rel="#authortip1" href="http://www.ibm.com/developerworks/library/os-php-designptrns/#author1">Jack D Herrington</a> (<a href="mailto:jherr@pobox.com?subject=Five%20common%20PHP%20design%20patterns&amp;cc=dwxed@us.ibm.com">jherr@pobox.com</a>), Senior Software Engineer, Leverage Software Inc.</p>
<p><em><strong><a name="N10076">The factory pattern:</a></strong></em></p>
<p>Many of the design patterns in the original <em>Design Patterns</em> book encourage <em>loose coupling</em>. To understand this concept, it&#8217;s easiest to talk about a struggle that many developers go through in large systems. The problem occurs when you change one piece of code and watch as a cascade of breakage happens in other parts of the system &#8212; parts you thought were completely unrelated.</p>
<p>The problem is <em>tight coupling</em>. Functions and classes in one part of the system rely too heavily on behaviors and structures in other functions and classes in other parts of the system. You need a set of patterns that lets these classes talk with each other, but you don&#8217;t want to tie them together so heavily that they become interlocked.</p>
<p>In large systems, lots of code relies on a few key classes. Difficulties can arise when you need to change those classes. For example, suppose you have a <code>User</code> class that reads from a file. You want to change it to a different class that reads from the database, but all the code references the original class that reads from a file. This is where the factory pattern comes in handy.</p>
<p>The <em>factory pattern</em> is a class that has some methods that create objects for you. Instead of using <code>new</code> directly, you use the factory class to create objects. That way, if you want to change the types of objects created, you can change just the factory. All the code that uses the factory changes automatically.</p>
<p>Listing 1 shows an example of a factory class. The server side of the equation comes in two pieces: the database, and a set of PHP pages that let you add feeds, request the list of feeds, and get the article associated with a particular feed.<br />
<a name="listing1"><strong>Listing 1. Factory1.php</strong></a></p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>
<pre>
&lt;?php
interface IUser
{
  function getName();
}

class User implements IUser
{
  public function __construct( $id ) { }

  public function getName()
  {
    return "Jack";
  }
}

class UserFactory
{
  public static function Create( $id )
  {
    return new User( $id );
  }
}

$uo = UserFactory::Create( 1 );
echo( $uo-&gt;getName()."\n" );
?&gt;</pre>
</td>
</tr>
</tbody>
</table>
<p>An interface called <code>IUser</code> defines what a user object should do. The implementation of <code>IUser</code> is called <code>User</code>, and a factory class called <code>UserFactory</code> creates <code>IUser</code> objects. This relationship is shown as UML in Figure 1.<br />
<a name="fig1"><strong>Figure 1. The factory class and its related IUser interface and user class</strong></a><br />
<img src="http://www.ibm.com/developerworks/library/os-php-designptrns/factory1.gif" alt="The factory class and its related IUser interface and user class" width="221" height="86" /></p>
<p>If you run this code on the command line using the <code>php</code> interpreter, you get this result:</p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>
<pre>% php factory1.php
Jack
%</pre>
</td>
</tr>
</tbody>
</table>
<p>The test code asks the factory for a <code>User</code> object and prints the result of the <code>getName</code> method.</p>
<p>A variation of the factory pattern uses factory methods. These public static methods in the class construct objects of that type. This approach is useful when creating an object of this type is nontrivial. For example, suppose you need to first create the object and then set many attributes. This version of the factory pattern encapsulates that process in a single location so that the complex initialization code isn&#8217;t copied and pasted all over the code base.</p>
<p>Listing 2 shows an example of using factory methods.<br />
<a name="listing2"><strong>Listing 2. Factory2.php</strong></a></p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>
<pre>
&lt;?php
interface IUser
{
  function getName();
}

class User implements IUser
{
  public static function Load( $id )
  {
        return new User( $id );
  }

  public static function Create( )
  {
        return new User( null );
  }

  public function __construct( $id ) { }

  public function getName()
  {
    return "Jack";
  }
}

$uo = User::Load( 1 );
echo( $uo-&gt;getName()."\n" );
?&gt;</pre>
</td>
</tr>
</tbody>
</table>
<p>This code is much simpler. It has only one interface, <code>IUser</code>, and one class called <code>User</code> that implements the interface. The <code>User</code> class has two static methods that create the object. This relationship is shown in UML in Figure 2.<br />
<a name="fig2"><strong>Figure 2. The IUser interface and the user class with factory methods</strong></a><br />
<img src="http://www.ibm.com/developerworks/library/os-php-designptrns/factory2.gif" alt="The IUser interface and the user class with factory methods" width="95" height="113" /></p>
<p>Running the script on the command line yields the same result as the code in Listing 1, as shown here:</p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>
<pre>% php factory2.php
Jack
%</pre>
</td>
</tr>
</tbody>
</table>
<p>As stated, sometimes such patterns can seem like overkill in small situations. Nevertheless, it&#8217;s still good to learn solid coding forms like these for use in any size of project.</p>
<p><em><strong><a name="N10124">The singleton pattern:</a></strong></em></p>
<p>Some application resources are <em>exclusive</em> in that there is one and only one of this type of resource. For example, the connection to a database through the database handle is exclusive. You want to share the database handle in an application because it&#8217;s an overhead to keep opening and closing connections, particularly during a single page fetch.</p>
<p>The singleton pattern covers this need. An object is a <em>singleton</em> if the application can include one and only one of that object at a time. The code in Listing 3 shows a database connection singleton in PHP V5.<br />
<a name="listing3"><strong>Listing 3. Singleton.php</strong></a></p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>
<pre>
&lt;?php
require_once("DB.php");

class DatabaseConnection
{
  public static function get()
  {
    static $db = null;
    if ( $db == null )
      $db = new DatabaseConnection();
    return $db;
  }

  private $_handle = null;

  private function __construct()
  {
    $dsn = 'mysql://root:password@localhost/photos';
    $this-&gt;_handle =&amp; DB::Connect( $dsn, array() );
  }

  public function handle()
  {
    return $this-&gt;_handle;
  }
}

print( "Handle = ".DatabaseConnection::get()-&gt;handle()."\n" );
print( "Handle = ".DatabaseConnection::get()-&gt;handle()."\n" );
?&gt;</pre>
</td>
</tr>
</tbody>
</table>
<p>This code shows a single class called <code>DatabaseConnection</code>. You can&#8217;t create your own <code>DatabaseConnection</code> because the constructor is private. But you can get the one and only one <code>DatabaseConnection</code> object using the static <code>get</code> method. The UML for this code is shown in Figure 3.<br />
<a name="fig3"><strong>Figure 3. The database connection singleton</strong></a><br />
<img src="http://www.ibm.com/developerworks/library/os-php-designptrns/singleton.gif" alt="The database connection singleton" width="165" height="41" /></p>
<p>The proof in the pudding is that the database handle returned by the <code>handle</code> method is the same between two calls. You can see this by running the code on the command line.</p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>
<pre>% php singleton.php
Handle = Object id #3
Handle = Object id #3
%</pre>
</td>
</tr>
</tbody>
</table>
<p>The two handles returned are the same object. If you use the database connection singleton across the application, you reuse the same handle everywhere.</p>
<p>You could use a global variable to store the database handle, but that approach only works for small applications. In larger applications, avoid globals, and go with objects and methods to get access to resources.</p>
<p><em><strong><a name="N10177">The observer pattern:</a></strong></em></p>
<p>The observer pattern gives you another way to avoid tight coupling between components. This pattern is simple: One object makes itself observable by adding a method that allows another object, the <em>observer</em>, to register itself. When the observable object changes, it sends a message to the registered observers. What those observers do with that information isn&#8217;t relevant or important to the observable object. The result is a way for objects to talk with each other without necessarily understanding why.</p>
<p>A simple example is a list of users in a system. The code in Listing 4 shows a user list that sends out a message when users are added. This list is watched by a logging observer that puts out a message when a user is added.<br />
<a name="listing4"><strong>Listing 4. Observer.php</strong></a></p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>
<pre>
&lt;?php
interface IObserver
{
  function onChanged( $sender, $args );
}

interface IObservable
{
  function addObserver( $observer );
}

class UserList implements IObservable
{
  private $_observers = array();

  public function addCustomer( $name )
  {
    foreach( $this-&gt;_observers as $obs )
      $obs-&gt;onChanged( $this, $name );
  }

  public function addObserver( $observer )
  {
    $this-&gt;_observers []= $observer;
  }
}

class UserListLogger implements IObserver
{
  public function onChanged( $sender, $args )
  {
    echo( "'$args' added to user list\n" );
  }
}

$ul = new UserList();
$ul-&gt;addObserver( new UserListLogger() );
$ul-&gt;addCustomer( "Jack" );
?&gt;</pre>
</td>
</tr>
</tbody>
</table>
<p>This code defines four elements: two interfaces and two classes. The <code>IObservable</code> interface defines an object that can be observed, and the <code>UserList</code> implements that interface to register itself as observable. The <code>IObserver</code> list defines what it takes to be an observer, and the <code>UserListLogger</code> implements that <code>IObserver</code> interface. This is shown in the UML in Figure 4.<br />
<a name="fig4"><strong>Figure 4. The observable user list and the user list event logger</strong></a><br />
<img src="http://www.ibm.com/developerworks/library/os-php-designptrns/observer.gif" alt="The observable user list and the user list event logger" width="414" height="99" /></p>
<p>If you run this on the command line, you see this output:</p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>
<pre>% php observer.php
'Jack' added to user list
%</pre>
</td>
</tr>
</tbody>
</table>
<p>The test code creates a <code>UserList</code> and adds the <code>UserListLogger</code> observer to it. Then the code adds a customer, and the <code>UserListLogger</code> is notified of that change.</p>
<p>It&#8217;s critical to realize that the <code>UserList</code> doesn&#8217;t know what the logger is going to do. There could be one or more listeners that do other things. For example, you may have an observer that sends a message to the new user, welcoming him to the system. The value of this approach is that the <code>UserList</code> is ignorant of all the objects depending on it; it focuses on its job of maintaining the user list and sending out messages when the list changes.</p>
<p>This pattern isn&#8217;t limited to objects in memory. It&#8217;s the underpinning of the database-driven message queuing systems used in larger applications.</p>
<p><em><strong><a name="N101DE">The chain-of-command pattern:</a></strong></em></p>
<p>Building on the loose-coupling theme, the <em>chain-of-command</em> pattern routes a message, command, request, or whatever you like through a set of handlers. Each handler decides for itself whether it can handle the request. If it can, the request is handled, and the process stops. You can add or remove handlers from the system without influencing other handlers. Listing 5 shows an example of this pattern.<br />
<a name="listing5"><strong>Listing 5. Chain.php</strong></a></p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>
<pre>
&lt;?php
interface ICommand
{
  function onCommand( $name, $args );
}

class CommandChain
{
  private $_commands = array();

  public function addCommand( $cmd )
  {
    $this-&gt;_commands []= $cmd;
  }

  public function runCommand( $name, $args )
  {
    foreach( $this-&gt;_commands as $cmd )
    {
      if ( $cmd-&gt;onCommand( $name, $args ) )
        return;
    }
  }
}

class UserCommand implements ICommand
{
  public function onCommand( $name, $args )
  {
    if ( $name != 'addUser' ) return false;
    echo( "UserCommand handling 'addUser'\n" );
    return true;
  }
}

class MailCommand implements ICommand
{
  public function onCommand( $name, $args )
  {
    if ( $name != 'mail' ) return false;
    echo( "MailCommand handling 'mail'\n" );
    return true;
  }
}

$cc = new CommandChain();
$cc-&gt;addCommand( new UserCommand() );
$cc-&gt;addCommand( new MailCommand() );
$cc-&gt;runCommand( 'addUser', null );
$cc-&gt;runCommand( 'mail', null );
?&gt;</pre>
</td>
</tr>
</tbody>
</table>
<p>This code defines a <code>CommandChain</code> class that maintains a list of <code>ICommand</code> objects. Two classes implement the <code>ICommand</code> interface &#8212; one that responds to requests for mail and another that responds to adding users. The UML is shows in Figure 5.<br />
<a name="fig5"><strong>Figure 5. The command chain and its related commands</strong></a><br />
<img src="http://www.ibm.com/developerworks/library/os-php-designptrns/chain.gif" alt="The command chain and its related commands" width="359" height="121" /></p>
<p>If you run the script, which contains some test code, you see the following output:</p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>
<pre>% php chain.php
UserCommand handling 'addUser'
MailCommand handling 'mail'
%</pre>
</td>
</tr>
</tbody>
</table>
<p>The code first creates a <code>CommandChain</code> object and adds instances of the two command objects to it. It then runs two commands to see who responds to those commands. If the name of the command matches either <code>UserCommand</code> or <code>MailCommand</code>, the code falls through and nothing happens.</p>
<p>The chain-of-command pattern can be valuable in creating an extensible architecture for processing requests, which can be applied to many problems.</p>
<p><em><strong><a name="N1022F">The strategy pattern:</a></strong></em></p>
<p>The last design pattern we will cover is the <em>strategy</em> pattern. In this pattern, algorithms are extracted from complex classes so they can be replaced easily. For example, the strategy pattern is an option if you want to change the way pages are ranked in a search engine. Think about a search engine in several parts &#8212; one that iterates through the pages, one that ranks each page, and another that orders the results based on the rank. In a complex example, all those parts would be in the same class. Using the strategy pattern, you take the ranking portion and put it into another class so you can change how pages are ranked without interfering with the rest of the search engine code.</p>
<p>As a simpler example, Listing 6 shows a user list class that provides a method for finding a set of users based on a plug-and-play set of strategies.<br />
<a name="listing6"><strong>Listing 6. Strategy.php</strong></a></p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>
<pre>
&lt;?php
interface IStrategy
{
  function filter( $record );
}

class FindAfterStrategy implements IStrategy
{
  private $_name;

  public function __construct( $name )
  {
    $this-&gt;_name = $name;
  }

  public function filter( $record )
  {
    return strcmp( $this-&gt;_name, $record ) &lt;= 0;
  }
}

class RandomStrategy implements IStrategy
{
  public function filter( $record )
  {
    return rand( 0, 1 ) &gt;= 0.5;
  }
}

class UserList
{
  private $_list = array();

  public function __construct( $names )
  {
    if ( $names != null )
    {
      foreach( $names as $name )
      {
        $this-&gt;_list []= $name;
      }
    }
  }

  public function add( $name )
  {
    $this-&gt;_list []= $name;
  }

  public function find( $filter )
  {
    $recs = array();
    foreach( $this-&gt;_list as $user )
    {
      if ( $filter-&gt;filter( $user ) )
        $recs []= $user;
    }
    return $recs;
  }
}

$ul = new UserList( array( "Andy", "Jack", "Lori", "Megan" ) );
$f1 = $ul-&gt;find( new FindAfterStrategy( "J" ) );
print_r( $f1 );

$f2 = $ul-&gt;find( new RandomStrategy() );
print_r( $f2 );
?&gt;</pre>
</td>
</tr>
</tbody>
</table>
<p>The UML for this code is shown in Figure 6.<br />
<a name="fig6"><strong>Figure 6. The user list and the strategies for selecting users</strong></a><br />
<img src="http://www.ibm.com/developerworks/library/os-php-designptrns/strategy.gif" alt="The user list and the strategies for selecting users" width="309" height="138" /></p>
<p>The <code>UserList</code> class is a wrapper around an array of names. It implements a <code>find</code> method that takes one of several strategies for selecting a subset of those names. Those strategies are defined by the <code>IStrategy</code> interface, which has two implementations: One chooses users randomly and the other chooses all the names after a specified name. When you run the test code, you get the following output:</p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>
<pre>% php strategy.php
Array
(
    [0] =&gt; Jack
    [1] =&gt; Lori
    [2] =&gt; Megan
)
Array
(
    [0] =&gt; Andy
    [1] =&gt; Megan
)
%</pre>
</td>
</tr>
</tbody>
</table>
<p>The test code runs the same user lists against two strategies and shows the results. In the first case, the strategy looks for any name that sorts after <code>J</code>, so you get Jack, Lori, and Megan. The second strategy picks names randomly and yields different results every time. In this case, the results are Andy and Megan.</p>
<p>The strategy pattern is great for complex data-management systems or data-processing systems that need a lot of flexibility in how data is filtered, searched, or processed.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sobujarefin.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sobujarefin.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sobujarefin.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sobujarefin.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sobujarefin.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sobujarefin.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sobujarefin.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sobujarefin.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sobujarefin.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sobujarefin.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sobujarefin.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sobujarefin.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sobujarefin.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sobujarefin.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sobujarefin.wordpress.com&amp;blog=8727489&amp;post=20&amp;subd=sobujarefin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sobujarefin.wordpress.com/2009/09/17/five-common-php-design-patterns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a53dc64c8e98a0cf76830eedadf28174?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sobujarefin</media:title>
		</media:content>

		<media:content url="http://www.ibm.com/developerworks/library/os-php-designptrns/factory1.gif" medium="image">
			<media:title type="html">The factory class and its related IUser interface and user class</media:title>
		</media:content>

		<media:content url="http://www.ibm.com/developerworks/library/os-php-designptrns/factory2.gif" medium="image">
			<media:title type="html">The IUser interface and the user class with factory methods</media:title>
		</media:content>

		<media:content url="http://www.ibm.com/developerworks/library/os-php-designptrns/singleton.gif" medium="image">
			<media:title type="html">The database connection singleton</media:title>
		</media:content>

		<media:content url="http://www.ibm.com/developerworks/library/os-php-designptrns/observer.gif" medium="image">
			<media:title type="html">The observable user list and the user list event logger</media:title>
		</media:content>

		<media:content url="http://www.ibm.com/developerworks/library/os-php-designptrns/chain.gif" medium="image">
			<media:title type="html">The command chain and its related commands</media:title>
		</media:content>

		<media:content url="http://www.ibm.com/developerworks/library/os-php-designptrns/strategy.gif" medium="image">
			<media:title type="html">The user list and the strategies for selecting users</media:title>
		</media:content>
	</item>
		<item>
		<title>Firebug Tutorial : Section 4 – Net, CSS and DOM tabs</title>
		<link>http://sobujarefin.wordpress.com/2009/09/17/firebug-tutorial-section-4-%e2%80%93-net-css-and-dom-tabs/</link>
		<comments>http://sobujarefin.wordpress.com/2009/09/17/firebug-tutorial-section-4-%e2%80%93-net-css-and-dom-tabs/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 04:00:33 +0000</pubDate>
		<dc:creator>sobujarefin</dc:creator>
				<category><![CDATA[About Firebug]]></category>

		<guid isPermaLink="false">http://sobujarefin.wordpress.com/?p=8</guid>
		<description><![CDATA[This is the last post of Firebug tutorial series. I’m going to explain about Net panel, CSS panel and DOM panel in this tutorial. As there are not so much things to say about that, I’m gonna write up about all three panels in one post. #1. Net Panel The Net Panel can be used [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sobujarefin.wordpress.com&amp;blog=8727489&amp;post=8&amp;subd=sobujarefin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is the last post of Firebug tutorial series. I’m going to explain about Net panel, CSS panel and DOM panel in this tutorial. As there are not so much things to say about that, I’m gonna write up about all three panels in one post.</p>
<p><span style="text-decoration:underline;"><strong>#1. Net Panel</strong></span></p>
<p><img src="http://michaelsync.net/wp-content/uploads/2007/10/net-panel-toolbar.jpg" alt="Net Panel - Firebug" /></p>
<p>The <strong>Net Panel</strong> can be used for measuring the performance of your webpage. It shows very useful informations about how long your webpage takes to load, the size and loading time of each and every files (i.e: image files, css, js file and so on.) of your webpage. if you are looking for the way to improve the performance of your webpage, you just need to check the NET panel after loading your page and see which files took so long to load.</p>
<p>1.1. What is Net panel showing?</p>
<p><img src="http://michaelsync.net/wp-content/uploads/2007/10/net-panel-preview.jpg" alt="" /></p>
<p>Let’s take a lot what kinda information NET panel shows  for you. There are four columns in NET panel.</p>
<ol>
<li><strong>Name of files</strong> : The first column at the left-side shows the name of each and every files that are included in your webpage.</li>
<li><strong>Base URL</strong> : The second column shows the base URL of each file. If you are using some files from other sites (eg: linking image from other site, putting ads in your blog ) then the different URL(s) will be shown in this column.</li>
<li><strong>Size</strong> : The third column shows the size of each file.</li>
<li><strong>Loading Time</strong> : The last column shows the loading time of each file and whether those files are loaded from cache or not. It also show the status of each file in different colors as below. ( Thanks to <em>Jack Sleight</em> for the explanation of color and its</li>
</ol>
<ol>
<li>description )
<ol>
<li><strong>Green</strong> : Loading the file from server.</li>
<li><strong>Dark Grey</strong> :  Request sent to server, file loaded from server</li>
<li><strong>Light Grey</strong>: Request sent to server, “Not Modified” received, file loaded from the cache.</li>
<li><strong>No bar for the file</strong>: No request sent to server, file loaded from cache</li>
</ol>
</li>
</ol>
<p>You should also note that <span style="text-decoration:underline;">the list of files showing in the Net panel are sorted based on the order of how Firefox loaded those files.</span></p>
<p><strong>1.2. HTTP Headers</strong></p>
<p>The Net panel shows the <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html">HTTP headers</a> of every request/response messages so you can easily find out the interesting information like the parameters that are passed to server, the type of webserver, cookies and etc.</p>
<p><img src="http://michaelsync.net/wp-content/uploads/2007/10/header.jpg" alt="HTTP Header" /></p>
<p><strong> 1.3. Filter the requests by type</strong></p>
<p>If there are a lot of requests shown in Net panel, you can filter all of those requests based on the type of requests. For example, If you like to check the requests for image only then you can click the button called “Images” on toolbar to filter the requests for images.</p>
<p><img src="http://michaelsync.net/wp-content/uploads/2007/10/filter-by-type.jpg" alt="" /></p>
<p><strong>1.4. Full path of files and Image Preview</strong></p>
<p>If you move your cursor on the name of file (at the first column of Net panel), it will show you the full path of the file as a clickable link. If it is an image file then the actual image will be shown as a preview in Net panel. (Please check-out the pic below.)</p>
<p><img src="http://michaelsync.net/wp-content/uploads/2007/10/request-details.jpg" alt="" /></p>
<p><strong> Summary about Net panel</strong></p>
<ul>
<li>It shows the headers for request/response messages for all kind of requests</li>
<li>It can be used for XMLHttpRequest monitoring ( The Console panel does this too. You may check “Tracing XmlHttpRequest object” in <a title="Firebug Tutorial - Logging, Profiling and CommandLine (Part II)" href="http://michaelsync.net/2007/09/10/firebug-tutorial-logging-profiling-and-commandline-part-ii" target="_blank">this tutorial</a>. )</li>
<li>It sorts the files based on how Firefox loaded those files.</li>
<li>It shows the loading time, the size of each and every files.</li>
<li>It shows a particular file is loaded from server or cache.</li>
<li>Net panel is a packet sniffer. ( not like YSlow which is a DOM crawler.)</li>
</ul>
<p>Well. that’s all about Net panel. What do you think? Please leave a comment if you have any suggestion or comment.</p>
<p><span style="text-decoration:underline;"><strong>#2. CSS Panel</strong></span></p>
<p>The CSS panel allows you to view/edit the stylesheet of your page. It is just very simple panel and doesn’t have so much feature in it.</p>
<p><strong>2.1. List of CSS files</strong></p>
<p>To see all CSS files of your page, just click the button (”michaelsync.net” for my case) beside “Edit” button. Then, the content menu will be shown and all CSS files will be listed on that menu. So, you can simply click any CSS file that you wanna view.</p>
<p><img src="http://michaelsync.net/wp-content/uploads/2007/10/list-of-files.jpg" alt="" /></p>
<p><strong>2.2 Normal Mode Vs Editable Mode of CSS Panel</strong></p>
<p>Like HTML tab, it has normal mode and editable mode. If you click “Edit” button on the toolbar of CSS panel, it will become the editable mode.</p>
<p><span style="text-decoration:underline;">Normal Mode</span></p>
<p><img src="http://michaelsync.net/wp-content/uploads/2007/10/css-normal-view.jpg" alt="" /></p>
<ul>
<li>Advantages
<ul>
<li>It shows the highlighted CSS syntax so looks nice.</li>
<li>It allows you to edit the attribute of CSS class.</li>
<li>It autocompletes as you type against the list of possible values for the property you are editing</li>
<li>It allows you to disable a particular style on the fly.</li>
</ul>
</li>
<li>Disadvantages
<ul>
<li>You can’t create new CSS class in this view.</li>
<li>It is difficult to remove one or more CSS class(es) from the file</li>
</ul>
</li>
</ul>
<p><span style="text-decoration:underline;">Editable Mode</span></p>
<p><img src="http://michaelsync.net/wp-content/uploads/2007/10/editable-mode.jpg" alt="" /></p>
<ul>
<li>Advantages
<ul>
<li> You got the full control of your CSS file so that you can edit/remove the CSS class as many as you want. You will feel like writing in notepad.</li>
</ul>
</li>
<li>Disadvantages
<ul>
<li>You will lost all syntaxhighlighting or autocomplete feature of CSS panel.</li>
</ul>
</li>
</ul>
<p><span style="text-decoration:underline;"><strong>#3. DOM panel</strong></span></p>
<p>It shows all default DOM properties, functions, constants, the user-defined properties and user-defined function.This panel is not very helpful (at least for me) except one thing. If you wanna find out how many function or properties included your scripts, you may probably want to use this panel to find out about that.</p>
<p>Let’s write one short script as below in plain HTML file.</p>
<div id="highlighter_359584">
<div>
<div><a style="width:16px;height:16px;" title="view source" href="http://michaelsync.net/category/firebug#viewSource">view source</a></p>
<div></div>
<p><a style="width:16px;height:16px;" title="print" href="http://michaelsync.net/category/firebug#printSource">print</a><a style="width:16px;height:16px;" title="?" href="http://michaelsync.net/category/firebug#about">?</a></div>
</div>
<div>
<div><code>01.</code><span style="margin-left:0!important;"><code>&lt;!DOCTYPE html PUBLIC </code><code>"-//W3C//DTD XHTML 1.0 Transitional//EN"</code> <code>"<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>"</code><code>&gt;</code></span></div>
<div><code>02.</code><span style="margin-left:0!important;"><code>&lt;html xmlns=</code><code>"<a href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</a>"</code> <code>&gt;</code></span></div>
<div><code>03.</code><span style="margin-left:0!important;"><code>&lt;head&gt;</code></span></div>
<div><code>04.</code><span style="margin-left:0!important;"><code>&lt;title&gt;Untitled Page&lt;/title&gt;</code></span></div>
<div><code>05.</code><span style="margin-left:0!important;"><code>&lt;script type=</code><code>"text/javascript"</code><code>&gt;</code></span></div>
<div><code>06.</code><span style="margin-left:0!important;"><code>function</code> <code>Car(){</code></span></div>
<div><code>07.</code><span style="margin-left:0!important;"><code>this</code><code>.Gear = 5;</code></span></div>
<div><code>08.</code><span style="margin-left:0!important;"><code>this</code><code>.Start = </code><code>function</code><code>(){</code></span></div>
<div><code>09.</code><span style="margin-left:0!important;"><code>console.log(</code><code>"Please put my car a lit bit!"</code><code>);</code></span></div>
<div><code>10.</code><span style="margin-left:0!important;"><code>return</code> <code>false</code><code>;</code></span></div>
<div><code>11.</code><span style="margin-left:0!important;"><code>}</code></span></div>
<div><code>12.</code><span style="margin-left:0!important;"><code>}</code></span></div>
<div><code>13.</code><span style="margin-left:0!important;"><code>&lt;/script&gt;</code></span></div>
<div><code>14.</code><span style="margin-left:0!important;"><code>&lt;/head&gt;</code></span></div>
<div><code>15.</code><span style="margin-left:0!important;"><code>&lt;body&gt;</code></span></div>
<div><code>16.</code><span style="margin-left:0!important;"><code>&lt;/body&gt;</code></span></div>
<div><code>17.</code><span style="margin-left:0!important;"><code>&lt;/html&gt;</code></span></div>
</div>
</div>
<p>And then, save it as htm file. Open it in Firefox and then check the DOM tab. You will see the result as the picture below. “Car()” is a function that you just wrote in JS, isn’t it?</p>
<p><img src="http://michaelsync.net/wp-content/uploads/2007/10/dom.jpg" alt="" /></p>
<p>Okay. That’s all about DOM tab. This is the feature what DOM tab has so far….</p>
<p>My tutorials for Firebug is ended here. I hope that you all do enjoy reading all of my tutorials. Actually, I’m not teaching you about Firebug. I’m just sharing the way I understand about Firebug and I believe that you found it useful. Any feedback are welcome as usual. Feel free to let me know if you have any suggestion or comment.</p>
<p>One more thing is that Yahoo is releasing the Firefox addon called <a href="http://developer.yahoo.com/yslow/" target="_blank">YSlow</a> integreated with Firebug. This tool is also a performance measuring tool like Net panel. YSlow used to determine the performance of webpage based on <a href="http://developer.yahoo.com/yslow/help/#guidelines">13 rules</a></p>
<p>on behalf of -&gt; http://michaelsync.net/category/firebug</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sobujarefin.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sobujarefin.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sobujarefin.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sobujarefin.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sobujarefin.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sobujarefin.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sobujarefin.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sobujarefin.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sobujarefin.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sobujarefin.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sobujarefin.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sobujarefin.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sobujarefin.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sobujarefin.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sobujarefin.wordpress.com&amp;blog=8727489&amp;post=8&amp;subd=sobujarefin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sobujarefin.wordpress.com/2009/09/17/firebug-tutorial-section-4-%e2%80%93-net-css-and-dom-tabs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a53dc64c8e98a0cf76830eedadf28174?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sobujarefin</media:title>
		</media:content>

		<media:content url="http://michaelsync.net/wp-content/uploads/2007/10/net-panel-toolbar.jpg" medium="image">
			<media:title type="html">Net Panel - Firebug</media:title>
		</media:content>

		<media:content url="http://michaelsync.net/wp-content/uploads/2007/10/net-panel-preview.jpg" medium="image" />

		<media:content url="http://michaelsync.net/wp-content/uploads/2007/10/header.jpg" medium="image">
			<media:title type="html">HTTP Header</media:title>
		</media:content>

		<media:content url="http://michaelsync.net/wp-content/uploads/2007/10/filter-by-type.jpg" medium="image" />

		<media:content url="http://michaelsync.net/wp-content/uploads/2007/10/request-details.jpg" medium="image" />

		<media:content url="http://michaelsync.net/wp-content/uploads/2007/10/list-of-files.jpg" medium="image" />

		<media:content url="http://michaelsync.net/wp-content/uploads/2007/10/css-normal-view.jpg" medium="image" />

		<media:content url="http://michaelsync.net/wp-content/uploads/2007/10/editable-mode.jpg" medium="image" />

		<media:content url="http://michaelsync.net/wp-content/uploads/2007/10/dom.jpg" medium="image" />
	</item>
		<item>
		<title>Review On The Birds (1963)</title>
		<link>http://sobujarefin.wordpress.com/2009/07/25/review-on-the-birds-1963/</link>
		<comments>http://sobujarefin.wordpress.com/2009/07/25/review-on-the-birds-1963/#comments</comments>
		<pubDate>Sat, 25 Jul 2009 16:09:29 +0000</pubDate>
		<dc:creator>sobujarefin</dc:creator>
				<category><![CDATA[Favourite]]></category>
		<category><![CDATA[Movie]]></category>

		<guid isPermaLink="false">http://sobujarefin.wordpress.com/?p=6</guid>
		<description><![CDATA[The Birds (1963) is a modern Hitchcock thriller/masterpiece, his first film with Universal Studios. It is the apocalyptic story of a northern California coastal town filled with an onslaught of seemingly unexplained, arbitrary and chaotic attacks of ordinary birds &#8211; not birds of prey. Ungrammatical advertising campaigns emphasized: &#8220;The Birds Is Coming.&#8221; This Technicolor feature [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sobujarefin.wordpress.com&amp;blog=8727489&amp;post=6&amp;subd=sobujarefin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="font-size:x-small;"><strong>The Birds</strong> (1963) is a modern Hitchcock thriller/masterpiece,      his first film with Universal Studios. It is the apocalyptic story of a northern      California coastal town filled with an onslaught of seemingly unexplained,      arbitrary and chaotic attacks of ordinary birds &#8211; not birds of prey. Ungrammatical      advertising campaigns emphasized: &#8220;The Birds Is Coming.&#8221; This Technicolor      feature came after <a href="http://www.filmsite.org/psyc.html"><em>Psycho (1960)</em></a> &#8211; another      film loaded with &#8216;bird&#8217; references. </span></p>
<p><span style="font-size:x-small;">Novelist Evan Hunter based his screenplay upon the 1952 collection      of short stories of the same name by Daphne du Maurier &#8211; Hitchcock&#8217;s third      major film based on the author&#8217;s works (after <em>Jamaica Inn (1939)</em> and      <a href="http://www.filmsite.org/rebec.html"><em>Rebecca (1940)</em></a>). In du Maurier&#8217;s story, the      birds were attacking in the English countryside, rather than in a small town      north of San Francisco. The film&#8217;s technical wizardry is extraordinary, especially      in the film&#8217;s closing scene (a complex, trick composite shot) &#8211; the special      visual effects of Ub Iwerks were nominated for an Academy Award (the film&#8217;s      sole nomination), but the Oscar was lost to <em>Cleopatra</em>. Hundreds of      birds (gulls, ravens, and crows) were trained for use in some of the scenes,      while mechanical birds and animations were employed for others.</span></p>
<p><span style="font-size:x-small;"> </span></p>
<p><span style="font-size:x-small;"> The film&#8217;s non-existent musical score is replaced by an electronic soundtrack      (including simulated bird cries and wing-flaps), with Hitchcock&#8217;s favorite      composer Bernard Herrmann serving as a sound consultant. It was shot on location      in the port town of Bodega Bay (north of San Francisco) and in San Francisco      itself. Hitchcock introduced a &#8216;fascinating new personality&#8217; for the film      &#8211; his successor to Grace Kelly &#8211; a cool, blonde professional model named &#8216;Tippi&#8217;      Hedren, in her film debut in a leading role. [Hedren reprised her character      in a minor supporting role, in an inferior made-for-TV sequel, <em>The Birds      II: Land's End (1994)</em>, set in the New England fishing town of Land's End.      The director was Rick Rosenthal, although the standard generic pseudonym 'Alan      Smithee' is found in the credits. Leads Rod Taylor and Tippi Hedren are replaced      by Brad Johnson and Chelsea Field.] </span></p>
<p><span style="font-size:x-small;"> Initially, critics were baffled when they attempted to interpret the film      on a literal level and measure it against other typical disaster/horror films      of its kind. The typical Hitchcock MacGuffin is the question: <em>Why do the      strange attacks occur?</em> But the film cannot solely be interpreted that      way, because as the actors in the film discover in the long discussion scene      in the Tides Restaurant, there is no solid, rational reason why the birds      are attacking. They are not seeking revenge for nature&#8217;s mistreatment, or      foreshadowing doomsday, and they don&#8217;t represent God&#8217;s punishment for humankind&#8217;s      evil. </span></p>
<p><span style="font-size:x-small;"> When this is understood, the symbolic film&#8217;s complex fabric makes more sense,      especially if interpreted in Freudian terms. It is about three needy women      (literally &#8216;birds&#8217;) &#8211; and a fourth from a younger generation &#8211; each flocking      around and vying for varying degrees of affection and attention from the sole,      emotionally-cold male lead, and the fragile tensions, anxieties and unpredictable      relations between them. The attacks are mysteriously related to the mother      and son relationship in the film &#8211; anger (and fears of abandonment or being      left lonely) of the jealous, initially hostile mother surface when her bachelor      son brings home an attractive young woman. Curiously, the first attack has      symbolic phallic undertones &#8211; it occurs when the man and woman approach toward      each other outside the restaurant in the coastal town. </span></p>
<p><span style="font-size:x-small;"> On an allegorical level, the birds in the film are the physical      embodiment and exteriorization of unleashed, disturbing, shattering forces      that threaten all of humanity (those threatened in the film include schoolchildren,      a defenseless farmer, bystanders, a schoolteacher, etc.) when relationships      have become insubstantial, unsupportive, or hurtful. In a broader, more universal      sense, the stability of the home and natural world environment, symbolized      by broken teacups at the domestic level, is in jeopardy and becoming disordered      when people cannot &#8216;see&#8217; the dangers gathering nearby, and cannot adequately      protect themselves from violence behind transparent windows, telephone booths,      eyeglasses, or facades. Numerous allusions to blindness are sprinkled throughout      the film (the farmer&#8217;s eyes are pecked out, the children play blindman&#8217;s bluff      at the birthday party, the broken glasses of the fleeing schoolchild, etc.),      giving the hint that the camera&#8217;s voyeuristic lens (and its screen-viewing      audience) is also being subjected to assault. </span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sobujarefin.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sobujarefin.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sobujarefin.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sobujarefin.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sobujarefin.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sobujarefin.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sobujarefin.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sobujarefin.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sobujarefin.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sobujarefin.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sobujarefin.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sobujarefin.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sobujarefin.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sobujarefin.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sobujarefin.wordpress.com&amp;blog=8727489&amp;post=6&amp;subd=sobujarefin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sobujarefin.wordpress.com/2009/07/25/review-on-the-birds-1963/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a53dc64c8e98a0cf76830eedadf28174?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sobujarefin</media:title>
		</media:content>
	</item>
		<item>
		<title>Migrating Joomla from 1.0.x to 1.5 Stable</title>
		<link>http://sobujarefin.wordpress.com/2009/07/25/migrating-joomla-from-1-0-x-to-1-5-stable/</link>
		<comments>http://sobujarefin.wordpress.com/2009/07/25/migrating-joomla-from-1-0-x-to-1-5-stable/#comments</comments>
		<pubDate>Sat, 25 Jul 2009 15:22:13 +0000</pubDate>
		<dc:creator>sobujarefin</dc:creator>
				<category><![CDATA[Joomla Resource]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://sobujarefin.wordpress.com/?p=3</guid>
		<description><![CDATA[The migration from Joomla! 1.0 to 1.5 is handled for the most part automatically in two stages. The first stage is the export migration component for Joomla! 1.0 and the second stage is the import or migration phase of the Joomla! 1.5 installer. The system is automated due to a large number of changes that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sobujarefin.wordpress.com&amp;blog=8727489&amp;post=3&amp;subd=sobujarefin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The migration from Joomla! 1.0 to 1.5 is handled for the most part automatically in two stages. The first stage is the export migration component for Joomla! 1.0 and the second stage is the import or migration phase of the Joomla! 1.5 installer. The system is automated due to a large number of changes that make data slightly incompatible between Joomla! 1.0 and 1.5, such as parameters for menus and content items. Whilst it is still possible to use a database dump to migrate, this is not advised as there will be data loss. This page aims to detail how to migrate from Joomla! 1.0 to Joomla! 1.5 with as much ease as possible.</p>
<h2><span>Prerequisites</span></h2>
<p>You will need a working Joomla! install, though using the latest available release of Joomla! 1.0 is always the best option. It is suggested that if you are using 1.0.13 you install <a title="http://forum.joomla.org/index.php/topic,200725.0.html" rel="nofollow" href="http://forum.joomla.org/index.php/topic,200725.0.html">Rob Schley&#8217;s patch for admin sessions</a>. As with everything you should take a full backup of everything before you start just in case something does go wrong. We advise that you do not destroy your 1.0.x install until you have completely finished migrating to 1.5 and are happy that things are working properly. Ideally you should complete migration using a testing system first before attempting it on your production system (e.g. either by using sites restored from backups or other replicas) and when deploying, separate your 1.0.x install from 1.5 (e.g. different database or at the least a different prefix).</p>
<p>If you&#8217;re using a UTF-8 database please make sure that you have followed <a title="http://forum.joomla.org/viewtopic.php?f=11&amp;t=55065" rel="nofollow" href="http://forum.joomla.org/viewtopic.php?f=11&amp;t=55065">David Gal&#8217;s Joomla! UTF-8 guide</a> before you export from your Joomla! 1.0 site &#8211; this will make your dump file in UTF-8 format so when you come to the relevant part of the Joomla! 1.5 installation your encoding will be UTF-8.</p>
<p>If you aren&#8217;t creating UTF-8 dump files then you are going to need to either have iconv installed on your server where you&#8217;re installing 1.5 so it can automatically convert your dump file or convert it from what ever encoding it is presently into UTF-8 prior to migration. You can check if you have iconv by looking at the output of phpinfo for &#8216;iconv&#8217;, available in the help system of Joomla! (System -&gt; System Info -&gt; PHP Info under Joomla! 1.0 and Help -&gt; System Info -&gt; PHP Information under Joomla! 1.5). iconv is a relatively common extension that should be available in most situations, refer to either the PHP documentation or your hosting provider on how you can enable iconv.</p>
<p><a id="Step_1:_Downloading_the_Migrator_component_and_installing_it_into_your_1.0_instance" name="Step_1:_Downloading_the_Migrator_component_and_installing_it_into_your_1.0_instance"></a></p>
<h2><span>Step 1: Downloading the Migrator component and installing it into your 1.0 instance</span></h2>
<p>The latest version of the migrator component exists at the <a title="http://joomlacode.org/gf/project/pasamioprojects/frs/" rel="nofollow" href="http://joomlacode.org/gf/project/pasamioprojects/frs/">Pasamio Project&#8217;s FRS site</a>. At the time of writing the latest release is <a title="http://joomlacode.org/gf/download/frsrelease/10646/41924/migrator.zip" rel="nofollow" href="http://joomlacode.org/gf/download/frsrelease/10646/41924/migrator.zip">Migrator 1.5</a>. Download the Migrator component to your system and then install it into the 1.0 install. This is done like any normal component install. There will be a Migrator entry in the Component menu option where you can access the Migrator.</p>
<p><a id="Step_2:_Installing_Third_Party_Migrator_plugins" name="Step_2:_Installing_Third_Party_Migrator_plugins"></a></p>
<h2><span>Step 2: Installing Third Party Migrator plugins</span></h2>
<p>The Migration system only handles the core system in its migration which means that if you want to include third party extension data from other tables you will have to install migrator plugins to handle the migration of this data. There are two types of plugins that are used: an &#8220;SQL&#8221; plugin which is a plain text SQL file and an &#8220;ETL&#8221; Plugin which is a bit of PHP that tells the migrator how to handle the data stored in tables (or in configuration files). This is done by selecting &#8220;Add Third Party Migrators&#8221;, and then locating the plugin you wish to install and uploading the file. SQL files will be prepended to the output automatically and ETL plugins will be executed automatically. You can view a list of ETL plugins by clicking &#8220;List Plugins&#8221; in the main screen. You can also upload ETL plugins to the &#8220;plugins&#8221; directory in the &#8220;/administrator/components/com_migrator&#8221; directory in your Joomla! site.</p>
<p>The JED lists <a title="http://extensions.joomla.org/extensions/extension-specific/migrator-extensions" rel="nofollow" href="http://extensions.joomla.org/extensions/extension-specific/migrator-extensions">third party migrator ETL plugins</a>.</p>
<p><a id="Step_3:_Creating_the_Migration_SQL_File" name="Step_3:_Creating_the_Migration_SQL_File"></a></p>
<h2><span>Step 3: Creating the Migration SQL File</span></h2>
<p>Once you have installed any third party migrator plugins, you can select the &#8220;Create Migration SQL file&#8221; to begin the creation process. The system is designed to build an SQL file without causing a timeout on the server, so you may notice that the page automatically refreshes and displays status information. Eventually it will display a notification that the process has been completed and the SQL file will be available for download. Part of the SQL file generation involves the alteration of various fields to make them compatible with changes made in Joomla! 1.5, including the rewriting of mosimage tags.</p>
<p><a id="Step_4:_Installing_Joomla.21_1.5" name="Step_4:_Installing_Joomla.21_1.5"></a></p>
<h2><span>Step 4: Installing Joomla! 1.5</span></h2>
<p><strong>Note: Create your new Joomla! 1.5 install in a separate directory and database to your existing install (or different prefix if you cannot create a new database). You cannot extract over the top of your 1.0 install, you have to create a new Joomla! 1.5 site. Alternatively, move your 1.0 install to a safe location and install into the empty directory 1.0 will have created. It is not a very good idea to install a new Joomla! 1.5 site over the top of your existing 1.0 site, it is better to test things in a seperate directory and progress from there.</strong></p>
<p>If you can&#8217;t install Joomla!, or Joomla! has already been installed, you can use the Migration Assistant in your 1.5 site. Note that beyond itself it will wipe out the 1.5 site&#8217;s database back to a clean install and then do the migration. Any information that is in the 1.5 sites database will be deleted. The migration assistant is available at the same place as the Migrator, the latest version is <a title="http://joomlacode.org/gf/download/frsrelease/8194/29876/migrationassistant.tgz" rel="nofollow" href="http://joomlacode.org/gf/download/frsrelease/8194/29876/migrationassistant.tgz">Migration Assistant 1.5.2</a>. There may be a later version, so check <a title="http://joomlacode.org/gf/project/pasamioprojects/frs/" rel="nofollow" href="http://joomlacode.org/gf/project/pasamioprojects/frs/">Pasamio Project&#8217;s FRS site</a> for any updates.</p>
<p><strong>If you haven&#8217;t done so already, take a full back up of your 1.0 site, including all of the filesystem and the database. Do not proceed without a backup.</strong></p>
<p>The last phase of the migration is the installation of a new Joomla! 1.5 site. You need to install &#8217;1.5 into a completely new directory, you should keep this separate to your 1.0 directory. If you just unzip over the top of your existing 1.0 site, you will have issues with it finding an invalid copy of the configuration.php&#8221; file, so either move your original install or create a new directory. Complete the initial steps of the installation as per a normal installation. In the final step where you are prompted for the site name you are given the opportunity to initiate the migration process. Migration requires the generated SQL file to complete its operation, which might need to be uploaded to your new 1.5 site, there are two options for doing this:</p>
<ul>
<li>HTTP Upload</li>
<li>FTP/SCP Upload</li>
</ul>
<p>The first method, HTTP upload, is best for smaller SQL files that will fit within the upload limits of PHP. The alternative is to upload a file using either FTP, SCP or some other method of file transfer that your hosting provider offers. This is useful for larger SQL files that would normally not be permitted by PHP. To use the HTTP method, simply select the file like a normal component installation. To use the alternative upload method, upload the files into the installation/sql/migration folder and rename the file to be called &#8220;migrate.sql&#8221;. If for some reason the migration fails you will need to reupload the SQL file for both methods, HTTP and FTP/SCP, as the file is altered through the migration process. The prefix for all migration dumps is &#8220;jos_&#8221;, this should be placed into the provided text box. Once migration has been completed, enter in a site name (the site name cannot be migrated for technical reasons) and finish the installation.</p>
<p>Using either method the &#8220;/installation/sql/migration&#8221; folder and your temporary files folder (e.g. &#8220;/tmp&#8221;) need to be writeable by the web user (e.g. &#8220;wwwrun&#8221;, &#8220;www-data&#8221; or &#8220;apache&#8221;). The migrator will write data back to these locations as it updates the dump files.</p>
<p>Please note you also need to tick the &#8220;This script is a Joomla! 1.0 migration script&#8221; box as well before you migrate otherwise you will have issues with importing data.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sobujarefin.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sobujarefin.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sobujarefin.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sobujarefin.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sobujarefin.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sobujarefin.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sobujarefin.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sobujarefin.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sobujarefin.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sobujarefin.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sobujarefin.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sobujarefin.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sobujarefin.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sobujarefin.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sobujarefin.wordpress.com&amp;blog=8727489&amp;post=3&amp;subd=sobujarefin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sobujarefin.wordpress.com/2009/07/25/migrating-joomla-from-1-0-x-to-1-5-stable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a53dc64c8e98a0cf76830eedadf28174?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sobujarefin</media:title>
		</media:content>
	</item>
	</channel>
</rss>
