<?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>Oville Project</title>
	<atom:link href="http://www.oville.info/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.oville.info</link>
	<description>Work and Play</description>
	<lastBuildDate>Wed, 30 Jun 2010 19:19:32 +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>PHP: Use isset() Instead of strlen()</title>
		<link>http://www.oville.info/2008/12/php-use-isset-instead-of-strlen/</link>
		<comments>http://www.oville.info/2008/12/php-use-isset-instead-of-strlen/#comments</comments>
		<pubDate>Mon, 01 Dec 2008 16:19:46 +0000</pubDate>
		<dc:creator>brunito</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[function]]></category>

		<guid isPermaLink="false">http://www.oville.info/?p=75</guid>
		<description><![CDATA[If you are writing an application on which you need to check the minimum length of a string, I would suggest you use isset() and treat the variable as an array. Each character of the string will be become an element in the array, and you can determine the number of characters by adding 1 [...]]]></description>
			<content:encoded><![CDATA[<p>If you are writing an application on which you need to check the minimum length of a string, I would suggest you use isset() and treat the variable as an array. Each character of the string will be become an element in the array, and you can determine the number of characters by adding 1 at the last element of the array. ( Note that the first character is element 0)</p>
<p>If your string is &#8220;oville&#8221;, Your array would look something like this:</p>
<pre class="brush: plain;">
Array
(
    [0] =&gt; o
    [1] =&gt; v
    [2] =&gt; i
    [3] =&gt; l
    [4] =&gt; l
    [5] =&gt; e
)
</pre>
<p>As you can see, there are six elements (0-5). So if you want to check whether a string has 6 characters, your PHP code would look something like this:</p>
<pre class="brush: php;">
&lt;?php
if (isset($str[5])) {
     //the string is at least 6 characters.
}
?&gt;
</pre>
<p>Some say, this method is faster than using strlen(). Well, I&#8217;m not going comment on that until I perform a benchmark using of course our <a href="http://www.oville.info/2008/08/php-a-small-benchmark-class/">simple benchmarking class</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oville.info/2008/12/php-use-isset-instead-of-strlen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: A small benchmark class</title>
		<link>http://www.oville.info/2008/08/php-a-small-benchmark-class/</link>
		<comments>http://www.oville.info/2008/08/php-a-small-benchmark-class/#comments</comments>
		<pubDate>Sat, 09 Aug 2008 21:58:56 +0000</pubDate>
		<dc:creator>brunito</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[code testing]]></category>
		<category><![CDATA[debug]]></category>

		<guid isPermaLink="false">http://www.oville.info/2010/06/php-a-small-benchmark-class/</guid>
		<description><![CDATA[I have been asked with questions like &#8220;how does Wordpress get its code execute time&#8221; or &#8220;how to benchmark my php code&#8221; so many times already, so I decided to share a simple benchmarking class that I have written for debugging purposes. I have been using this to test functions before implementing them in my [...]]]></description>
			<content:encoded><![CDATA[<p>I have been asked with questions like &#8220;how does Wordpress get its code execute time&#8221; or &#8220;how to benchmark my php code&#8221; so many times already, so I decided to share a simple benchmarking class that I have written for debugging purposes. I have been using this to test functions before implementing them in my projects.</p>
<pre class="brush: php;">
class Benchmark {
	protected $s, $e, $r;
	public function start(){
		$this-&gt;s = microtime(true);
	}
	public function exec_time() {
		$this-&gt;e = microtime(true);
		$this-&gt;r = number_format($this-&gt;e - $this-&gt;s, 4);
		return $this-&gt;r;
	}
}
</pre>
<p>Usage: </p>
<pre class="brush: php;">
&lt;?php
$bench = new Benchmark();
$bench-&gt;start();
//..
// code here..
// ..
echo $bench-&gt;exec_time();
?&gt;
</pre>
<p>Please note that execution time will be in seconds.</p>
<p><a href="http://www.oville.info/pub/index.php?dir=&#038;file=bm.class.txt">Download</a> the source code</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oville.info/2008/08/php-a-small-benchmark-class/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP: Simple username generator</title>
		<link>http://www.oville.info/2008/04/php-simple-username-generator/</link>
		<comments>http://www.oville.info/2008/04/php-simple-username-generator/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 18:37:47 +0000</pubDate>
		<dc:creator>brunito</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[username generator]]></category>

		<guid isPermaLink="false">http://www.oville.info/?p=39</guid>
		<description><![CDATA[Here is a simple function I wrote to generate a username based on user&#8217;s first and last name.  This function will concatenate the first 5 characters of the first name to the first character of the last name. I used the explode function to split names with more than one word, and ran loops to [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a simple function I wrote to generate a username based on user&#8217;s first and last name.  This function will concatenate the first 5 characters of the first name to the first character of the last name. I used the explode function to split names with more than one word, and ran loops to concatenate them back to trim spaces.</p>
<pre class="brush: php;">
function generate_username($first_name = '', $last_name = ''){
	$f_array = explode(' ', $first_name);
	$l_array = explode(' ', $last_name);
	foreach($f_array as $f_bit) $fname .= $f_bit;
	foreach($l_array as $l_bit) $lname .= $l_bit;
	return strtolower(substr($fname, 0, 5) . substr($lname, 0, 1));
}
</pre>
<p>Usage:</p>
<pre class="brush: php;">$username = generate_username('Juan Miguel', 'De Vega');</pre>
<p>returns: &#8220;juanmd&#8221;</p>
<p>Click <a href="http://www.oville.info/pub/index.php?dir=&#038;file=uname_gen.php">here</a> to see it in action.</p>
<p><a href="http://www.oville.info/pub/index.php?dir=&#038;file=uname_gen.txt">Download</a> the full source code.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oville.info/2008/04/php-simple-username-generator/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to configure Globe Tattoo in Ubuntu</title>
		<link>http://www.oville.info/2008/02/how-to-configure-globe-tattoo-in-ubuntu/</link>
		<comments>http://www.oville.info/2008/02/how-to-configure-globe-tattoo-in-ubuntu/#comments</comments>
		<pubDate>Fri, 01 Feb 2008 19:32:58 +0000</pubDate>
		<dc:creator>brunito</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.oville.info/?p=29</guid>
		<description><![CDATA[Here is a simple way to configure Globe Tattoo in Ubuntu. It&#8217;s very useful when you&#8217;re travelling with your *nix powered lappy.

Open your Network Connections &#62; click on Mobile Broadband tab &#62; then click Add

Select your Mobile Modem &#62; click Forward

Select Philippines &#62; click Forward

Select Globe Telecom &#62; click Forward

For Postpaid: Select Internet &#62; click [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a simple way to configure Globe Tattoo in Ubuntu. It&#8217;s very useful when you&#8217;re travelling with your *nix powered lappy.</p>
<p><img class="alignnone size-medium wp-image-32" title="Screenshot-Network Connections" src="http://www.oville.info/wp-content/uploads/2010/06/Screenshot-Network-Connections1-300x196.png" alt="" width="300" height="196" /></p>
<p>Open your Network Connections &gt; click on Mobile Broadband tab &gt; then click Add</p>
<p><img class="alignnone size-medium wp-image-31" title="2" src="http://www.oville.info/wp-content/uploads/2010/06/2-300x210.png" alt="" width="300" height="210" /></p>
<p>Select your Mobile Modem &gt; click Forward</p>
<p><img class="alignnone size-medium wp-image-33" title="3" src="http://www.oville.info/wp-content/uploads/2010/06/3-300x210.png" alt="" width="300" height="210" /></p>
<p>Select Philippines &gt; click Forward</p>
<p><img class="alignnone size-medium wp-image-34" title="4" src="http://www.oville.info/wp-content/uploads/2010/06/4-300x210.png" alt="" width="300" height="210" /></p>
<p>Select Globe Telecom &gt; click Forward</p>
<p><img class="alignnone size-medium wp-image-35" title="5" src="http://www.oville.info/wp-content/uploads/2010/06/5-300x210.png" alt="" width="300" height="210" /></p>
<p><em>For Postpaid:</em> Select Internet &gt; click Forward &gt; click Apply</p>
<p><em>For Prepaid:</em> Select My plan is not listed &gt; type in <strong>http.globe.com.ph</strong> as your APN &gt; click Forward &gt; click Apply</p>
<p>That&#8217;s it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oville.info/2008/02/how-to-configure-globe-tattoo-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
