<?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>Tech Blog &#187; PHP</title>
	<atom:link href="http://newverhost.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://newverhost.com</link>
	<description>Your online tech help</description>
	<lastBuildDate>Tue, 29 Jun 2010 11:21:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Put Excel on the net with ASP.NET</title>
		<link>http://newverhost.com/2009/06/put-excel-on-the-net-with-asp-net/</link>
		<comments>http://newverhost.com/2009/06/put-excel-on-the-net-with-asp-net/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 09:35:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tech Category]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[Microsoft Excel]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://newverhost.com/?p=71</guid>
		<description><![CDATA[The idea and the implementation
The idea was to Microsoft Excel COM interop with ASP.NET &#8211; I had seen examples of the use of tables to generate interop, but it seemed no one had actually done anything.
Since I had not really done any ASP.NET orders from the ground up, and it was mostly cobbled together only [...]]]></description>
			<content:encoded><![CDATA[<p><strong>The idea and the implementation</strong><br />
The idea was to Microsoft Excel COM interop with ASP.NET &#8211; I had seen examples of the use of tables to generate interop, but it seemed no one had actually done anything.</p>
<p>Since I had not really done any ASP.NET orders from the ground up, and it was mostly cobbled together only to see if it could be done so that the software development methods such as &#8220;Copy and Paste.</p>
<p>It was initially a problem with Excel, such as the Windows version I use is in Finnish, and my Office 2007 is the English version. Every time I tried something in the table as a value from a cell, it would throw an exception. Fortunately, some Googling gave me the answer to the currently executing thread to the locale en-US, the fixed and let me continue.</p>
<p>Finally, I found ways to do everything I needed: first steps and the specific cells&#8217; values and formulas. Then it was for the creation of the JavaScript-based interface for IT, which is essentially a very very simple inline table edit the changes on the server with Ajax.<br />
<span id="more-71"></span><br />
<strong>Demonstration</strong><br />
I unfortunately do not have a server that can ASP.NET, and it is not really a very good idea to make them on a live server for real users, either on things that I tell you about in a bit &#8230; but here is a Screencast I made to you an idea:<br />
<a href="http://newverhost.com/wordpress/wp-content/uploads/2009/06/asdasd.jpg"><img src="http://newverhost.com/wordpress/wp-content/uploads/2009/06/asdasd.jpg" alt="demo" title="asdasd" width="500" class="size-full wp-image-79" /></a></p>
<p>From the screenshot, you can see how it first loads the Excel spreadsheet of the current data in the network, and if changes are made, all changes that affect the values in the table are included in the network as well.</p>
<p><strong>So is this a Google Spreadsheets Killer?</strong></p>
<p>Well &#8230; Maybe.</p>
<p>As you can see from the above, it is a workable concept. However, it has a number of questions, because Excel is not a &#8220;server&#8221; type of application.</p>
<p>Excel is as something that the user interacts with directly, as in a desktop application. If you have a formula incorrectly, it would take you a pop-up and you close it, and the like.</p>
<p>If you use a wrong formula in the JS-grid, it is in Excel, which is a pop &#8230; but there is no one to close it. It is in fact the whole app with the pop: No response to the news until the popup is closed, and all actions that throw an exception.</p>
<p>Theoretically you could use the server so that it is an application that automatically click on the pop-ups Excel displays to close them &#8230; but I&#8217;m not sure whether the work so well.</p>
]]></content:encoded>
			<wfw:commentRss>http://newverhost.com/2009/06/put-excel-on-the-net-with-asp-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Framework and Translation</title>
		<link>http://newverhost.com/2009/06/zend-framework-and-translation/</link>
		<comments>http://newverhost.com/2009/06/zend-framework-and-translation/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 08:58:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tech Category]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[translation]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://newverhost.com/?p=61</guid>
		<description><![CDATA[In multi-lingual web pages are more and more important, I would like to show two ways how to static text snippets from your application with Zend Framework. Zend Framework provides us with several packages as Zend_Translate Zend_Locale and developers to make life easier &#8211; but how these components work together?
Creating a Zend Framework application
First, we [...]]]></description>
			<content:encoded><![CDATA[<p>In multi-lingual web pages are more and more important, I would like to show two ways how to static text snippets from your application with Zend Framework. Zend Framework provides us with several packages as Zend_Translate Zend_Locale and developers to make life easier &#8211; but how these components work together?</p>
<p><strong>Creating a Zend Framework application</strong><br />
First, we need a Zend Framework application. You can use either your own existing or create a new one directly with Zend Studio for Eclipse:<br />
<img src="http://newverhost.com/wordpress/wp-content/uploads/2009/06/1-zend-framework-and-translation.png" alt="1-zend-framework-and-translation" title="1-zend-framework-and-translation" width="475" height="230" class="size-full wp-image-62" /><br />
If you do not know what a Zend Framework application you can take a look at the Zend Framework QuickStart.<br />
<span id="more-61"></span><br />
<strong>Zend_Locale and Zend_Translate</strong><br />
As already mentioned, we have instances of Zend_Locale and Zend_Translate. I initialized both objects in the class initializer which is created by the Zend Framework Project Wizard:</p>
<p>&lt;?php</p>
<p>/**</p>
<p>* Initialize Locale and Translation</p>
<p>*</p>
<p>* @return void</p>
<p>*/</p>
<p>public function initLocale() {</p>
<p>$localeValue = &#8216;en&#8217;;</p>
<p>$locale = new Zend_Locale($localeValue);</p>
<p>Zend_Registry::set(&#8217;Zend_Locale&#8217;, $locale);</p>
<p>$translationFile = $this-&gt;_root . DIRECTORY_SEPARATOR . &#8216;lang&#8217;</p>
<p>. DIRECTORY_SEPARATOR . $localeValue . &#8216;.inc.php&#8217;;</p>
<p>$translate = new Zend_Translate(&#8217;array&#8217;, $translationFile, $localeValue);</p>
<p>Zend_Registry::set(&#8217;Zend_Translate&#8217;, $translate);</p>
<p>}</p>
<p>The Initializer:: initLocale ()-method is used by the Initializer:: _routeStartup ()-method. Obviously you can use this functionality in a similar way also in the bootstrap file.<br />
I have chosen the very simple way of initializing a Zend_Locale object for this demo: I have the variable $ localeValue directly into the method. Of course, this is not recommended! Maybe you can use the current user of the meeting locale or let Zend_Locale choose. Once you Zend_Locale object, you can use the complete application documents, by the Zend_Registry with key &#8220;Zend_Locale. So it is possible to have several IF components to find it there. In the next step we create the necessary components for translation. Therefore, we use the array Zend_Translate and adapters. That means we have to create a PHP file provides a translation of the array.<br />
<img src="http://newverhost.com/wordpress/wp-content/uploads/2009/06/2-zend-framework-and-translation.png" alt="2-zend-framework-and-translation" title="2-zend-framework-and-translation" width="198" height="186" class="size-full wp-image-63" /></p>
]]></content:encoded>
			<wfw:commentRss>http://newverhost.com/2009/06/zend-framework-and-translation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP vs MySQL. Who has time faster?</title>
		<link>http://newverhost.com/2009/06/php-vs-mysql-who-has-time-faster/</link>
		<comments>http://newverhost.com/2009/06/php-vs-mysql-who-has-time-faster/#comments</comments>
		<pubDate>Sat, 13 Jun 2009 13:47:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tech Category]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://newverhost.com/?p=12</guid>
		<description><![CDATA[No-no, here it is not about productivity, but about the simple ordinary hours =) 
Once he saw in PHP something like
$ date = mysql_result (mysql_query ( &#8220;SELECT CURRENT_TIMESTAMP&#8221;), 0, 0); 
It seems to shitcode case &#8230; 
Laughed and forgot. Then swapped windows surfing with ubuntu and here is something interesting happened yesterday =) MySQL and [...]]]></description>
			<content:encoded><![CDATA[<p>No-no, here it is not about productivity, but about the simple ordinary hours =) </p>
<p>Once he saw in PHP something like<br />
$ date = mysql_result (mysql_query ( &#8220;SELECT CURRENT_TIMESTAMP&#8221;), 0, 0); </p>
<p>It seems to shitcode case &#8230; </p>
<p>Laughed and forgot. Then swapped windows surfing with ubuntu and here is something interesting happened yesterday =) MySQL and PHP in XAMPP (LAMPP) returned to a different current time! </p>
<p>print (date ( &#8216;Y-m-d H: i: s&#8217;));<br />
/ / 2009-06-20 8:00:00 </p>
<p>print ( &#8220;\ n&#8221;, mysql_result (mysql_query ( &#8220;SELECT CURRENT_TIMESTAMP&#8221;), 0, 0));<br />
/ / 2009-06-20 15:00:00 </p>
<p>because when windows surfing this problem does not occur, I looked up the net and learned that Linux and Windows differently interpret the system time. Windows makes the system time according to local (and doing it consistently every time you boot and synchronization), a Linux system finds UTC and local time is counted from the time zone assigned.<br />
<span id="more-12"></span><br />
Solution 1. Match the system time for a local Linux </p>
<p>1. Set time to current. </p>
<p>user @ server: ~ $ sudo date-s 12:00 </p>
<p>2. Make the local system time: </p>
<p>user @ server: ~ $ sudo / sbin / hwclock &#8211; systohc &#8211; localtime </p>
<p>3. Synchronize local and system time: </p>
<p>user @ server: ~ $ sudo / sbin / hwclock &#8211; hctosys &#8211; localtime </p>
<p>4. Reboot the computer if necessary. Well in my case, it was necessary to simply restart XAMPP / LAMPP </p>
<p>user @ server: ~ $ sudo / opt / lampp / lampp restart </p>
<p>Solution 2. Fit the time zone for MySQL </p>
<p>Presumably (as I am satisfied with the first solution) here:<br />
dev.mysql.com/doc/refman/5.1/en/time-zone-support.html </p>
<p>Solution 3. Move to London </p>
<p>But since there is daylight saving time, this solution works only 6 months of the year. But as for the Algerian sys admins they have never faced up such a problem =)</p>
]]></content:encoded>
			<wfw:commentRss>http://newverhost.com/2009/06/php-vs-mysql-who-has-time-faster/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

