<?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>Juozas devBlog &#187; rob allen</title>
	<atom:link href="http://dev.juokaz.com/tag/rob-allen/feed" rel="self" type="application/rss+xml" />
	<link>http://dev.juokaz.com</link>
	<description>Random ideas, scripts and facts</description>
	<lastBuildDate>Mon, 22 Mar 2010 10:48:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Finalizing WinPHP competition</title>
		<link>http://dev.juokaz.com/winphp-2009/finalizing-winphp-competition</link>
		<comments>http://dev.juokaz.com/winphp-2009/finalizing-winphp-competition#comments</comments>
		<pubDate>Mon, 01 Jun 2009 10:23:44 +0000</pubDate>
		<dc:creator>Juozas</dc:creator>
				<category><![CDATA[WinPhp 2009]]></category>
		<category><![CDATA[competition]]></category>
		<category><![CDATA[deepzoom]]></category>
		<category><![CDATA[jelly fish]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[rob allen]]></category>
		<category><![CDATA[silverlight]]></category>
		<category><![CDATA[sql driver]]></category>
		<category><![CDATA[sql server]]></category>
		<category><![CDATA[winphp]]></category>
		<category><![CDATA[zfmssql]]></category>

		<guid isPermaLink="false">http://dev.juokaz.com/?p=824</guid>
		<description><![CDATA[It&#8217;s been more than a month since this competition started, but the time ran very quickly. Today I&#8217;m going to summarize what I&#8217;ve used to create my entry and what I&#8217;ve learned.
Final application available at http://winphp.juokaz.com:82/.
Goal was:
My project will allow people to upload huge collections of photos (probably archived in one zip file) and get [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-830" style="margin-right: 5px; float: left;" title="Gallery" src="http://dev.juokaz.com/wp-content/uploads/2009/06/gallery.jpg" alt="Gallery" width="159" height="146" />It&#8217;s been more than a month since this competition started, but the time ran very quickly. Today I&#8217;m going to summarize what I&#8217;ve used to create my entry and what I&#8217;ve learned.</p>
<p>Final application available at <a href="http://winphp.juokaz.com:82/">http://winphp.juokaz.com:82/</a>.</p>
<p>Goal <a href="http://dev.juokaz.com/winphp-2009/first-annual-winphp-challenge">was</a>:</p>
<blockquote><p>My project will allow people to upload huge collections of photos (probably archived in one zip file) and get nice online gallery.</p></blockquote>
<p>I decided not to use archived files and simply allowed to upload multiple files using Silverlight <a href="http://www.codeplex.com/SilverlightFileUpld">control</a>, but pretty much everything left the same. My approach to this competition was to focus on technologies and not on functionality. That&#8217;s why I spent huge amount of time creating abstractions and making parts of application to be very customizable and not adding a lot of functions.</p>
<p>Functions in my app are really easy to add and in a matter of some lines one can add various parameters to images (tags, name etc.) and then sort/filter them &#8211; a lot of hard work is done under the hood. Silverlight based gallery is also absolutely independent from whole application and will work as long as front-end supplies correct gallery xml file, hence it can be easily customized. </p>
<p>Rules had 4 criterias:</p>
<ol>
<li> Application originality &#8211; I think I passed this one</li>
<li> Completeness &#8211; I have done everything what I&#8217;ve wanted</li>
<li> Use of Windows specific features/services &#8211; uses <a href="http://www.php.net/manual/en/book.com.php">COM</a> objects, Silverlight</li>
<li> Documentation of the process &#8211; <a href="http://dev.juokaz.com/category/winphp-2009">articles</a> in this blog and a lot of <a href="http://search.twitter.com/search?q=&#038;ands=&#038;phrase=&#038;ors=&#038;nots=&#038;tag=winphp&#038;lang=all&#038;from=juokaz&#038;to=&#038;ref=&#038;near=&#038;within=15&#038;units=mi&#038;since=&#038;until=&#038;rpp=15">tweets</a></li>
</ol>
<p>I think I have done everything that was required and now will try to push this application even further. Maybe Microsoft itself will show interest in it, because what I&#8217;ve done and used has been key topics in <a href="http://www.microsoft.com/events/mix/default.mspx">MIX 09</a>.</p>
<p><img class="alignnone size-full wp-image-826" title="Gallery x" src="http://dev.juokaz.com/wp-content/uploads/2009/06/gallery-x_1243856343122.png" alt="Gallery x" width="555" height="152" /></p>
<p><strong>Silverlight</strong> part and images processing is based on <a href="http://jellyfishdz.codeplex.com/">Jellyfish</a> library. At first I used <a href="http://dev.juokaz.com/winphp-2009/creating-deep-zoom-applications-with-c">Microsoft libraries</a>, but soon I got stuck because of lack of documentation and functionality. However Jellyfish is far from perfect &#8211; a lot of things are hardcoded, made <em>private</em> and hard to change. Also, it has some functions which are useful only in rare cases and need to be removed. For example, each mouse move, click and scroll used to look through all images in scene (using loop) and detect which one is under the mouse cursor. Very inefficient (especially if you don&#8217;t need it).</p>
<p><strong>Zend Framework</strong> was used to power whole website. I didn&#8217;t find any difference running it on Windows from running on Linux, so I can&#8217;t say much about <a href="http://dev.juokaz.com/winphp-2009/zend-framework-and-microsoft-iis">anything specific</a>. However, I <a href="http://dev.juokaz.com/winphp-2009/sql-native-client-as-mssql-driver-for-zend-framework">decided</a> to use the new <a href="http://sql2k5php.codeplex.com/">Sql driver</a> implementation for PHP, but it wasn&#8217;t included in Zend Framework supported adapters <a href="http://framework.zend.com/manual/en/zend.db.html#zend.db.adapter.adapter-notes">list</a>. That&#8217;s why me and <a href="http://akrabat.com/">Rob Allen</a> started a <a href="http://zfmssql.codeplex.com/">project</a> at <a href="http://www.codeplex.com">codeplex</a> to create an adapter for sql driver. It&#8217;s almost complete and at least both of us use it for our projects &#8211; everyone is free to test it and suggest changes though.</p>
<p><strong>Windows</strong> was good enough. I haven&#8217;t used Windows for any development for more than two years, but it worked surprisingly good. <a href="http://www.netbeans.org/">NetBeans</a> works the same in all platforms, but Visual Studio was almost a new thing. Nevertheless, both have done their job. <a href="http://www.iis.net/">IIS</a> was a <a href="http://dev.juokaz.com/winphp-2009/setting-up-windows-for-php-server">new thing</a> too, but I didn&#8217;t find a big difference for a developer, only that it allows to change everything without touching config files &#8211; I found it faster when settings are in multiple places.</p>
<p><strong>Community </strong>is outstanding. Stuart Herbert,  Rob Allen, Alton Crosslen and organizer Bram Veenhof were all chatting on <a href="http://search.twitter.com/search?q=winphp">Twitter</a> and it felt more like a community project and not a competition. Also the level of entries, from my point of view, is really high &#8211; this competition doesn&#8217;t had a lot of entrants (only slightly more than 10), but all of them are really competitive. </p>
<p>It was really a great time.</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.juokaz.com/winphp-2009/finalizing-winphp-competition/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Framework and Microsoft IIS</title>
		<link>http://dev.juokaz.com/winphp-2009/zend-framework-and-microsoft-iis</link>
		<comments>http://dev.juokaz.com/winphp-2009/zend-framework-and-microsoft-iis#comments</comments>
		<pubDate>Tue, 05 May 2009 01:52:52 +0000</pubDate>
		<dc:creator>Juozas</dc:creator>
				<category><![CDATA[WinPhp 2009]]></category>
		<category><![CDATA[driver]]></category>
		<category><![CDATA[iis]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[mssql]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[permissions]]></category>
		<category><![CDATA[rob allen]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[sql server]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[windows 7]]></category>
		<category><![CDATA[zend]]></category>
		<category><![CDATA[zend framework]]></category>

		<guid isPermaLink="false">http://dev.juokaz.com/?p=617</guid>
		<description><![CDATA[My task today was to make Rob Allen&#8217;s Zend framework tutorial project run on Windows. Some years ago such task could have been a problem, but as you will see, now it&#8217;s nothing special.
To start with, Windows sometimes really annoys. For example, by default I can&#8217;t add files to C:\inetpub\wwwroot. It doesn&#8217;t ask for &#8220;Allow/Cancel?&#8220;, [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-460" title="Zend framework" src="http://dev.juokaz.com/wp-content/uploads/2009/04/logo-zend-framework.jpg" alt="Zend framework" width="115" height="77" />My task today was to make Rob Allen&#8217;s <a href="http://akrabat.com/zend-framework-tutorial/">Zend framework tutorial</a> project run on Windows. Some years ago such task could have been a problem, but as you will see, now it&#8217;s nothing special.</p>
<p><a href="http://dev.juokaz.com/wp-content/uploads/2009/05/iis-2.png"><img class="alignnone size-thumbnail wp-image-622" style="margin-left: 5px; float: right;" title="Access is denied" src="http://dev.juokaz.com/wp-content/uploads/2009/05/iis-2-150x150.png" alt="Access is denied" width="100" height="100" /></a>To start with, Windows sometimes really annoys. For example, by default I can&#8217;t add files to C:\inetpub\wwwroot. It doesn&#8217;t ask for &#8220;<a href="http://www.youtube.com/watch?v=FxOIebkmrqs">Allow/Cancel?</a>&#8220;, is doesn&#8217;t show permissions error &#8211; you just can&#8217;t do anything. I decided not to waste my time trying to find a way how to do it and ended up with virtual directory pointed to my project folder. I&#8217;m using Windows 7, so one can run programs as administrator, but having two Explorers is not a very good idea, especially when you can&#8217;t tell a difference between admin and non-admin mode (can you?).</p>
<p><a href="http://dev.juokaz.com/wp-content/uploads/2009/05/iis-3.png"></a><a href="http://dev.juokaz.com/wp-content/uploads/2009/05/iis-3.png"><img class="alignnone size-thumbnail wp-image-618" style="float: right; margin-left: 5px;" title="Import .htaccess" src="http://dev.juokaz.com/wp-content/uploads/2009/05/iis-3-150x150.png" alt="Import .htaccess" width="100" height="100" /></a>First problem was <a href="http://framework.zend.com/manual/en/zend.controller.router.html">routes</a> &#8211; almost all frameworks nowadays uses something like &#8220;/controller/action/id&#8221; which is achieved by <a href="http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html">mod_rewrite</a> and <a href="http://httpd.apache.org/docs/1.3/howto/htaccess.html">.htaccess</a>. However, IIS is not Apache, hence .htaccess doesn&#8217;t exist. Although IIS has a routing module which pretty much works the same and also has nice a GUI for all who doesn&#8217;t know how to use <a href="http://en.wikipedia.org/wiki/Regular_expression">regexp</a>&#8217;s. Furthermore, it also has import function which surprisingly imports from .htaccess &#8211; select file, click Import, remove or fix not recognized rules and click Apply. I haven&#8217;t tried any complex rules, but since most of frameworks only require to redirect everything (&#8220;^.*$&#8221;) it should work.</p>
<p><a href="http://dev.juokaz.com/wp-content/uploads/2009/05/mssql-1.png"><img class="alignnone size-thumbnail wp-image-632" style="float: right; margin-left: 5px;" title="Microsoft SQL" src="http://dev.juokaz.com/wp-content/uploads/2009/05/mssql-1-150x150.png" alt="Microsoft SQL" width="100" height="100" /></a>Next &#8220;problem&#8221; is the database. MySQL works fine in Windows, but I wanted to use <a href="http://en.wikipedia.org/wiki/Microsoft_SQL_Server">MSSQL</a>. Not only because I haven&#8217;t tried MSSQL before, but also because MSSQL is much more integrated into Windows. However, MSSQL driver in PHP has some <a href="http://blog.stuartherbert.com/php/2007/10/16/microsofts-first-php-extension-sql-server-2005-support/">limitations</a>. Nevertheless, Microsoft has released a <a href="http://msdn.microsoft.com/en-us/data/aa937733.aspx">native driver</a>, which seems to have fixed all previous problems. You only need to download actual driver from <a href="http://download.microsoft.com/download/2/7/c/27c60d49-6dbe-423e-9a9e-1c873f269484/sqlncli.msi">here</a> and PHP extensions from <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=61BF87E0-D031-466B-B09A-6597C21A2E2A&amp;displaylang=en">here</a>. Extension can be used like <a href="http://akrabat.com/2009/05/04/mssql-and-php/">this</a> (it provides <a href="http://msdn.microsoft.com/en-us/library/cc296152(SQL.90).aspx">sqlsrv_*</a> functions), however I really prefer using <a href="http://uk3.php.net/manual/en/intro.pdo.php">PDO</a> or other object oriented database layer. That&#8217;s why I use it like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">try <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$hostname</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;localhost\SQLEXPRESS&quot;</span><span style="color: #339933;">;</span>            <span style="color: #666666; font-style: italic;">//host</span>
    <span style="color: #000088;">$dbname</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;zf-tutorial&quot;</span><span style="color: #339933;">;</span>            <span style="color: #666666; font-style: italic;">//db name</span>
    <span style="color: #000088;">$username</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;sa&quot;</span><span style="color: #339933;">;</span>            <span style="color: #666666; font-style: italic;">// username like 'sa'</span>
    <span style="color: #000088;">$pw</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;juozas&quot;</span><span style="color: #339933;">;</span>                <span style="color: #666666; font-style: italic;">// password for the user</span>
&nbsp;
    <span style="color: #000088;">$dsn</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Driver={SQL Server Native Client 10.0};
            Server=<span style="color: #006699; font-weight: bold;">{$hostname}</span>;
            Database=<span style="color: #006699; font-weight: bold;">{$dbname}</span>;
            Uid=<span style="color: #006699; font-weight: bold;">{$username}</span>;
            Pwd=<span style="color: #006699; font-weight: bold;">{$pw}</span>;&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$dbh</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> PDO <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;odbc:&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$dsn</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> catch <span style="color: #009900;">&#40;</span>PDOException <span style="color: #000088;">$e</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Failed to get DB handle: &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$e</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getMessage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> PHP_EOL<span style="color: #339933;">;</span>
    <span style="color: #990000;">exit</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000088;">$sth</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$dbh</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">prepare</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT * FROM albums&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$sth</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">execute</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$sth</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fetchAll</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">print_r</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>I should add, that I haven&#8217;t tested it much, but at least demo project from the tutorial works. Later this week I will probably choose which method to use (sqlsrv_* or PDO), because Zend framework currently doesn&#8217;t support <a href="http://msdn.microsoft.com/en-us/data/aa937733.aspx">MSSQL Native client</a> and I will implement adapter myself (Zend_Db_Adapters are around 500 lines). <a href="http://akrabat.com/">Rob Allen</a> is also working on a driver implementation for Zend so one of us should come with a solution pretty soon. Currently I&#8217;m using Zend_Db_Adapter_Pdo_Odbc from <a href="http://framework.zend.com/issues/browse/ZF-905">here</a>, however it still works only as a hack.</p>
<p>That&#8217;s all &#8211; your Zend Framework project should work (you may also need to set correct <a href="http://drupal.org/node/202491">file permissions</a>).</p>
<p><em>If I wouldn&#8217;t have started <a href="http://wiki.phpconference.nl/2009_WinPHP_Challenge">Winphp</a> competition, I may have never realized how Microsoft is struggling to support PHP. Starting from <a href="http://blogs.msdn.com/sqlphp/">blogs</a> and ending with special <a href="http://www.codeplex.com/SQL2K5PHP">drivers</a>, <a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=c8498c9b-a85a-4afa-90c0-593d0e4850cb">tutorials</a> and even <a href="http://www.phponwindows.ca/ftw/">competitions</a>. Is Microsoft trying to &#8220;repair&#8221; its public profile?</em></p>
]]></content:encoded>
			<wfw:commentRss>http://dev.juokaz.com/winphp-2009/zend-framework-and-microsoft-iis/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
