<?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; competition</title>
	<atom:link href="http://dev.juokaz.com/tag/competition/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>How to use external libraries in PHP?</title>
		<link>http://dev.juokaz.com/winphp-2009/how-to-use-outside-libraries-in-php</link>
		<comments>http://dev.juokaz.com/winphp-2009/how-to-use-outside-libraries-in-php#comments</comments>
		<pubDate>Sat, 23 May 2009 14:24:58 +0000</pubDate>
		<dc:creator>Juozas</dc:creator>
				<category><![CDATA[WinPhp 2009]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[assembly]]></category>
		<category><![CDATA[com]]></category>
		<category><![CDATA[competition]]></category>
		<category><![CDATA[deepzoom]]></category>
		<category><![CDATA[dotnet]]></category>
		<category><![CDATA[gac]]></category>
		<category><![CDATA[gacutil]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[php extensions]]></category>
		<category><![CDATA[regasm]]></category>
		<category><![CDATA[winphp]]></category>

		<guid isPermaLink="false">http://dev.juokaz.com/?p=793</guid>
		<description><![CDATA[External libraries are useful for performance demanding tasks where PHP is simply too slow. Also PHP can work as front-end system for various back-end systems (where server doesn&#8217;t provide any PHP supported communication types). I have written some posts about using .Net libraries in PHP so far, but there are some other choices available too. [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://dev.juokaz.com/wp-content/uploads/2009/05/osoft_1490922690php-logo-300x158.png" alt="osoft_1490922690php-logo" title="osoft_1490922690php-logo" width="150" height="79" class="alignnone size-medium wp-image-800" />External libraries are useful for performance demanding tasks where PHP is simply too slow. Also PHP can work as front-end system for various back-end systems (where server doesn&#8217;t provide any PHP supported communication types). I have written some posts about using <a href="http://dev.juokaz.com/winphp-2009/using-php-with-c-written-libraries">.Net libraries in PHP</a> so far, but there are some other choices available too. To start with, there are two main categories of possible external code usage in PHP:</p>
<ol>
<li><a href="http://pecl.php.net/">PHP extensions</a></li>
<li><a href="http://uk.php.net/manual/en/class.com.php">COM</a> objects, programs executed with exec()</li>
</ol>
<p>Today I&#8217;m going to look at all of them and explain my choice to use COM objects and not others from above. </p>
<h5>Three choices</h5>
<p><strong>PHP extensions</strong> (how to create them read <a href="http://devzone.zend.com/article/1021">here</a>) are fast and (at least should be) stable. However they are quite hard to create at start and uses <a href="http://en.wikipedia.org/wiki/C_programming_language">C</a>. For example, I&#8217;m now using library written in C# and rewriting it in C just to use it as extension is way to complicated and time consuming (and probably not worth it). I can only image PHP extensions as libraries to optimize some parts of code or to be used in multiple projects. In my <a href="http://dev.juokaz.com/winphp-2009/first-annual-winphp-challenge">case</a>, I only need to some limited tasks.</p>
<p><a href="http://dev.juokaz.com/wp-content/uploads/2009/05/visualstudio-6.png"><img src="http://dev.juokaz.com/wp-content/uploads/2009/05/visualstudio-6-150x150.png" alt="visualstudio-6" title="visualstudio-6" width="100" height="100" style="float: right; margin-left: 5px;" class="alignnone size-thumbnail wp-image-805" /></a>Next logical choice would be executing programs with <strong>exec()</strong>. In my opinion it&#8217;s the easiest way because programs can be created with any language you like, can be supplied with source code and none of system settings need be changed. If exec() is not blocked in php.ini it&#8217;s very practical solution. </p>
<p><a href="http://dev.juokaz.com/wp-content/uploads/2009/05/expolorer-1.png"><img src="http://dev.juokaz.com/wp-content/uploads/2009/05/expolorer-1-150x150.png" alt="expolorer-1" title="expolorer-1" width="100" height="100" style="float: right; margin-left: 5px;" class="alignnone size-thumbnail wp-image-807" /></a>Windows users has an option to use <strong>COM objects</strong>. COM objects stand somewhere between PHP extensions and exec(). They can be created in many languages, but libraries are not executed outside PHP script &#8211; they behave as normal PHP objects (almost). They are more convenient to work with than compiled programs, but need to registered with Windows.</p>
<h5>The best</h5>
<p>I was testing last two solutions for more than two weeks and my final choice is&#8230; COM objects.  To explain this choice here is a short story:</p>
<p><a href="http://dev.juokaz.com/wp-content/uploads/2009/05/visualstudio-7.png"><img src="http://dev.juokaz.com/wp-content/uploads/2009/05/visualstudio-7-150x150.png" alt="visualstudio-7" title="visualstudio-7" width="100" style="float: right; margin-left: 5px;" height="100" class="alignnone size-thumbnail wp-image-809" /></a>I have a webpage which allows uploading multiple pictures. Two files are uploaded in parallel and once uploaded they are processed (resized, thumbnail and special structure for <a href="http://dev.juokaz.com/winphp-2009/creating-deep-zoom-applications-with-c">DeepZoom</a> is created). All this processing is written in C# and uses various windows and 3rd-party libraries.</p>
<p><a href="http://dev.juokaz.com/wp-content/uploads/2009/05/firefox-1.png"><img src="http://dev.juokaz.com/wp-content/uploads/2009/05/firefox-1-150x150.png" alt="firefox-1" title="firefox-1" width="100" height="100" style="float: right; margin-left: 5px;" class="alignnone size-thumbnail wp-image-803" /></a>At first I tried compiling a program as &#8220;console application&#8221; (in VisualStudio) and then run it with exec(). It worked as expected, but was a little bit too slow. Script was taking around 3 s. to execute, even though actual program ran in 1 s. I didn&#8217;t spent much time analyzing where overhead was coming from but it was clear that it can be optimized.</p>
<p><a href="http://dev.juokaz.com/wp-content/uploads/2009/05/iis-5.png"><img src="http://dev.juokaz.com/wp-content/uploads/2009/05/iis-5-150x150.png" alt="iis-5" title="iis-5" width="100" height="100" style="float: right; margin-left: 5px;" class="alignnone size-thumbnail wp-image-796" /></a>So I compiled program as &#8220;class library&#8221;, registered it with the <a href="http://en.wikipedia.org/wiki/Global_Assembly_Cache">Windows assembly cache</a> and then used with a <a href="http://uk.php.net/manual/en/class.dotnet.php">DOTNET</a> class. First problem was IIS server &#8211; it <a href="http://twitter.com/juokaz/status/1880755692">kept</a> throwing 500 errors no matter what I did. I didn&#8217;t wanted to waste my time trying to find where was a problem &#8211; after changing to COM class it magically started to work (even though it uses the same library). Using my library inside PHP was much more faster and execution time reduced to less than a second (depends on a size of image).</p>
<h5>Conclusion</h5>
<p>I have tested most of possible ways to execute external code. Even though COM objects perform better they can&#8217;t be suggested as default choice, because libraries need to registered with a system what can be problematic and maybe not even possible. So if you have limited permissions to server &#8211; use exec(), but in all other cases &#8211; I definitely recommend using COM. PHP extensions are even better, but harder to code and limited to C.</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.juokaz.com/winphp-2009/how-to-use-outside-libraries-in-php/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SQL Native Client as MSSQL driver for Zend Framework</title>
		<link>http://dev.juokaz.com/winphp-2009/sql-native-client-as-mssql-driver-for-zend-framework</link>
		<comments>http://dev.juokaz.com/winphp-2009/sql-native-client-as-mssql-driver-for-zend-framework#comments</comments>
		<pubDate>Thu, 07 May 2009 01:39:53 +0000</pubDate>
		<dc:creator>Juozas</dc:creator>
				<category><![CDATA[WinPhp 2009]]></category>
		<category><![CDATA[competition]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[driver]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[mssql]]></category>
		<category><![CDATA[odbc]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[sql native client]]></category>
		<category><![CDATA[sqlsrv]]></category>
		<category><![CDATA[wiinphp]]></category>
		<category><![CDATA[zend framework]]></category>

		<guid isPermaLink="false">http://dev.juokaz.com/?p=648</guid>
		<description><![CDATA[Stuart Herbert in his blog more than a year ago pointed some key Microsoft Sql extension for PHP pros:
What’s Wrong With The Existing MSSQL Extension For PHP?
… or, why do we need an improved SQL Server extension for PHP? :)
The existing MSSQL extension works well, but has a few practical limitations that have to be [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://dev.juokaz.com/wp-content/uploads/2009/05/ms_sql_logo2.jpg" alt="Microsoft Sql server" title="Microsoft Sql server" width="163" height="56" class="alignnone size-full wp-image-672" /><a href="http://blog.stuartherbert.com/php/">Stuart Herbert</a> in his blog more than a year ago <a href="http://blog.stuartherbert.com/php/2007/10/16/microsofts-first-php-extension-sql-server-2005-support/">pointed</a> some key Microsoft Sql extension for PHP pros:</p>
<blockquote><p><strong>What’s Wrong With The Existing MSSQL Extension For PHP?</strong></p>
<p>… or, why do we need an improved SQL Server extension for PHP? :)</p>
<p>The existing MSSQL extension works well, but has a few practical limitations that have to be worked around.</p>
<ul>
<li><em>Limited to varchar(255) support</em></li>
<li><em>No support for unicode columns like nvarchar</em></li>
<li><em>No PDO drivers</em></li>
<li><em>Poor error reporting</em></li>
</ul>
</blockquote>
<p>Now some of these issues are fixed, however Microsoft native Sql driver is still not used. As I&#8217;ve mentioned <a href="http://dev.juokaz.com/winphp-2009/zend-framework-and-microsoft-iis">before</a>, there are to ways to use <a href="http://www.microsoft.com/sqlserver/2005/en/us/PHP-Driver.aspx">native driver</a> in PHP now:</p>
<ol>
<li> As <a href="http://devzone.zend.com/article/1021">PHP extension</a></li>
<li>Through <a href="http://en.wikipedia.org/wiki/Open_Database_Connectivity">ODBC</a></li>
</ol>
<p>However, none of these is available in Zend Framwork. So my task now (because of <a href="http://wiki.phpconference.nl/2009_WinPHP_Challenge">Winphp competition</a>) is to come up with something what can be used to connect to Microsft Sql database with the new driver. To start with, lets look how standard DB config looks like:</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">;application/config/application.ini, ZF 1.8</span>
resources.db.adapter <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> PDO_MYSQL</span>
resources.db.params.host <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> localhost</span>
resources.db.params.username <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> usr</span>
resources.db.params.password <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> psw</span>
resources.db.params.dbname <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> zf-tutorial</span></pre></div></div>

<p><a href="http://dev.juokaz.com/wp-content/uploads/2009/05/lfzl3021.gif"><img src="http://dev.juokaz.com/wp-content/uploads/2009/05/lfzl3021-150x150.gif" alt="ODBC" title="ODBC" width="100" height="100" style="float: right; margin-left: 5px;" class="alignnone size-thumbnail wp-image-674" /></a>My goal is to change it as minimal as possible to allow easy db&#8217;s migration. To test <a href="http://en.wikipedia.org/wiki/Open_Database_Connectivity"><strong>ODBC</strong></a> connector I downloaded this <a href="http://framework.zend.com/issues/browse/ZF-905">class</a> and renamed it to <strong>Add_Db_Adapter_Pdo_Odbc</strong> (because it&#8217;s not a good idea to change something in actual Zend Framework library). To use it in your code you need to change config file to something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">resources.db.adapter <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> PDO_ODBC</span>
resources.db.params.adapterNamespace <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> App_Db_Adapter</span>
resources.db.params.username <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> usr</span>
resources.db.params.password <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> psw</span>
resources.db.params.dbname <span style="color: #000066; font-weight:bold;">=</span> <span style="color: #933;">&quot;Driver={SQL Native Client};
Server=localhost\SQLEXPRESS;Database=zf-tutorial;&quot;</span></pre></div></div>

<p>Note <em>dbname</em> string &#8211; now it has not only database name, but also driver information and host. I guess such format is chosen because dns&#8217; for ODBC are very different for different providers, so to make things easier you just supply whole string, not it&#8217;s parts (driver, server/file, etc.). Don&#8217;t forget to use correct server host &#8211; for some strange reasons 127.0.0.1 refused to work for me.</p>
<p>Problem with ODBC is that it&#8217;s too general: ODBC supports <a href="http://www.connectionstrings.com/">a lot</a> databases, hence they each can have something different (correct me if I&#8217;m wrong). That&#8217;s why I&#8217;m thinking about refactoring this class to <em>App_Db_Adapter_Pdo_Odbc_Abstract</em> abstract class and separate classes for different drivers. Although this class works fine for MSSQL, so can be used as is.</p>
<p>To test <strong>PHP extension</strong> there are no classes at all (at least I haven&#8217;t found, only in <a href="http://adodb.sourceforge.net/">Adodb</a>). So I decided to implement one myself &#8211; with a help of <a href="http://msdn.microsoft.com/en-us/library/cc296152(SQL.90).aspx">SqlSrv API Reference</a> and <a href="http://framework.zend.com/apidoc/core/Zend_Db/Adapter/Zend_Db_Adapter_Abstract.html">Zend_Db_Adapter_Abstract</a> abstract class I quite quickly came up with a working solution <strong>App_Db_Adapter_Mssql</strong>. Connection configuration looks the same:</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">resources.db.adapter <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> MSSQL</span>
resources.db.params.adapterNamespace <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> App_Db_Adapter</span>
resources.db.params.host <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> localhost\SQLEXPRESS</span>
resources.db.params.username <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> usr</span>
resources.db.params.password <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> psw</span>
resources.db.params.dbname <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> zf-tutorial</span></pre></div></div>

<p>I&#8217;ve tested both classes with the same application from <a href="http://dev.juokaz.com/winphp-2009/zend-framework-and-microsoft-iis">previous post</a> and benchmark results surprised me. They were <strong>equal</strong>! With a small variations page generation times were about 140 <em>ms</em> (all default settings, IIS7, MSSQL Express). Why? SQL server driver for PHP is open source, so if you look at it&#8217;s source you would find (C++):</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">SQLRETURN build_connection_string_and_set_conn_attr<span style="color: #008000;">&#40;</span>
       sqlsrv_conn <span style="color: #0000ff;">const</span><span style="color: #000040;">*</span> conn, <span style="color: #0000ff;">const</span> <span style="color: #0000ff;">char</span><span style="color: #000040;">*</span> server, zval <span style="color: #0000ff;">const</span><span style="color: #000040;">*</span> options,
       __inout std<span style="color: #008080;">::</span><span style="color: #007788;">string</span><span style="color: #000040;">&amp;</span> connection_string TSRMLS_DC <span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
   ...
&nbsp;
   <span style="color: #007788;">connection_string</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Driver={SQL Native Client};Server=&quot;</span><span style="color: #008080;">;</span>
   connection_string <span style="color: #000040;">+</span><span style="color: #000080;">=</span> server<span style="color: #008080;">;</span>
   connection_string <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;;&quot;</span><span style="color: #008080;">;</span>
&nbsp;
   ...
&nbsp;
   <span style="color: #0000ff;">for</span><span style="color: #008000;">&#40;</span> zend_hash_internal_pointer_reset<span style="color: #008000;">&#40;</span> oht <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
         zend_hash_has_more_elements<span style="color: #008000;">&#40;</span> oht <span style="color: #008000;">&#41;</span> <span style="color: #000080;">==</span> SUCCESS<span style="color: #008080;">;</span>
         zend_hash_move_forward<span style="color: #008000;">&#40;</span> oht <span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
&nbsp;
      ...
&nbsp;
       <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span> NO_ATTRIBUTE <span style="color: #000080;">==</span> ret.<span style="color: #007788;">attr</span> <span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
           <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span> ret.<span style="color: #007788;">add</span> <span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
               connection_string <span style="color: #000040;">+</span><span style="color: #000080;">=</span> key<span style="color: #008080;">;</span>
               connection_string <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;={&quot;</span><span style="color: #008080;">;</span>
               connection_string <span style="color: #000040;">+</span><span style="color: #000080;">=</span> ret.<span style="color: #007788;">str_value</span><span style="color: #008080;">;</span>
               connection_string <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;};&quot;</span><span style="color: #008080;">;</span>
           <span style="color: #008000;">&#125;</span>
       <span style="color: #008000;">&#125;</span>
       ...
   <span style="color: #008000;">&#125;</span>
&nbsp;
   ...
&nbsp;
   <span style="color: #0000ff;">return</span> SQL_SUCCESS<span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>If you are familiar with C++ you can look at full source at <a href="http://sql2k5php.codeplex.com/SourceControl/changeset/view/33567#265058">codeplex.com</a>. What this function does is it creates ODBC connection string, so basically it&#8217;s the same thing as using <a href="http://php.oregonstate.edu/manual/en/ref.pdo-odbc.php">PDO_ODBC</a> (no?). Both are implemented as extensions (not as PHP code) so there are no performance differences, test proves that.</p>
<p>After today&#8217;s analysis I can&#8217;t say which driver is better to use: ODBC or native driver. However, since <a href="http://php.oregonstate.edu/manual/en/intro.pdo.php">Pdo</a> driver is already being used in Zend Framework it&#8217;s easier and faster to use ODBC. Also, ODBC doesn&#8217;t require Sql PHP extension to be installed, so as long as you have Sql server and <a href="http://msdn.microsoft.com/en-us/data/aa937733.aspx">native client</a> it will work without <em>php.ini</em> modifications.</p>
<p>In conclusion, if you want to use SQL Native driver with Zend Framework solutions are almost here. I can promise, that something stable and proven to be working by actual application will be released before middle of June. I would love to hear comments from Microsoft people or ODBC users &#8211; I&#8217;m confused a little bit, because I didn&#8217;t have a lot of experience with Microsoft&#8217;s Sql and ODBC (you can share find me in twitter also <a href="http://twitter.com/juokaz">@juokaz</a>).</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.juokaz.com/winphp-2009/sql-native-client-as-mssql-driver-for-zend-framework/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Creating Deep Zoom applications with C#</title>
		<link>http://dev.juokaz.com/winphp-2009/creating-deep-zoom-applications-with-c</link>
		<comments>http://dev.juokaz.com/winphp-2009/creating-deep-zoom-applications-with-c#comments</comments>
		<pubDate>Sun, 26 Apr 2009 22:43:32 +0000</pubDate>
		<dc:creator>Juozas</dc:creator>
				<category><![CDATA[WinPhp 2009]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[blogs]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[competition]]></category>
		<category><![CDATA[deep zoom]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[manoknyga]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[msdn]]></category>
		<category><![CDATA[silverlight]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[windows server]]></category>

		<guid isPermaLink="false">http://dev.juokaz.com/?p=578</guid>
		<description><![CDATA[Today I was again working with my entry for WinPhp competition. Now with a key feature &#8211; Microsoft Deep Zoom.
To start with, there are many ways how Deep Zoom application can be created. As I have written before here, easiest way is to use Deep Zoom Composer. However, I want to use it as a [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://dev.juokaz.com/wp-content/uploads/2009/04/060807-0453-nextgenerat11.jpg" alt="Seadragon" title="Seadragon" width="219" height="98" class="alignnone size-full wp-image-593" />Today I was again working with my entry for <a href="http://wiki.phpconference.nl/2009_WinPHP_Challenge">WinPhp competition</a>. Now with a key feature &#8211; Microsoft <a href="http://livelabs.com/seadragon/">Deep Zoom</a>.</p>
<p>To start with, there are many ways how Deep Zoom application can be created. As I have written before <a href="http://dev.juokaz.com/html/deep-zoom-with-microsoft-seadragon">here</a>, easiest way is to use <a href="http://www.microsoft.com/downloads/details.aspx?familyid=457b17b7-52bf-4bda-87a3-fa8a4673f8bf&amp;displaylang=en">Deep Zoom Composer</a>. However, I want to use it as a part of my application, so any outside application is not a choice.</p>
<p>Microsoft has released independent Deep Zoom library, but documentation is <strong>very</strong> limited, so I mostly used various <a href="http://en.wikipedia.org/wiki/MSDN">MSDN</a> blogs. For example, only in this <a href="http://blogs.msdn.com/expression/archive/2008/11/26/hello-deepzoomtools-dll-deep-zoom-image-tile-generation-made-easy.aspx">article</a> I have found list of available classes (with some useful comments). My first try was to use <a href="http://blogs.sqlxml.org/bryantlikes/archive/2008/11/27/deep-zoom-image-generation-with-deepzoomtools-dll.aspx">this</a> Bryan Like&#8217;s example (at the end of post you can find a link to a working application).</p>
<p><a href="http://dev.juokaz.com/wp-content/uploads/2009/04/2313509133_d9602713d3.jpg"><img src="http://dev.juokaz.com/wp-content/uploads/2009/04/2313509133_d9602713d3-150x150.jpg" alt="Seadragon" title="Seadragon" style="float: right; margin-left: 5px;" width="100" height="100" class="alignnone size-thumbnail wp-image-595" /></a>Given code works just fine, but it can be improved. It allows doing a lot of post-processing modifications inside Silverligt client application, but in most cases such approach is very slow. Problem is, for every zoom level it loads not &#8220;grouped&#8221; image like <a href="http://dev.juokaz.com/wp-content/uploads/2009/04/0_1.jpg">this</a> but required size copies of all visible images.</p>
<p>If, for example, there are 1000 images in a window, it will load all of them even if a single image size is just some pixels. What correct application should do is to load &#8220;grouped&#8221; images &#8211; downloaded amount of data is the same, but required HTTP calls is minimal. I only recommend using that code if you need to have dynamic layout or something like that. As I said before, in most cases, different approach should be chosen.</p>
<p>For my tests I downloaded big collection (>5000) of books covers from my project <a href="http://www.manoknyga.lt">ManoKnyga.lt</a> and when tried to show them in one screen. Working <a href="http://winphp.juokaz.com/demo01/">demo</a> (requires Silverlight <a href="http://silverlight.net/GetStarted/">installed</a>), JavaScript example:<br />
<script type="text/javascript" src="http://seadragon.com/ajax/embed.js"></script><script type="text/javascript">Seadragon.embed("500px", "300px", "http://winphp.juokaz.com/demo01/ClientBin/GeneratedImages/output.xml", 29517, 20175, 256, 1, "jpg", [[0,0,29517,20175,0,9],[1956,0,652,665,0,10],[3260,0,652,321,0,10],[7824,0,652,628,0,10],[11084,0,652,495,0,10],[12388,0,1304,1047,0,10],[16952,0,652,487,0,10],[26080,0,652,843,0,10],[14344,0,652,1314,0,10],[21516,0,652,1628,0,10],[26732,0,652,1628,0,10],[24776,0,652,2490,0,10],[3260,869,652,2574,0,10],[4564,0,652,3463,0,10],[10432,0,652,3430,0,10],[11736,0,652,3054,0,10],[14996,0,652,3390,0,10],[16952,869,652,2305,0,10],[27384,0,652,3362,0,10],[1304,0,652,4324,0,10],[1956,869,652,3440,0,10],[2608,0,652,4263,0,10],[5216,0,652,4320,0,10],[7172,0,652,3956,0,10],[8476,0,652,4309,0,10],[9128,0,652,4174,0,10],[9780,0,652,4128,0,10],[10432,3476,652,672,0,10],[11084,869,652,3183,0,10],[12388,1047,652,3285,0,10],[19560,0,652,4023,0,10],[22820,0,652,3965,0,10],[24776,2607,652,1436,0,10],[25428,0,652,4316,0,10],[26080,869,652,3415,0,10],[11084,4346,652,552,0,10],[12388,4346,652,533,0,10],[16952,3476,652,1702,0,10],[17604,0,652,5047,0,10],[19560,4346,652,575,0,10],[20864,0,652,5201,0,10],[23472,0,652,4777,0,10],[24776,4346,652,652,0,10],[27384,3476,652,1712,0,10],[28036,0,652,4896,0,10],[28688,0,652,5206,0,10],[3912,0,652,5781,0,10],[8476,4346,652,1548,0,10],[15648,0,652,5890,0,10],[19560,5215,652,667,0,10],[22820,4346,652,1521,0,10],[24124,0,652,6074,0,10],[5216,4346,652,2556,0,10],[11084,5215,652,1435,0,10],[14344,1738,652,5058,0,10],[19560,6084,652,827,0,10],[24124,6084,652,417,0,10],[24776,5215,652,1595,0,10],[652,0,652,7762,0,10],[2608,4346,652,3274,0,10],[3912,6084,652,1701,0,10],[5216,6953,652,652,0,10],[5868,0,652,7609,0,10],[6520,0,652,7754,0,10],[11736,3476,652,4340,0,10],[16952,5215,652,2580,0,10],[20212,0,652,7520,0,10],[23472,5215,652,2303,0,10],[26080,4346,652,3230,0,10],[1304,4346,652,4220,0,10],[3260,3476,652,5020,0,10],[5216,7822,652,863,0,10],[5868,7822,1304,920,0,10],[7172,4346,652,4316,0,10],[12388,5215,652,3412,0,10],[14344,6953,652,1483,0,10],[14996,3476,652,5082,0,10],[15648,6084,652,2474,0,10],[11736,7822,652,1731,0,10],[13040,1047,652,8430,0,10],[13692,0,652,9293,0,10],[18256,0,652,9558,0,10],[22168,0,652,9309,0,10],[23472,7822,652,1617,0,10],[1304,8691,652,1732,0,10],[18256,9560,652,810,0,10],[21516,1738,652,8578,0,10],[26080,7822,652,2313,0,10],[28036,5215,652,5177,0,10],[0,0,652,11250,0,10],[652,7822,652,3417,0,10],[1304,10429,652,840,0,10],[26080,10429,652,867,0,10],[3912,7822,652,4125,0,10],[9128,4346,652,7777,0,10],[9780,4346,652,7808,0,10],[17604,5215,652,6843,0,10],[22168,9560,652,2605,0,10],[24124,6953,652,5189,0,10],[12388,8691,652,4282,0,10],[16952,7822,652,5155,0,10],[17604,12168,652,770,0,10],[25428,4346,652,8565,0,10],[28688,5215,652,7605,0,10],[13040,9560,652,4296,0,10],[19560,6953,652,6736,0,10],[20212,7822,652,6062,0,10],[21516,10429,652,3309,0,10],[24776,6953,652,6716,0,10],[28688,13037,652,851,0,10],[3260,8691,652,5997,0,10],[8476,6084,652,8626,0,10],[10432,4346,652,10419,0,10],[20212,13906,652,845,0,10],[20864,5215,652,9136,0,10],[27384,5215,652,9320,0,10],[28688,13906,652,843,0,10],[2608,7822,652,7797,0,10],[3912,12168,652,3447,0,10],[9128,12168,652,3259,0,10],[16300,0,652,15624,0,10],[2608,15644,652,744,0,10],[3260,14775,652,1648,0,10],[3912,15644,652,660,0,10],[4564,3476,652,12824,0,10],[6520,8742,652,7742,0,10],[7172,8691,652,7678,0,10],[12388,13037,652,3386,0,10],[18256,10429,652,5867,0,10],[20212,14775,652,1437,0,10],[21516,13906,652,2600,0,10],[26732,1738,652,14700,0,10],[11084,6953,652,10347,0,10],[13040,13906,652,3274,0,10],[13692,9560,652,7758,0,10],[14344,8691,652,8658,0,10],[19560,13906,652,3259,0,10],[20864,14775,652,2520,0,10],[18908,0,652,18230,0,10],[22168,12168,652,6020,0,10],[22820,6084,652,12138,0,10],[24124,12168,652,6081,0,10],[26080,11298,652,6744,0,10],[0,11298,652,7736,0,10],[1304,11298,652,7605,0,10],[6520,16513,652,2563,0,10],[7172,16513,652,2659,0,10],[7824,869,652,18411,0,10],[8476,14775,652,4703,0,10],[9128,15644,652,3562,0,10],[9780,12168,652,7147,0,10],[10432,14775,652,4407,0,10],[11084,17382,652,1782,0,10],[11736,9560,652,9636,0,10],[12388,16513,652,2816,0,10],[13040,17382,652,1760,0,10],[13692,17382,652,1821,0,10],[14344,17382,652,1653,0,10],[14996,8691,652,10579,0,10],[15648,8691,652,10684,0,10],[16300,15644,652,3683,0,10],[16952,13037,652,6227,0,10],[17604,13037,652,6192,0,10],[18256,16513,652,2573,0,10],[18908,18251,652,1104,0,10],[19560,17382,652,1845,0,10],[20212,16513,652,2733,0,10],[20864,17382,652,1928,0,10],[21516,16513,652,2580,0,10],[22168,18251,652,1089,0,10],[22820,18251,652,1011,0,10],[23472,9560,652,9640,0,10],[24124,18251,652,970,0,10],[24776,13906,652,5244,0,10],[25428,13037,652,6246,0,10],[26080,18251,652,1101,0,10],[26732,16513,652,2737,0,10],[27384,14775,652,4316,0,10],[28036,10429,652,8963,0,10],[28688,14775,652,4511,0,10],[0,19120,652,991,0,10],[652,11298,652,8474,0,10],[1304,19120,652,825,0,10],[1956,4346,652,15829,0,10],[2608,16513,652,3601,0,10],[3260,16513,652,3539,0,10],[3912,16513,652,3654,0,10],[4564,16513,652,3486,0,10],[5216,8691,652,11262,0,10],[5868,8742,652,11402,0,10],[6520,19120,652,1053,0,10],[1956,0,652,665,0,11],[3260,0,652,321,0,11],[7824,0,652,628,0,11],[11084,0,652,495,0,11],[12388,0,1304,1047,0,11],[16952,0,652,487,0,11],[26080,0,652,843,0,11],[14344,0,652,1314,0,11],[21516,0,652,1628,0,11],[26732,0,652,1628,0,11],[24776,0,652,2490,0,11],[3260,869,652,2574,0,11],[4564,0,652,3463,0,11],[10432,0,652,3430,0,11],[11736,0,652,3054,0,11],[14996,0,652,3390,0,11],[16952,869,652,2305,0,11],[27384,0,652,3362,0,11],[1304,0,652,4324,0,11],[1956,869,652,3440,0,11],[2608,0,652,4263,0,11],[5216,0,652,4320,0,11],[7172,0,652,3956,0,11],[8476,0,652,4309,0,11],[9128,0,652,4174,0,11],[9780,0,652,4128,0,11],[10432,3476,652,672,0,11],[11084,869,652,3183,0,11],[12388,1047,652,3285,0,11],[19560,0,652,4023,0,11],[22820,0,652,3965,0,11],[24776,2607,652,1436,0,11],[25428,0,652,4316,0,11],[26080,869,652,3415,0,11],[11084,4346,652,552,0,11],[12388,4346,652,533,0,11],[16952,3476,652,1702,0,11],[17604,0,652,5047,0,11],[19560,4346,652,575,0,11],[20864,0,652,5201,0,11],[23472,0,652,4777,0,11],[24776,4346,652,652,0,11],[27384,3476,652,1712,0,11],[28036,0,652,4896,0,11],[28688,0,652,5206,0,11],[3912,0,652,5781,0,11],[8476,4346,652,1548,0,11],[15648,0,652,5890,0,11],[19560,5215,652,667,0,11],[22820,4346,652,1521,0,11],[24124,0,652,6074,0,11],[5216,4346,652,2556,0,11],[11084,5215,652,1435,0,11],[14344,1738,652,5058,0,11],[19560,6084,652,827,0,11],[24124,6084,652,417,0,11],[24776,5215,652,1595,0,11],[652,0,652,7762,0,11],[2608,4346,652,3274,0,11],[3912,6084,652,1701,0,11],[5216,6953,652,652,0,11],[5868,0,652,7609,0,11],[6520,0,652,7754,0,11],[11736,3476,652,4340,0,11],[16952,5215,652,2580,0,11],[20212,0,652,7520,0,11],[23472,5215,652,2303,0,11],[26080,4346,652,3230,0,11],[1304,4346,652,4220,0,11],[3260,3476,652,5020,0,11],[5216,7822,652,863,0,11],[5868,7822,1304,920,0,11],[7172,4346,652,4316,0,11],[12388,5215,652,3412,0,11],[14344,6953,652,1483,0,11],[14996,3476,652,5082,0,11],[15648,6084,652,2474,0,11],[11736,7822,652,1731,0,11],[13040,1047,652,8430,0,11],[13692,0,652,9293,0,11],[18256,0,652,9558,0,11],[22168,0,652,9309,0,11],[23472,7822,652,1617,0,11],[1304,8691,652,1732,0,11],[18256,9560,652,810,0,11],[21516,1738,652,8578,0,11],[26080,7822,652,2313,0,11],[28036,5215,652,5177,0,11],[0,0,652,11250,0,11],[652,7822,652,3417,0,11],[1304,10429,652,840,0,11],[26080,10429,652,867,0,11],[3912,7822,652,4125,0,11],[9128,4346,652,7777,0,11],[9780,4346,652,7808,0,11],[17604,5215,652,6843,0,11],[22168,9560,652,2605,0,11],[24124,6953,652,5189,0,11],[12388,8691,652,4282,0,11],[16952,7822,652,5155,0,11],[17604,12168,652,770,0,11],[25428,4346,652,8565,0,11],[28688,5215,652,7605,0,11],[13040,9560,652,4296,0,11],[19560,6953,652,6736,0,11],[20212,7822,652,6062,0,11],[21516,10429,652,3309,0,11],[24776,6953,652,6716,0,11],[28688,13037,652,851,0,11],[3260,8691,652,5997,0,11],[8476,6084,652,8626,0,11],[10432,4346,652,10419,0,11],[20212,13906,652,845,0,11],[20864,5215,652,9136,0,11],[27384,5215,652,9320,0,11],[28688,13906,652,843,0,11],[2608,7822,652,7797,0,11],[3912,12168,652,3447,0,11],[9128,12168,652,3259,0,11],[16300,0,652,15624,0,11],[2608,15644,652,744,0,11],[3260,14775,652,1648,0,11],[3912,15644,652,660,0,11],[4564,3476,652,12824,0,11],[6520,8742,652,7742,0,11],[7172,8691,652,7678,0,11],[12388,13037,652,3386,0,11],[18256,10429,652,5867,0,11],[20212,14775,652,1437,0,11],[21516,13906,652,2600,0,11],[26732,1738,652,14700,0,11],[11084,6953,652,10347,0,11],[13040,13906,652,3274,0,11],[13692,9560,652,7758,0,11],[14344,8691,652,8658,0,11],[19560,13906,652,3259,0,11],[20864,14775,652,2520,0,11],[18908,0,652,18230,0,11],[22168,12168,652,6020,0,11],[22820,6084,652,12138,0,11],[24124,12168,652,6081,0,11],[26080,11298,652,6744,0,11],[0,11298,652,7736,0,11],[1304,11298,652,7605,0,11],[6520,16513,652,2563,0,11],[7172,16513,652,2659,0,11],[7824,869,652,18411,0,11],[8476,14775,652,4703,0,11],[9128,15644,652,3562,0,11],[9780,12168,652,7147,0,11],[10432,14775,652,4407,0,11],[11084,17382,652,1782,0,11],[11736,9560,652,9636,0,11],[12388,16513,652,2816,0,11],[13040,17382,652,1760,0,11],[13692,17382,652,1821,0,11],[14344,17382,652,1653,0,11],[14996,8691,652,10579,0,11],[15648,8691,652,10684,0,11],[16300,15644,652,3683,0,11],[16952,13037,652,6227,0,11],[17604,13037,652,6192,0,11],[18256,16513,652,2573,0,11],[18908,18251,652,1104,0,11],[19560,17382,652,1845,0,11],[20212,16513,652,2733,0,11],[20864,17382,652,1928,0,11],[21516,16513,652,2580,0,11],[22168,18251,652,1089,0,11],[22820,18251,652,1011,0,11],[23472,9560,652,9640,0,11],[24124,18251,652,970,0,11],[24776,13906,652,5244,0,11],[25428,13037,652,6246,0,11],[26080,18251,652,1101,0,11],[26732,16513,652,2737,0,11],[27384,14775,652,4316,0,11],[28036,10429,652,8963,0,11],[28688,14775,652,4511,0,11],[0,19120,652,991,0,11],[652,11298,652,8474,0,11],[1304,19120,652,825,0,11],[1956,4346,652,15829,0,11],[2608,16513,652,3601,0,11],[3260,16513,652,3539,0,11],[3912,16513,652,3654,0,11],[4564,16513,652,3486,0,11],[5216,8691,652,11262,0,11],[5868,8742,652,11402,0,11],[6520,19120,652,1053,0,11],[1956,0,652,665,0,12],[3260,0,652,321,0,12],[7824,0,652,628,0,12],[11084,0,652,495,0,12],[12388,0,1304,1047,0,12],[16952,0,652,487,0,12],[26080,0,652,843,0,12],[14344,0,652,1314,0,12],[21516,0,652,1628,0,12],[26732,0,652,1628,0,12],[24776,0,652,2490,0,12],[3260,869,652,2574,0,12],[4564,0,652,3463,0,12],[10432,0,652,3430,0,12],[11736,0,652,3054,0,12],[14996,0,652,3390,0,12],[16952,869,652,2305,0,12],[27384,0,652,3362,0,12],[1304,0,652,4324,0,12],[1956,869,652,3440,0,12],[2608,0,652,4263,0,12],[5216,0,652,4320,0,12],[7172,0,652,3956,0,12],[8476,0,652,4309,0,12],[9128,0,652,4174,0,12],[9780,0,652,4128,0,12],[10432,3476,652,672,0,12],[11084,869,652,3183,0,12],[12388,1047,652,3285,0,12],[19560,0,652,4023,0,12],[22820,0,652,3965,0,12],[24776,2607,652,1436,0,12],[25428,0,652,4316,0,12],[26080,869,652,3415,0,12],[11084,4346,652,552,0,12],[12388,4346,652,533,0,12],[16952,3476,652,1702,0,12],[17604,0,652,5047,0,12],[19560,4346,652,575,0,12],[20864,0,652,5201,0,12],[23472,0,652,4777,0,12],[24776,4346,652,652,0,12],[27384,3476,652,1712,0,12],[28036,0,652,4896,0,12],[28688,0,652,5206,0,12],[3912,0,652,5781,0,12],[8476,4346,652,1548,0,12],[15648,0,652,5890,0,12],[19560,5215,652,667,0,12],[22820,4346,652,1521,0,12],[24124,0,652,6074,0,12],[5216,4346,652,2556,0,12],[11084,5215,652,1435,0,12],[14344,1738,652,5058,0,12],[19560,6084,652,827,0,12],[24124,6084,652,417,0,12],[24776,5215,652,1595,0,12],[652,0,652,7762,0,12],[2608,4346,652,3274,0,12],[3912,6084,652,1701,0,12],[5216,6953,652,652,0,12],[5868,0,652,7609,0,12],[6520,0,652,7754,0,12],[11736,3476,652,4340,0,12],[16952,5215,652,2580,0,12],[20212,0,652,7520,0,12],[23472,5215,652,2303,0,12],[26080,4346,652,3230,0,12],[1304,4346,652,4220,0,12],[3260,3476,652,5020,0,12],[5216,7822,652,863,0,12],[5868,7822,1304,920,0,12],[7172,4346,652,4316,0,12],[12388,5215,652,3412,0,12],[14344,6953,652,1483,0,12],[14996,3476,652,5082,0,12],[15648,6084,652,2474,0,12],[11736,7822,652,1731,0,12],[13040,1047,652,8430,0,12],[13692,0,652,9293,0,12],[18256,0,652,9558,0,12],[22168,0,652,9309,0,12],[23472,7822,652,1617,0,12],[1304,8691,652,1732,0,12],[18256,9560,652,810,0,12],[21516,1738,652,8578,0,12],[26080,7822,652,2313,0,12],[28036,5215,652,5177,0,12],[0,0,652,11250,0,12],[652,7822,652,3417,0,12],[1304,10429,652,840,0,12],[26080,10429,652,867,0,12],[3912,7822,652,4125,0,12],[9128,4346,652,7777,0,12],[9780,4346,652,7808,0,12],[17604,5215,652,6843,0,12],[22168,9560,652,2605,0,12],[24124,6953,652,5189,0,12],[12388,8691,652,4282,0,12],[16952,7822,652,5155,0,12],[17604,12168,652,770,0,12],[25428,4346,652,8565,0,12],[28688,5215,652,7605,0,12],[13040,9560,652,4296,0,12],[19560,6953,652,6736,0,12],[20212,7822,652,6062,0,12],[21516,10429,652,3309,0,12],[24776,6953,652,6716,0,12],[28688,13037,652,851,0,12],[3260,8691,652,5997,0,12],[8476,6084,652,8626,0,12],[10432,4346,652,10419,0,12],[20212,13906,652,845,0,12],[20864,5215,652,9136,0,12],[27384,5215,652,9320,0,12],[28688,13906,652,843,0,12],[2608,7822,652,7797,0,12],[3912,12168,652,3447,0,12],[9128,12168,652,3259,0,12],[16300,0,652,15624,0,12],[2608,15644,652,744,0,12],[3260,14775,652,1648,0,12],[3912,15644,652,660,0,12],[4564,3476,652,12824,0,12],[6520,8742,652,7742,0,12],[7172,8691,652,7678,0,12],[12388,13037,652,3386,0,12],[18256,10429,652,5867,0,12],[20212,14775,652,1437,0,12],[21516,13906,652,2600,0,12],[26732,1738,652,14700,0,12],[11084,6953,652,10347,0,12],[13040,13906,652,3274,0,12],[13692,9560,652,7758,0,12],[14344,8691,652,8658,0,12],[19560,13906,652,3259,0,12],[20864,14775,652,2520,0,12],[18908,0,652,18230,0,12],[22168,12168,652,6020,0,12],[22820,6084,652,12138,0,12],[24124,12168,652,6081,0,12],[26080,11298,652,6744,0,12],[0,11298,652,7736,0,12],[1304,11298,652,7605,0,12],[6520,16513,652,2563,0,12],[7172,16513,652,2659,0,12],[7824,869,652,18411,0,12],[8476,14775,652,4703,0,12],[9128,15644,652,3562,0,12],[9780,12168,652,7147,0,12],[10432,14775,652,4407,0,12],[11084,17382,652,1782,0,12],[11736,9560,652,9636,0,12],[12388,16513,652,2816,0,12],[13040,17382,652,1760,0,12],[13692,17382,652,1821,0,12],[14344,17382,652,1653,0,12],[14996,8691,652,10579,0,12],[15648,8691,652,10684,0,12],[16300,15644,652,3683,0,12],[16952,13037,652,6227,0,12],[17604,13037,652,6192,0,12],[18256,16513,652,2573,0,12],[18908,18251,652,1104,0,12],[19560,17382,652,1845,0,12],[20212,16513,652,2733,0,12],[20864,17382,652,1928,0,12],[21516,16513,652,2580,0,12],[22168,18251,652,1089,0,12],[22820,18251,652,1011,0,12],[23472,9560,652,9640,0,12],[24124,18251,652,970,0,12],[24776,13906,652,5244,0,12],[25428,13037,652,6246,0,12],[26080,18251,652,1101,0,12],[26732,16513,652,2737,0,12],[27384,14775,652,4316,0,12],[28036,10429,652,8963,0,12],[28688,14775,652,4511,0,12],[0,19120,652,991,0,12],[652,11298,652,8474,0,12],[1304,19120,652,825,0,12],[1956,4346,652,15829,0,12],[2608,16513,652,3601,0,12],[3260,16513,652,3539,0,12],[3912,16513,652,3654,0,12],[4564,16513,652,3486,0,12],[5216,8691,652,11262,0,12],[5868,8742,652,11402,0,12],[6520,19120,652,1053,0,12],[1956,0,652,665,0,13],[3260,0,652,321,0,13],[7824,0,652,628,0,13],[11084,0,652,495,0,13],[12388,0,1304,1047,0,13],[16952,0,652,487,0,13],[26080,0,652,843,0,13],[14344,0,652,1314,0,13],[21516,0,652,1628,0,13],[26732,0,652,1628,0,13],[15648,0,652,2716,0,13],[24776,0,652,2490,0,13],[3260,869,652,2574,0,13],[4564,0,652,3463,0,13],[10432,0,652,3430,0,13],[11736,0,652,3054,0,13],[14996,0,652,3390,0,13],[16952,869,652,2305,0,13],[23472,0,652,3659,0,13],[27384,0,652,3362,0,13],[1304,0,652,4324,0,13],[1956,869,652,3440,0,13],[2608,0,652,4263,0,13],[5216,0,652,4320,0,13],[7172,0,652,3956,0,13],[8476,0,652,4309,0,13],[9128,0,652,4174,0,13],[9780,0,652,4128,0,13],[10432,3476,652,672,0,13],[11084,869,652,3183,0,13],[12388,1047,652,3285,0,13],[19560,0,652,4023,0,13],[22820,0,652,3965,0,13],[24776,2607,652,1436,0,13],[25428,0,652,4316,0,13],[26080,869,652,3415,0,13],[2608,4346,652,968,0,13],[11084,4346,652,552,0,13],[12388,4346,652,533,0,13],[16952,3476,652,1702,0,13],[17604,0,652,5047,0,13],[19560,4346,652,575,0,13],[20864,0,652,5201,0,13],[23472,4346,652,431,0,13],[24776,4346,652,652,0,13],[27384,3476,652,1712,0,13],[28036,0,652,4896,0,13],[28688,0,652,5206,0,13],[3912,0,652,5781,0,13],[8476,4346,652,1548,0,13],[9780,4346,652,1927,0,13],[15648,3476,652,2414,0,13],[19560,5215,652,667,0,13],[22820,4346,652,1521,0,13],[24124,0,652,6074,0,13],[5216,4346,652,2556,0,13],[11084,5215,652,1435,0,13],[14344,1738,652,5058,0,13],[17604,5215,652,1740,0,13],[18908,0,652,7008,0,13],[19560,6084,652,827,0,13],[24124,6084,652,417,0,13],[24776,5215,652,1595,0,13],[652,0,652,7762,0,13],[2608,6084,652,1536,0,13],[3912,6084,652,1701,0,13],[5216,6953,652,652,0,13],[5868,0,652,7609,0,13],[6520,0,652,7754,0,13],[11736,3476,652,4340,0,13],[16952,5215,652,2580,0,13],[20212,0,652,7520,0,13],[23472,5215,652,2303,0,13],[26080,4346,652,3230,0,13],[1304,4346,652,4220,0,13],[3260,3476,652,5020,0,13],[3912,7822,652,973,0,13],[5216,7822,652,863,0,13],[5868,7822,1304,920,0,13],[7172,4346,652,4316,0,13],[12388,5215,652,3412,0,13],[14344,6953,652,1483,0,13],[14996,3476,652,5082,0,13],[15648,6084,652,2474,0,13],[11736,7822,652,1731,0,13],[13040,1047,652,8430,0,13],[13692,0,652,9293,0,13],[15648,8691,652,1055,0,13],[18256,0,652,9558,0,13],[18908,7822,652,1931,0,13],[22168,0,652,9309,0,13],[23472,7822,652,1617,0,13],[1304,8691,652,1732,0,13],[18256,9560,652,810,0,13],[21516,1738,652,8578,0,13],[26080,7822,652,2313,0,13],[28036,5215,652,5177,0,13],[0,0,652,11250,0,13],[652,7822,652,3417,0,13],[1304,10429,652,840,0,13],[26080,10429,652,867,0,13],[652,11298,652,948,0,13],[3912,9560,652,2387,0,13],[9128,4346,652,7777,0,13],[9780,6953,652,5201,0,13],[17604,7822,652,4236,0,13],[22168,9560,652,2605,0,13],[24124,6953,652,5189,0,13],[12388,8691,652,4282,0,13],[16952,7822,652,5155,0,13],[17604,12168,652,770,0,13],[25428,4346,652,8565,0,13],[28688,5215,652,7605,0,13],[13040,9560,652,4296,0,13],[19560,6953,652,6736,0,13],[20212,7822,652,6062,0,13],[21516,10429,652,3309,0,13],[24776,6953,652,6716,0,13],[28688,13037,652,851,0,13],[3260,8691,652,5997,0,13],[8476,6084,652,8626,0,13],[10432,4346,652,10419,0,13],[20212,13906,652,845,0,13],[20864,5215,652,9136,0,13],[27384,5215,652,9320,0,13],[28688,13906,652,843,0,13],[2608,7822,652,7797,0,13],[3912,12168,652,3447,0,13],[9128,12168,652,3259,0,13],[16300,0,652,15624,0,13],[2608,15644,652,744,0,13],[3260,14775,652,1648,0,13],[3912,15644,652,660,0,13],[4564,3476,652,12824,0,13],[6520,8742,652,7742,0,13],[7172,8691,652,7678,0,13],[12388,13037,652,3386,0,13],[18256,10429,652,5867,0,13],[20212,14775,652,1437,0,13],[21516,13906,652,2600,0,13],[26732,1738,652,14700,0,13],[6520,16513,652,913,0,13],[11084,6953,652,10347,0,13],[13040,13906,652,3274,0,13],[13692,9560,652,7758,0,13],[14344,8691,652,8658,0,13],[19560,13906,652,3259,0,13],[20864,14775,652,2520,0,13],[14996,8691,652,9771,0,13],[18908,10429,652,7801,0,13],[22168,12168,652,6020,0,13],[22820,6084,652,12138,0,13],[24124,12168,652,6081,0,13],[26080,11298,652,6744,0,13],[0,11298,652,7736,0,13],[1304,11298,652,7605,0,13],[6520,18251,652,825,0,13],[7172,16513,652,2659,0,13],[7824,869,652,18411,0,13],[8476,14775,652,4703,0,13],[9128,15644,652,3562,0,13],[9780,12168,652,7147,0,13],[10432,14775,652,4407,0,13],[11084,17382,652,1782,0,13],[11736,10429,652,8767,0,13],[12388,16513,652,2816,0,13],[13040,17382,652,1760,0,13],[13692,17382,652,1821,0,13],[14344,17382,652,1653,0,13],[15648,10429,652,8946,0,13],[16300,15644,652,3683,0,13],[16952,13037,652,6227,0,13],[17604,13037,652,6192,0,13],[18256,16513,652,2573,0,13],[18908,18251,652,1104,0,13],[19560,17382,652,1845,0,13],[20212,16513,652,2733,0,13],[20864,17382,652,1928,0,13],[21516,16513,652,2580,0,13],[22168,18251,652,1089,0,13],[22820,18251,652,1011,0,13],[23472,9560,652,9640,0,13],[24124,18251,652,970,0,13],[24776,13906,652,5244,0,13],[25428,13037,652,6246,0,13],[26080,18251,652,1101,0,13],[26732,16513,652,2737,0,13],[27384,14775,652,4316,0,13],[28036,10429,652,8963,0,13],[28688,14775,652,4511,0,13],[0,19120,652,991,0,13],[652,13037,652,6735,0,13],[1304,19120,652,825,0,13],[1956,4346,652,15829,0,13],[2608,16513,652,3601,0,13],[3260,16513,652,3539,0,13],[3912,16513,652,3654,0,13],[4564,16513,652,3486,0,13],[5216,8691,652,11262,0,13],[5868,8742,652,11402,0,13],[6520,19120,652,1053,0,13],[1956,0,652,665,0,14],[3260,0,652,321,0,14],[5216,0,652,976,0,14],[7824,0,652,628,0,14],[8476,0,652,1043,0,14],[9128,0,652,928,0,14],[9780,0,652,1013,0,14],[10432,0,652,1082,0,14],[11084,0,652,495,0,14],[12388,0,1304,1047,0,14],[14996,0,652,963,0,14],[16952,0,652,487,0,14],[26080,0,652,843,0,14],[0,0,652,1924,0,14],[13692,0,652,1847,0,14],[14344,0,652,1314,0,14],[15648,0,652,2003,0,14],[17604,0,652,1755,0,14],[20212,0,652,1843,0,14],[20864,869,652,1032,0,14],[21516,0,652,1628,0,14],[26732,0,652,1628,0,14],[28688,869,652,935,0,14],[11736,0,652,2702,0,14],[12388,1738,652,1042,0,14],[14344,1738,652,998,0,14],[16952,869,652,1980,0,14],[21516,1738,652,1008,0,14],[23472,0,652,2720,0,14],[24124,0,652,2793,0,14],[24776,0,652,2490,0,14],[26080,869,652,1924,0,14],[26732,1738,652,963,0,14],[27384,869,652,1824,0,14],[28036,0,652,2751,0,14],[3260,1738,652,1705,0,14],[4564,869,652,2594,0,14],[10432,1738,652,1692,0,14],[14996,2607,652,783,0,14],[19560,0,652,3543,0,14],[20212,2607,652,1126,0,14],[22168,0,652,3601,0,14],[24776,2607,652,961,0,14],[652,0,652,4428,0,14],[1304,869,652,3455,0,14],[1956,869,652,3440,0,14],[2608,869,652,3394,0,14],[3260,3476,652,1055,0,14],[4564,3476,652,1055,0,14],[5216,1738,652,2582,0,14],[7172,2607,652,1349,0,14],[8476,1738,652,2571,0,14],[9128,1738,652,2436,0,14],[9780,1738,652,2390,0,14],[10432,3476,652,672,0,14],[11084,869,652,3183,0,14],[12388,3476,652,856,0,14],[16300,0,652,4483,0,14],[22820,0,652,3965,0,14],[25428,0,652,4316,0,14],[26080,3476,652,808,0,14],[1304,4346,652,1075,0,14],[3912,0,652,5362,0,14],[6520,1738,652,3628,0,14],[9780,4346,652,1073,0,14],[11084,4346,652,552,0,14],[11736,3476,652,1924,0,14],[12388,4346,652,533,0,14],[13040,3476,652,1874,0,14],[15648,3476,652,1909,0,14],[16952,3476,652,1702,0,14],[17604,2607,652,2440,0,14],[19560,4346,652,575,0,14],[20864,4346,652,855,0,14],[23472,4346,652,431,0,14],[24776,4346,652,652,0,14],[27384,3476,652,1712,0,14],[28036,3476,652,1420,0,14],[28688,4346,652,860,0,14],[7824,1738,652,4499,0,14],[8476,4346,652,1548,0,14],[11084,5215,652,960,0,14],[14344,4346,652,1876,0,14],[14996,3476,652,2723,0,14],[16300,5215,652,995,0,14],[16952,5215,652,1031,0,14],[18256,0,652,6262,0,14],[19560,5215,652,667,0,14],[22168,4346,652,1885,0,14],[22820,4346,652,1521,0,14],[24124,3476,652,2598,0,14],[25428,4346,652,1801,0,14],[3260,5215,652,1812,0,14],[5216,5215,652,1687,0,14],[9128,6084,652,963,0,14],[17604,5215,652,1740,0,14],[18908,0,652,7008,0,14],[19560,6084,652,827,0,14],[20212,4346,652,2797,0,14],[24124,6084,652,417,0,14],[24776,5215,652,1595,0,14],[26732,3476,652,3620,0,14],[652,6084,652,1678,0,14],[1956,4346,652,3658,0,14],[2608,6084,652,1536,0,14],[3912,6084,652,1701,0,14],[5216,6953,652,652,0,14],[5868,2607,652,5002,0,14],[6520,6953,652,801,0,14],[11736,6084,652,1732,0,14],[23472,6953,652,565,0,14],[24776,6953,652,976,0,14],[26080,4346,652,3230,0,14],[1304,6953,652,1613,0,14],[3260,7822,652,674,0,14],[3912,7822,652,973,0,14],[5216,7822,652,863,0,14],[5868,7822,1304,920,0,14],[7172,4346,652,4316,0,14],[7824,6953,652,1820,0,14],[9128,7822,652,974,0,14],[9780,6953,652,1920,0,14],[10432,4346,652,4454,0,14],[12388,5215,652,3412,0,14],[14344,6953,652,1483,0,14],[14996,6953,652,1605,0,14],[15648,6084,652,2474,0,14],[25428,7822,652,976,0,14],[26732,7822,652,1007,0,14],[3260,8691,652,959,0,14],[4564,5215,652,4587,0,14],[5216,8691,652,1141,0,14],[5868,8742,652,862,0,14],[11084,6953,652,2777,0,14],[11736,7822,652,1731,0,14],[13040,6953,652,2524,0,14],[13692,3476,652,5817,0,14],[14996,8691,652,970,0,14],[15648,8691,652,1055,0,14],[16952,7822,652,1744,0,14],[17604,8691,652,993,0,14],[18256,7822,652,1736,0,14],[18908,7822,652,1931,0,14],[19560,6953,652,2764,0,14],[22168,7822,652,1487,0,14],[23472,7822,652,1617,0,14],[1304,8691,652,1732,0,14],[1956,9560,652,998,0,14],[12388,8691,652,1852,0,14],[18256,9560,652,810,0,14],[20212,7822,652,2793,0,14],[21516,4346,652,5970,0,14],[22168,9560,652,1047,0,14],[25428,9560,652,1009,0,14],[26080,8691,652,1444,0,14],[27384,5215,652,5362,0,14],[28036,5215,652,5177,0,14],[0,2607,652,8643,0,14],[652,7822,652,3417,0,14],[1304,10429,652,840,0,14],[6520,9560,652,1817,0,14],[19560,10429,652,995,0,14],[20864,5215,652,6179,0,14],[23472,9560,652,1865,0,14],[24776,8691,652,2808,0,14],[26080,10429,652,867,0,14],[26732,9560,652,1854,0,14],[0,11298,652,1007,0,14],[652,11298,652,948,0,14],[1956,11298,652,1013,0,14],[3912,10429,652,1518,0,14],[4564,11298,652,1067,0,14],[9128,9560,652,2563,0,14],[9780,10429,652,1725,0,14],[14344,8691,652,3547,0,14],[17604,11298,652,760,0,14],[18908,10429,652,1806,0,14],[22168,11298,652,867,0,14],[24124,8691,652,3451,0,14],[3260,11298,652,1834,0,14],[5216,10429,652,2684,0,14],[6520,12168,652,1003,0,14],[7172,9560,652,3533,0,14],[7824,9560,652,3570,0,14],[8476,6084,652,7138,0,14],[10432,11298,652,1832,0,14],[11084,12168,652,931,0,14],[11736,10429,652,2617,0,14],[12388,12168,652,805,0,14],[13040,10429,652,2701,0,14],[13692,9560,652,3655,0,14],[14996,10429,652,2743,0,14],[16300,7822,652,5274,0,14],[16952,11298,652,1679,0,14],[17604,12168,652,770,0,14],[22168,12168,652,951,0,14],[23472,12168,1304,985,0,14],[25428,11298,652,1613,0,14],[28688,5215,652,7605,0,14],[5868,10429,652,3736,0,14],[14344,13037,652,945,0,14],[16952,13037,652,1043,0,14],[17604,13037,652,997,0,14],[18256,10429,652,3635,0,14],[18908,13037,652,889,0,14],[19560,12168,652,1521,0,14],[20212,13037,652,847,0,14],[21516,12168,652,1570,0,14],[22820,7822,652,6170,0,14],[24776,12168,652,1501,0,14],[28688,13037,652,851,0,14],[652,13037,652,1808,0,14],[3260,13906,652,782,0,14],[5216,13906,652,920,0,14],[8476,13906,652,804,0,14],[10432,13906,652,859,0,14],[15648,11298,652,3590,0,14],[20212,13906,652,845,0,14],[20864,12168,652,2183,0,14],[24776,13906,652,1074,0,14],[25428,13037,652,1904,0,14],[26080,13037,652,1797,0,14],[26732,12168,652,2762,0,14],[27384,13037,652,1498,0,14],[28688,13906,652,843,0,14],[1304,11298,652,4501,0,14],[1956,13906,652,1805,0,14],[2608,7822,652,7797,0,14],[3912,13037,652,2578,0,14],[7172,14775,1956,932,0,14],[9128,12168,652,3259,0,14],[14996,14775,652,1130,0,14],[16300,14775,652,849,0,14],[20864,14775,652,1047,0,14],[24124,13153,652,2598,0,14],[2608,15644,652,744,0,14],[3260,14775,652,1648,0,14],[3912,15644,652,660,0,14],[4564,13906,652,2394,0,14],[5216,15644,652,1055,0,14],[6520,15644,652,840,0,14],[7172,15707,652,662,0,14],[8476,15707,652,857,0,14],[10432,14775,652,1916,0,14],[12388,15644,652,779,0,14],[18256,15644,652,652,0,14],[20212,15644,652,568,0,14],[21516,13906,652,2600,0,14],[22820,14775,652,1825,0,14],[25428,15644,652,923,0,14],[26732,15644,652,794,0,14],[3260,16513,652,1028,0,14],[9128,15644,652,1831,0,14],[11084,13906,652,3394,0,14],[11736,13906,652,3547,0,14],[12388,16513,652,932,0,14],[13040,14775,652,2405,0,14],[13692,16513,652,805,0,14],[14344,14775,652,2574,0,14],[14996,16513,652,1013,0,14],[16952,14775,652,2701,0,14],[19560,14775,652,2390,0,14],[20212,16513,652,1032,0,14],[20864,16513,652,782,0,14],[27384,16513,652,913,0,14],[2608,17382,652,956,0,14],[5216,17382,652,910,0,14],[9780,12168,652,6310,0,14],[17604,14775,652,3556,0,14],[18908,15644,652,2586,0,14],[20864,17382,652,950,0,14],[21516,16513,652,1993,0,14],[22168,16513,652,1675,0,14],[22820,17382,652,840,0,14],[23472,13153,652,5464,0,14],[24124,17382,652,867,0,14],[24776,15644,652,2766,0,14],[25428,17382,652,1070,0,14],[26080,15644,652,2398,0,14],[0,14775,652,4259,0,14],[1304,18251,652,652,0,14],[6520,18251,652,825,0,14],[7172,16513,652,2659,0,14],[7824,15707,652,3573,0,14],[9128,18251,652,955,0,14],[11084,18251,652,913,0,14],[12388,18251,652,1078,0,14],[13040,18251,652,891,0,14],[13692,17382,652,1821,0,14],[14344,18251,652,784,0,14],[15648,15644,652,3731,0,14],[16300,15644,652,3683,0,14],[19560,18251,652,976,0,14],[22820,18251,652,1011,0,14],[24124,18251,652,970,0,14],[26080,18251,652,1101,0,14],[26732,16513,652,2737,0,14],[27384,18251,652,840,0,14],[28036,13037,652,6355,0,14],[28688,16513,652,2773,0,14],[0,19120,652,991,0,14],[652,17382,652,2390,0,14],[1304,19120,652,825,0,14],[1956,19120,652,1055,0,14],[2608,19120,652,994,0,14],[3260,19120,652,932,0,14],[3912,18251,652,1916,0,14],[4564,17382,652,2617,0,14],[5216,19120,652,833,0,14],[5868,14775,652,5369,0,14],[7824,0,652,628,0,15],[21516,0,652,949,0,15],[25428,0,652,953,0,15],[26080,0,652,843,0,15],[1304,869,652,920,0,15],[2608,869,652,938,0,15],[14344,869,652,445,0,15],[28688,869,652,935,0,15],[3912,0,652,2723,0,15],[4564,869,652,1804,0,15],[9128,1738,652,1043,0,15],[11736,1738,652,964,0,15],[12388,1738,652,1042,0,15],[5868,2607,652,881,0,15],[10432,1738,652,1692,0,15],[11084,2607,652,1004,0,15],[14996,2607,652,783,0,15],[18256,2607,652,1802,0,15],[18908,2607,652,1835,0,15],[22820,3476,652,489,0,15],[26080,3476,652,808,0,15],[8476,4346,652,1000,0,15],[26732,3476,652,1764,0,15],[27384,4346,652,842,0,15],[28036,4346,652,550,0,15],[28688,4346,652,860,0,15],[1956,4346,652,1906,0,15],[4564,6084,652,1144,0,15],[5216,5215,652,1687,0,15],[5868,5215,652,1800,0,15],[9128,6084,652,963,0,15],[12388,6084,652,943,0,15],[24124,6084,652,417,0,15],[24776,6084,652,726,0,15],[13692,6953,652,1063,0,15],[14344,6953,652,884,0,15],[14996,6953,652,1009,0,15],[15648,6953,652,978,0,15],[21516,6953,652,1764,0,15],[22168,7822,652,957,0,15],[22820,7822,652,902,0,15],[23472,7822,652,878,0,15],[26732,7822,652,1007,0,15],[0,8691,652,933,0,15],[11736,8691,652,862,0,15],[652,8691,652,1869,0,15],[1956,9560,652,998,0,15],[2608,9560,652,1052,0,15],[8476,9560,652,922,0,15],[9128,9560,652,902,0,15],[7824,10429,652,1109,0,15],[13040,10429,652,1068,0,15],[16300,10429,652,906,0,15],[16952,11298,652,1002,0,15],[25428,11298,652,1056,0,15],[24776,12168,652,1043,0,15],[652,13037,652,940,0,15],[28688,13037,652,851,0,15],[3912,13037,652,1827,0,15],[4564,13906,652,959,0,15],[8476,13906,652,804,0,15],[9780,13906,652,932,0,15],[11736,13906,652,914,0,15],[11084,13906,652,1870,0,15],[13040,14775,652,942,0,15],[14344,14775,652,978,0,15],[16300,14775,652,849,0,15],[19560,14775,652,929,0,15],[21516,15644,652,862,0,15],[22820,15644,652,956,0,15],[24776,15644,652,902,0,15],[26732,15644,652,794,0,15],[28036,15644,652,956,0,15],[28688,16513,652,974,0,15],[2608,17382,652,956,0,15],[4564,17382,652,962,0,15],[7824,17382,652,1898,0,15],[11084,18251,652,913,0,15],[13040,18251,652,891,0,15],[14344,18251,652,784,0,15],[16300,17382,652,1945,0,15]]);</script></p>
<p>After doing some in-depth analysis of <em>Composer </em>generated files I almost ended up witting my own Deep Zoom implementation, because I couldn&#8217;t find any flexible solution. However, later I found out that <em>SparseImageCreator </em>class is the only thing I need. It works almost the same as previously discussed <em>CollectionCreator </em>class, but generated output is exactly what I need. Code:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #FF0000;">string</span> source <span style="color: #008000;">=</span> <span style="color: #666666;">@&quot;C:\tests\Books&quot;</span><span style="color: #008000;">;</span>
<span style="color: #FF0000;">string</span> dest <span style="color: #008000;">=</span> <span style="color: #666666;">@&quot;C:\tests\GeneratedImages&quot;</span><span style="color: #008000;">;</span>
&nbsp;
List images <span style="color: #008000;">=</span> GetImagesInDirectory<span style="color: #000000;">&#40;</span>source<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
List<span style="color: #008000;">&lt;</span>Image<span style="color: #008000;">&gt;</span> data <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> List<span style="color: #008000;">&lt;</span>Image<span style="color: #008000;">&gt;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #FF0000;">int</span> start <span style="color: #008000;">=</span> <span style="color: #FF0000;">200</span><span style="color: #008000;">;</span>
<span style="color: #FF0000;">int</span> limit <span style="color: #008000;">=</span> start<span style="color: #008000;">;</span>
&nbsp;
<span style="color: #FF0000;">double</span> x <span style="color: #008000;">=</span> <span style="color: #FF0000;">0.0</span><span style="color: #008000;">;</span>
<span style="color: #FF0000;">double</span> y <span style="color: #008000;">=</span> <span style="color: #FF0000;">0.0</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #FF0000;">double</span> rows <span style="color: #008000;">=</span> Math.<span style="color: #0000FF;">Sqrt</span><span style="color: #000000;">&#40;</span>start<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #0600FF;">foreach</span> <span style="color: #000000;">&#40;</span>var image <span style="color: #0600FF;">in</span> images<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>limit <span style="color: #008000;">&lt;</span> <span style="color: #FF0000;">0</span><span style="color: #000000;">&#41;</span>
        break<span style="color: #008000;">;</span>
&nbsp;
    limit<span style="color: #008000;">--;</span>
&nbsp;
    Image img <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Image<span style="color: #000000;">&#40;</span>image<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
    img.<span style="color: #0000FF;">ViewportWidth</span> <span style="color: #008000;">=</span> rows<span style="color: #008000;">+</span><span style="color: #FF0000;">1</span><span style="color: #008000;">;</span>
    img.<span style="color: #0000FF;">ViewportOrigin</span> <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Windows</span>.<span style="color: #0000FF;">Point</span><span style="color: #000000;">&#40;</span><span style="color: #008000;">-</span>x, <span style="color: #008000;">-</span>y<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
    x <span style="color: #008000;">+=</span> <span style="color: #FF0000;">1</span><span style="color: #008000;">;</span>
&nbsp;
    <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>x <span style="color: #008000;">&gt;=</span> rows<span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
        y <span style="color: #008000;">+=</span> <span style="color: #FF0000;">1.333</span><span style="color: #008000;">;</span>
        x <span style="color: #008000;">=</span> <span style="color: #FF0000;">0.0</span><span style="color: #008000;">;</span>
    <span style="color: #000000;">&#125;</span>
&nbsp;
    data.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span>img<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
SparseImageCreator cc <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> SparseImageCreator<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
cc.<span style="color: #0000FF;">TileSize</span> <span style="color: #008000;">=</span> <span style="color: #FF0000;">256</span><span style="color: #008000;">;</span>
cc.<span style="color: #0000FF;">TileFormat</span> <span style="color: #008000;">=</span> ImageFormat.<span style="color: #0000FF;">Jpg</span><span style="color: #008000;">;</span>
cc.<span style="color: #0000FF;">ImageQuality</span> <span style="color: #008000;">=</span> <span style="color: #FF0000;">0.95</span><span style="color: #008000;">;</span>
cc.<span style="color: #0000FF;">TileOverlap</span> <span style="color: #008000;">=</span> <span style="color: #FF0000;">1</span><span style="color: #008000;">;</span>
&nbsp;
cc.<span style="color: #0000FF;">Create</span><span style="color: #000000;">&#40;</span>data, dest <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;<span style="color: #008080; font-weight: bold;">\\</span>output&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<p>This code loops through all images (with limit) in folder and adds them to a list of <em>Image</em>s. Also it sets the <em><a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.multiscaleimage.viewportorigin(VS.95).aspx">ViewportOrigin</a></em> property, which is used to position <em>Image</em> in space. Last step is to create a collection, what is done by <em>SparseImageCreator </em>class. Depending on images count this takes a while and consumes quite a lot of memory, so for using in a web application I need to create a <a href="http://support.microsoft.com/kb/308569">scheduler</a> too.</p>
<p>Another part of Deep Zoom is creating a Silverlight application. It can be easily done with <a href="http://www.microsoft.com/downloads/details.aspx?familyid=457b17b7-52bf-4bda-87a3-fa8a4673f8bf&#038;displaylang=en">Composer</a> (just create a project with one image, and then customize generated source code for your needs). However, I&#8217;m not going to explain how to do it, because there are lots of <a href="http://expression.microsoft.com/en-us/cc745977.aspx">examples</a> online and I&#8217;m going to write another article about Silverlight only.</p>
<p>Currently I have some problems with library throwing <a href="http://en.wikipedia.org/wiki/Exception_handling">Exceptions</a> with big collections, nevertheless another milestone is reached (first was using <a href="http://dev.juokaz.com/winphp-2009/using-php-with-c-written-libraries">.NET assemblies in PHP</a>). Now I need to work on front-end part.</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.juokaz.com/winphp-2009/creating-deep-zoom-applications-with-c/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Dynamic Assemblies loading using Reflection</title>
		<link>http://dev.juokaz.com/winphp-2009/dynamic-assemblies-loading-using-reflection</link>
		<comments>http://dev.juokaz.com/winphp-2009/dynamic-assemblies-loading-using-reflection#comments</comments>
		<pubDate>Fri, 24 Apr 2009 14:04:28 +0000</pubDate>
		<dc:creator>Juozas</dc:creator>
				<category><![CDATA[WinPhp 2009]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[assembly]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[competition]]></category>
		<category><![CDATA[dll]]></category>
		<category><![CDATA[gac]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[reflection]]></category>
		<category><![CDATA[system.reflection]]></category>
		<category><![CDATA[winphp]]></category>

		<guid isPermaLink="false">http://dev.juokaz.com/?p=544</guid>
		<description><![CDATA[Tuesday I&#8217;ve posted post how to use .Net assemblies in PHP, however, as Teal&#8217;c correctly pointed out:
Making your library COM visible requires that you register the DLL in the GAC and registering something in the GAC should only be done when multiple applications need to access the same version of the same library. Even then, [...]]]></description>
			<content:encoded><![CDATA[<p>Tuesday I&#8217;ve posted post how to use <a href="http://dev.juokaz.com/winphp-2009/using-php-with-c-written-libraries">.Net assemblies in PHP</a>, however, as Teal&#8217;c correctly pointed out:</p>
<blockquote><p><img src="http://dev.juokaz.com/wp-content/uploads/2009/04/picture.png" alt=".NET" title=".NET" width="48" height="48" class="alignnone size-full wp-image-566" style="float: right;" />Making your library COM visible requires that you register the DLL in the GAC and registering something in the GAC should only be done when multiple applications need to access the same version of the same library. Even then, most software houses will deploy each app with it’s own copy of the DLL instead of using the GAC.</p></blockquote>
<p>Nevertheless, C# (and most of other languages) support <a href="http://en.wikipedia.org/wiki/Reflection_(computer_science)">Reflection</a>. Basically using reflection, programs can &#8220;observe and modify its own structure and behavior&#8221; (wiki). .NET has <a href="http://msdn.microsoft.com/en-us/library/system.reflection.aspx">System.Reflection</a> namespace with all needed methods. Purpose of this post is to find a way how to load DLL&#8217;s dynamically &#8211; without worrying about registering, re-registering, unregistering them in running system/production servers. </p>
<p>DLL&#8217;s are library assemblies, which &#8220;contain code in CIL, which is usually generated from .NET languages, and then compiled into machine language at runtime by the CLR just-in-time compiler.&#8221; (<a href="http://en.wikipedia.org/wiki/.NET_assembly">from</a>). For all not familiar with assemblies, assembly &#8220;is a reusable, versionable, and self-describing building block of a common language runtime application.&#8221; (<a href="http://msdn.microsoft.com/en-us/library/system.reflection.assembly.aspx">from</a>). Consider this code:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">using</span> <span style="color: #008080;">System</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Reflection</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #0600FF;">namespace</span> Php
<span style="color: #000000;">&#123;</span>
    <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">class</span> Reflection
    <span style="color: #000000;">&#123;</span>
        <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">Object</span> get<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> assembly, <span style="color: #FF0000;">string</span> className<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            Assembly asm <span style="color: #008000;">=</span> Assembly.<span style="color: #0000FF;">LoadFrom</span><span style="color: #000000;">&#40;</span>assembly<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #0600FF;">return</span> asm.<span style="color: #0000FF;">CreateInstance</span><span style="color: #000000;">&#40;</span>className, <span style="color: #0600FF;">true</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>This is very basic class, which can be used to do such things as:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">Php.<span style="color: #0000FF;">Reflection</span> obj <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Php.<span style="color: #0000FF;">Reflection</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #FF0000;">Object</span> my <span style="color: #008000;">=</span> obj.<span style="color: #0000FF;">get</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;my.dll&quot;</span>, <span style="color: #666666;">&quot;namespace.class&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<p>You may have thought that this class is absolutely useless, because you can simply use <a href="http://msdn.microsoft.com/en-us/library/system.reflection.assembly.aspx"><em>System.Reflection.Assembly</em></a> without wrapping it into separate class. However, I was writing this code with an intention to use it as <a href="http://uk2.php.net/manual/en/class.com.php">COM</a> object in PHP and because PHP can&#8217;t access static COM class methods (which I find very disappointing) I needed to create this class. Now in PHP you can write:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$obj</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Com <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Php.Reflection&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$math</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$obj</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;math_class.dll&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;phpclass3.first&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><a href="http://dev.juokaz.com/wp-content/uploads/2009/04/dotnet_global_assembly_cache.gif"><img src="http://dev.juokaz.com/wp-content/uploads/2009/04/dotnet_global_assembly_cache-150x150.gif" alt="dotnet_global_assembly_cache" title="dotnet_global_assembly_cache" width="100" height="100" style="float: right; margin-left: 5px;" class="alignnone size-thumbnail wp-image-572" /></a>This method, in my opinion, is much much more better than registering every single class with <a href="http://en.wikipedia.org/wiki/Global_Assembly_Cache">global assembly cache</a>. It&#8217;s more practical and maintainable to have all required libraries in the same project directory, and not somewhere in Windows core. However, benchmarks are still coming so stay <a href="http://dev.juokaz.com/feed">tuned</a>.</p>
<p>* <em> For everyone interested in Winphp contest, and people building PHP apps in Windows, I recommend reading <a href="http://www.eurowinphp.com/">www.eurowinphp.com</a> blog, which aggregates all participants blogs. For example, Timmy Kokke, another WinPHP participant, recently wrote another great tutorial <a href="http://geekswithblogs.net/tkokke/archive/2009/04/24/how-to-use-.net-assemblies-in-php.aspx">how to make your .NET classes accessible in PHP</a>. Also, you can follow my on Twitter at <a href="http://twitter.com/juokaz">twitter.com/juokaz</a>.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://dev.juokaz.com/winphp-2009/dynamic-assemblies-loading-using-reflection/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First Annual WinPHP Challenge</title>
		<link>http://dev.juokaz.com/winphp-2009/first-annual-winphp-challenge</link>
		<comments>http://dev.juokaz.com/winphp-2009/first-annual-winphp-challenge#comments</comments>
		<pubDate>Mon, 20 Apr 2009 15:21:09 +0000</pubDate>
		<dc:creator>Juozas</dc:creator>
				<category><![CDATA[WinPhp 2009]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[competition]]></category>
		<category><![CDATA[deep zoom]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[silverlight]]></category>
		<category><![CDATA[winphp]]></category>
		<category><![CDATA[zend framework]]></category>

		<guid isPermaLink="false">http://dev.juokaz.com/?p=452</guid>
		<description><![CDATA[Sometime in the end of March Microsoft and partners announced 2009 WinPHP competition. I always wanted to try to create an app with both PHP and C#, so I decided to register &#8211; my idea is to create a project, which will demonstrate both PHP and .NET connectivity and Deep Zoom functionality.
My project will allow [...]]]></description>
			<content:encoded><![CDATA[<p>Sometime in the end of March Microsoft and partners <a href="http://blogs.msdn.com/bramveen/archive/2009/03/23/european-winphp-challange.aspx">announced</a> 2009 <a href="http://wiki.phpconference.nl/2009_WinPHP_Challenge">WinPHP</a> competition. I always wanted to try to create an app with both PHP and C#, so I decided to register &#8211; my idea is to create a project, which will demonstrate both PHP and .NET <a href="http://www.php.net/manual/en/ref.dotnet.php">connectivity</a> and <a href="http://msdn.microsoft.com/en-us/library/cc645050(VS.95).aspx">Deep Zoom</a> functionality.</p>
<p><img class="alignnone size-full wp-image-457" style="float: right;" title="Silverlight" src="http://dev.juokaz.com/wp-content/uploads/2009/04/microsoft_silverlight_c.jpg" alt="Silverlight" width="97" height="109" />My project will allow people to upload huge collections of photos (probably archived in one zip file) and get nice online gallery. Users will have selection of Ajax or <a href="http://silverlight.net/themes/silverlight/common/home.aspx?AspxAutoDetectCookieSupport=1">Silverlight</a> version and password protection for galleries. If I have time, I will also add ability to select different photos shuffle style, background theme and/or music, and maybe even automatic tour with captions.</p>
<p><img class="alignnone size-full wp-image-460" style="float: left;" title="Zend framework" src="http://dev.juokaz.com/wp-content/uploads/2009/04/logo-zend-framework.jpg" alt="Zend framework" width="120" height="80" />PHP will work as front-end language (with <a href="http://framework.zend.com/">Zend Framework</a>), and C# will be responsible for all Deep Zoom work (which I haven&#8217;t tried/tested yet, but I believe it will work). Not only it&#8217;s quite useful app, but also showcases a lot of cool technologies. <a href="http://www.leaseweb.com/en/">Leaseweb</a>, sponsor of this competition, provided us with dedicated servers so I will hopefully publish <em>alpha</em> version in some weeks.</p>
<p>Why I chose to participate? Firstly, it&#8217;s good experience, because I do a lot of <a href="http://dev.juokaz.com/category/php">PHP</a>, but also more and more <a href="http://en.wikipedia.org/wiki/C_Sharp_(programming_language)">C#</a>, so it&#8217;s great opportunity to learn more. Secondly, in my belief, such competitions are really useful for portfolios and CV&#8217;s &#8211; I&#8217;m currently looking for a <a href="http://www.zend.com/en/store/education/certification/yellow-pages.php#show-ClientCandidateID=ZEND008553">job</a>, so it can help. Lastly, competitions are fun, so, I&#8217;m in.</p>
<p>Part of competition requirements is &#8220;<span lang="EN-US">blog about your experiences with Windows Server 2008 during the contest&#8221; so I&#8217;ll write around 2-3 posts every week about project status, problems with switching from Linux back to Windows and more. Also, I&#8217;m really bad in designing websites, so if anyone would like to help me &#8211; please feel free to contact. </span></p>
]]></content:encoded>
			<wfw:commentRss>http://dev.juokaz.com/winphp-2009/first-annual-winphp-challenge/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
