<?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>Ruud Hein &#187; PHP</title>
	<atom:link href="http://ruudhein.com/topic/php/feed" rel="self" type="application/rss+xml" />
	<link>http://ruudhein.com</link>
	<description></description>
	<lastBuildDate>Fri, 03 Sep 2010 15:49:16 +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>Insert Adsense in Content in Wordpress</title>
		<link>http://ruudhein.com/adsense-in-content</link>
		<comments>http://ruudhein.com/adsense-in-content#comments</comments>
		<pubDate>Thu, 29 Oct 2009 01:12:14 +0000</pubDate>
		<dc:creator>Ruud</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[ads]]></category>
		<category><![CDATA[advertisement]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://ruudhein.com/?p=166</guid>
		<description><![CDATA[While ago I was playing around with inserting Adsense ads not somewhere floating before or after the content but in it.

I hacked programmed  some code together which inserts Adsense after the xth paragraph.
Someone asked for something just like this so I thought I would throw this out there.
When I used it I used it [...]]]></description>
			<content:encoded><![CDATA[<p>While ago I was playing around with inserting Adsense ads not somewhere floating before or after the content but <em>in</em> it.<br />
<span id="more-166"></span><br />
I <del datetime="2009-10-29T01:04:30+00:00">hacked</del> programmed  some code together which inserts Adsense after the x<sup>th</sup> paragraph.</p>
<p>Someone <a href="http://www.cre8asiteforums.com/forums/index.php?showtopic=73590">asked</a> for something just like this so I thought I would throw this out there.</p>
<p>When I used it I used it as a function in functions.php; I prefer to keep most of my stuff there vs. running plugins. I&#8217;m releasing the code in plugin form though.</p>
<p>Usual applies: no warranties, no promises, if it&#8217;s broke it&#8217;s your problem, yadah yadah.</p>
<h2>Instructions</h2>
<p>Download the file below by right-clicking on the link and Save As&#8230;</p>
<p>Open the file and insert your Adsense code in the $adsense variable.</p>
<p>Rename the file from .txt to .php, upload to your plugin folder and activate.</p>
<p>Alternatively you can add the <code>add_filter</code> and <code>function</code> to the functions file in your template folder. If that makes no sense or raises more questions, you&#8217;re better off with the plugin option :)</p>
<h2>Download</h2>
<p><b><a href="http://ruudhein.com/wp-content/uploads/2009/10/incontent.txt">Right-click here &#038; Save As</a></b></p>
]]></content:encoded>
			<wfw:commentRss>http://ruudhein.com/adsense-in-content/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Mind Like Water: PHP&#8217;s Stateless State</title>
		<link>http://ruudhein.com/mind-like-water-phps-stateless-state</link>
		<comments>http://ruudhein.com/mind-like-water-phps-stateless-state#comments</comments>
		<pubDate>Wed, 21 Jun 2006 01:32:42 +0000</pubDate>
		<dc:creator>Ruud</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.ruudhein.com/mind-like-water-phps-stateless-state-2006-06-20</guid>
		<description><![CDATA[In karate there is an image that’s used to define the position of perfect readiness: &#8220;mind like water&#8221;.
&#8211;  David Allen, Getting Things Done
I find web applications, scripts, fascinating. Like water their natural state is stateless. And like water they have no memory at all.
Every time you interact with a web application is its first [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>In karate there is an image that’s used to define the position of perfect readiness: &#8220;mind like water&#8221;.<br />
<cite>&#8211;  David Allen, <a href="http://www.amazon.com/exec/obidos/ASIN/0670899240/thehappycoupl-20">Getting Things Done</a></cite></p></blockquote>
<p>I find web applications, scripts, fascinating. Like water their natural state is stateless. And like water they have no memory at all.</p>
<p>Every time you interact with a web application is its first time ever. Every single time is its first and only time.<br />
<span id="more-15"></span><br />
That is because most web applications are stateless. You start them, they gather whichever files they need, do their thing … and then forget all about it. All. Everything&#8217;s gone.</p>
<p>Imagine that: when you clicked on the link for this page scripts on the backend read configuration files, learned where and how to connect to a database, made that connection, retrieved this article, figured out how this page should look and what information should go on it – and now, by the time you&#8217;re reading this, it has forgotten all about it! The next time someone wants to see this article the script has to go through the same steps because it honestly has no clue, no memory, of what it just has done.</p>
<p>Apply that to your desktop applications for a moment! You click the icon of your favorite application. *Click*. It loads. It loads itself, configuration information, user settings, additional files it uses. Finally, there it is…</p>
<p>Now you click one of its buttons – and it would have to start all over again? No way! Your computer remembers all its &#8220;stuff&#8221; in memory.</p>
<p>But with web applications the answer is &#8220;way!!&#8221;.</p>
<p>Why again? Because a web application, because PHP, is stateless.</p>
<p>How then does a web application remember &#8220;stuff&#8221;? How does it remember its configuration? Its user settings?</p>
<p>Simple: the programmer, the developer, has to make sure that all relevant information is stored <i>and</i> make sure that all relevant information is read back in when the script is called upon. He also has to make sure this happens <b>fast</b>.<br />
Which is where the folly of doing things the &#8220;clever&#8221; way come in. </p>
<h2>The Long Way</h2>
<blockquote><p>It&#8217;s a long way.<br />
It&#8217;s a long, long, long way there,<br />
I&#8217;m gonna keep on tryin&#8217;<br />
<cite>&#8211; The Little River Band, It&#8217;s a long way</cite></p></blockquote>
<p>When you retrieve information from files because you have to remember that information you will want to – nay, <i>need</i> to &#8212;  use that information in and through variables of some type or another.</p>
<p>Storing that information in a scheme, for example in <a href=" http://www.php-tools.net/site.php?file=patConfiguration/overview.xml">XML through patConfiguration</a>, may seem like a neat trick but what do you gain?</p>
<p>The script loads. It loads the class to parse the configuration file. It loads the configuration file itself. It parses the configuration file – and stores the information in variables. If you want you can cache the file so it doesn&#8217;t need to be parsed again.</p>
<p>This, my friend, is not a state of perfect readiness. This doesn&#8217;t achieve the high velocity impact we want our web application to have.</p>
<p>It doesn&#8217;t help that an additional class has to be compiled each time the script runs. It doesn&#8217;t help that a non-native format has to be translated into something PHP understands.</p>
<p>What does help is squashing the urge to reinvent the wheel. Go with the flow and use PHP&#8217;s own built-in functions instead. Built-in, that means; pre-compiled, highly optimized. Fast. Effective. <a href=" http://www.php.net/manual/en/function.parse-ini-file.php">parse_ini_file</a>, for example.</p>
<p>Not enough options, not enough depth? Combine it with <a href=" http://www.php.net/manual/en/function.array-merge.php">array_merge</a> or <a href=" http://www.php.net/manual/en/function.array-merge-recursive.php">array_merge_recursive</a>.</p>
<p>There are many ways to be clever, very clever indeed, in PHP but The Long Way hardly ever is.</p>
<p>Make your code flow and follow the natural, intuitive path of least resistance.</p>
]]></content:encoded>
			<wfw:commentRss>http://ruudhein.com/mind-like-water-phps-stateless-state/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
