<?xml version="1.0" encoding="UTF-8" standalone="yes"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0"> 
  <channel>
    <title><![CDATA[Camby Liverson - Blog]]></title>
        <link>http://www.cambyliverson.com/</link>
    <description><![CDATA[RSS of Camby Liverson's Blog]]></description>
    <createTime>Fri, 06 Jul 2018 15:53:09 +0800</createTime>
    <maxShow>20</maxShow>
    <language>en-us</language><itunes:explicit>no</itunes:explicit><itunes:subtitle>RSS of Camby Liverson's Blog</itunes:subtitle><item>
		  <title><![CDATA[sql-mode-caused-error]]></title>
		  <description>
		  <![CDATA[<p>
	Sometimes we may got some sql error like belows:</p>
<div>
	<strong>- Field doesn&#39;t have a default values</strong></div>
<div>
	<strong>- Incorrect integer value: &#39;&#39; for column</strong></div>
<p>
	These because your MySQL server runing <span style="color:#ff0000;"><strong>strict mode</strong></span>, if you don&#39;t want to change your sql statement, a simple solution is switch off the strict mode</p>
<p>
	find my.ini or my.cnf, add the following line to the end of the file and restart the service (for cPanel , the path may be /etc/&nbsp;my.cnf)</p>
<p>
	sql_mode=NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION</p>
]]>
		  </description>
		  <pubDate>Fri, 06 Jul 2018 15:53:09 +0800</pubDate>
		  <link>http://www.cambyliverson.com/blog/sql-mode-caused-error.html</link>
		</item><item>
		  <title><![CDATA[Phonegap change Android App title bar]]></title>
		  <description>
		  <![CDATA[<h5>
	Usage in phonegap build:</h5>
<p>
	Put the following two line in config.xml</p>
<pre>
&lt;preference name="HeaderColor" value="#becb29" />
&lt;plugin name="cordova-plugin-headercolor" version="1" /></pre>
<p>

<p>
	&nbsp;</p>
<div style="page-break-after: always;">
	<span style="display: none;">&nbsp;</span></div>
<p>
	<br />
	<img alt="" src="https://i.stack.imgur.com/7pWau.png" style="width: 367px; height: 584px;" /></p>
<p>
	&nbsp;</p>
]]>
		  </description>
		  <pubDate>Sun, 03 Sep 2017 00:00:00 +0800</pubDate>
		  <link>http://www.cambyliverson.com/blog/android-app-title-bar-phonegap.html</link>
		</item><item>
		  <title><![CDATA[HTML5 Link Prefetch Tag]]></title>
		  <description>
		  <![CDATA[<p>
	HTML5 added a prefetch function to allow you preload a web page or source (image, video, everything...).<br />
	The prefetch api uses a link tag and with rel attribute set to &#39;prefetch&#39;.</p>
<pre class="code" lang="html">
&lt;link href=&quot;http://yourdomain.com/nextpage&quot; rel=&quot;prefetch&quot; /&gt;
</pre>
]]>
		  </description>
		  <pubDate>Sun, 24 Jan 2016 00:00:00 +0800</pubDate>
		  <link>http://www.cambyliverson.com/blog/HTML5-Link-Prefetch-Tag.html</link>
		</item><item>
		  <title><![CDATA[PHP Geo]]></title>
		  <description>
		  <![CDATA[<p>
	A nice library to calculate geographical distances for PHP.</p>
<p>
	example code:</p>

<pre class="code" lang="php">
use Location\Coordinate;
use Location\Distance\Haversine;

$coordinate1 = new Coordinate(19.820664, -155.468066); // Mauna Kea Summit
$coordinate2 = new Coordinate(20.709722, -156.253333); // Haleakala Summit

echo $coordinate1-&gt;getDistance($coordinate2, new Haversine()); // returns 128384.515 (meters; &asymp;128 kilometers)
</pre>

<div style="page-break-after: always;">
	<span style="display: none;">&nbsp;</span></div>

<a href="https://github.com/mjaschen/phpgeo">https://github.com/mjaschen/phpgeo</a>]]>
		  </description>
		  <pubDate>Thu, 05 Nov 2015 00:00:00 +0800</pubDate>
		  <link>http://www.cambyliverson.com/blog/phpgeo.html</link>
		</item><item>
		  <title><![CDATA[Prettify mobile view of pretty photo]]></title>
		  <description>
		  <![CDATA[<div class="post-text" itemprop="text">
	<p>
		I got the issue that pretty photo shows photos too small on mobile device, I think the problem just caused by the calculating of the resizing, so I try to find the snippet of the resize function from the js source and that was easily got the solution as below:</p>
	<p>
		I am using the 3.1.6 version, please find the function <code>_fitToViewport</code> in line 568. Then scroll down some more you will see <code>imageWidth = (windowWidth - 200);</code> and <code>imageHeight = (windowHeight - 200);</code></p>
	<p>
		Just reduce the number and then the mobile view will become very nice!! I try to adjust many times and got the best fit number is 38 and 100. You can just copy the following code to replace the original one:</p>
	<pre class="code" lang="js">
if(pp_containerWidth &gt; windowWidth - 38){
    imageWidth = (windowWidth - 38);
    imageHeight = (height/width) * imageWidth;
} else if(pp_containerHeight &gt; windowHeight - 100) {
    imageHeight = (windowHeight - 100);
    imageWidth = (width/height) * imageHeight;
} else {
    fitting = true;
};
</pre>
</div>
<p>
	&nbsp;</p>
]]>
		  </description>
		  <pubDate>Thu, 16 Jul 2015 00:00:00 +0800</pubDate>
		  <link>http://www.cambyliverson.com/blog/prettify-mobile-view-of-pretty-photo.html</link>
		</item><item>
		  <title><![CDATA[Enabling notification for comments on every post]]></title>
		  <description>
		  <![CDATA[<p>
	Enabling this lets you know whenever someone comments on your blog. You get a regular notification on Facebook and you can visit your blog to reply the comment.</p>
<p>
	&ndash; Visit this URL: <strong>https://developers.facebook.com/tools/comments/?id=<font color="red">YOUR_APP_ID</font></strong></p>
<p>
	&ndash; Be sure to replace <font color="red">YOUR_APP_ID</font> with your real application ID</p>
<p>
	&ndash; On the page that opens, click on settings and add yourself or other friends as moderator</p>
<p>
	# If you want to add someone not your friend in facebook, add them as some role in the app role setting first by their username or fb id.</p>
<p>
	Detail at <a href="http://geek.ng/2012/08/new-facebook-comment-box-for-blogger-with-notifications-enabled-2.html">http://geek.ng/2012/08/new-facebook-comment-box-for-blogger-with-notifications-enabled-2.html</a></p>
]]>
		  </description>
		  <pubDate>Sat, 30 May 2015 00:00:00 +0800</pubDate>
		  <link>http://www.cambyliverson.com/blog/Enabling-notification-for-comments-on-every-post.html</link>
		</item><item>
		  <title><![CDATA[git push failed to push some refs]]></title>
		  <description>
		  <![CDATA[<p>
	<strong>If you found the following error on git push commit</strong></p>
<p>
	&nbsp;! [remote rejected] master -&gt; master (branch is currently checked out)<br />
	error: failed to push some refs to &#39;git@192.168.1.X:/var/git.server/.../web&#39;</p>
<p>
	<b>Edit .git/config, add the following code：</b></p>
<p>
	&nbsp;&nbsp;&nbsp; [receive]<br />
	&nbsp;&nbsp;&nbsp; denyCurrentBranch = ignore</p>
]]>
		  </description>
		  <pubDate>Sun, 08 Feb 2015 00:00:00 +0800</pubDate>
		  <link>http://www.cambyliverson.com/blog/git-push-failed-to-push-some-refs.html</link>
		</item><item>
		  <title><![CDATA[Mod Rewrite not working in wamp]]></title>
		  <description>
		  <![CDATA[<p>
	If you found your rewrite module not working well even mod rewrite is enabled, try to do the following change:</p>
<p>
	Search <b>AllowOverride None</b> from httpd.conf and replace it by <b>AllowOverride All</b>.</p>
<p>
	Restart your service and check your page again, the rewrite rule should be working now.</p>
]]>
		  </description>
		  <pubDate>Thu, 05 Feb 2015 00:00:00 +0800</pubDate>
		  <link>http://www.cambyliverson.com/blog/mod-rewrite-not-working-in-wamp.html</link>
		</item><item>
		  <title><![CDATA[Disable text auto zoom on Andorid]]></title>
		  <description>
		  <![CDATA[<p>
	If your website does not using responsive web design, you may have an issue that the browser will automatically zoom in the text. Usually, it is convenient to user if the text is too small to read. However, sometimes the text zooming may break your design and make it ugly, in this way, we will want to disable the text zooming.</p>
<p>
	I think you may tried text-size-adjust: none before come into this page, actully, this property was already removed from Chrome 30. To disable text zoom, you can add the following line in your CSS:</p>
<p>
	<prd class="code" lang="css">html * {max-height:1000000px;}</prd></p>
]]>
		  </description>
		  <pubDate>Mon, 19 Jan 2015 00:00:00 +0800</pubDate>
		  <link>http://www.cambyliverson.com/blog/disable-text-auto-zoom-on-andorid.html</link>
		</item><item>
		  <title><![CDATA[Post request show 404 not found on php with IIS]]></title>
		  <description>
		  <![CDATA[<p>
	May related to:<br />
	1.<br />
	This line in my web.config file was causing the issue:<br />
	<code><span class="tag">&lt;trace</span><span class="pln"> </span><span class="atn">enabled</span><span class="pun">=</span><span class="atv">&quot;true&quot;</span><span class="pln"> </span><span class="atn">localOnly</span><span class="pun">=</span><span class="atv">&quot;false&quot;</span><span class="pln"> </span><span class="atn">pageOutput</span><span class="pun">=</span><span class="atv">&quot;false&quot;</span><span class="pln"> </span><span class="atn">requestLimit</span><span class="pun">=</span><span class="atv">&quot;40&quot;</span><span class="pln"> </span><span class="tag">/&gt;</span></code></p>
<p>
	2.<br />
	I had this same problem. Any PHP POST to another PHP page was hanging. In the process of rebuilding the web.config file from scratch, I found an error message that suggested running the AppPool <strong>Managed pipeline mode</strong> in Classic mode.<br />
	After making the above change, my PHP code is working as expected.</p>
<p>
	&nbsp;</p>
<p>
	&nbsp;</p>
<p>
	Reference:<br />
	http://stackoverflow.com/questions/4357636/iis7-php-http-post-hang</p>
]]>
		  </description>
		  <pubDate>Mon, 08 Dec 2014 00:00:00 +0800</pubDate>
		  <link>http://www.cambyliverson.com/blog/post-request-show-404-not-found-on-php-with-iis.html</link>
		</item><item>
		  <title><![CDATA[Responsive image map]]></title>
		  <description>
		  <![CDATA[<p>
	Source: <a href="https://github.com/stowball/jQuery-rwdImageMaps">https://github.com/stowball/jQuery-rwdImageMaps</a></p>
<p>
	Demo: <a href="http://mattstow.com/experiment/responsive-image-maps/rwd-image-maps.html#bubbles">http://mattstow.com/experiment/responsive-image-maps/rwd-image-maps.html#bubbles</a></p>
<p>
	One line code to make your image map responsive, $(<span class="pl-s1"><span class="pl-pds">&#39;</span>img[usemap]<span class="pl-pds">&#39;</span></span>).rwdImageMaps();</p>
]]>
		  </description>
		  <pubDate>Tue, 02 Dec 2014 00:00:00 +0800</pubDate>
		  <link>http://www.cambyliverson.com/blog/responsive-image-map.html</link>
		</item><item>
		  <title><![CDATA[Extract tar.gz by cmd (prevent wrong decoding)]]></title>
		  <description>
		  <![CDATA[<p>1. Use cd command to navigate to your file's path (replace {path} by your file's path)</p>
<pre class="code">cd C:\{path}</pre>

<p>2. Use following command to extract</p>
<pre class="code">tar -xvf Phpfiles-org.tar --wildcards</pre>
<p>The above will extract the full folder and files</p>

<p>To extract specific file(s), you can add the part or full path of the file(s) to the end of the command<br />
For example, if you want to extract all .jpg file:</p>
<pre class="code">tar -xvf Phpfiles-org.tar --wildcards *.jpg</pre>

<p>For example, if you want to extract all files under the folder "abc":</p>
<pre class="code">tar -xvf Phpfiles-org.tar --wildcards /files/abc/*</pre>
<p>The above example assume "fiels" is the highest level and "abc" is under the folder "files".<br />
You can put * anywhere to match the path. For example:<br />
/files/a*bc/ will extract any folder match the name like abc, axbc, axxbc, axxxbc...</p>]]>
		  </description>
		  <pubDate>Fri, 28 Nov 2014 00:00:00 +0800</pubDate>
		  <link>http://www.cambyliverson.com/blog/cmd-unzip-tar.gz.html</link>
		</item><item>
		  <title><![CDATA[Aspen, Colorado, USA]]></title>
		  <description>
		  <![CDATA[<p>
	Aspen, Colorado, USA</p>
]]>
		  </description>
		  <pubDate>Tue, 21 Oct 2014 00:00:00 +0800</pubDate>
		  <link>http://www.cambyliverson.com/blog/aspen-colorado.html</link>
		</item><item>
		  <title><![CDATA[A nice way to output csv with temporary file]]></title>
		  <description>
		  <![CDATA[<p>In php programming, we always need to output data with csv format, fputcsv is good function to do that. However, it require a file handler which means you must do fopen to open a file write the content to it. But usually we just need to generate the output file for download and don't need to save in server. Today I find a better way to write csv with php memory as shown below.

<pre class="code" lang="php">
// output up to 5MB is kept in memory, if it becomes bigger
// it will automatically be written to a temporary file
$csv = fopen('php://temp/maxmemory:'. (5*1024*1024), 'r+');

fputcsv($csv, array('blah','blah'));

rewind($csv);

// put it all in a variable
$output = stream_get_contents($csv);
</pre>]]>
		  </description>
		  <pubDate>Tue, 23 Sep 2014 00:00:00 +0800</pubDate>
		  <link>http://www.cambyliverson.com/blog/a-nice-way-to-output-csv-with-temporary-file.html</link>
		</item><item>
		  <title><![CDATA[Allow multiple line of code for a string variable in Javascript]]></title>
		  <description>
		  <![CDATA[<p>When we set a html string to a variable, we cannot come to next line with only press enter like in php, example below show the case:</p>

<pre class="code" lang="js">
$htm = '<div style="background-color: red; color:#FFF;">
          <a href="erer">
            <strong>This is a link</strong>
          </a>
        </div>';
</pre>

<p>You will get a warning like this:<br />
<span style="color:red;">SyntaxError: unterminated string literal</span>
</p>

<p>Usually, we will use "+" to link up multiple line of code to solve this problem. Today I found a way to allow this which just easily add a "\\" at the end of a line.</p>
<pre class="code" lang="js">
$htm = '<div style="background-color: red; color:#FFF;"> \
          <a href="erer">                                \
            <strong>This is a link</strong>              \
          </a>                                           \
        </div>';
</pre>]]>
		  </description>
		  <pubDate>Mon, 22 Sep 2014 00:00:00 +0800</pubDate>
		  <link>http://www.cambyliverson.com/blog/javascript-multiple-line-of-code-for-string-variable.html</link>
		</item><item>
		  <title><![CDATA[GD Enhancer]]></title>
		  <description>
		  <![CDATA[<p>
	A good php class for image editing</p>
<p>
	http://www.gdenhancer.com/index.php?content=home</p>
]]>
		  </description>
		  <pubDate>Fri, 11 Jul 2014 00:00:00 +0800</pubDate>
		  <link>http://www.cambyliverson.com/blog/gdenhancer.html</link>
		</item><item>
		  <title><![CDATA[A beautity place - Santorini]]></title>
		  <description>
		  <![CDATA[<p>
	A beautiful Island in Greece</p>
]]>
		  </description>
		  <pubDate>Sun, 04 May 2014 00:00:00 +0800</pubDate>
		  <link>http://www.cambyliverson.com/blog/Santorini.html</link>
		</item>
  </channel>
</rss>