<?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>Nisi's work blog</title>
	<atom:link href="http://wiki.nisi.ro/feed/" rel="self" type="application/rss+xml" />
	<link>http://wiki.nisi.ro</link>
	<description>Nisi's work blog - programing tips</description>
	<lastBuildDate>Mon, 21 Nov 2011 08:43:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>How to disable comments notification for WordPress</title>
		<link>http://wiki.nisi.ro/2011/11/how-to-disable-comments-notification-for-wordpress/</link>
		<comments>http://wiki.nisi.ro/2011/11/how-to-disable-comments-notification-for-wordpress/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 08:43:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[disable]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://wiki.nisi.ro/?p=408</guid>
		<description><![CDATA[Do you receive alot of emails sent by your WordPress Blog becouse people comment your posts? You can turn this off like this: 1. Login to your blog admin page 2. Click on Settings -&#62; Discussion 3. Search in that list for &#8220;E-mail me whenever:&#8221; Now by default you receive email when &#8220;Anyone posts a [...]]]></description>
			<content:encoded><![CDATA[<p>Do you receive alot of emails sent by your WordPress Blog becouse people comment your posts?</p>
<p>You can turn this off like this:</p>
<p>1. Login to your blog admin page</p>
<p>2. Click on Settings -&gt; Discussion</p>
<p>3. Search in that list for &#8220;<em>E-mail me whenever</em>:&#8221;</p>
<p>Now by default you receive email when &#8220;<em>Anyone posts a comment</em>&#8221; and &#8220;<em>A comment is held for moderation</em>&#8220;. Uncheck any or both of this options as you like.</p>
<p>You should definitely uncheck &#8220;Anyone posts a comment&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://wiki.nisi.ro/2011/11/how-to-disable-comments-notification-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unable to find the wrapper &#8220;https&#8221;</title>
		<link>http://wiki.nisi.ro/2011/10/unable-to-find-the-wrapper-https/</link>
		<comments>http://wiki.nisi.ro/2011/10/unable-to-find-the-wrapper-https/#comments</comments>
		<pubDate>Sat, 29 Oct 2011 05:07:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[PHP & MySQL]]></category>
		<category><![CDATA[apache module]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[facebook login]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php_openssl]]></category>
		<category><![CDATA[ssl_module]]></category>

		<guid isPermaLink="false">http://wiki.nisi.ro/?p=402</guid>
		<description><![CDATA[Today I had to put a simple script on one of my hosting server where a &#8220;Facebook Login&#8221; button was available for login. However when I had to run it I encountered the following error: Warning: file_get_contents() [function.file-get-contents]: Unable to find the wrapper &#8220;https&#8221; &#8211; did you forget to enable it when you configured PHP? [...]]]></description>
			<content:encoded><![CDATA[<p>Today I had to put a simple script on one of my hosting server where a &#8220;<strong><a href="http://developers.facebook.com/docs/guides/web/#login" target="_blank">Facebook Login</a></strong>&#8221; button was available for login. However when I had to run it I encountered the following error:</p>
<p><em><strong>Warning:</strong> file_get_contents() [function.file-get-contents]: Unable to find the wrapper &#8220;https&#8221; &#8211; did you forget to enable it when you configured PHP?</em></p>
<p>This was becouse the url served to <strong><em>file_get_contents</em></strong> start with http:// &#8230;.</p>
<p>If you have the same problem there are 2 steps to rezolve it:</p>
<ol>
<li>apache module ssl_module need to be avilble</li>
<li>php extension php_openssl need to be activated too</li>
</ol>
<p>Server restart and you are good to go.</p>
<p>To test from PHP is extension php_openssl is active just paste this code:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw1">if</span> <span class="br0">&#40;</span><a href="http://www.php.net/extension_loaded"><span class="kw3">extension_loaded</span></a><span class="br0">&#40;</span><span class="st0">&#8216;php_openssl&#8217;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<a href="http://www.php.net/echo"><span class="kw3">echo</span></a><span class="br0">&#40;</span><span class="st0">&#8216;php_openssl ok&#8217;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">else</span> </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<a href="http://www.php.net/echo"><span class="kw3">echo</span></a><span class="br0">&#40;</span><span class="st0">&#8216;php_openssl off&#8217;</span><span class="br0">&#41;</span>;</div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://wiki.nisi.ro/2011/10/unable-to-find-the-wrapper-https/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>$_FILES limitation when uploading files in PHP</title>
		<link>http://wiki.nisi.ro/2011/10/_files-limitation-when-uploading-files-in-php/</link>
		<comments>http://wiki.nisi.ro/2011/10/_files-limitation-when-uploading-files-in-php/#comments</comments>
		<pubDate>Fri, 14 Oct 2011 09:10:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[PHP & MySQL]]></category>
		<category><![CDATA[$_FILES]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[javascriupt]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[upload file]]></category>

		<guid isPermaLink="false">http://wiki.nisi.ro/?p=395</guid>
		<description><![CDATA[Along with the &#8220;upload_max_filesize&#8221; when uploading files with PHP there is another parameter named &#8220;max_file_uploads&#8221; witch prevent uploading more files that the value of this parameter. Default size of this parameter is 20 and is should be enough for more apps then I can count but today I had to repair a bug in a [...]]]></description>
			<content:encoded><![CDATA[<p>Along with the &#8220;upload_max_filesize&#8221; when uploading files with PHP there is another parameter named &#8220;max_file_uploads&#8221; witch prevent uploading more files that the value of this parameter.</p>
<p>Default size of this parameter is 20 and is should be enough for more apps then I can count but today I had to repair a bug in a page where a form contain 30 file uploads and just 20 were availble in $_FILES from php script.</p>
<p><strong>How can you change this?</strong></p>
<p>There are 2 methods. One is to change it from php.ini but not always you can access php.ini file</p>
<p>The second method <strong>is not</strong> using ini_set :( . Tried that and not working.</p>
<p>I did find another method witch need some javascript. The method is when submiting the form a javascript will disable all unused upload elements like this:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">jQuery<span class="br0">&#40;</span><span class="st0">&quot;#upload_files1&quot;</span><span class="br0">&#41;</span>.<span class="me1">submit</span><span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; jQuery<span class="br0">&#40;</span><span class="st0">&#8216;input:file[value=&quot;&quot;]&#8216;</span><span class="br0">&#41;</span>.<span class="me1">attr</span><span class="br0">&#40;</span><span class="st0">&quot;disabled&quot;</span>, <span class="kw2">true</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span><span class="br0">&#41;</span>;</div>
</li>
</ol>
</div>
<p>and the form:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&lt;form id=&quot;upload_files1&quot; enctype=&quot;multipart/form-data&quot; method=&quot;post&quot;&gt;
</div>
</li>
<li class="li1">
<div class="de1">&lt;input name=&quot;img[]&quot; type=&quot;file&quot; /&gt;
</div>
</li>
<li class="li1">
<div class="de1">&lt;input name=&quot;img[]&quot; type=&quot;file&quot; /&gt;
</div>
</li>
<li class="li2">
<div class="de2">&#8230;
</div>
</li>
<li class="li1">
<div class="de1">&lt;input name=&quot;img[]&quot; type=&quot;file&quot; /&gt;
</div>
</li>
<li class="li1">
<div class="de1">&lt;input name=&quot;save&quot; type=&quot;submit&quot; value=&quot;Save&quot; /&gt;
</div>
</li>
<li class="li1">
<div class="de1">&lt;/form&gt;</div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://wiki.nisi.ro/2011/10/_files-limitation-when-uploading-files-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>7pic &#8211; the new free photo hosting service</title>
		<link>http://wiki.nisi.ro/2011/05/7pic-the-new-free-photo-hosting-service/</link>
		<comments>http://wiki.nisi.ro/2011/05/7pic-the-new-free-photo-hosting-service/#comments</comments>
		<pubDate>Mon, 30 May 2011 18:42:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Websites & Web services]]></category>
		<category><![CDATA[7pic.com]]></category>
		<category><![CDATA[free photo sharing]]></category>
		<category><![CDATA[image hosting]]></category>

		<guid isPermaLink="false">http://wiki.nisi.ro/?p=392</guid>
		<description><![CDATA[I had stumbled today on 7pic.com website witch is a new and free hosting service for photo sharing. I give it a try and I like it becouse i can use the 7pic uploader to upload picts without to start a browser. Uploaded images are stored in albums and can be shares as an images [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://7pic.com/l/1/?a=1078" target="_blank"><img class="alignleft" title="7pic free photo hosting service" src="http://fs14.7pic.com/66c76a.jpg" alt="" width="500" height="189" /></a>I had stumbled today on <a href="http://7pic.com/l/1/?a=1078" target="_blank">7pic.com</a> website witch is a new and free hosting service for photo sharing. I give it a try and I like it becouse i can use the 7pic uploader to upload picts without to start a browser.</p>
<p>Uploaded images are stored in albums and can be shares as an images witch can be embedded in a blog post or as a link to a page on <a href="http://7pic.com/l/1/?a=1078" target="_blank">7pic.com</a> where anybody can comment that images share on facebook, twitter and other social networks and of course anybody can rate the picture.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://wiki.nisi.ro/2011/05/7pic-the-new-free-photo-hosting-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use call_user_func_array with a simple function and with class methods</title>
		<link>http://wiki.nisi.ro/2011/05/how-to-use-call_user_func_array-with-a-simple-function-and-with-class-methods/</link>
		<comments>http://wiki.nisi.ro/2011/05/how-to-use-call_user_func_array-with-a-simple-function-and-with-class-methods/#comments</comments>
		<pubDate>Sat, 28 May 2011 11:49:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP & MySQL]]></category>
		<category><![CDATA[call_user_func_array]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[method]]></category>
		<category><![CDATA[private]]></category>
		<category><![CDATA[static]]></category>

		<guid isPermaLink="false">http://wiki.nisi.ro/?p=386</guid>
		<description><![CDATA[In this post you will see a example of using call_user_func_array (from PHP) to call a simple function, a public static method from a class and a public method. First I define one function and one class: function add&#40;$p1, $p2&#41;&#123; &#160; &#160;return $p1 + $p2; &#125; &#160; class CSimpleMath&#123; &#160; &#160;function __construct&#40;$v1&#41; &#123; &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>In this post you will see a example of using call_user_func_array (from PHP) to call a simple function, a public static method from a class and a public method.</p>
<p>First I define one function and one class:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">function</span> add<span class="br0">&#40;</span><span class="re0">$p1</span>, <span class="re0">$p2</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="kw1">return</span> <span class="re0">$p1</span> + <span class="re0">$p2</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2"><span class="kw2">class</span> CSimpleMath<span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="kw2">function</span> __construct<span class="br0">&#40;</span><span class="re0">$v1</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="kw2">public</span> <a href="http://www.php.net/static"><span class="kw3">static</span></a> <span class="kw2">function</span> multiply<span class="br0">&#40;</span><span class="re0">$a</span>, <span class="re0">$b</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="re0">$a</span> * <span class="re0">$b</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="kw2">public</span> <span class="kw2">function</span> substract<span class="br0">&#40;</span><span class="re0">$a</span>, <span class="re0">$b</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="re0">$b</span> &#8211; <span class="re0">$a</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp;<span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="kw2">function</span> __destruct<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="br0">&#125;</span>&nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<p>Maybe you notice that in the class I did inserted a construct and destruct functions. You dont realy need them for this example to work but I always include them when I write a class.</p>
<p><strong>Call a simple function with call_user_func_array:</strong></p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <a href="http://www.php.net/call_user_func_array"><span class="kw3">call_user_func_array</span></a><span class="br0">&#40;</span><span class="st0">&#8216;add&#8217;</span>, <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="nu0">2</span>, <span class="nu0">5</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</div>
</li>
</ol>
</div>
<p><strong>Call a public static method:</strong></p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <a href="http://www.php.net/call_user_func_array"><span class="kw3">call_user_func_array</span></a><span class="br0">&#40;</span><span class="st0">&#8216;CSimpleMath::multiply&#8217;</span>, <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="nu0">2</span>, <span class="nu0">5</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</div>
</li>
</ol>
</div>
<p><strong>Call a public class method</strong></p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><a href="http://www.php.net/call_user_func_array"><span class="kw3">call_user_func_array</span></a><span class="br0">&#40;</span><a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st0">&#8216;CSimpleMath&#8217;</span>, <span class="st0">&#8216;substract&#8217;</span><span class="br0">&#41;</span>, <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="nu0">2</span>, <span class="nu0">5</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://wiki.nisi.ro/2011/05/how-to-use-call_user_func_array-with-a-simple-function-and-with-class-methods/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;Progress bar&#8221; for long running cron scripts in PHP</title>
		<link>http://wiki.nisi.ro/2011/05/progress-bar-for-long-running-cron-scripts-in-php/</link>
		<comments>http://wiki.nisi.ro/2011/05/progress-bar-for-long-running-cron-scripts-in-php/#comments</comments>
		<pubDate>Thu, 12 May 2011 13:43:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP & MySQL]]></category>
		<category><![CDATA[Website's]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[cron progress]]></category>
		<category><![CDATA[email progress bar]]></category>
		<category><![CDATA[long running]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://wiki.nisi.ro/?p=381</guid>
		<description><![CDATA[Long running scripts can be a pain if you dont know how much will be running. If you need to see a progress and flush() or ob_flush() do not work becouse of browser cache you can implement an &#8220;email progress bar&#8221;. PHP example: $step = 0; $last_percent = 0; $total_rows = while&#40;1&#41; &#123; &#160; &#160;$step++; [...]]]></description>
			<content:encoded><![CDATA[<p>Long running scripts can be a pain if you dont know how much will be running. If you need to see a progress and flush() or ob_flush() do not work becouse of browser cache you can implement an &#8220;email progress bar&#8221;.</p>
<p><strong>PHP example:</strong></p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="re0">$step</span> = <span class="nu0">0</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="re0">$last_percent</span> = <span class="nu0">0</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="re0">$total_rows</span> =</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">while</span><span class="br0">&#40;</span><span class="nu0">1</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp;<span class="re0">$step</span>++; <span class="co1">//count step</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="co1">// here should be is the code witch consume time for every loop</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="co1">// end consuming time code</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp;<span class="re0">$procent</span> = <span class="br0">&#40;</span><span class="re0">$step</span> * <span class="nu0">100</span><span class="br0">&#41;</span> / <span class="re0">$total_rows</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$last_percent</span> != <a href="http://www.php.net/round"><span class="kw3">round</span></a><span class="br0">&#40;</span><span class="re0">$procent</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#123;</span> </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="co1">// becouse you do not want to receive an email for every step</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="re0">$last_percent</span> = <a href="http://www.php.net/round"><span class="kw3">round</span></a><span class="br0">&#40;</span><span class="re0">$procent</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="br0">&#40;</span><span class="re0">$last_percent</span> % <span class="nu0">10</span><span class="br0">&#41;</span> == <span class="nu0">0</span><span class="br0">&#41;</span><span class="br0">&#123;</span> &nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="co1">// this will send email from 10 % to 10 % &#8211; total 10 emails</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a href="http://www.php.net/mail"><span class="kw3">mail</span></a><span class="br0">&#40;</span>your_email_here, <span class="st0">&#8216;Progress &#8216;</span>.<span class="re0">$last_percent</span>.<span class="st0">&#8216;% done&#8217;</span> , <span class="st0">&quot;Progress: &quot;</span>.<span class="re0">$contor</span>.<span class="st0">&quot;/&quot;</span>.<span class="re0">$total_rows</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2"><span class="br0">&#125;</span> <span class="co1">// end while</span></div>
</li>
</ol>
</div>
<p>As you can see the ideea is very simple and you can implement it in any language.</p>
]]></content:encoded>
			<wfw:commentRss>http://wiki.nisi.ro/2011/05/progress-bar-for-long-running-cron-scripts-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apple spy your iOS 4 iPad and iPhone</title>
		<link>http://wiki.nisi.ro/2011/04/apple-spy-your-ios-4-ipad-and-iphone/</link>
		<comments>http://wiki.nisi.ro/2011/04/apple-spy-your-ios-4-ipad-and-iphone/#comments</comments>
		<pubDate>Sun, 24 Apr 2011 13:18:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPhone Apps]]></category>
		<category><![CDATA[iphone spy]]></category>
		<category><![CDATA[iPhoneTraker]]></category>
		<category><![CDATA[mac]]></category>

		<guid isPermaLink="false">http://wiki.nisi.ro/?p=376</guid>
		<description><![CDATA[If you want to see what Apple will know about you on your next device sync look for file consolidated.db and open it with a sqlite application or watch it sync over a map with the free application iPhoneTraker (just for MAC users)]]></description>
			<content:encoded><![CDATA[<p><object width="520" height="349"><param name="movie" value="http://www.youtube-nocookie.com/v/GynEFV4hsA0?fs=1&amp;hl=en_US" /><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><embed type="application/x-shockwave-flash" width="520" height="349" src="http://www.youtube-nocookie.com/v/GynEFV4hsA0?fs=1&amp;hl=en_US" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>If you want to see what Apple will know about you on your next device sync look for file consolidated.db and open it with a sqlite application or watch it sync over a map with the free application<a href="http://petewarden.github.com/iPhoneTracker/" target="_blank"> iPhoneTraker</a> (just for MAC users)</p>
]]></content:encoded>
			<wfw:commentRss>http://wiki.nisi.ro/2011/04/apple-spy-your-ios-4-ipad-and-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Prevent Firefox to load css/js from cache</title>
		<link>http://wiki.nisi.ro/2011/03/prevent-firefox-to-load-cssjs-from-cache/</link>
		<comments>http://wiki.nisi.ro/2011/03/prevent-firefox-to-load-cssjs-from-cache/#comments</comments>
		<pubDate>Sun, 13 Mar 2011 15:40:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Other]]></category>

		<guid isPermaLink="false">http://wiki.nisi.ro/?p=370</guid>
		<description><![CDATA[This days I was working on a webpage but to test in Firefox was a pain. Firefox store css and js in cache with the rest of the page. Reloading page with CRTL + F5 combination seems to reload from server the page but not the css/js files. After hours of frustration and complete cache [...]]]></description>
			<content:encoded><![CDATA[<p>This days I was working on a webpage but to test in Firefox was a pain. Firefox store css and js in cache with the rest of the page. Reloading page with CRTL + F5 combination seems to reload from server the page but not the css/js files. After hours of frustration and complete cache delete before every page test I did found 2 methods to prevent Firefox to cache.</p>
<p>First and the easy one is to enter in the about:config menu (if you do not know what I mean by about:config go to Firefox url box paste about:config and press &lt;enter&gt;. You will find there settings you will not find in the firefox menus).</p>
<p>From the about:config search  <code>network.http.use-cache</code> and set it to <strong><span style="color: #ff0000;">false</span></strong>. This will force Firefox to stop loading pages from cache (this will slow your firefox).</p>
<p>The second method to prevent caching (and this method is working for all browsers) is to load the js / css like this</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"> &lt;!&#8211; style loading &#8211;&gt;
</div>
</li>
<li class="li1">
<div class="de1">&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;style.css?&lt;?=rand(0, getrandmax()); ?&gt;&quot; /&gt;
</div>
</li>
<li class="li1">
<div class="de1">&lt;!&#8211; js loading &#8211;&gt;
</div>
</li>
<li class="li1">
<div class="de1">&lt;script src=&quot;xxx.js?&lt;?=rand(0, getrandmax()); ?&gt;&quot; type=&quot;text/javascript&quot;&gt;&lt;!&#8211;mce:0&#8211;&gt;&lt;/script&gt;&lt;/link&gt;</div>
</li>
</ol>
</div>
<p>The second method is availble just for developers</p>
]]></content:encoded>
			<wfw:commentRss>http://wiki.nisi.ro/2011/03/prevent-firefox-to-load-cssjs-from-cache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to replace substring in MySQL table field</title>
		<link>http://wiki.nisi.ro/2011/03/how-to-replace-substring-in-mysql-table-field/</link>
		<comments>http://wiki.nisi.ro/2011/03/how-to-replace-substring-in-mysql-table-field/#comments</comments>
		<pubDate>Fri, 11 Mar 2011 12:30:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP & MySQL]]></category>
		<category><![CDATA[instr]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[replace]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[where]]></category>

		<guid isPermaLink="false">http://wiki.nisi.ro/?p=368</guid>
		<description><![CDATA[This replace will search in every row of the table where condition from WHERE is true and replace function will replace all instances in a string. ex. if you have text &#8220;hello world&#8221; and you want to replace the &#8220;o&#8221; letter with &#8220;*&#8221; this will will transform the text in &#8220;hell* w*rld&#8221; UPDATE `mytable` SET [...]]]></description>
			<content:encoded><![CDATA[<p>This replace will search in every row of the table where condition from WHERE is true and replace function will replace all instances in a string.</p>
<p>ex. if you have text &#8220;hello world&#8221; and you want to replace the &#8220;o&#8221; letter with &#8220;*&#8221; this will will transform the text in &#8220;hell* w*rld&#8221;</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw1">UPDATE</span> `mytable`</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">SET</span> my_content = <span class="kw1">REPLACE</span><span class="br0">&#40;</span>content, <span class="st0">&#8216;substr_string_to_replace&#8217;</span>,<span class="st0">&#8216;the_new_string&#8217;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">WHERE</span> <span class="kw1">INSTR</span><span class="br0">&#40;</span>content, <span class="st0">&#8216;substr_string_to_replace&#8217;</span><span class="br0">&#41;</span> &gt; <span class="nu0">0</span>;</div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://wiki.nisi.ro/2011/03/how-to-replace-substring-in-mysql-table-field/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: trim spaces in the middle of a string</title>
		<link>http://wiki.nisi.ro/2011/02/php-trim-spaces-in-the-middle-of-a-string/</link>
		<comments>http://wiki.nisi.ro/2011/02/php-trim-spaces-in-the-middle-of-a-string/#comments</comments>
		<pubDate>Mon, 14 Feb 2011 11:29:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP & MySQL]]></category>
		<category><![CDATA[colapse]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[space]]></category>
		<category><![CDATA[trim]]></category>

		<guid isPermaLink="false">http://wiki.nisi.ro/?p=365</guid>
		<description><![CDATA[When you let users input text in a textfield or input box iti is always a good ideea to use trim function to remove spaces form the begining or the end of the string. Today I needed a function to trim spaces from the middle of a string and replace with a single space. /* [...]]]></description>
			<content:encoded><![CDATA[<p>When you let users input text in a textfield or input box iti is always a good ideea to use trim function to remove spaces form the begining or the end of the string.</p>
<p>Today I needed a function to trim spaces from the middle of a string and replace with a single space.</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="coMULTI">/* </span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">&nbsp; &nbsp; this will return the string where groups of consecutive spaces </span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">&nbsp; &nbsp; are collapsed in a single space</span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">&nbsp; &nbsp; </span></div>
</li>
<li class="li2">
<div class="de2"><span class="coMULTI">&nbsp; &nbsp; eg. $str = &quot;This is &nbsp; &nbsp;my test &nbsp; &nbsp;string&quot;;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">&nbsp; &nbsp; function will output &quot;This is my test string&quot; </span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">&nbsp;*/</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">function</span> centerTrim<span class="br0">&#40;</span><span class="re0">$str</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">return</span> <a href="http://www.php.net/preg_replace"><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st0">&quot;/<span class="es0">\s</span>+/&quot;</span>, <span class="st0">&quot; &quot;</span>, <span class="re0">$str</span><span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<p>if you need to remove all spaces you can use this function:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="coMULTI">/* </span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">&nbsp; &nbsp; eg. $str = &quot;This is &nbsp; &nbsp;my test &nbsp; &nbsp;string&quot;;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">&nbsp; &nbsp; function will output &quot;Thisismyteststring&quot; </span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">&nbsp;*/</span></div>
</li>
<li class="li2">
<div class="de2"><span class="kw2">function</span> centerTrim2<span class="br0">&#40;</span><span class="re0">$str</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">return</span> <a href="http://www.php.net/preg_replace"><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st0">&quot;/<span class="es0">\s</span>+/&quot;</span>, <span class="st0">&quot;&quot;</span>, <span class="re0">$str</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://wiki.nisi.ro/2011/02/php-trim-spaces-in-the-middle-of-a-string/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

