<?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>Joseph Piché &#187; php</title>
	<atom:link href="http://jpiche.com/tags/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://jpiche.com</link>
	<description>Web development professional with expertise in PHP, MySQL query optimization, Ajax, and XHTML</description>
	<lastBuildDate>Tue, 20 Jul 2010 04:04:51 +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>Getting Paid to Write AI</title>
		<link>http://jpiche.com/2010/06/getting-paid-to-write-ai/</link>
		<comments>http://jpiche.com/2010/06/getting-paid-to-write-ai/#comments</comments>
		<pubDate>Sat, 05 Jun 2010 01:01:17 +0000</pubDate>
		<dc:creator>Joseph Piché</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[ai]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://jpiche.com/?p=453</guid>
		<description><![CDATA[One of the best parts of my previous job&#8212;and also the part that kept me going for so long&#8212;is that I had the chance to work on a variety of projects, in many cases for completely different business ventures. One week I had been privileged with the task of writing a small program which ended [...]]]></description>
			<content:encoded><![CDATA[<p>One of the best parts of my previous job&mdash;and also the part that kept me going for so long&mdash;is that I had the chance to work on a variety of projects, in many cases for completely different business ventures. One week I had been privileged with the task of writing a small program which ended up being semi-intelligent (of course artificially, thus AI). As it so happens I also seemed to have stretched PHP to its limits.</p>
<p>When originally typing up this post, I kept the details to a minimum, but now that I&#8217;ve moved on I can freely discuss it. This program&mdash;code-named &ldquo;twitterbot&rdquo;&mdash;was tasked with searching Twitter for tweets with certain keywords within a radius of a location, like for tweets containing &#8220;hungry&#8221; within 30 miles of Minneapolis, and <a href="http://help.twitter.com/entries/13920-frequently-asked-questions#replies">@reply</a> to that person within an hour of their tweet about &#8230; a website I probably shouldn&#8217;t name. However this becomes tricky since Twitter is really good at detecting spam, and a lot of Twitter users really hate spam (like me). To get around it, I made a bunch of twitter accounts using anonymous email addresses, created bios, set profile pictures, and set color schemes, all to make them look like real people.</p>
<p>However, just because a Twitter account has a profile picture, it does not mean it will be treated like a human: the account has to have realistic-looking posts. No problem. First I set a limit to the number of posts an account can make per day, make sure all the posts are within normal waking hours (like 6am to 10pm), have 30-50% of the tweets be the spamming tweets, and the rest be copies of tweets from a different search that none of the accounts will be replying to. Then since the spam tweets themselves are also randomized, the sum of it all equals twitter accounts that even people are sometimes not able to recognize that the account is a bot.
<p>For the technical, I wrote this program in PHP both because we had thousands and thousands of lines of legacy code in other programs that we didn&#8217;t want to touch, and second because it is extremely simple and quick to code and deploy. With a semi-AI bot though, the scene changes and suddenly both opportunities and concerns that weren&#8217;t there before suddenly are. Example opportunity: <a href="http://www.php.net/manual/en/function.pcntl-fork.php">pcntl-fork</a> becomes available. Example concern: the PHP program will probably be running as a daemon on a server, use up all your RAM and explode.</p>
<p>In the end, the bot ran strong for about 2 weeks before management changed their minds and had it shut down&mdash;spamming people does not make for good press. I felt terrible having to write such a program; I really don&#8217;t like spam, let alone being the one doing the spamming. But since then I&#8217;ve moved on to a position at a <a href="http://http://www.irishtitan.com/" title="Irish Titan">different company</a> and write ethical code now.</p>
]]></content:encoded>
			<wfw:commentRss>http://jpiche.com/2010/06/getting-paid-to-write-ai/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Conversation About PHP</title>
		<link>http://jpiche.com/2009/12/conversation-about-php/</link>
		<comments>http://jpiche.com/2009/12/conversation-about-php/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 02:57:26 +0000</pubDate>
		<dc:creator>Joseph Piché</dc:creator>
				<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[quote]]></category>

		<guid isPermaLink="false">http://jpiche.com/?p=375</guid>
		<description><![CDATA[I wrote down this conversation I had with a co-worker the other day. I just found it, and thought I would share it.
me: how do i tell php to be smarter?co-worker: you have to enable that in your php.inime: oh of courseco-worker: but you have to make sure php was compiled with the &#8211;smart flagme: [...]]]></description>
			<content:encoded><![CDATA[<p>I wrote down this conversation I had with a co-worker the other day. I just found it, and thought I would share it.</p>
<blockquote><p>me: how do i tell php to be smarter?<br/>co-worker: you have to enable that in your php.ini<br/>me: oh of course<br/>co-worker: but you have to make sure php was compiled with the &#8211;smart flag<br/>me: dang</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://jpiche.com/2009/12/conversation-about-php/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>If it&#8217;s good enough for Google</title>
		<link>http://jpiche.com/2009/04/if-its-good-enough-for-google/</link>
		<comments>http://jpiche.com/2009/04/if-its-good-enough-for-google/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 15:49:49 +0000</pubDate>
		<dc:creator>Joseph Piché</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[languages]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://jpiche.com/?p=42</guid>
		<description><![CDATA[A few weeks ago, I realized that in order to expand my possibilities in the programming world, I need to master another language&#8212;one not built only for the web. PHP is a good language for the specific task of web programming, but its usefulness ends there. I do know that there are projects that aim [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, I realized that in order to expand my possibilities in the programming world, I need to master another language&mdash;one not built only for the web. PHP is a good language for the specific task of web programming, but its usefulness ends there. I do know that there are projects that aim to expand what PHP is capable of: <a href="http://gtk.php.net/">PHP-GTK</a>, <a href="http://pear.php.net/">PEAR</a>, <a href="http://pecl.php.net/">PELC</a>. But these can only do so much. I need a language that I can do cross-platform programming of desktop applications, yet be flexible and is already extensively used (so that it&#8217;s worth my time to learn it).</p>
<p>After assessing my options, I&#8217;ve concluded <a href="http://python.org/">Python</a> is the language I need to master. On top of fulfilling all my requirements, Google uses it, and if it&#8217;s good enough for Google to use for applications that millions of people rely on every day, then it&#8217;s good enough for me. Besides that, it makes a great calculator in Windows.</p>
<p>I&#8217;ve looked at Python before, and it didn&#8217;t look too amazing. But now that I live in a different world and have a new perspective, Python is awesome. Some people frown on the forced indentation, lack of end-line symbols, and non-dollar-sign-prepended variables. After writing a few &#8220;hello world&#8221; programs, I believe these are not failures but perks. If you are among a team of people writing a massive application, these qualities might keep you on this side of sanity. However, the &#8220;batteries-included&#8221; philosophy of Python and its hyper-extendability really push it over the top.</p>
]]></content:encoded>
			<wfw:commentRss>http://jpiche.com/2009/04/if-its-good-enough-for-google/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Learning about garbage</title>
		<link>http://jpiche.com/2009/04/learning-about-garbage/</link>
		<comments>http://jpiche.com/2009/04/learning-about-garbage/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 15:57:26 +0000</pubDate>
		<dc:creator>Joseph Piché</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://jpiche.com/?p=22</guid>
		<description><![CDATA[After switching careers to being a full-time programmer, I have started to see and realize aspects of programming that truly amaze me. Before starting this job, I worked on PHP and Java what I though was a considerable amount. I was wrong, I only scratched the surface with what these languages can do and I [...]]]></description>
			<content:encoded><![CDATA[<p>After switching careers to being a full-time programmer, I have started to see and realize aspects of programming that truly amaze me. Before starting this job, I worked on PHP and Java what I though was a considerable amount. I was wrong, I only scratched the surface with what these languages can do and I had no idea of their limits.</p>
<p>The real-life example from this week is memory management in PHP. That&#8217;s right, I have a html page generated by&mdash;what I (and confirmed by my project leader) think is&mdash;efficient PHP code which I had to write in memory management code for. I was confused out of my mind for a while, since PHP has built-in garbage collection. After looking at my code further and analyzing what was going on, I started to understand what garbage collection is and what its limits are. Of course though, just because I understand what is going on doesn&#8217;t mean that I actually coding memory management is easy. Calling <code>unset()</code> at the right time is key.</p>
]]></content:encoded>
			<wfw:commentRss>http://jpiche.com/2009/04/learning-about-garbage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
