<?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; windows</title>
	<atom:link href="http://dev.juokaz.com/tag/windows/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>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>
		<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>Using PHP with C# written libraries</title>
		<link>http://dev.juokaz.com/winphp-2009/using-php-with-c-written-libraries</link>
		<comments>http://dev.juokaz.com/winphp-2009/using-php-with-c-written-libraries#comments</comments>
		<pubDate>Wed, 22 Apr 2009 14:59:48 +0000</pubDate>
		<dc:creator>Juozas</dc:creator>
				<category><![CDATA[WinPhp 2009]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[challenge]]></category>
		<category><![CDATA[com]]></category>
		<category><![CDATA[comvisible]]></category>
		<category><![CDATA[dll]]></category>
		<category><![CDATA[iis]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[windows server]]></category>
		<category><![CDATA[windows xp]]></category>
		<category><![CDATA[winphp]]></category>

		<guid isPermaLink="false">http://dev.juokaz.com/?p=509</guid>
		<description><![CDATA[One of the biggest issue for me in WinPHP challenge (more info) is using C# written libraries in PHP. Actual PHP part is very easy to write, because only thing you need to do is to create COM object. However, making your dll&#8217;s visible by PHP is a bit tricky. 
I followed this tutorial, which [...]]]></description>
			<content:encoded><![CDATA[<p><img style="float:left; margin-right: 2px; " src="http://dev.juokaz.com/wp-content/uploads/2009/04/q2208984400_9262.jpg" alt="C#" title="C#" width="45" height="45" class="alignnone size-full wp-image-525" />One of the biggest issue for me in <a href="http://dev.juokaz.com/winphp-2009/first-annual-winphp-challenge">WinPHP challenge</a> (<a href="http://wiki.phpconference.nl/2009_WinPHP_Challenge/Participants">more info</a>) is using C# written libraries in PHP. Actual PHP part is very easy to write, because only thing you need to do is to create <a href="http://uk2.php.net/manual/en/class.com.php">COM object</a>. However, making your <a href="http://en.wikipedia.org/wiki/Dynamic-link_library">dll</a>&#8217;s visible by PHP is a bit tricky. </p>
<p>I followed this <a href="http://www.devarticles.com/c/a/PHP/Using-the-.NET-Assembly-in-PHP/">tutorial</a>, which has most of required information. Firstly, you create your &#8220;Class library&#8221;, then create <a href="http://support.microsoft.com/kb/815808">assembly key file</a> and assign it to project assembly. After project is built, you register and add to global assembly cache your library. Probably it&#8217;s quite natural process for all .NET developers, but for PHP developer like me, registering something with whole system seemed quite odd (<a href="http://en.wikipedia.org/wiki/DLL_hell">dll hell?</a>).</p>
<p><a href="http://dev.juokaz.com/wp-content/uploads/2009/04/visualstudio-1.jpg"><img class="alignnone size-thumbnail wp-image-510" title="visualstudio-1" style="float: right; margin-left: 5px;" src="http://dev.juokaz.com/wp-content/uploads/2009/04/visualstudio-1-150x150.jpg" alt="visualstudio-1" width="100" height="100" /></a>First problem was <strong><a href="http://msdn.microsoft.com/en-us/library/ms182157(VS.80).aspx">ComVisible</a></strong>. ComVisible is a keyword in assembly which is used to control types visibility: &#8220;If you need to access a type in this assembly from COM, set the ComVisible attribute to true on that type&#8221;. VisualStudio by default sets it to false, so all types are hidden and trying to register dll will result in this warning:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">RegAsm : warning RA0000 : No types were registered</pre></div></div>

<p><a href="http://dev.juokaz.com/wp-content/uploads/2009/04/visualstudio-4.jpg"><img src="http://dev.juokaz.com/wp-content/uploads/2009/04/visualstudio-4-150x150.jpg" style="float: right; margin-left: 5px;" alt="visualstudio-4" title="visualstudio-4" width="100" height="100" class="alignnone size-thumbnail wp-image-533" /></a>Luckily, I find out about ComVisible property quite soon &#8211; it&#8217;s quite hard to know about it if you haven&#8217;t done anything serious with .NET. Nevertheless, after setting it to <em>true</em>, everything should work fine. Sometimes VisualStudio (2008 Professional Edition) refused to build project because of locked dll, so don&#8217;t forget to try to kill <a href="http://uk2.php.net/security.cgi-bin">PHP-CGI</a> process first (Ctrl+Alt+Del). I didn&#8217;t had any other problems.</p>
<p><a href="http://dev.juokaz.com/wp-content/uploads/2009/04/visualstudio-3.jpg"><img class="alignnone size-thumbnail wp-image-512" title="visualstudio-3" style="float: right; margin-left: 5px;"  src="http://dev.juokaz.com/wp-content/uploads/2009/04/visualstudio-3-150x150.jpg" alt="visualstudio-3" width="100" height="100" /></a>After some tests and failures I ended up with two simple C# classes and PHP caller. <em>Class1</em> has two public variables (<em>x</em>, <em>y</em>) which are set by PHP in <em>$math</em> object. Method <em>Class1.sum()</em> creates new <em>Math</em> object with constructor parameters <em>x</em> and <em>y</em>, and calls getSum() which returns sum of <em>x</em> and <em>y</em>. Useless stuff, but it worked great to test if:</p>
<ul>
<li>COM objects works</li>
<li>One class can call another (Class1 -> Math)</li>
<li>Types are correctly understood/converted</li>
</ul>
<p>Working PHP code (<em>phpclass2</em> is C# library namespace):</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$math</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;phpclass2.Class1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$math</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">x</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">100</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$math</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">y</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">100</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;sum = &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$math</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">sum</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$math</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Which successfully outputted:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">sum <span style="color: #339933;">=</span> <span style="color: #cc66cc;">200</span></pre></div></div>

<p><a href="http://dev.juokaz.com/wp-content/uploads/2009/04/iis-1.jpg"><img class="alignnone size-thumbnail wp-image-511" title="iis-1" style="float: right; margin-left: 5px;" src="http://dev.juokaz.com/wp-content/uploads/2009/04/iis-1-150x150.jpg" alt="iis-1" width="100" height="95" /></a>I tried this code with the same <a href="http://www.microsoft.com/web/platform/default.aspx">Web Platform</a> I <a href="http://dev.juokaz.com/winphp-2009/setting-up-windows-for-php-server">used</a> in Windows Server 2008, but now with older IIS (v5, Windows XP) and it worked perfectly with all default settings. Also, IIS control panel in Server 2008 is 10 times better than in Windws Xp &#8211; in Xp-one I couldn&#8217;t even find how to add new virtual host (my bad, but in IIS 7 it&#8217;s way easier to do). And because I was installing it second time, it took me only few minutes.</p>
<p>Getting this to work was probably one of the biggest milestones &#8211; actual frontend code and <a href="http://msdn.microsoft.com/en-us/library/cc645050(VS.95).aspx">Deepzoom</a> C# library is not that tricky. After some days of working with PHP+Windows things are starting to get a shape &#8211; except of different OS GUI, web server works good in both Linux and Windows &#8211; clearly Microsoft is holding this competition to show it. And they are in the right way.</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.juokaz.com/winphp-2009/using-php-with-c-written-libraries/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting up Windows for PHP server</title>
		<link>http://dev.juokaz.com/winphp-2009/setting-up-windows-for-php-server</link>
		<comments>http://dev.juokaz.com/winphp-2009/setting-up-windows-for-php-server#comments</comments>
		<pubDate>Tue, 21 Apr 2009 11:37:35 +0000</pubDate>
		<dc:creator>Juozas</dc:creator>
				<category><![CDATA[WinPhp 2009]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[challenge]]></category>
		<category><![CDATA[iis]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[skype]]></category>
		<category><![CDATA[virtualbox]]></category>
		<category><![CDATA[web platform]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[windows server]]></category>
		<category><![CDATA[winphp]]></category>

		<guid isPermaLink="false">http://dev.juokaz.com/?p=469</guid>
		<description><![CDATA[To start with, all work took about 1:30, including Skype distractions, reading how-to&#8217;s, etc. Only one problem I had is that I was given remote desktop connection access to Windows Server 2008 machine, but I&#8217;m working with Linux. How to connect to remote desktop from Linux?
Luckily, I had Windows XP in VirtualBox so I tried [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-493" style="float: left; margin-right: 5px;" title="iis_logo" src="http://dev.juokaz.com/wp-content/uploads/2009/04/iis_logo.png" alt="iis_logo" width="160" height="76" />To start with, all work took about 1:30, including <a href="http://www.skype.com">Skype</a> distractions, reading how-to&#8217;s, etc. Only one problem I had is that I was given <a href="http://www.microsoft.com/windowsXp/using/mobility/getstarted/Remoteintro.mspx">remote desktop</a> connection access to Windows Server 2008 machine, but I&#8217;m working with Linux. How to connect to remote desktop from Linux?</p>
<p><a href="http://dev.juokaz.com/wp-content/uploads/2009/04/screenshot-windows-xp-running-sun-xvm-virtualbox-15.png"><img class="alignnone size-thumbnail wp-image-488" style="float: right; margin-left: 5px;" title="screenshot-windows-xp-running-sun-xvm-virtualbox-15" src="http://dev.juokaz.com/wp-content/uploads/2009/04/screenshot-windows-xp-running-sun-xvm-virtualbox-15-150x150.png" alt="screenshot-windows-xp-running-sun-xvm-virtualbox-15" width="100" height="100" /></a>Luckily, I had Windows XP in <strong><a href="http://www.virtualbox.org/">VirtualBox</a></strong> so I tried it. And it worked really well. I&#8217;m using <a href="http://www.ed.ac.uk">university</a> internet network so connections speeds are very fast and Ubuntu -&gt; Windows Xp -&gt; Windows Server 2008 worked just fine. Later I will probably use real Windows system, but for first steps virtual machine worked much more faster than I expected.</p>
<p><a href="http://dev.juokaz.com/wp-content/uploads/2009/04/screenshot-windows-xp-running-sun-xvm-virtualbox-3.png"><img class="size-thumbnail wp-image-475" style="float: right; margin-left: 5px;" title="screenshot-windows-xp-running-sun-xvm-virtualbox-3" src="http://dev.juokaz.com/wp-content/uploads/2009/04/screenshot-windows-xp-running-sun-xvm-virtualbox-3-150x150.png" alt="screenshot-windows-xp-running-sun-xvm-virtualbox-3" width="100" height="99" /></a> Almost 4 years ago I had experience installing <strong><a href="http://en.wikipedia.org/wiki/Internet_Information_Services">IIS</a></strong> server, but I haven&#8217;t done much since then. Nevertheless, installing IIS+PHP was really easy &#8211; I followed <a href="http://blogs.msdn.com/bramveen/archive/2009/04/20/creating-your-php-dev-environment-for-the-winphp-challenge.aspx">this</a> tutorial, which shows you how to install <a href="http://www.microsoft.com/web/platform/default.aspx">Microsoft Web Platform</a>, and IIS was ready. Platform installer allows you to install not only SQL, PHP, ASP.NET, etc. but also various web applications &#8211; <a href="http://www.wordpress.org">Wordpress</a>, <a href="http://drupal.org/">Drupal</a> and many more. Experience with IIS was very similar to <a href="http://dev.juokaz.com/php/zend-server-complete-php-environment-in-minutes">Zend Server</a>, but IIS control panel is way better.</p>
<p><a href="http://dev.juokaz.com/wp-content/uploads/2009/04/screenshot-windows-xp-running-sun-xvm-virtualbox-8.png"><img class="size-thumbnail wp-image-478" style="float: right; margin-left: 5px;" title="screenshot-windows-xp-running-sun-xvm-virtualbox-8" src="http://dev.juokaz.com/wp-content/uploads/2009/04/screenshot-windows-xp-running-sun-xvm-virtualbox-8-150x150.png" alt="screenshot-windows-xp-running-sun-xvm-virtualbox-8" width="100" height="100" /></a>I chose to install Wordpress, just to test if IIS is working properly, but Platform installer doesn&#8217;t install <strong>MySQL</strong>. PHP is installed with MySQL extension, but no server is being installed &#8211; quite illogical. However, installing MySQL server is as easy as installing any other windows application (subjective) &#8211; download installer, Next, Next, Next and server is running. Also, <em>mysql</em> tool works the same in Windows <a href="http://en.wikipedia.org/wiki/Windows_command_line">cmd</a> and Linux console.</p>
<p><a href="http://dev.juokaz.com/wp-content/uploads/2009/04/screenshot-windows-xp-running-sun-xvm-virtualbox-10.png"><img class="alignnone size-thumbnail wp-image-491" style="float: right; margin-left: 5px;" title="screenshot-windows-xp-running-sun-xvm-virtualbox-10" src="http://dev.juokaz.com/wp-content/uploads/2009/04/screenshot-windows-xp-running-sun-xvm-virtualbox-10-150x150.png" alt="screenshot-windows-xp-running-sun-xvm-virtualbox-10" width="100" height="100" /></a>Tutorials and other information:</p>
<ul>
<li> <a href="http://blogs.msdn.com/bramveen/archive/2009/04/20/creating-your-php-dev-environment-for-the-winphp-challenge.aspx">Creating your PHP dev environment for the WinPHP Challenge </a></li>
<li> <a href="http://www.microsoft.com/web/downloads/platform.aspx">Microsoft Web Platform</a></li>
<li><a href="http://learn.iis.net/page.aspx/610/setting-up-mysql-for-php-applications/">Setting up MySQL for PHP applications</a></li>
<li><a href="http://php.iis.net/">PHP on IIS7</a></li>
</ul>
<p><a href="http://dev.juokaz.com/wp-content/uploads/2009/04/screenshot-windows-xp-running-sun-xvm-virtualbox-14.png"><img class="alignnone size-thumbnail wp-image-485" style="float: right; margin-left: 5px;" title="screenshot-windows-xp-running-sun-xvm-virtualbox-14" src="http://dev.juokaz.com/wp-content/uploads/2009/04/screenshot-windows-xp-running-sun-xvm-virtualbox-14-150x150.png" alt="screenshot-windows-xp-running-sun-xvm-virtualbox-14" width="101" height="101" /></a><br />
What I liked very much is GUI for web server control.  Currently I have 13 web apps running in my laptop and every app has different port (localhost:80, localhost:81, localhost:82, etc.), but I haven&#8217;t found any good tool for adding more sites. I would like to have simple tool, which would accept port number and directory, and create virtual host. IIS control application allows it very easily.</p>
<p>In conclusion, working with PHP in Windows server seems to be pretty acceptable. I haven&#8217;t tested setting up anything except Wordpress, but Wordpress seems to work just fine. Especially I liked using GUI, because most of tasks for development machine can be done much more easier and faster, still I&#8217;m not going to switch from Linux yet.</p>
<p><strong>Advantages</strong>:</p>
<ul>
<li>GUI</li>
<li>Easy to setup</li>
<li>PHP works</li>
</ul>
<p><strong>Disadvantages</strong>:</p>
<ul>
<li>Some functionality is hard to find</li>
<li>Differences from Apache (<a href="http://www.petefreitag.com/item/286.cfm">mod_rewrite</a>, etc.)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://dev.juokaz.com/winphp-2009/setting-up-windows-for-php-server/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Free Microsoft products? Yes</title>
		<link>http://dev.juokaz.com/programming/free-microsoft-products-yes</link>
		<comments>http://dev.juokaz.com/programming/free-microsoft-products-yes#comments</comments>
		<pubDate>Mon, 02 Mar 2009 20:40:01 +0000</pubDate>
		<dc:creator>Juozas</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[dreamspark]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[myed]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[no charge]]></category>
		<category><![CDATA[online]]></category>
		<category><![CDATA[openid]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[staff]]></category>
		<category><![CDATA[students]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://dev.juokaz.com/?p=305</guid>
		<description><![CDATA[I&#8217;m not fan of Microsoft, but I&#8217;m not hater too. I stand in neutral position &#8211; I use Linux in my computer, but sometimes I use Windows for Photoshop, I&#8217;m programming using NetBeans, but sometimes I do it in Visual Studio (I&#8217;m preparing for C# and ASP.NET work).
When I started programming in C# some months [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not fan of <a href="http://www.microsoft.com">Microsoft</a>, but I&#8217;m not hater too. I stand in neutral position &#8211; I use Linux in my computer, but sometimes I use Windows for Photoshop, I&#8217;m programming using <a href="http://dev.juokaz.com/programming/netbeans-7-hands-on-experience">NetBeans</a>, but sometimes I do it in Visual Studio (I&#8217;m preparing for C# and ASP.NET work).</p>
<p>When I started programming in C# some months ago, I chose Express edition tool-kit, because it&#8217;s free and quite lightweight. But absolutely accidentally I ran into <a href="https://www.dreamspark.com/default.aspx">Microsoft DreamSpark</a> program. They introduce it by:</p>
<blockquote><p><span id="ctl00_ContentPlaceHolder1_Span_Default_Content">DreamSpark is simple, it&#8217;s all about giving students Microsoft professional-level developer and design tools <strong>at no charge</strong> so you can chase your dreams and create the next big breakthrough in technology &#8211; or just get a head start on your career.</span></p></blockquote>
<p><a href="http://www.dreamspark.com"><img class="alignnone size-full wp-image-309" title="DreamSpark" src="http://dev.juokaz.com/wp-content/uploads/2009/03/dreamspark_header.jpg" alt="DreamSpark" width="506" height="292" /></a></p>
<p>At <strong>no charge</strong>? Yes, that&#8217;s right &#8211; all students can download various developer tools for free. List includes:</p>
<ul>
<li>Visual Studio 2008 Professional Edition</li>
<li>Windows Server 2008 Standard</li>
<li>SQL Server 2008 Developer</li>
<li>Expression Studio 2</li>
<li>and more</li>
</ul>
<p>I don&#8217;t know how student verification works in other universities, but my university  (<a href="http://www.ed.ac.uk">The University of Edinburgh</a>) has special login system which works as authentication gateway. Somehow Microsoft arranged it and I verified myself by using that system &#8211; process similar to using <a href="http://openid.net/">OpenID</a>. Process took only some minutes and downloads where going.</p>
<p>It used to be that Microsoft programming languages were criticized because they where only available to use with IDE&#8217;s which cost a lot. And for starters, high-school or university students it was almost impossible to start programming in for example C#. They are not cheap now too, but now everyone can use Express versions and students can even get profession-level tools.</p>
<p>Isn&#8217;t it great? It may sound as Microsoft advertisement, but as student I really like this initiative. I&#8217;m not going to start using Windows again because of that, but the fact that Microsoft is thinking about students as a potential Microsoft technologies users and investing in them is really great.</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.juokaz.com/programming/free-microsoft-products-yes/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
