<?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>Steve Taylor &#187; miscellaneous</title>
	<atom:link href="http://sltaylor.co.uk/blog/category/miscellaneous/feed/" rel="self" type="application/rss+xml" />
	<link>http://sltaylor.co.uk</link>
	<description>Freelance WordPress developer in London - XHTML, CSS &#38; design</description>
	<lastBuildDate>Wed, 25 Apr 2012 20:43:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Rushkoff on branding</title>
		<link>http://sltaylor.co.uk/blog/rushkoff-on-branding/</link>
		<comments>http://sltaylor.co.uk/blog/rushkoff-on-branding/#comments</comments>
		<pubDate>Sat, 15 Jan 2011 02:07:07 +0000</pubDate>
		<dc:creator>Steve Taylor</dc:creator>
				<category><![CDATA[miscellaneous]]></category>

		<guid isPermaLink="false">http://sltaylor.co.uk/?p=554</guid>
		<description><![CDATA[I usually keep posting here strictly to the techie nitty-gritty. But I thought that aside from this talk by Douglas Rushkoff directly addressing important issues around commerce and the internet, it&#8217;s also just a fundamentally important perspective. While I found Doug&#8217;s recent books Life Inc. and Program or Be Programmed to be well-written, sound advice, [...]]]></description>
			<content:encoded><![CDATA[<p>I usually keep posting here strictly to the techie nitty-gritty. But I thought that aside from this talk by Douglas Rushkoff directly addressing important issues around commerce and the internet, it&#8217;s also just a fundamentally important perspective.<br />
<span id="more-554"></span></p>
<p>While I found Doug&#8217;s recent books <a href="http://www.rushkoff.com/life-inc/"><i>Life Inc.</i></a> and <a href="http://www.orbooks.com/our-books/program/"><i>Program or Be Programmed</i></a> to be well-written, sound advice, none of it comes close to this closing keynote talk he gave at a social media conference. He says:</p>
<blockquote><p>I got really tired of listening to brand managers talk about their &#8220;Twitter strategies,&#8221; and by the time my closing keynote came around, it felt like I had watched the corporatization the net recapitulated over the course of the afternoon.</p></blockquote>
<p>Please watch this if you&#8217;ve not come across Douglas&#8217; recent ideas. (And please excuse the autoplay!)</p>
<p><script src="http://player.ooyala.com/player.js?deepLinkEmbedCode=VmN2xyMTo5V4kbLAo7vMJdcRMrfiOzQP%2CZkbG9yMTruVXdsITsBG748xOfGM4HLf8%2C90YnVyMToXwJ7Mhi24k2if1Za8h-E7KV&#038;autoplay=1&#038;embedCode=VmN2xyMTo5V4kbLAo7vMJdcRMrfiOzQP&#038;browserPlacement=right489px"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://sltaylor.co.uk/blog/rushkoff-on-branding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Formatting a string with optional elements</title>
		<link>http://sltaylor.co.uk/blog/formatting-a-string-with-optional-elements/</link>
		<comments>http://sltaylor.co.uk/blog/formatting-a-string-with-optional-elements/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 15:30:17 +0000</pubDate>
		<dc:creator>Steve Taylor</dc:creator>
				<category><![CDATA[miscellaneous]]></category>

		<guid isPermaLink="false">http://sltaylor.co.uk/?p=281</guid>
		<description><![CDATA[I&#8217;ve often found myself writing little bits of code to format strings with optional elements. The classic example is outputting the company someone works for, together with their position in that company&#8212;if the position is given. The format if both are given is: [position], [company] If the position isn&#8217;t given, you just output the company. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve often found myself writing little bits of code to format strings with optional elements. The classic example is outputting the company someone works for, together with their position in that company&#8212;if the position is given. The format if both are given is:</p>
<p><i>[position], [company]</i></p>
<p>If the position isn&#8217;t given, you just output the company. Without, obviously, the comma. It&#8217;s a trivial thing to code, but on a current project I&#8217;ve found myself doing it in several different places. Of course, this suggests there should be a function written for it.</p>
<p>Ideally the function should be able to cope with any number of optional elements. With PHP&#8217;s <a href="http://www.php.net/manual/en/function.func-get-args.php"><code>func_get_args()</code></a>, it&#8217;s easy:</p>
<pre name="code" class="php">function formatOptionalText( $delimiter ) {
	$elements = array_slice( func_get_args(), 1 );
	$text = "";
	$i = 0;
	foreach ( $elements as $element ) {
		if ( trim ( $element ) ) {
			if ( $i &#038;&#038; $text ) $text .= $delimiter;
			$text .= $element;
		}
		$i++;
	}
	return $text;
}</pre>
<p>Note that you have to pass a delimiter first, and you should include a space if necessary (e.g. <code>", "</code>). After that, pass any number of strings and they&#8217;ll be output without gaps.</p>
]]></content:encoded>
			<wfw:commentRss>http://sltaylor.co.uk/blog/formatting-a-string-with-optional-elements/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Welcome</title>
		<link>http://sltaylor.co.uk/blog/welcome/</link>
		<comments>http://sltaylor.co.uk/blog/welcome/#comments</comments>
		<pubDate>Tue, 16 Jan 2007 13:18:12 +0000</pubDate>
		<dc:creator>Steve Taylor</dc:creator>
				<category><![CDATA[miscellaneous]]></category>

		<guid isPermaLink="false">http://sltaylor.co.uk/?p=4</guid>
		<description><![CDATA[This is my work blog, which I&#8217;ll mostly be using (initially at least) to document various tricks, tips, workarounds, hacks and other sundry discoveries I make doing web work. I don&#8217;t expect it to be too busy. But when I solve a particularly tricky coding problem, or discover something tremendously useful, I find it a [...]]]></description>
			<content:encoded><![CDATA[<p>This is my work blog, which I&#8217;ll mostly be using (initially at least) to document various tricks, tips, workarounds, hacks and other sundry discoveries I make doing web work.</p>
<p>I don&#8217;t expect it to be too busy. But when I solve a particularly tricky coding problem, or discover something tremendously useful, I find it a good practice to document it on the webâ€”both for my own future reference and for other poor souls struggling with the same thing.</p>
<p>Comments will be closed because I don&#8217;t expect much here apart from spam! There&#8217;s always the <a href="/contact/">contact form</a> if you want to respond to something&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://sltaylor.co.uk/blog/welcome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  sltaylor.co.uk/blog/category/miscellaneous/feed/ ) in 0.24296 seconds, on May 17th, 2012 at 1:27 pm UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on May 17th, 2012 at 2:27 pm UTC -->
