<?xml version="1.0" encoding="utf-8"?>
<!-- generator="wordpress/2.3.1" -->
<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/"
	>

<channel>
	<title>Kwebble &#187; Programming</title>
	<link>http://kwebble.com/blog</link>
	<description></description>
	<pubDate>Thu, 26 Jun 2008 21:40:59 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
	<language>en</language>
			<item>
		<title>PHP tip: omit ?&#62; from PHP only files</title>
		<link>http://kwebble.com/blog/2008_05_28/php-tip-omit-from-php-only-files</link>
		<comments>http://kwebble.com/blog/2008_05_28/php-tip-omit-from-php-only-files#comments</comments>
		<pubDate>Wed, 28 May 2008 20:15:14 +0000</pubDate>
		<dc:creator>Rob Schlüter</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://kwebble.com/blog/2008_05_28/php-tip-omit-from-php-only-files</guid>
		<description><![CDATA[Great tip from the <a href="http://framework.zend.com/manual/en/coding-standard.php-file-formatting.html#coding-standard.php-file-formatting.general">Zend programmer's Reference Guide</a>: <q cite="http://framework.zend.com/manual/en/coding-standard.php-file-formatting.html#coding-standard.php-file-formatting.general">For files that contain only PHP code, the closing tag ("?>") is never permitted.</q>.]]></description>
			<content:encoded><![CDATA[<p>Great tip from the <a href="http://framework.zend.com/manual/en/coding-standard.php-file-formatting.html#coding-standard.php-file-formatting.general">Zend programmer&#8217;s Reference Guide</a>: <q cite="http://framework.zend.com/manual/en/coding-standard.php-file-formatting.html#coding-standard.php-file-formatting.general">For files that contain only PHP code, the closing tag (&#8221;?>&#8221;) is never permitted.</q>.</p>
<p>This is useful as it prevents whitespace after the closing <code>?&gt;</code> from being accidentally added to the output. I always check PHP files for whitespace manually, but this technique solves that problem automatically. Great!</p>
]]></content:encoded>
			<wfw:commentRss>http://kwebble.com/blog/2008_05_28/php-tip-omit-from-php-only-files/feed</wfw:commentRss>
		</item>
		<item>
		<title>MySQL STRICT_TRANS_TABLES mode and truncated text values</title>
		<link>http://kwebble.com/blog/2008_04_20/mysql-strict_trans_tables-mode-and-truncated-text-values</link>
		<comments>http://kwebble.com/blog/2008_04_20/mysql-strict_trans_tables-mode-and-truncated-text-values#comments</comments>
		<pubDate>Sun, 20 Apr 2008 18:59:53 +0000</pubDate>
		<dc:creator>Rob Schlüter</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[mysql]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[test]]></category>

		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://kwebble.com/blog/2008_04_20/mysql-strict_trans_tables-mode-and-truncated-text-values</guid>
		<description><![CDATA[I just upgraded Apache, PHP and MySQL to their current versions on my development system. After that a unit test of one of my PHP classes failed on inserting a row in a MySQL table. The test inserts text with a greater length than the maximum column length of a VARCHAR column. 
This test fails [...]]]></description>
			<content:encoded><![CDATA[<p>I just upgraded Apache, PHP and MySQL to their current versions on my development system. After that a unit test of one of my PHP classes failed on inserting a row in a MySQL table. The test inserts text with a greater length than the maximum column length of a <code>VARCHAR</code> column. </p>
<p>This test fails because the new server runs with <code>STRICT_TRANS_TABLES</code> mode. It means that a inserted value must be equal to the stored value or the statement fails. Without the mode setting the inserted value is truncated to the column&#8217;s maximum length.</p>
]]></content:encoded>
			<wfw:commentRss>http://kwebble.com/blog/2008_04_20/mysql-strict_trans_tables-mode-and-truncated-text-values/feed</wfw:commentRss>
		</item>
		<item>
		<title>COBOL example</title>
		<link>http://kwebble.com/blog/2007_12_31/cobol-example</link>
		<comments>http://kwebble.com/blog/2007_12_31/cobol-example#comments</comments>
		<pubDate>Mon, 31 Dec 2007 13:38:55 +0000</pubDate>
		<dc:creator>Rob Schlüter</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[cobol]]></category>

		<guid isPermaLink="false">http://kwebble.com/blog/2007_12_31/cobol-example</guid>
		<description><![CDATA[In my comment on the post <a href="http://www.iseries-cobol.com/blog/2007/12/12/logical-flow-of-an-interactive-program/#comment-2662">Logical flow of an Interactive program</a> the structure of the COBOL source code got lost, here is how it's supposed to look:]]></description>
			<content:encoded><![CDATA[<p>In my comment on the post <a href="http://www.iseries-cobol.com/blog/2007/12/12/logical-flow-of-an-interactive-program/#comment-2662">Logical flow of an Interactive program</a> the structure of the COBOL source code got lost, here is how it&#8217;s supposed to look:</p>
<pre>       MainParagraph.
           perform InitProgram
           perform ProcessScreen
             until EndOfProgram
           perform ExitProgram

           goback
           .

       InitProgram.
           set ContinueProgram             to true
           .

       ExitProgram.
           continue
           .

       ProcessScreen.
           perform ShowScreen

           evaluate true
             when EnterKey
               perform CheckInput

             when CF03
               set EndOfProgram            to true
               set linkF03Used             to true

             when CF08
               perform CheckInput

               if NoErrors
                  perform WriteData
               end-if

               if NoErrors
                  set EndOfProgram         to true
               end-if

             when CF12
                set EndOfProgram           to true
                set linkF12Used            to true
           end-evaluate
           .
</pre>
]]></content:encoded>
			<wfw:commentRss>http://kwebble.com/blog/2007_12_31/cobol-example/feed</wfw:commentRss>
		</item>
		<item>
		<title>Archives for a category WordPress plugin</title>
		<link>http://kwebble.com/blog/2007_08_15/archives_for_a_category</link>
		<comments>http://kwebble.com/blog/2007_08_15/archives_for_a_category#comments</comments>
		<pubDate>Wed, 15 Aug 2007 21:05:41 +0000</pubDate>
		<dc:creator>Rob Schlüter</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://kwebble.com/blog/2007_08_15/archives_for_a_category</guid>
		<description><![CDATA[For the new version of this website I wanted to show a list of monthly archives, limited to posts of a specific category. The software used to run this website is WordPress but the <code><a href="http://codex.wordpress.org/Template_Tags/wp_get_archives">wp_get_archives()</a></code> function, to get a list of archives, does not have the ability to filter on category. So I created the 'Archives for a category' plugin that enhances this function to show archive links for a specific category.]]></description>
			<content:encoded><![CDATA[<p>For the new version of this website I wanted to show a list of monthly archives, limited to posts of a specific category. The software used to run this website is WordPress but the <code><a href="http://codex.wordpress.org/Template_Tags/wp_get_archives">wp_get_archives()</a></code> function, to get a list of archives, does not have the ability to filter on category. So I created the &#8216;Archives for a category&#8217; plugin that enhances this function to show archive links for a specific category.</p>
<h3>Installation</h3>
<ol>
<li><a href="http://kwebble.com/download/wordpress/plugin/kwebble_archives_by_cat.zip">Download the plugin zip file</a> and unzip the file in a temporary directory.</li>
<li>Put the <code>kwebble_archives_by_cat.php</code> file in your WordPress plugin directory:<br />
<code>&lt;your wordpress dir&gt;/wp-content/plugins</code></li>
<li>Activate the plugin &#8216;Archives for a category&#8217; on the Plugin Management page of the WordPress administration panel.</li>
<li>Optionally disable the canonical URLs from the menu Options | Kwebble.<br />
A WordPress feature added in version 2.3, called canonical URLs, redirects browsers on certain URLs. This also happens with the URLs for the archives with a cat parameter. This causes the archive pages to contain posts which do not belong to the selected period.</p>
<p>To solve this problem the plugin can disable canonical URLs. This uses the technique used in the <a href="http://txfx.net/files/wordpress/disable-canonical-redirects.phps">Disable Canonical URL Redirection plugin</a> Mark Jaquith made. So if you are already using that plugin you don&#8217;t need to change the setting for this plugin.<br />
To disable canonical URLs go to the administration section of your blog, choose the Options tab and then the Kwebble subtab. On that page you will find a checkbox to disable canonical URLs.</li>
</ol>
<h3>Usage</h3>
<p>After installing and activating the plugin the <code>wp_get_archives()</code> function accepts a  &#8216;cat&#8217; parameter. Its value must be one or more category ID&#8217;s, separated by comma&#8217;s, of the categories to include in building the list of archives.</p>
<p>For example, to show the default monthly list of archives for category 1 put this in a template:</p>
<pre>
&lt;?php wp_get_archives('cat=1'); ?&gt;
</pre>
<p>The same list, but with posts from categories 1 and 3:</p>
<pre>
&lt;?php wp_get_archives('cat=1,3'); ?&gt;
</pre>
<p>To create a list of archives for category 1 as a dropdown box use:</p>
<pre>
&lt;?php wp_get_archives('format=option&amp;cat=1'); ?&gt;
</pre>
<p>For a complete description of all parameters see the documentation of <code><a href="http://codex.wordpress.org/Template_Tags/wp_get_archives">wp_get_archives()</a></code>.</p>
<p>The last thing is to make sure the template used to show each archive displays posts from the selected category. I&#8217;m using category specific templates on this site, like <code>category-id.php</code> where id is the ID of the category to display.<br />
You can use other templates in the <a href="http://codex.wordpress.org/Templates_Hierarchy">template hierarchy</a>, but make sure the template shows items of that category.</p>
<h3>Limitations</h3>
<p>This plugin does not work for weekly archives. The list with archive links is correct, but the links themselves do not include the category. So when used, WordPress will not filter the resulting page on the category. The technical reason is that WordPress does not apply filters when the links for weekly archives are generated, so the plugin can&#8217;t change them. Perhaps in a next version of WordPress…</p>
<p>This plug-in was developed and tested to work correctly with WordPress versions 2.2.1 and 2.3.1. It probably also works with 2.3.2.</p>
<h3>Older versions</h3>
<h4>Version 1.2</h4>
<p>23-11-2007 - Added support for WordPress 2.3.1. <a href="http://kwebble.com/download/wordpress/plugin/kwebble_archives_by_cat_1_2.zip">Download</a>.</p>
<h4>Version 1.0</h4>
<p>15-08-2007 - Initial version, works with WordPress 2.2.1. <a href="http://kwebble.com/download/wordpress/plugin/kwebble_archives_by_cat_1_0.zip">Download</a>.</p>
<h3>Copyright</h3>
<p>Copyright 2007, 2008 Rob Schlüter. All rights reserved.</p>
<h3>Licensing terms</h3>
<ul>
<li>You may use, change and redistribute this software provided the copyright notice above is included.</li>
<li>This software is provided without warranty, you use it at your own risk.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://kwebble.com/blog/2007_08_15/archives_for_a_category/feed</wfw:commentRss>
		</item>
		<item>
		<title>Digg enhancer greasemonkey script</title>
		<link>http://kwebble.com/blog/2006_04_23/digg-enhancer-greasemonkey-script</link>
		<comments>http://kwebble.com/blog/2006_04_23/digg-enhancer-greasemonkey-script#comments</comments>
		<pubDate>Sun, 23 Apr 2006 18:25:52 +0000</pubDate>
		<dc:creator>Rob Schlüter</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://kwebble.com/?p=452</guid>
		<description><![CDATA[Everytime I looked at Digg it bothered me that the boxes with the number of diggs in front of each news item overlaps with a the start of the text.
So I made a litte Greasemonkey script that move the text to the right. And at the same time it removes the upper limit of the [...]]]></description>
			<content:encoded><![CDATA[<p>Everytime I looked at <a href="http://digg.com/">Digg</a> it bothered me that the boxes with the number of diggs in front of each news item overlaps with a the start of the text.</p>
<p>So I made a litte Greasemonkey script that move the text to the right. And at the same time it removes the upper limit of the page width, so there&#8217;s less space wasted on the sides of the pages.</p>
<h3>Installation</h3>
<ol>
<li>This script requires <a href="http://greasemonkey.mozdev.org/">Greasemonkey</a>, so if you don&#8217;t have that installed do that first.</li>
<li><a href="http://kwebble.com/software/greasemonkey/digg_enhancer.user.js">Install Digg enhancer</a>.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://kwebble.com/blog/2006_04_23/digg-enhancer-greasemonkey-script/feed</wfw:commentRss>
		</item>
		<item>
		<title>Dynamic Drive</title>
		<link>http://kwebble.com/blog/2005_10_12/dynamic-drive</link>
		<comments>http://kwebble.com/blog/2005_10_12/dynamic-drive#comments</comments>
		<pubDate>Wed, 12 Oct 2005 09:06:20 +0000</pubDate>
		<dc:creator>Rob Schlüter</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://kwebble.com/?p=410</guid>
		<description><![CDATA[Dynamic Drive is a collection of cross-browser compatible DHTML &#38; Javascripts in several categories like Dynamic Content, Form Effects, Games  and Menus &#38; Navigation. The scripts are free for personal and commercial use.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.dynamicdrive.com/">Dynamic Drive</a> is a collection of cross-browser compatible DHTML &amp; Javascripts in several categories like Dynamic Content, Form Effects, Games  and Menus &amp; Navigation. The scripts are free for personal and commercial use.</p>
]]></content:encoded>
			<wfw:commentRss>http://kwebble.com/blog/2005_10_12/dynamic-drive/feed</wfw:commentRss>
		</item>
		<item>
		<title>U3</title>
		<link>http://kwebble.com/blog/2005_10_11/u3</link>
		<comments>http://kwebble.com/blog/2005_10_11/u3#comments</comments>
		<pubDate>Tue, 11 Oct 2005 21:42:42 +0000</pubDate>
		<dc:creator>Rob Schlüter</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://kwebble.com/?p=407</guid>
		<description><![CDATA[U3 lets you carry programs and personal preferences, launch software, and access all of your own data on any Windows XP or Windows 2000 PC from a USB stick.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.u3.com/default.aspx">U3</a> lets you carry programs and personal preferences, launch software, and access all of your own data on any Windows XP or Windows 2000 PC from a USB stick.</p>
]]></content:encoded>
			<wfw:commentRss>http://kwebble.com/blog/2005_10_11/u3/feed</wfw:commentRss>
		</item>
		<item>
		<title>Harnessing the BackPack API - Part I</title>
		<link>http://kwebble.com/blog/2005_10_08/harnessing-the-backpack-api-part-i</link>
		<comments>http://kwebble.com/blog/2005_10_08/harnessing-the-backpack-api-part-i#comments</comments>
		<pubDate>Sat, 08 Oct 2005 12:47:49 +0000</pubDate>
		<dc:creator>Rob Schlüter</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://kwebble.com/?p=402</guid>
		<description><![CDATA[The article Harnessing the BackPack API takes a look at the BackPack API and puts it to use with C#. This first article covers how to set up a free BackPack account, grab the XML Token needed, and delve into connecting to the server to send commands and data back and forth. We&#8217;ll do this [...]]]></description>
			<content:encoded><![CDATA[<p>The article <a href="http://msdn.microsoft.com/coding4fun/xmlforfun/BackPackAPI_PartI/default.aspx">Harnessing the BackPack API</a> takes a look at the BackPack API and puts it to use with C#. This first article covers how to set up a free BackPack account, grab the XML Token needed, and delve into connecting to the server to send commands and data back and forth. We&#8217;ll do this by building a rough Windows Forms application that models all of the available operations for just the BackPack page object.</p>
<p>The next two articles will flesh out the rest of the API, improve the UI for our application, and then play around with XML serialization and other goodness to make BackPack portable.</p>
]]></content:encoded>
			<wfw:commentRss>http://kwebble.com/blog/2005_10_08/harnessing-the-backpack-api-part-i/feed</wfw:commentRss>
		</item>
		<item>
		<title>Putting the geo position in a Wordpress RSS feed</title>
		<link>http://kwebble.com/blog/2005_10_02/putting-the-geo-position-in-a-wordpress-rss-feed</link>
		<comments>http://kwebble.com/blog/2005_10_02/putting-the-geo-position-in-a-wordpress-rss-feed#comments</comments>
		<pubDate>Sun, 02 Oct 2005 15:06:07 +0000</pubDate>
		<dc:creator>Rob Schlüter</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://kwebble.com/?p=322</guid>
		<description><![CDATA[The last few days I&#8217;ve been looking at adding geographic information to articles on this website. For WordPress, the software this site is running on, I found the Geo plugin with which you can store geographic coordinates for an article. The plugin adds this information to the page of each article, but not in the [...]]]></description>
			<content:encoded><![CDATA[<p>The last few days I&#8217;ve been looking at adding geographic information to articles on this website. For <a href="http://wordpress.org/">WordPress</a>, the software this site is running on, I found the <a href="http://dev.wp-plugins.org/wiki/GeoPlugin">Geo plugin</a> with which you can store geographic coordinates for an article. The plugin adds this information to the page of each article, but not in the RSS feed, so I made a function that does this, though not automatically.  </p>
<p>To use it, start with adding the following function to the Geo plugin. I&#8217;m using version 1.0, don&#8217;t know if it works in earlier versions: </p>
<pre>function get_the_rss_geotags()
/**
* Returns the tags with geo information for inclusion in RSS 2.0 feeds.
*
* Include a call to this function inside the &lt;item&gt; tag to
* add tags with geo information if available.
* To keep the feed valid add these namespace declarations to the &lt;rss&gt; tag:
*    xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
*    xmlns:icbm="http://postneo.com/icbm"
*    xmlns:geourl="http://geourl.org/rss/module/"
*/
{
	global $wp_query;

	if(!get_settings('use_geo_positions')) return;

	list($lat, $lon) = split(',', get_post_meta($wp_query-&gt;post-&gt;ID, '_geo_location', true));
	if ($lat == '' || $lon == '') {
		if (get_settings('use_default_geourl')){
			// send the default here
			$lat = get_settings('default_geourl_lat');
			$lon = get_settings('default_geourl_lon');
		}
	}
	if ($lat != '' &#038;&#038; $lon != '') {
		echo "&lt;geo :lat&gt;$lat&lt;/geo&gt;&lt;geo :long&gt;$lon&lt;/geo&gt;\n"
				. "&lt;icbm :latitude&gt;$lat&lt;/icbm&gt;&lt;icbm :longitude&gt;$lon&lt;/icbm&gt;\n"
				. "&lt;geourl :longitude&gt;$lon&lt;/geourl&gt;&lt;geourl :latitude&gt;$lat&lt;/geourl&gt;\n";
	}
}
</pre>
<p>Now you can add this line to wp-rss2.php, somewhere inside the &lt;item&gt; tag:</p>
<pre>&lt;?php echo get_the_rss_geotags(); ?&gt;</pre>
<p>Also remember to add these namespace declarations to the rss tag:</p>
<pre>&lt;rss version=&#8221;2.0&#8221;
<em>	xmlns:geo=&#8221;http://www.w3.org/2003/01/geo/wgs84_pos#&#8221;
	xmlns:icbm=&#8221;http://postneo.com/icbm&#8221;
	xmlns:geourl=&#8221;http://geourl.org/rss/module/&#8221;</em>&gt;
</pre>
<p>That&#8217;s it.</p>
]]></content:encoded>
			<wfw:commentRss>http://kwebble.com/blog/2005_10_02/putting-the-geo-position-in-a-wordpress-rss-feed/feed</wfw:commentRss>
		</item>
		<item>
		<title>PHP, caching and the flickr api</title>
		<link>http://kwebble.com/blog/2005_09_29/php-caching-and-the-flickr-api</link>
		<comments>http://kwebble.com/blog/2005_09_29/php-caching-and-the-flickr-api#comments</comments>
		<pubDate>Thu, 29 Sep 2005 21:33:16 +0000</pubDate>
		<dc:creator>Rob Schlüter</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://kwebble.com/?p=382</guid>
		<description><![CDATA[PHP, caching and the Flickr api is a simple example using PHP to access and cache requests to the Flickr API. This is the method used to create the flickr world map.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.allthegoodness.com/projects/map/flickr/flickrapi.php">PHP, caching and the Flickr api</a> is a simple example using PHP to access and cache requests to the Flickr API. This is the method used to create the <a href="http://www.allthegoodness.com/projects/map/flickr/">flickr world map</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://kwebble.com/blog/2005_09_29/php-caching-and-the-flickr-api/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
