<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>George Papayiannis</title>
	
	<link>http://www.sematopia.com</link>
	<description />
	<lastBuildDate>Mon, 21 Nov 2011 23:18:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/GeorgeAPapayiannis" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="georgeapapayiannis" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Getting Socket.IO to Run On Windows Node.JS Setup (Until NPM is Built)</title>
		<link>http://www.sematopia.com/2011/11/getting-socket-io-to-run-on-windows-node-js-setup/</link>
		<comments>http://www.sematopia.com/2011/11/getting-socket-io-to-run-on-windows-node-js-setup/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 23:09:58 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/?p=661</guid>
		<description><![CDATA[I just spent a little bit of time figuring out how to get Socket.IO to run on a Windows Node.JS setup. The best line in Ryan Dahl&#8217;s intro to Node.JS video is: Windows is very important. Just like php The package manager for Node.JS NPM (in Windows) is currently in development. Until that gets released, [...]]]></description>
			<content:encoded><![CDATA[<p>I just spent a little bit of time figuring out how to get Socket.IO to run on a Windows Node.JS setup.  The best line in Ryan Dahl&#8217;s <a href="http://www.youtube.com/watch?v=jo_B4LTHi3I">intro to Node.JS</a> video is:</p>
<blockquote><p>Windows is very important. Just like php</p></blockquote>
<p>The package manager for Node.JS NPM (in Windows) is currently in development.  Until that gets released, getting Socket.IO to run on Windows takes a little downloading, copy and pasting (basically copying the folder structure in Linux).  First download the source for socket.io, socket.io.client and uglifyjs.  Then in the same folder were node.exe exists create the following folder structure:</p>
<div class='code_parent'>
<div class='code_title'>Code:</div>
<div class='code_child'><code>
<div class='pre_container'>
<pre>node_modules
   -socket.io (extract download here)
     - node_modules
       - socket.io.client (extract download here)
          - node_modules
             - uglify-js (extract download here)</pre>
</div>
<p></code></div>
</div>
<p>That&#8217;s it, follow the instructions on the socket.io website and all should work.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2011/11/getting-socket-io-to-run-on-windows-node-js-setup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache SVN Add New User to dav_svn.authz</title>
		<link>http://www.sematopia.com/2011/11/apache-svn-add-new-user-to-dav_svn-authz/</link>
		<comments>http://www.sematopia.com/2011/11/apache-svn-add-new-user-to-dav_svn-authz/#comments</comments>
		<pubDate>Fri, 11 Nov 2011 17:29:55 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/?p=658</guid>
		<description><![CDATA[Code: htpasswd -m /etc/apache2/dav_svn.passwd user]]></description>
			<content:encoded><![CDATA[<div class='code_parent'>
<div class='code_title'>Code:</div>
<div class='code_child'><code>
<div class='pre_container'>
<pre>htpasswd -m /etc/apache2/dav_svn.passwd user</pre>
</div>
<p></code></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2011/11/apache-svn-add-new-user-to-dav_svn-authz/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Sister’s Eulogy for Steve Jobs – NYTimes.com</title>
		<link>http://www.sematopia.com/2011/11/a-sister%e2%80%99s-eulogy-for-steve-jobs-nytimes-com/</link>
		<comments>http://www.sematopia.com/2011/11/a-sister%e2%80%99s-eulogy-for-steve-jobs-nytimes-com/#comments</comments>
		<pubDate>Tue, 01 Nov 2011 17:41:41 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[Coffee]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/2011/11/a-sister%e2%80%99s-eulogy-for-steve-jobs-nytimes-com/</guid>
		<description><![CDATA[Incredibly moving, an amazing piece. I loved “Fashion is what seems beautiful now but looks ugly later; art can be ugly at first but it becomes beautiful later.” http://www.nytimes.com/2011/10/30/opinion/mona-simpsons-eulogy-for-steve-jobs&#8230;]]></description>
			<content:encoded><![CDATA[<div class='posterous_autopost'>Incredibly moving, an amazing piece. I loved “Fashion is what seems <br />beautiful now but looks ugly later; art can be ugly at first but it <br />becomes beautiful later.”
<p /> <a href="http://www.nytimes.com/2011/10/30/opinion/mona-simpsons-eulogy-for-steve-jobs.html?_r=1">http://www.nytimes.com/2011/10/30/opinion/mona-simpsons-eulogy-for-steve-jobs&#8230;</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2011/11/a-sister%e2%80%99s-eulogy-for-steve-jobs-nytimes-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why Is This Cargo Container Emitting So Much Radiation?</title>
		<link>http://www.sematopia.com/2011/10/why-is-this-cargo-container-emitting-so-much-radiation/</link>
		<comments>http://www.sematopia.com/2011/10/why-is-this-cargo-container-emitting-so-much-radiation/#comments</comments>
		<pubDate>Sat, 29 Oct 2011 04:09:29 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[Coffee]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/2011/10/why-is-this-cargo-container-emitting-so-much-radiation/</guid>
		<description><![CDATA[http://m.wired.com/magazine/2011/10/ff_radioactivecargo/all/1 This article isn&#8217;t that interesting, but this one piece is: &#8220;It was hardly the first fishy shipment to pass through Gioia Tauro. Famously, just six weeks after 9/11, workers there heard noises coming from inside a container being transshipped to Nova Scotia via Rotterdam. Inside, police found an Egyptian-born Canadian carrying a Canadian passport, [...]]]></description>
			<content:encoded><![CDATA[<div class='posterous_autopost'><a href="http://m.wired.com/magazine/2011/10/ff_radioactivecargo/all/1">http://m.wired.com/magazine/2011/10/ff_radioactivecargo/all/1</a>
<p /> This article isn&#8217;t that interesting, but this one piece is:
<p /> &#8220;It was hardly the first fishy shipment to pass through Gioia Tauro. <br />Famously, just six weeks after 9/11, workers there heard noises coming <br />from inside a container being transshipped to Nova Scotia via <br />Rotterdam. Inside, police found an Egyptian-born Canadian carrying a <br />Canadian passport, a satellite phone, a cell phone, a laptop, cameras, <br />maps, and security passes to airports in Canada, Thailand, and Egypt. <br />The container’s interior was outfitted with a bed, a water supply, a <br />heater, and a toilet. Nicknamed Container Bob, the man posted bail in <br />Italian court and was never seen again.&#8221;
<p /> ..</div>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2011/10/why-is-this-cargo-container-emitting-so-much-radiation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debugging VSTO Office Addin with Visual Studio 2010</title>
		<link>http://www.sematopia.com/2011/07/debugging-vsto-office-addin-with-visual-studio-2010/</link>
		<comments>http://www.sematopia.com/2011/07/debugging-vsto-office-addin-with-visual-studio-2010/#comments</comments>
		<pubDate>Sun, 17 Jul 2011 02:18:40 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/?p=652</guid>
		<description><![CDATA[I ran into a strange problem today that my breakpoints were not being hit in Visual Studio 2010 for an Office Addin. After reading here, here and here. I realized I needed to let Visual Studio know the .NET version Office was using. So by adding excel.exe.config in the Excel.exe folder with: Code: &#60;?xml version="1.0"?> [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into a strange problem today that my breakpoints were not being hit in Visual Studio 2010 for an Office Addin.  After reading <a href="http://www.add-in-express.com/docs/net-deploying-debugging-tips.php#breakpoints">here</a>, <a href="http://www.add-in-express.com/forum/read.php?FID=5&#038;TID=7912">here</a> and <a href="http://www.add-in-express.com/forum/read.php?FID=5&#038;TID=8914">here</a>.  I realized I needed to let Visual Studio know the .NET version Office was using.  So by adding excel.exe.config in the Excel.exe folder with:</p>
<div class='code_parent'>
<div class='code_title'>Code:</div>
<div class='code_child'><code>
<div class='pre_container'>
<pre>&#60;?xml version="1.0"?>
&#60;configuration>
&#60;startup>
&#60;supportedRuntime version="v2.0.50727"/>
&#60;/startup>
&#60;/configuration></pre>
</div>
<p></code></div>
</div>
<p>fixed the problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2011/07/debugging-vsto-office-addin-with-visual-studio-2010/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The State of the Union – Signed The Boss</title>
		<link>http://www.sematopia.com/2011/06/the-state-of-the-union-signed-the-boss/</link>
		<comments>http://www.sematopia.com/2011/06/the-state-of-the-union-signed-the-boss/#comments</comments>
		<pubDate>Wed, 01 Jun 2011 17:20:18 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[Capital Markets]]></category>
		<category><![CDATA[Coffee]]></category>
		<category><![CDATA[Corporate]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/?p=648</guid>
		<description><![CDATA[This was supposedly written by a genuine small business owner, but I supposed it could be apocryphal. &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- To All My Valued Employees, There have been some rumblings around the office about the future of this company, and more specifically, your job. As you know, the economy has changed for the worse and presents many [...]]]></description>
			<content:encoded><![CDATA[<p>This was supposedly written by a genuine small business owner, but I supposed it could be apocryphal.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>To All My Valued Employees,</p>
<p>There have been some rumblings around the office about the future of this company, and more specifically, your job. As you know, the economy has changed for the worse and presents many challenges. However, the good news is this: The economy doesn&#8217;t pose a threat to your job. What does threaten your job however, is the changing political landscape in this country. However, let me tell you some little tidbits of fact which might help you decide what is in your best interests.</p>
<p>First, while it is easy to spew rhetoric that casts employers against employees, you have to understand that for every business owner there is a Back Story. This back story is often neglected and overshadowed by what you see and hear. Sure, you see me park my Mercedes outside. You&#8217;ve seen my big home at last years Christmas party. I&#8217;m sure; all these flashy icons of luxury conjure up some idealized thoughts about my life.</p>
<p>However, what you don&#8217;t see is the BACK STORY: I started this company 28 years ago. At that time, I lived in a 300 square foot studio apartment for 3 years. My entire living apartment was converted into an office so I could put forth 100% effort into building a company, which by the way, would eventually employ you.</p>
<p>My diet consisted of Ramen Pride noodles because every dollar I spent went back into this company. I drove a rusty Toyota Corolla with a defective transmission. I didn&#8217;t have time to date. Often times, I stayed home on weekends, while my friends went out drinking and partying. In fact, I was married to my business &#8212; hard work, discipline, and sacrifice.</p>
<p>Meanwhile, my friends got jobs. They worked 40 hours a week and made a modest $50K a year and spent every dime they earned. They drove flashy cars and lived in expensive homes and wore fancy designer clothes. Instead of hitting the Nordstrom&#8217;s for the latest hot fashion item, I was trolling through the discount store extracting any clothing item that didn&#8217;t look like it was birthed in the 70&#8242;s. My friends refinanced their mortgages and lived a life of luxury.</p>
<p>I, however, did not. I put my time, my money, and my life into a business with a vision that eventually, some day, I too, will be able to afford these luxuries my friends supposedly had.</p>
<p>So, while you physically arrive at the office at 9 A.M., mentally check in at about noon, and then leave at 5 P.M., I don&#8217;t. There is no &#8220;off&#8221; button for me. When you leave the office, you are done and you have a weekend all to yourself. I unfortunately do not have the freedom. I eat, and breathe this company every minute of the day. There is no rest. There is no weekend. There is no happy hour.</p>
<p>Every day this business is attached to my hip like a 1 year old special-needs child. You, of course, only see the fruits of that garden &#8212; the nice house, the Mercedes, the vacations&#8230; you never realize the Back Story and the sacrifices I&#8217;ve made.</p>
<p>Now, the economy is falling apart and I, the guy that made all the right decisions and saved his<br />
money, have to bail-out all the people who didn&#8217;t. The people that overspent their paychecks suddenly<br />
feel entitled to the same luxuries that I earned and sacrificed a decade of my life for.</p>
<p>Yes, business ownership has is benefits but the price I&#8217;ve paid is steep and not without wounds. Unfortunately, the cost of running this business, and employing you, is starting to eclipse the threshold of marginal benefit and let me tell you why:</p>
<p>I am being taxed to death and the government thinks I don&#8217;t pay enough. I have state taxes. Federal taxes. Property taxes. Sales and use taxes. Payroll taxes. Workers compensation taxes. Unemployment taxes. Taxes on taxes. I have to hire a tax man to manage all these taxes and then guess<br />
what? I have to pay taxes for employing him.</p>
<p>Government mandates and regulations and all the accounting that goes with it, now occupy most of my<br />
time. On Oct 15th, I wrote a check to the US Treasury for $288,000 for quarterly taxes. You know what my &#8220;stimulus&#8221; check was? Zero.. Nada. Zilch.</p>
<p>The question I have is this: Who is stimulating the economy? Me, the guy who has provided 14 people good paying jobs and serves over 2,200,000 people per year with a flourishing business? Or, the single mother sitting at home pregnant with her fourth child waiting for her next welfare check? Obviously, government feels the latter is the economic stimulus of this country.</p>
<p>The fact is, if I deducted (Read: Stole) 50% of your paycheck you&#8217;d quit and you wouldn&#8217;t work here. I mean, why should you? That&#8217;s nuts. Who wants to get rewarded only 50% of their hard work? Well, I agree which is why your job is in jeopardy. Here is what many of you don&#8217;t understand &#8230; to stimulate the economy you need to stimulate what runs the economy. Had suddenly government mandated to me that I didn&#8217;t need to pay taxes, guess what? Instead of depositing that $288,000 into the Washington black-hole, I would have spent it, hired more employees, and generated substantial economic growth. My employees would have enjoyed the wealth of that tax cut in the form of promotions and better salaries. But you can forget it now.</p>
<p>When you have a comatose man on the verge of death, you don&#8217;t defibrillate and shock his thumb thinking that will bring him back to life, do you? Or, do you defibrillate his heart? Business is at the heart of America and always has been. To restart it, you must stimulate it, not kill it. Suddenly, the power brokers in washington believe the poor of America are the essential drivers of the American economic engine. Nothing could be further from the truth and this is the type of change you can keep. So where am I going with all this? It&#8217;s quite simple.</p>
<p>If any new taxes are levied on me, or my company, my reaction will be swift and simple. I&#8217;ll fire you. I&#8217;ll fire your co-workers. You can then plead with the government to pay for your mortgage, your SUV, and your child&#8217;s future. Frankly, it isn&#8217;t my problem any more.</p>
<p>Then, I will close this company down, move to another country, and retire. You see, I&#8217;m done. I&#8217;m done with a country that penalizes the productive and gives to the unproductive. My motivation to work and to provide jobs will be destroyed, and with it, will be my citizenship.</p>
<p>So, if you lose your job, it won&#8217;t be at the hands of the economy; it will be at the hands of a political hurricane that swept through this country, steamrolled the constitution, and will have changed its landscape forever. If that happens, you can find me sitting on a beach, retired, and with no employees to worry about&#8230;.</p>
<p>Signed, THE BOSS</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2011/06/the-state-of-the-union-signed-the-boss/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP: How to Redirect Server-Side (Code 301 to 307)</title>
		<link>http://www.sematopia.com/2011/04/php-how-to-redirect-server-side-code-301-to-307/</link>
		<comments>http://www.sematopia.com/2011/04/php-how-to-redirect-server-side-code-301-to-307/#comments</comments>
		<pubDate>Sat, 23 Apr 2011 21:03:03 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[PHP/MySQL]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/?p=644</guid>
		<description><![CDATA[I needed a way to do a server-side PHP redirect based on the RFC 2616 spec. After some research and some help on the net, I put together this: Code: function redirect($to,$code=307) { $location = null; $sn = $_SERVER['SCRIPT_NAME']; $cp = dirname($sn); if (substr($to,0,4)=='http') $location = $to; // Absolute URL else { $schema = $_SERVER['SERVER_PORT']=='443'?'https':'http'; [...]]]></description>
			<content:encoded><![CDATA[<p>I needed a way to do a server-side PHP redirect based on the <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html">RFC 2616 spec</a>.  After some research and some help on the net, I put together this:</p>
<div class='code_parent'>
<div class='code_title'>Code:</div>
<div class='code_child'><code>
<div class='pre_container'>
<pre>function redirect($to,$code=307) {
		$location = null;
		$sn = $_SERVER['SCRIPT_NAME'];
		$cp = dirname($sn);
		if (substr($to,0,4)=='http') $location = $to; // Absolute URL
		else {
			$schema = $_SERVER['SERVER_PORT']=='443'?'https':'http';
			$host = strlen($_SERVER['HTTP_HOST'])?$_SERVER['HTTP_HOST']:$_SERVER['SERVER_NAME'];
			if (substr($to,0,1)=='/') $location = "$schema://$host$to";
			elseif (substr($to,0,1)=='.') {
				$location = "$schema://$host/";
				$pu = parse_url($to);
				$cd = dirname($_SERVER['SCRIPT_FILENAME']).'/';
				$np = realpath($cd.$pu['path']);
				$np = str_replace($_SERVER['DOCUMENT_ROOT'],'',$np);
				$location.= $np;
				if ((isset($pu['query'])) &#038;&#038; (strlen($pu['query'])>0)) $location.= '?'.$pu['query'];
			}
		}

		$hs = headers_sent();
		if ($hs==false) {
			if ($code==301) header("301 Moved Permanently HTTP/1.1"); // Convert to GET
			elseif ($code==302) header("302 Found HTTP/1.1"); // Conform re-POST
			elseif ($code==303) header("303 See Other HTTP/1.1"); // dont cache, always use GET
			elseif ($code==304) header("304 Not Modified HTTP/1.1"); // use cache
			elseif ($code==305) header("305 Use Proxy HTTP/1.1");
			elseif ($code==306) header("306 Not Used HTTP/1.1");
			elseif ($code==307) header("307 Temorary Redirect HTTP/1.1");
			else trigger_error("Unhandled redirect() HTTP Code: $code",E_USER_ERROR);
			header("Location: $location");
			header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
		}
		elseif (($hs==true) || ($code==302) || ($code==303)) {
			// todo: draw some javascript to redirect
			$cover_div_style = 'background-color: #ccc; height: 100%; left: 0px; position: absolute; top: 0px; width: 100%;';
			echo "&#60;div style='$cover_div_style'>\n";
			$link_div_style = 'background-color: #fff; border: 2px solid #f00; left: 0px; margin: 5px; padding: 3px; ';
			$link_div_style.= 'position: absolute; text-align: center; top: 0px; width: 95%; z-index: 99;';
			echo "&#60;div style='$link_div_style'>\n";
			echo "&#60;p>Please See: &#60;a href='$to'>".htmlspecialchars($location)."&#60;/a>&#60;/p>\n";
			echo "&#60;/div>\n&#60;/div>\n";
		}
		exit(0);
	}</pre>
</div>
<p></code></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2011/04/php-how-to-redirect-server-side-code-301-to-307/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP: Functions to Check if String Starts &amp; Ends With String</title>
		<link>http://www.sematopia.com/2011/04/php-functions-to-check-if-string-starts-ends-with-string/</link>
		<comments>http://www.sematopia.com/2011/04/php-functions-to-check-if-string-starts-ends-with-string/#comments</comments>
		<pubDate>Sat, 23 Apr 2011 18:10:21 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[PHP/MySQL]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/?p=641</guid>
		<description><![CDATA[Another example of functions that aren&#8217;t part of PHP, but should be. Luckily there was a good solution on StackOverflow: Code: function startsWith($haystack,$needle,$case=true) { if($case){return (strcmp(substr($haystack, 0, strlen($needle)),$needle)===0);} return (strcasecmp(substr($haystack, 0, strlen($needle)),$needle)===0); } function endsWith($haystack,$needle,$case=true) { if($case){return (strcmp(substr($haystack, strlen($haystack) - strlen($needle)),$needle)===0);} return (strcasecmp(substr($haystack, strlen($haystack) - strlen($needle)),$needle)===0); }]]></description>
			<content:encoded><![CDATA[<p>Another example of functions that aren&#8217;t part of PHP, but should be.  Luckily there was a good solution on <a href="http://stackoverflow.com/questions/834303/php-startswith-and-endswith-functions">StackOverflow</a>:</p>
<div class='code_parent'>
<div class='code_title'>Code:</div>
<div class='code_child'><code>
<div class='pre_container'>
<pre>function startsWith($haystack,$needle,$case=true) {
    if($case){return (strcmp(substr($haystack, 0, strlen($needle)),$needle)===0);}
    return (strcasecmp(substr($haystack, 0, strlen($needle)),$needle)===0);
}

function endsWith($haystack,$needle,$case=true) {
    if($case){return (strcmp(substr($haystack, strlen($haystack) - strlen($needle)),$needle)===0);}
    return (strcasecmp(substr($haystack, strlen($haystack) - strlen($needle)),$needle)===0);
}</pre>
</div>
<p></code></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2011/04/php-functions-to-check-if-string-starts-ends-with-string/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: Splitting an Array into Multiple Arrays</title>
		<link>http://www.sematopia.com/2011/04/php-splitting-an-array-into-multiple-arrays/</link>
		<comments>http://www.sematopia.com/2011/04/php-splitting-an-array-into-multiple-arrays/#comments</comments>
		<pubDate>Sat, 23 Apr 2011 18:04:56 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[PHP/MySQL]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/?p=639</guid>
		<description><![CDATA[I had an array that I needed to split into multiple arrays, surprised there wasn&#8217;t a built in function for this, here it is: Code: function array_split($array, $pieces=2) { if ($pieces &#60; 2) { return array($array); } $newCount = ceil(count($array)/$pieces); $a = array_slice($array, 0, $newCount); $b = $this->array_split(array_slice($array, $newCount), $pieces-1); return array_merge(array($a),$b); }]]></description>
			<content:encoded><![CDATA[<p>I had an array that I needed to split into multiple arrays, surprised there wasn&#8217;t a built in function for this,  here it is:</p>
<div class='code_parent'>
<div class='code_title'>Code:</div>
<div class='code_child'><code>
<div class='pre_container'>
<pre>function array_split($array, $pieces=2) {
	if ($pieces &#60; 2) {
		return array($array);
	}
	$newCount = ceil(count($array)/$pieces);
	$a = array_slice($array, 0, $newCount);
	$b = $this->array_split(array_slice($array, $newCount), $pieces-1);
	return array_merge(array($a),$b);
}</pre>
</div>
<p></code></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2011/04/php-splitting-an-array-into-multiple-arrays/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Loving Netflix Canada..</title>
		<link>http://www.sematopia.com/2011/04/loving-netflix-canada/</link>
		<comments>http://www.sematopia.com/2011/04/loving-netflix-canada/#comments</comments>
		<pubDate>Fri, 22 Apr 2011 20:16:01 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[Coffee]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/?p=634</guid>
		<description><![CDATA[I&#8217;ve become a big fan of Netflix Canada, I know the inventory isn&#8217;t that great and a lot of the stuff is old, but there are some real gems on there. I go to NewNetflix.ca pretty much daily to see if anything new has come up. Some of my favorites include: Damages (TV Series) The [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve become a big fan of Netflix Canada, I know the inventory isn&#8217;t that great and a lot of the stuff is old, but there are some real gems on there.  I go to <a href="http://newnetflix.ca">NewNetflix.ca</a> pretty much daily to see if anything new has come up.  Some of my favorites include:</p>
<ul>
<li>Damages (TV Series)</li>
<li>The Tudors (TV Series)</li>
<li>Mad Men (TV Series)</li>
<li>King of Kong (Documentary)</li>
<li>.. Too many documentaries to list ..</li>
<li>Top Gear (TV Series)</li>
<li>.. Too many comedy specials to list ..</li>
</ul>
<p>For $8 a month, how can you go wrong?  A warning: be careful your internet bandwidth!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2011/04/loving-netflix-canada/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss><!-- Dynamic Page Served (once) in 0.600 seconds -->

