<?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/"
	>

<channel>
	<title>{ Online Notes }</title>
	<atom:link href="http://www.armando.ws/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.armando.ws</link>
	<description>All things Technical and Personal - Armando Padilla</description>
	<lastBuildDate>Wed, 10 Mar 2010 02:51:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Someday.</title>
		<link>http://www.armando.ws/2010/03/776/</link>
		<comments>http://www.armando.ws/2010/03/776/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 02:39:42 +0000</pubDate>
		<dc:creator>Armando Padilla</dc:creator>
				<category><![CDATA[Personal Rants]]></category>

		<guid isPermaLink="false">http://www.armando.ws/?p=776</guid>
		<description><![CDATA[Do you think that we run in the way we live our life? I used to run a few laps in the opposite direction everyone else was running at the local park in South Gate when i lived in Los Angeles. Now, I run with my head down trying to finish my 2 miles.  [...]]]></description>
			<content:encoded><![CDATA[<p>Do you think that we run in the way we live our life? I used to run a few laps in the opposite direction everyone else was running at the local park in South Gate when i lived in Los Angeles. Now, I run with my head down trying to finish my 2 miles.  I look occasionally up to see how much i have left. .60 miles, 1.20 miles. 2 miles, *click the stop button.  Just get it done.</p>
<p>I used to climb mountains in my dreams, a few nights ago I had a dream of climbing a mountain that I used to easily reach its summit, this time i took the harder route. The terrain wasn&#8217;t the issue it just had a casino, escalators, and generally people getting in my way. Beware of fluff.  </p>
<p>2 teachers come to mind right now.  One told my mom i had low self-esteem, the other told my mom I was a big fish in a small pond but I knew that already so I grow complacent.  He warned me that one day I will be introduced to a bigger fish. Still thinking why this keeps bugging me.</p>
<p>I have a new friend that reminds me too much of an old friend.  The body is different but the person is the same.  We meet the same soul in this short journey many times throughout our lives for a reason.  I&#8217;m not sure why.  </p>
<p>I have 30 years to go, give or take. Going to make it count somehow.</p>
<p>Armando Padilla  &#8211; Zoning out at work usually means im thinking of one of the 5 things above.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.armando.ws/2010/03/776/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The need to write returns!</title>
		<link>http://www.armando.ws/2010/03/the-need-to-write-returns/</link>
		<comments>http://www.armando.ws/2010/03/the-need-to-write-returns/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 03:24:33 +0000</pubDate>
		<dc:creator>Armando Padilla</dc:creator>
				<category><![CDATA[Personal Rants]]></category>

		<guid isPermaLink="false">http://www.armando.ws/?p=773</guid>
		<description><![CDATA[So Im back to writing.  
Im currently in class &#8230; &#8220;in. class&#8221;.  Some guy is presenting his final but yea, the prof said 20 minutes we all stuck to 20 minutes and this guy is going on 1 hour&#8230;:-&#124; not cool.  So to make the point clear im not paying attention anymore. [...]]]></description>
			<content:encoded><![CDATA[<p>So Im back to writing.  </p>
<p>Im currently in class &#8230; &#8220;in. class&#8221;.  Some guy is presenting his final but yea, the prof said 20 minutes we all stuck to 20 minutes and this guy is going on 1 hour&#8230;:-| not cool.  So to make the point clear im not paying attention anymore.  I could be an asshole and say, &#8220;this machine learning algo isnt applicable to this&#8221; OR say, &#8220;whats wrong with current libraries, most if not all of what you want can already be done with Java AND even PHP&#8221;  but im not i dont want to be that know-it-all guy in the class since i know my presentation wasnt good either BUT at least it ddnt take up an hour of our time. Anywho.</p>
<p>Why is it so easy for kids to realize a number of things which adults seem to over complicate.  I guess you can say that we see the consequences. Wasnt it so much easier then? Lately I&#8217;m realizing the end of friendships are much like the end of a relationship born out of love (or the concept of love).  Theres a slooow drown out process, but it does have a process.  Ive been through both and I think &#8220;breaking up&#8221; with a friend is much worse.</p>
<p>At this point I feel like its a game of managing both expectations and risk.</p>
<p>Armando Padilla &#8211; on &#8230;whatever.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.armando.ws/2010/03/the-need-to-write-returns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML5, Chrome, and WebDatabase.</title>
		<link>http://www.armando.ws/2010/02/html5-chrome-and-webdatabase/</link>
		<comments>http://www.armando.ws/2010/02/html5-chrome-and-webdatabase/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 08:35:09 +0000</pubDate>
		<dc:creator>Armando Padilla</dc:creator>
				<category><![CDATA[PHP Development]]></category>

		<guid isPermaLink="false">http://www.armando.ws/?p=668</guid>
		<description><![CDATA[I started to get the HTML5 itch a few weeks ago so I started to look around the web to feed my appetite for all things HTML 5.  Turns out info is pretty hard to come by.  Not sure when your reading this but its been tough to find adequate examples of what [...]]]></description>
			<content:encoded><![CDATA[<p>I started to get the HTML5 itch a few weeks ago so I started to look around the web to feed my appetite for all things HTML 5.  Turns out info is pretty hard to come by.  Not sure when your reading this but its been tough to find adequate examples of what IS and what ISNT implemented yet since it all depends on the browser your using.  Anyway. So im going to jot down my notes on using HTML5&#8217;s Web Database here by creating a few examples.</p>
<p><strong>Quick Agenda</strong><br />
1. <a href="#whatis">What is HTML 5</a>.<br />
2. <a href="#gettingstarted">What you need to get started.</a><br />
3. <a href="#devtool">The tool to view the DB</a><br />
4. <a href="#createconndb">How to create AND connect to a DB</a>.<br />
5. <a href="#createtable">How to create a table.</a><br />
6. <a href="#insertrecords">How to insert/update/delete records into a table.</a><br />
7. <a href="#listrecords">How to list records in a table.</a></p>
<p>Let get the ball rollin&#8217; now&#8230;buhahah</p>
<p><strong id="whatis">What is HTML 5.</strong><br />
HTML 5 is a collection of new tags, (<a href="http://www.w3schools.com/html5/html5_reference.asp">list here</a>)  and along with the new tags it provides a tool set to store data on the user&#8217;s machine using javascript, yes Javascript (<a href="http://dev.w3.org/html5/webdatabase/">Web database API here</a>). </p>
<p><strong id="gettingstarted">What you need to get started.</strong><br />
For the example you&#8217;ll need at least Chrome 4.  Of course you can use any browser you wish but <strong>YOU NEED TO BE SURE HTML 5 WEB DATABASE IS SUPPORTED.</strong>.  I strongly recommend you download and install Google&#8217;s Chrome browser, so far it&#8217;s great. <a href="http://www.google.com/chrome/">Click here for download link</a>.</p>
<p>Thats all you need, oh! and you&#8217;ll need some HTML and Javascript know-how.</p>
<p><div id="attachment_674" class="wp-caption alignleft" style="width: 310px"><img src="http://www.armando.ws/wp-content/uploads/2010/02/figure1.0-300x155.jpg" alt="Figure 1.0 - Chrome Developer Tools" title="figure1.0" width="300" height="155" class="size-medium wp-image-674" /><p class="wp-caption-text">Figure 1.0 - Chrome Developer Tools</p></div><strong id="devtool">The tools</strong><br />
If you don&#8217;t have Chrome installed skip this section. This section will show the visual tool Chrome supplies developers to view not only the database but other neat things about your page. </p>
<p>Load the web page your going to test on.  In my case its http://localhost then click on the &#8220;Control Page&#8221; document icon on the far-top-right corner of your browser . Select <strong><em>Developer > Developer Tools</em></strong>. (Figure 1.0)</p>
<p>You should now see a window as shown in Figure 1.2 (minus the DB). If you do not see the information displayed on Figure 1.2 click on &#8220;Storage&#8221; on the top menu. The &#8220;Storage&#8221; window contains a nice little DATABASE list on the left along with other items specific to that page.  At the moment there&#8217;s no databases so you wont see anything. This is just the place where you&#8217;ll be able to work with the DB <img src='http://www.armando.ws/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><strong id="createconndb">How to create AND connect to the DB</strong><br />
Let&#8217;s create a database. Our database will have the name, &#8220;test_database&#8221; and will be our initial 1.0 version. (Note: the database name is case sensitive)</p>
<p><code></p>
<pre>
dbObj = null;

function connectToDB(){
  dbObj = openDatabase('test_database', '1.0',
                                 'Test Database', 1024*1024*3);
}

connectToDB();
</pre>
<p></code></p>
<p>1. <strong>openDatabase</strong>(&#8217;name of db&#8217;, &#8216;version&#8217;, &#8216;database description&#8217;, total bits table will use, call back function)</p>
<p>The callback function is used to create the table structure if present.  In this example we&#8217;ll create the tables later.  Also note that the size of the database is dependent on the amount of free space the user has available. <div id="attachment_683" class="wp-caption alignleft" style="width: 310px"><img src="http://www.armando.ws/wp-content/uploads/2010/02/figure_1.2-300x228.jpg" alt="Developer Tool Database" title="Figure 1.2" width="300" height="228" class="size-medium wp-image-683" /><p class="wp-caption-text">Figure 1.2 Developer Tool Database</p></div>It is also recommended that the site only take up to 5 mbs of space. The spec also mentions the user will be prompted when the site requests additional space. (<a href="http://dev.w3.org/html5/webdatabase/#disk-space">quote</a>)</p>
<p>Once you run the above javascript on your sandbox, pull up the Chrome Developer tool, you should now see the database (Figure 1.2) </p>
<p><strong id="createtable">How to create a table.</strong><br />
Were going to add a table.  We&#8217;re going open a connection to the database again as shown in the first example and then use the SQLTransation object to execute a CREATE statement. </p>
<p><code></p>
<pre>
dbObj = null;

function connectToDB()
{
   dbObj = openDatabase('test_database', '1.0',
                                   'Test Database', 1024*1024*3);
}

connectToDB();

  //Create the table method
createTable = function()
{
   dbObj.transaction(function(SQLTransaction){
        SQLTransaction.executeSql(
        "CREATE TABLE userinfo (id INTEGER PRIMARY KEY, item1 TEXT)", [],
        function(){ alert('I am a successfull callback function!'); },
        function(){ alert('Oh no! I am a sad error callback function'); } );
      });
}

createTable();
</pre>
<p></code></p>
<p>Copy the above javascript, place into your file, and refresh the page. You will now have the table &#8216;userinfo&#8217; in our database.  If you want to add more tables simple call the method once more with a different CREATE statement. (Figure 1.3). </p>
<p><strong>Some explaining&#8230;</strong><br />
SQLTransaction has 2 methods, transaction() (Read/Write) and readTransaction() (Read only).  We use the transaction method when we need to read AND write. The readTransaction() has only &#8216;read only&#8217; functionality and best used for SELECT SQL statements.</p>
<p>To execute the SQL statements we use the executeSql() method.  A parameter explanation is shown below.</p>
<p><strong>executeSql</strong>(&#8217;SQL Statement&#8217;, [], success callback function, error callback function) .  The [] contains values for each ? used within the SQL statement.  &#8220;INSERT INTO userinfo (item1) VALUES (?)&#8221; will replace the ? with the the content to save for the specific column.  It&#8217;s also recommended to use this feature to code against SQL Injection attacks. (<a href="http://dev.w3.org/html5/webdatabase/#sql-injection">quote</a>)</p>
<p><strong id="insertrecords">How to insert/update/delete records into the DB</strong><br />
At this point UPDATE, INSERT, as well as DELETE statements use the same process as the previous example. We use the SQLTransaction.transaction() method as well as the executeSql() method.  </p>
<p>The next example will insert a record into our database table, &#8216;userinfo&#8217;, and we&#8217;ll verify the data entered using the Chrome Developer tool. Please note that the below code assumes you already created the table.</p>
<p><code></p>
<pre>
dbObj = null;

function connectToDB()
{
   dbObj = openDatabase('test_database', '1.0',
				   'Test Database', 1024*1024*3);
}

connectToDB();

//Insert record into Table.
insertRecord = function(item1)
{
   dbObj.transaction(function(SQLTransaction){
      SQLTransaction.executeSql("INSERT INTO userinfo (item1) VALUES (?)", [item1],
   function(){ alert('Record saved!'); },
   function(){ alert('Uh Oh! record not save!'); } );

   });

}
var item1 = "your not funny dude..really your not.";
insertRecord(item1);
</pre>
<p></code></p>
<p><div id="attachment_752" class="wp-caption alignleft" style="width: 310px"><img src="http://www.armando.ws/wp-content/uploads/2010/02/figure1_3-300x228.jpg" alt="Figure 1.3 - Verifying our record was inserted." title="figure1_3" width="300" height="228" class="size-medium wp-image-752" /><p class="wp-caption-text">Figure 1.3 - Verifying our record was inserted.</p></div>Pull up your Dev Tools Window again, expand the database by clicking the arrow, and click on the table.  The record you just inserted will be displayed on the right as shown in Figure 1.3. Thats great but let&#8217;s now focus on retrieving the records to possibly manipulate the data!</p>
<p><strong id="listrecords">How to List records</strong><br />
With data in our database, lets fetch the record we have in the table.  To do so we use the read/write SQLTransaction method, readTransaction().  </p>
<p>The following code assumes you have the database created, table created, and information stored in the table.  If not go back and read the different sections.</p>
<p><code></p>
<pre>
dbObj = null;

function connectToDB()
{
   dbObj = openDatabase('test_database', '1.0',
				   'Test Database', 1024*1024*3);
}

connectToDB();

fetchRecords = function(){

   dbObj.readTransaction(function(SQLTransaction){
      SQLTransaction.executeSql('SELECT id, item1 FROM userinfo', [],
				function(SQLTransaction, data){
                                displayRecords(data); });
		});

}

displayRecords = function(data){

   var a = document.getElementById("text");
   a.innerText = data.rows.item(0).item1;

}

fetchRecords();
</pre>
<p></code></p>
<p>In this example we query the table and display the results of the call.  We use the SQLTransaction readTransaction() method, SQLTransaction executeSql() method passing in the SQL statement and a call back function displayRecords().   If the SQL SELECT statement successfully ran we pass a SQLResultSet object, &#8216;data&#8217;, to the displayRecords() method.  The displayRecords() method fetches the HTMLElement node, &#8216;text&#8217; and sets the text for the node to be the record fetched item1 value.  </p>
<p><strong>Fetching a specific value for a row.</strong><br />
To fetch the record we use the SQLResultSet object&#8217;s &#8216;rows&#8217; attribute which returns a SQLResultSetRowList object.  We then use the &#8216;item()&#8217; method to fetch a specific row in the row list.  In this case we fetch the first row and call the objects class property, &#8216;item1&#8242;.  Note that each column in the table is represented but a class property.</p>
<p><strong>Conclusion</strong><br />
We covered all the basic features of the HTML 5 web database.  Inserting, creating a table, connecting to a DB, and fetching records.  Give it a shot, if you have any questions feel free to leave a comment or refer to the W3C page <img src='http://www.armando.ws/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Armando Padilla</p>
]]></content:encoded>
			<wfw:commentRss>http://www.armando.ws/2010/02/html5-chrome-and-webdatabase/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ambition, What matters, and my short fuse.</title>
		<link>http://www.armando.ws/2010/02/ambition-what-matters-and-my-short-fuse/</link>
		<comments>http://www.armando.ws/2010/02/ambition-what-matters-and-my-short-fuse/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 04:08:32 +0000</pubDate>
		<dc:creator>Armando Padilla</dc:creator>
				<category><![CDATA[Personal Rants]]></category>

		<guid isPermaLink="false">http://www.armando.ws/?p=745</guid>
		<description><![CDATA[Yes I did say I wasn&#8217;t going to write on here but whatever.  Whats on my mind? What matters to me.  A few years ago if someone would have said, &#8220;You care how much your partner makes, huh?&#8221;, I would have said, &#8220;im not that shallow. It doesn&#8217;t matter to me&#8221;.  Now [...]]]></description>
			<content:encoded><![CDATA[<p>Yes I did say I wasn&#8217;t going to write on here but whatever.  Whats on my mind? What matters to me.  A few years ago if someone would have said, &#8220;You care how much your partner makes, huh?&#8221;, I would have said, &#8220;im not that shallow. It doesn&#8217;t matter to me&#8221;.  Now I have to fess up, it does matter to me.  How do I feel about this?  Not that bad actually.  Here&#8217;s my justification.  If one person in the relationship is working hard to be at and stay at a certain level of income while the other person isn&#8217;t holding up to their end of the bargain its only a matter of time before the person working hard starts to ask serious questions about the relationship. Making what my mom makes (she has no education) is not acceptable in my eyes any more. Can i say that i want someone to make what i make?  Absolutely not! I believe making what my mom makes isnt pushing yourself.  This is part of the complete &#8220;Love&#8221; package.  Its no longer simply about loving someone, its about, &#8220;Does this person make for a good mate&#8221; plus the emotional piece.  </p>
<p>Ambition.  some people have it others don&#8217;t. For the last 2 maybe 3 years ive been sitting on my ass.  I&#8217;ve bought into the idea that, &#8220;Hey as long as i know im good thats all that matters&#8221;.  Turns out thats not how it works with me.  I am good and im actively getting back to my &#8220;roots&#8221; of showing that im good.  If people think im a dick&#8230;dont really care at this point.  Am I saying im going to actively put people down and not be a team player?  No! Being &#8220;good&#8221; at what you do also means making others around you good as well. </p>
<p>So lately, if I&#8217;ve blown you off or possibly cut you off, im not really going to apologize here, but rather want to say; if i allowed anyone around me to get away with just talk, I&#8217;ve failed you as a friend and/or bf.</p>
<p>Armando Padilla &#8211; on &#8220;getting on with the fuck&#8217;n program&#8221;  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.armando.ws/2010/02/ambition-what-matters-and-my-short-fuse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shutting it down.</title>
		<link>http://www.armando.ws/2010/01/shutting-it-down/</link>
		<comments>http://www.armando.ws/2010/01/shutting-it-down/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 07:06:49 +0000</pubDate>
		<dc:creator>Armando Padilla</dc:creator>
				<category><![CDATA[Personal Rants]]></category>

		<guid isPermaLink="false">http://www.armando.ws/?p=571</guid>
		<description><![CDATA[This will be my last personal rant.
All in all, i dont know what the future holds and for once im starting to enjoy the feeling  
Armando Padilla &#8211; on &#8220;the glass on my desk&#8230;&#8221;
]]></description>
			<content:encoded><![CDATA[<p>This will be my last personal rant.<br />
All in all, i dont know what the future holds and for once im starting to enjoy the feeling <img src='http://www.armando.ws/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Armando Padilla &#8211; on &#8220;the glass on my desk&#8230;&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.armando.ws/2010/01/shutting-it-down/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Benchmarking Zend Framework 1.8.4</title>
		<link>http://www.armando.ws/2009/07/benchmarking-zend-framework-1-8-4/</link>
		<comments>http://www.armando.ws/2009/07/benchmarking-zend-framework-1-8-4/#comments</comments>
		<pubDate>Sun, 26 Jul 2009 04:11:15 +0000</pubDate>
		<dc:creator>Armando Padilla</dc:creator>
				<category><![CDATA[PHP Development]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://www.armando.ws/?p=406</guid>
		<description><![CDATA[About 2 months ago I sat in on a PHP performance session at work taught by non other than Rasmus Lerdof.  Aside from creating PHP he had some really neat stuff to talk about concerning performance.  Most of the presentation came from the php.net site, talks.php.net. Take a look at the talks when you have [...]]]></description>
			<content:encoded><![CDATA[<p>About 2 months ago I sat in on a PHP performance session at work taught by non other than Rasmus Lerdof.  Aside from creating PHP he had some really neat stuff to talk about concerning performance.  Most of the presentation came from the php.net site, <a href="http://talks.php.net">talks.php.net</a>. Take a look at the talks when you have some time. </p>
<p><strong>The question</strong><br />
Anywho&#8230;that&#8217;s when my benchmarking and optimizing curiosity kicked in.  It wasn&#8217;t until yet another talk at work concerning the benefits of an MVC framework (Symfony) that I started to think about Zend Framework and its performance out of the box (without caching).   So I sat down today and started to benchmark the framework with a simple question in mind, &#8220;How does a simple ZF application compare to an application not using it?&#8221; </p>
<p><strong>The applications</strong><br />
To answer the question I created 3 web projects. The first web project was a static-HTML only application which displayed &#8220;hello world&#8221; on the screen, very simple.  (For those who just want to see the ab results <a href="http://www.armando.ws/projects/zf_benchmark_reading.txt">click here</a>  as well as the <a href="http://www.armando.ws/projects/zf_benchmark_cachegrind.out">Xdebug cachegrind output file</a>.)</p>
<p>The second web project was a single PHP file with the below PHP code.</p>
<p><em>Listing 1.1 &#8211; Simple Hello world PHP</em><br />
<code>&lt;?php echo "hello world"; ?&gt;</code></p>
<p>The above 2 projects acted as my baselines. it would allow me to determine the overhead ZF introduced into the application.</p>
<p>Finally, the third web project was created using ZF&#8217;s Zend Tool and executing the below command.</p>
<p><em>Listing 1.2 &#8211; Zf Project Creation.</em><br />
<code>> zf create project helloworld_zf</code></p>
<p>Finally, I replaced the default index.phtml HTML with the simple PHP code shown in Listing 1.1.  </p>
<p>Yes some may say that these examples are far too simple, but I wanted to test the Framework&#8217;s process to load and what better way to do this than with a very simple example.  I also based it off the talk that was given comparing Symfony.</p>
<p><strong>The Hardware &#038; ab command</strong><br />
Here is the set-up.<br />
1.  Windows machine running Apache 2.2<br />
2.  PHP 5.2.9<br />
3.  Zend Framework 1.8.4<br />
4.  Pentium 4 3.20 GHz<br />
5.  1Gbs of RAM</p>
<p>I used the Apache Benchmark, &#8216;ab&#8217;, tool which comes included with all Apache installation and ran the below command 3 times.</p>
<p>Listing 1.3<br />
<code>&gt; ab -n 1000 -c 5 http://localhost/index.[html|php]</code></p>
<p>The results, for me, were very surprising. I have included all the ab outputs.</p>
<p><strong>Observations</strong><br />
<strong>HTML ONLY &#8211; Reading 1</strong><br />
Concurrency Level:      5<br />
Time taken for tests:   2.344 seconds<br />
Complete requests:     1000<br />
Failed requests:          0<br />
Write errors:              0<br />
Total transferred:       352000 bytes<br />
HTML transferred:       83000 bytes<br />
Requests per second:  426.67 [#/sec] (mean)<br />
Time per request:       11.719 [ms] (mean)<br />
Time per request:       2.344 [ms] (mean, across all concurrent requests)<br />
Transfer rate:            146.67 [Kbytes/sec] received</p>
<p><strong>HTML ONLY &#8211; Reading 2</strong><br />
Concurrency Level:      5<br />
Time taken for tests:   2.375 seconds<br />
Complete requests:     1000<br />
Failed requests:          0<br />
Write errors:              0<br />
Total transferred:       352000 bytes<br />
HTML transferred:       83000 bytes<br />
Requests per second:  421.05 [#/sec] (mean)<br />
Time per request:       11.875 [ms] (mean)<br />
Time per request:       2.375 [ms] (mean, across all concurrent requests)<br />
Transfer rate:            144.74 [Kbytes/sec] received</p>
<p><strong>HTML ONLY &#8211; Reading 3</strong><br />
Concurrency Level:      5<br />
Time taken for tests:   2.344 seconds<br />
Complete requests:     1000<br />
Failed requests:          0<br />
Write errors:              0<br />
Total transferred:       352000 bytes<br />
HTML transferred:       83000 bytes<br />
Requests per second:  426.67 [#/sec] (mean)<br />
Time per request:       11.719 [ms] (mean)<br />
Time per request:       2.344 [ms] (mean, across all concurrent requests)<br />
Transfer rate:            146.67 [Kbytes/sec] received</p>
<p>Observations:<br />
1.  Roughly 0.0117 seconds per request.<br />
2.  Up to 424.79 requests satisfied per second.</p>
<p><strong>Basic PHP &#8211; Reading 1</strong><br />
Concurrency Level:      5<br />
Time taken for tests:   2.609 seconds<br />
Complete requests:     1000<br />
Failed requests:          0<br />
Write errors:              0<br />
Total transferred:       267000 bytes<br />
HTML transferred:       81000 bytes<br />
Requests per second:  383.23 [#/sec] (mean)<br />
Time per request:       13.047 [ms] (mean)<br />
Time per request:       2.609 [ms] (mean, across all concurrent requests)<br />
Transfer rate:            99.93 [Kbytes/sec] received</p>
<p><strong>Basic PHP &#8211; Reading 2</strong><br />
Concurrency Level:      5<br />
Time taken for tests:   2.609 seconds<br />
Complete requests:     1000<br />
Failed requests:          0<br />
Write errors:              0<br />
Total transferred:       267000 bytes<br />
HTML transferred:       81000 bytes<br />
Requests per second:  383.23 [#/sec] (mean)<br />
Time per request:       13.047 [ms] (mean)<br />
Time per request:       2.609 [ms] (mean, across all concurrent requests)<br />
Transfer rate:            99.93 [Kbytes/sec] received</p>
<p><strong>Basic PHP &#8211; Reading 3</strong><br />
Concurrency Level:       5<br />
Time taken for tests:    2.625 seconds<br />
Complete requests:      1000<br />
Failed requests:          0<br />
Write errors:              0<br />
Total transferred:      267000 bytes<br />
HTML transferred:       81000 bytes<br />
Requests per second:    380.95 [#/sec] (mean)<br />
Time per request:       13.125 [ms] (mean)<br />
Time per request:       2.625 [ms] (mean, across all concurrent requests)<br />
Transfer rate:          99.33 [Kbytes/sec] received</p>
<p>Observations:<br />
1. There seems to be a 100 request (roughly) drop when supporting PHP.<br />
2. Requests per second satisfied =  382.47 (a drop of 42.32 requests or 9% drop)<br />
3. Time per request = 13.073 or 0.0130 seconds per request (Increase of 11%)</p>
<p><strong>Out of the box ZF 1.8.4 &#8211; Reading 1</strong><br />
Concurrency Level:      5<br />
Time taken for tests:   68.297 seconds<br />
Complete requests:      1000<br />
Failed requests:        0<br />
Write errors:           0<br />
Total transferred:      197000 bytes<br />
HTML transferred:       11000 bytes<br />
Requests per second:    14.64 [#/sec] (mean)<br />
Time per request:       341.484 [ms] (mean)<br />
Time per request:       68.297 [ms] (mean, across a<br />
Transfer rate:          2.82 [Kbytes/sec] received</p>
<p><strong>Out of the box ZF 1.8.4 &#8211; Reading 2</strong><br />
Concurrency Level:      5<br />
Time taken for tests:   70.281 seconds<br />
Complete requests:      1000<br />
Failed requests:        0<br />
Write errors:           0<br />
Total transferred:      197000 bytes<br />
HTML transferred:       11000 bytes<br />
Requests per second:    14.23 [#/sec] (mean)<br />
Time per request:       351.406 [ms] (mean)<br />
Time per request:       70.281 [ms] (mean, across all c<br />
Transfer rate:          2.74 [Kbytes/sec] received</p>
<p><strong>Out of the box ZF 1.8.4 &#8211; Reading 3</strong><br />
Concurrency Level:      5<br />
Time taken for tests:   69.656 seconds<br />
Complete requests:      1000<br />
Failed requests:        0<br />
Write errors:           0<br />
Total transferred:      197000 bytes<br />
HTML transferred:       11000 bytes<br />
Requests per second:    14.36 [#/sec] (mean)<br />
Time per request:       348.281 [ms] (mean)<br />
Time per request:       69.656 [ms] (mean, across all c<br />
Transfer rate:          2.76 [Kbytes/sec] received</p>
<p>Observations:<br />
Framework not only has a slower response time but also satisfies less requests per second. <strong>Am I doing something wrong????</strong> This cant be correct.</p>
<p>1. Request per second = 15.24 a change of 367.23 requests per second or a drop of 96% between trivial PHP and a ZF power app.<br />
2. Time per request (time taken to satisfy 1 request) = 328.49 ms or 0.328 seconds a change of .315 seconds or an increase of 23%</p>
<p><strong>Conclusion</strong><br />
Even though my benchmarking techniques might be flawed, taking a base line reading with no HTML as well as a very simple PHP script web project allowed me to at least compare.  </p>
<p>Based on these figures (if correct) Zend Framework has a HUGE overheard.  But this should not discourage any would be ZF coder because there are caching techniques which were not used such as using APC and the benefits of a good network admin <img src='http://www.armando.ws/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  </p>
<p>Also the benefits of using any framework far outweigh the drawbacks in my personal opinion.  Where else can you get code which has been tested by the best and packed to contain methods for many of our typical coding requests.</p>
<p>Armando Padilla.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.armando.ws/2009/07/benchmarking-zend-framework-1-8-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to set up Zend_Tool on Windows.</title>
		<link>http://www.armando.ws/2009/05/how-to-set-up-zend_tool-on-windows/</link>
		<comments>http://www.armando.ws/2009/05/how-to-set-up-zend_tool-on-windows/#comments</comments>
		<pubDate>Tue, 19 May 2009 01:17:52 +0000</pubDate>
		<dc:creator>Armando Padilla</dc:creator>
				<category><![CDATA[PHP Development]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[Zend_Tool]]></category>

		<guid isPermaLink="false">http://www.armando.ws/?p=404</guid>
		<description><![CDATA[A few people we&#8217;re having issues installing Zend_Tool on Windows, hell I was having trouble myself since all of the tutorials out there are either Macs or Red Hat based.  So dont feel bad if your reading this  .  I thought i would take some time and create a tutorial, from the ground up [...]]]></description>
			<content:encoded><![CDATA[<p>A few people we&#8217;re having issues installing Zend_Tool on Windows, hell I was having trouble myself since all of the tutorials out there are either Macs or Red Hat based.  So dont feel bad if your reading this <img src='http://www.armando.ws/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .  I thought i would take some time and create a tutorial, from the ground up and learn a few things myself along the way.  So here we go!</p>
<p><strong>Step one Installing PHP (if you havent yet)</strong><br />
If you have PHP already installed skip this section and head over to &#8220;An overview of the installation&#8221;.  Eeryone else, head over to the PHP site,  <a href="http://www.php.net">php.net</a> and download the latest and greatest. As of this writing the latest Windows installer is php-5.2.9-2 msi.  Download the executable.  Yea so what I use executable and you should too its easier to install and configure on Windows.<br />
Once the file downloads, double click the installer, click &#8220;next&#8221; a few times, and stop when you reach the &#8220;Choose Items to Install&#8221;.</p>
<p><strong><img class="alignleft size-medium wp-image-411" style="margin: 5px;" title="choose_items" src="http://www.armando.ws/wp-content/uploads/2009/05/choose_items-300x235.jpg" alt="choose_items" width="300" height="235" /></strong><strong>Choose Items to Install</strong><br />
Once you reach this point your going to check off which extensions you want installed.  By default the installer has a few modules turned off but you can easily turn them on by checking off the items to install.  Make sure that the &#8220;CLI Executable&#8221; has no red x marks next to it as shown in the neat picture to the left.   If it does click on the &#8220;X&#8221; and select,  &#8220;Will be installed on local hard drive&#8221;.  By doing this your going to installed the php.exe file as well as allow the executable to automatically update and create System Variables. Click &#8220;Next&#8221;, then &#8220;Install&#8221; and watch it go.</p>
<p><img class="alignright size-full wp-image-410" style="margin: 5px;" title="system_var" src="http://www.armando.ws/wp-content/uploads/2009/05/system_var.jpg" alt="system_var" width="268" height="302" /></p>
<p><strong>An overview of the Installation and Required System Variables</strong><br />
When the installation is done you should have a new directory, C:\Program Files\PHP (if you didnt change the default location).  This contains the php.exe file along with a number of other things.   You should also have some updates to your environment variables.  Open the Environment Variables window by right clicking on &#8220;My Computer&#8221; , &#8220;Properties&#8221;,  &#8220;Advanced&#8221;, &#8220;Environment Variables&#8221; .  At the bottom of the window you should have 2 System Variables, &#8220;Path&#8221; and &#8220;PHPRC&#8221;.  Make sure &#8220;Path&#8221; contains the &#8220;C:\Program Files\PHP\;&#8221;  (Replace with the location of your PHP directory) and make sure PHPRC contains, &#8220;C:\Program Files\PHP\&#8221; (Location to your php.ini file) .    If all the variables are set click &#8220;Ok&#8221; and head onto the next section.</p>
<p><strong>Verifying Installation.</strong><br />
Now to check that the installation went smoothly.  Open a command line window.  You do this by going to &#8220;Start&#8221;, &#8220;Run&#8221;, and then typing in &#8220;cmd&#8221;, then click &#8220;Ok&#8221;.  Once the command line window appears type in:  php &#8211;version</p>
<p>You should see:</p>
<p><img class="alignnone size-full wp-image-414" title="php_version" src="http://www.armando.ws/wp-content/uploads/2009/05/php_version.jpg" alt="php_version" width="640" height="103" /></p>
<p><strong></strong></p>
<p>If you do great!  Your done with PHP. Let&#8217;s install Zend Framework now.</p>
<p><strong>Installing Zend_Tool</strong><br />
If all went well,  now its time to install Zend_Tool. Download the latest Zend Framework (latest is 1.8.1)  and extract the files somewhere onto your system.   Move the files</p>
<ul>
<li>bin/zf.php</li>
<li>bin/zf.bat</li>
</ul>
<p>into the directory C:\Program Files\PHP and place all the content of the library folder into the C:\zf directory.  Many tutorials recommend installing the library in your PHP includes directory but I decided to install it under C:\zf to demonstrate how to use ZEND_TOOL_INCLUDE_PATH environment variable since the library can practically live anywhere when your developing sites.    The full path to your Zend Framework instillation is now, C:\zf\library\Zend.</p>
<p><strong>Setting up ZEND_TOOL_INCLUDE_PATH</strong><br />
Open the Environment Variable window again and create a new environment variables under the &#8220;System Variables&#8221;  section.   In the &#8220;Variable Name&#8221;  text field enter, &#8220;ZEND_TOOL_INCLUDE_PATH&#8221;  and in the &#8220;Variable Value&#8221; text field enter &#8220;C:\Program Files\PHP\includes\library\&#8221;  (path to the Zend Library minus the Zend portion).   Click ok to close out the &#8220;New System Variable&#8221; window and then click &#8220;ok&#8221; once again to close the &#8220;Environment Variable&#8221; wndow.  Time to check if Zend_Tool works.</p>
<p><strong>Verify Installation</strong><br />
If you have any command line windows open, close them and then reopen one.   Type in <em>zf show version</em> you should see the below:</p>
<p><strong><img class="alignnone size-full wp-image-417" title="zf_command" src="http://www.armando.ws/wp-content/uploads/2009/05/zf_command.jpg" alt="zf_command" width="640" height="61" /><br />
</strong></p>
<p><strong>Useful commands.</strong><br />
Your set to create your projects , controller, actions now. Below I added a few commands I tend to use.</p>
<p><em>Create Project</em><br />
zf create project helloworld</p>
<p><em>Create a new controller</em> (below commands must be issued within project directory)<br />
zf create controller controller1<br />
zf create controller controller2</p>
<p><em>Create a few actions</em><br />
zf create action action1 controller1<br />
zf create action action2 controller2</p>
<p>Thats it!<br />
Armando Padilla</p>
]]></content:encoded>
			<wfw:commentRss>http://www.armando.ws/2009/05/how-to-set-up-zend_tool-on-windows/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Zend Framework 1.8 Released</title>
		<link>http://www.armando.ws/2009/05/zend-framework-18-released/</link>
		<comments>http://www.armando.ws/2009/05/zend-framework-18-released/#comments</comments>
		<pubDate>Mon, 04 May 2009 04:54:30 +0000</pubDate>
		<dc:creator>Armando Padilla</dc:creator>
				<category><![CDATA[PHP Development]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[Zend_Tool]]></category>

		<guid isPermaLink="false">http://www.armando.ws/?p=382</guid>
		<description><![CDATA[Last week ZF 1.8 was released and this weekend I spent the better part of it looking through the documentation and over a few of the items released within this package.  A few standouts include:

Zend_Tool
Zend_Tag
The Cloud computing components

For more information heres the complete list of features released.   I also had a questions for [...]]]></description>
			<content:encoded><![CDATA[<p>Last week ZF 1.8 was released and this weekend I spent the better part of it looking through the documentation and over a few of the items released within this package.  A few standouts include:</p>
<ol>
<li>Zend_Tool</li>
<li>Zend_Tag</li>
<li>The Cloud computing components</li>
</ol>
<p>For more information <a href="http://devzone.zend.com/article/4524-Zend-Framework-1.8.0-Released" target="_blank">heres</a> the complete list of features released.   I also had a questions for the Zend folks regarding Zend Tool on the page.   <img src='http://www.armando.ws/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Coming up I plan to take a stab at Zend_Tool_Framework_Provider and create a simple example on how use and implement.</p>
<p>Armando Padilla</p>
]]></content:encoded>
			<wfw:commentRss>http://www.armando.ws/2009/05/zend-framework-18-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to run Zend Framework with no .htaccess file.</title>
		<link>http://www.armando.ws/2009/03/how-to-run-zend-framework-with-no-htaccess-file/</link>
		<comments>http://www.armando.ws/2009/03/how-to-run-zend-framework-with-no-htaccess-file/#comments</comments>
		<pubDate>Sat, 07 Mar 2009 06:01:32 +0000</pubDate>
		<dc:creator>Armando Padilla</dc:creator>
				<category><![CDATA[PHP Development]]></category>
		<category><![CDATA[Set-Up]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://www.armando.ws/?p=337</guid>
		<description><![CDATA[Work has been overwhelming lately and frustrating but there was an interesting question asked by one of the developers at work.  Can the Zend Framework run without the .htaccess file?  The answer, Yes.

Why do we need the .htaccess file
First off why is the .htaccess file required in the first place by Zend Framework?  Think of [...]]]></description>
			<content:encoded><![CDATA[<p>Work has been overwhelming lately and frustrating but there was an interesting question asked by one of the developers at work.  Can the Zend Framework run without the .htaccess file?  The answer, Yes.<br />
<strong><br />
Why do we need the .htaccess file</strong><br />
First off why is the .htaccess file required in the first place by Zend Framework?  Think of the .htaccess file as a funnel.<br />
In a funnel, you poor water/liquid/stuff into the end contaning the larger diameter. The &#8220;stuff&#8221; is then squeezed out of a small single point at the opposite end. In the web world the &#8220;stuff&#8221; is web traffic and the the single point is where all the traffic goes through, in this case its the .htaccess file. </p>
<p>The .htaccess file will send all incoming traffic to your Front Controller which handles routing and dispatching etc.</p>
<p><strong>Removing .htaccess from the process.</strong><br />
For this im going use Apache 2.2. Start off by opening up the httpd.conf file located in the the conf folder of your Apache installation. Somewhere near the bottom add the following lines.</p>
<p><code>#Application Specific Include file<br />
Include conf/extra/httpd-zf.conf</code></p>
<p>This will allow Apache to add addition configuration settings once Apache is restarted and its a great place to isolate application specific Apache settings.</p>
<p>Now, go ahead an create the include file, &#8220;httpd-zf.conf&#8221; inside the APACHE_HOME/conf/extra/ directory and place the ReWrite rules which were originally in your .htaccess file into<br />
it.  Hit save, remove the .htaccess file, and restart Apache.  You should see your Zend Framework application running.</p>
<p><strong>Why do this?</strong><br />
Speed.  Your application must always read the .htaccess file when someone visits the site.  Removing this extra layer and placing it into the Web Server itself will reduce the amount of time a page loads.</p>
<p>Hope that helps someone out there <img src='http://www.armando.ws/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.armando.ws/2009/03/how-to-run-zend-framework-with-no-htaccess-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Framework and JQuery UI &#8211; Adding JQuery UI Widgets using ZendX_JQuery.</title>
		<link>http://www.armando.ws/2009/01/zend-framework-and-jquery-ui-adding-jquery-ui-widgets-using-zendx_jquery/</link>
		<comments>http://www.armando.ws/2009/01/zend-framework-and-jquery-ui-adding-jquery-ui-widgets-using-zendx_jquery/#comments</comments>
		<pubDate>Sat, 31 Jan 2009 04:56:34 +0000</pubDate>
		<dc:creator>Armando Padilla</dc:creator>
				<category><![CDATA[PHP Development]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[Zend Framework Extension]]></category>
		<category><![CDATA[ZendX_JQuery]]></category>

		<guid isPermaLink="false">http://www.armando.ws/?p=291</guid>
		<description><![CDATA[With the release of the new Zend Framework 1.7.3 a few nuggets were released.  One of those nuggets was the extension support for JQuery UI Widgets.  Featuring Dialog, Tabs, and Date Selection widgets among other bug fixes.  (A full list of updated Zend 1.7.3 release notes can be seen here)
With the release I started to [...]]]></description>
			<content:encoded><![CDATA[<p>With the release of the new Zend Framework 1.7.3 a few nuggets were released.  One of those nuggets was the extension support for JQuery UI Widgets.  Featuring Dialog, Tabs, and Date Selection widgets among other bug fixes.  (A full list of updated Zend 1.7.3 release notes can be seen <a href="http://devzone.zend.com/article/4196-Zend-Framework-v1.7.3-Released" target="_blank">here</a>)</p>
<p>With the release I started to dig into my current projects and started to update my forms.  Adding widgets here and there.   In the process I learned  thing or two and just wanted to share.</p>
<p><strong>Outline</strong><br />
What are we going to cover?</p>
<ul>
<li>All required Files and packages.</li>
<li>Installation of these files and packages</li>
<li>Examples &#8211; Dialog, DatePicker Widgets as well as their API.</li>
<li>Links to helpful readings</li>
</ul>
<p><strong>Required Files</strong><br />
If you havent download the latest release, 1.7.3, do so now (<a href="http://framework.zend.com/download/latest/" target="_blank">click her</a>).  Once your done downloading unzip the filea nd open the directory <em>extras/library</em>.  This is the directory which contains  the <em>ZendX</em> folder.</p>
<p>The latest Zend Framework release comes with an additional library, ZendX. These are extensions which are not part of the Core of the framework.  Currently the library contains 2 componenets;  the JQuery and the Console components.</p>
<p>Copy the <em>ZendX</em> folder into the folder which contains your current installation of the Zend library. On my webserver the directory structure looks like this after I copy ZenX into the directory . (Yes</p>
<p style="text-align: center;"><img class="size-full wp-image-294 aligncenter" title="dir_structure" src="http://www.armando.ws/wp-content/uploads/2009/01/dir_structure.bmp" alt="dir_structure" width="207" height="77" /></p>
<p>You now need the JQuery UI library. To take advantage of the latest and greatest your going to need the release candidate (<a href="http://jquery-ui.googlecode.com/files/jquery.ui-1.6rc6.zip" target="_blank">jquery 1.6rc6</a>), download it and unzip it.</p>
<p>Place the files</p>
<ul>
<li>themes</li>
<li>ui</li>
<li>external</li>
<li>jquery-1.3.1.js</li>
</ul>
<p>inside your public directory. Your final directory structure should look something similar to this:</p>
<p style="text-align: center;"><img class="size-full wp-image-300 aligncenter" title="final_js_dir" src="http://www.armando.ws/wp-content/uploads/2009/01/final_js_dir.bmp" alt="final_js_dir" width="141" height="121" /></p>
<p>Required Files are now installed.<br />
<strong>Identifying ZendX_JQuery to your Zend Application</strong><br />
Since the ZendX_JQuery is a View_Helper extension and not part of the main library we need to register it as a plugin using the Zend_View <em>addHelperPath() </em>method.</p>
<p>Open your bootstrap file. <em>public/index.php</em> and copy the below script into it.</p>
<p><code>$view = new Zend_View();<br />
$view-&gt;addHelperPath('ZendX/JQuery/View/Helper', 'ZendX_JQuery_View_Helper');<br />
$viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();<br />
$viewRenderer-&gt;setView($view);<br />
Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);</code></p>
<p>Adding the information to the bootstrap file will allow you to use the <em>ZendX_JQuery</em> throughout your application. From now on the only item you need to include in your View are the styleSheet to implement using the jQuery() addStylesheet()<br />
method and the jQuery() setUriLocalPath() method in your View.</p>
<p>The addStylesheet method will add the stylesheet.  If your setup is identical to one shown above you can use the string  &#8220;/js/themes/base/ui.all.css&#8221;  to refernce the css file required. (ZF reference manual mentions flora css, i could not find it)</p>
<p>The setURiLocalPath() will add the js library to use.  Set it to &#8220;/js/ui/jquery.ui.all.js&#8221;.</p>
<p>Well get to see how to use these jQuery methods now.</p>
<p><strong>Putting the pieces together &#8211; Examples<br />
</strong>Were going to implement 2 quick examples which will get us started on the right foot by implementing a Date-Picker and a Dialog.</p>
<p><strong> Date Picker</strong><br />
The first example demonstrates the use of the View Helper DatePicker.<br />
The full method accepts 4 parameters with the third parameter accepting an array containing options shown <a href="http://docs.jquery.com/UI/Datepicker/datepicker#options" target="_blank">here</a>.</p>
<p>datePicker(id, default_value_to_display_in_text_field, params, attributes)</p>
<p>Lets take a look at our View.</p>
<p><code><br />
</code></p>
<p>jQuery()-&gt;addStylesheet(&#8217;/js/themes/base/ui.all.css&#8217;);?&gt;</p>
<p><label for="startDate">Birth Day:</label><br />
datePicker(&#8221;startDate&#8221;,<br />
&#8216;Select Your Birth Day&#8217;,<br />
array(&#8217;defaultDate&#8217; =&gt; &#8216;+7&#8242;,<br />
&#8216;minDate&#8217; =&gt; &#8216;+7&#8242;,<br />
&#8216;dateFormat&#8217; =&gt; &#8216;mm-dd-yy&#8217;)); ?&gt;</p>
<p>jQuery()-&gt;setUiLocalPath(&#8221;/js/ui/jquery.ui.all.js&#8221;);?&gt;</p>
<p>The example shown above adds the stylesheet between the head node and places the js file at the very end of our HTML.  Placing the js at the very end of the body is critical to do.  Placing it anywhere else will  cause mixed results when executing Ajax features.</p>
<p>The example above also demonstrates how to format the date for the specific field using one of the parameters.   Go ahead and give it a try, you should see something like the below figure.</p>
<p style="text-align: center;"><img class="size-full wp-image-303 aligncenter" title="datepicker" src="http://www.armando.ws/wp-content/uploads/2009/01/datepicker.bmp" alt="datepicker" width="426" height="305" /></p>
<p><strong>Dialog Boxes</strong><br />
A dialog box is the Web 2.0 equivalent of the alert() javascript popup. Using the dialogContainer method we can add a dialog box to our page. Below is an example of a dialog box which uses parameters.</p>
<p>If you tried the example in the ZF Reference manual and didn&#8217;t have this work for you. Dont worry, change &#8216;dialog&#8217; to &#8216;dialogContainer&#8217; and you should be able to get it working.</p>
<p><code><br />
</code></p>
<p>jQuery()-&gt;addStylesheet(&#8217;/js/themes/base/ui.all.css&#8217;);?&gt;</p>
<p>dialogContainer(&#8221;dialog1&#8243;,<br />
&#8216;Welcome to the ZendX_JQuery World!&#8217;, array(&#8217;draggable&#8217; =&gt; true,<br />
&#8216;modal&#8217; =&gt; true,<br />
&#8216;resizable&#8217; =&gt; true,<br />
&#8216;title&#8217; =&gt; &#8216;Welcome message&#8217;,<br />
&#8216;closeOnEscape&#8217; =&gt; true)); ?&gt;</p>
<p>jQuery()-&gt;setUiLocalPath(&#8221;/js/ui/jquery.ui.all.js&#8221;);?&gt;<br />
For additional parameters available for the dialogContainer take a look at the JQuery API for the UI widget <a href="http://docs.jquery.com/UI/Dialog/dialog#options" target="_blank">here</a>.  Try out the View, you should see the Dialog window shown below.</p>
<p><img class="aligncenter size-full wp-image-305" title="zendx_jquery_dialogcontainer" src="http://www.armando.ws/wp-content/uploads/2009/01/zendx_jquery_dialogcontainer.bmp" alt="zendx_jquery_dialogcontainer" /></p>
<p>Thats it. Set up is done, you know the requirements for the JQuery UI Widgets, and you created 2 widgets.  Take a look at some of the links below that helped me get started.</p>
<p>There are a few quarcks i havent figured out yet such as the inability to move the dialog box using FF 3 and currently playnig around with the other widgets so Ill update as I go.  Next on the docket.  Progress bar and File Uploading using Jquery extension.</p>
<p><strong>Helpful Links</strong></p>
<ul>
<li><a href="http://framework.zend.com/manual/en/zendx.jquery.html" target="_blank">ZendX_JQuery &#8211; Full Refrence Page.<br />
</a></li>
<li><a href="http://ui.jquery.com/" target="_blank">JQuery UI Home Page</a></li>
<li><a href="http://docs.jquery.com/UI#Widgets" target="_blank">JQuery Widget API</a> (used for the $param parameter for each JQuery View_Helper Widget)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.armando.ws/2009/01/zend-framework-and-jquery-ui-adding-jquery-ui-widgets-using-zendx_jquery/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
