<?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>Pontus Östlund &#187; Pike</title>
	<atom:link href="http://www.poppa.se/blog/tag/pike/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.poppa.se/blog</link>
	<description>My blog about web development and such</description>
	<lastBuildDate>Mon, 16 Jan 2012 00:38:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Roxen Application Launcher 1.0.3</title>
		<link>http://www.poppa.se/blog/roxen-application-launcher-1-0-3/</link>
		<comments>http://www.poppa.se/blog/roxen-application-launcher-1-0-3/#comments</comments>
		<pubDate>Thu, 23 Sep 2010 23:35:49 +0000</pubDate>
		<dc:creator>Pontus</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Roxen]]></category>
		<category><![CDATA[Gnome]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[Pike]]></category>
		<category><![CDATA[RAL]]></category>
		<category><![CDATA[Vala]]></category>

		<guid isPermaLink="false">http://www.poppa.se/blog/?p=473</guid>
		<description><![CDATA[
In this release of Roxen Application Launcher (come again?) for Linux I&#8217;ve gotten rid of a few dependencies, namely: gconf, libgee and libgnome. The reason I dumped gconf and libgnome was to make it easier to install in KDE. I&#8217;ve verified it installs in KDE, although I noticed the translation doesn&#8217;t work and the Roxen [...]]]></description>
			<content:encoded><![CDATA[<p><a href="/blog/data/images/ral-103.png" class="no-file"><img src="/blog/data/images/ral-103.png/680" alt="Screenshot of Roxen Application Launcher" /></a></p>
<p>In this release of <a href="http://www.roxen.com">Roxen</a> Application Launcher (<a href="/blog/stuff/#roxen-applauncher">come again?</a>) for <a href="http://www.linux.com/">Linux</a> I&#8217;ve gotten rid of a few dependencies, namely: gconf, libgee and libgnome. The reason I dumped gconf and libgnome was to make it easier to install in KDE. I&#8217;ve verified it installs in KDE, although I noticed the translation doesn&#8217;t work and the Roxen SVG logo doesn&#8217;t show up in the window top border. </p>
<p><a href="/blog/data/images/ral-kde.png" class="no-file"><img src="/blog/data/images/ral-kde.png/680" alt="Screenshot of Roxen Application Launcher" /></a><br />
<em>Roxen Application Launcher in KDE</em></p>
<p>Libgee is a collections API written in Vala and since I used a newer version than what is available in most package managers, and I&#8217;m not sure all Linux distros provide libgee, I decided to dump it and implement the same functionality with the generic collection classes in Vala. And since the collections used in RAL is quite simple that worked out just fine. </p>
<p>I have also tried to implement bundled download, which is only used in Roxen Editorial Portal. Since I don&#8217;t have access to such an installation I haven&#8217;t been able to verify it works as expected. I re-implemented the same behavior as in the launcher written in Pike by the Roxen guys.</p>
<p>Oh, and if you already have an installation of my RAL your previously downloaded files and settings will not be available to the new install. Since I dumped gconf I now store the settings in a plain text file and I have put the RAL application directory in <code>~/.conf/roxenlauncher</code> since <code>~/.conf</code> is where you should put application specific data according to <a href="http://freedesktop.org">freedesktop.org</a>. In previous versions of RAL I stored application data in <code>~/.roxenlauncher</code> so if you want your previously downloaded files copy <code>~/.roxenlauncher/files</code> to <code>~/.conf/roxenlauncher/files</code>.</p>
<p>The sources is available at <a href="http://github.com/poppa/Roxen-Application-Launcher">Github</a>.</p>
<p><a href="/blog/data/roxenlauncher-1.0.3.tar.gz">Roxen Appliction Launcher 1.0.3</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.poppa.se/blog/roxen-application-launcher-1-0-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pike project &#8211; module stub creator</title>
		<link>http://www.poppa.se/blog/pike-project-module-stub-creator/</link>
		<comments>http://www.poppa.se/blog/pike-project-module-stub-creator/#comments</comments>
		<pubDate>Thu, 19 Aug 2010 22:06:31 +0000</pubDate>
		<dc:creator>Pontus</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[GTK]]></category>
		<category><![CDATA[Pike]]></category>

		<guid isPermaLink="false">http://www.poppa.se/blog/?p=455</guid>
		<description><![CDATA[
I recently began learning how to create Pike modules in C. The Pike module C API seems great and once you&#8217;ve sorted things out the modules are easy to build and install. Non the less, when creating a C module from scratch there&#8217;s a couple of files you need and some configurations of those before [...]]]></description>
			<content:encoded><![CDATA[<p><a href="/blog/data/images/pike-project.png" class="no-file"><img src="/blog/data/images/pike-project.png/680" alt="Screenshot of Pike project" /></a></p>
<p>I recently began learning how to create <a href='http://pike.ida.liu.se/'>Pike</a> modules in C. The Pike module C API seems great and once you&#8217;ve sorted things out the modules are easy to build and install. Non the less, when creating a C module from scratch there&#8217;s a couple of files you need and some configurations of those before everything is set for go. And here comes &#8220;pike-project&#8221; into play.</p>
<p>Pike-project is a simple <a href='http://www.gtk.org/'>GTK</a> program (works as command line tool also) written in Pike it self. The program will create the basics for a running Pike C module, or a plain installable Pike module. Then it&#8217;s just starting programming.</p>
<p>The program is available at my <a href='http://github.com/poppa/Pike-Modules/blob/master/tools/pike-project'>Github repository</a>.</p>
<p>BTW! At the moment it only works on Linux I suppose.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.poppa.se/blog/pike-project-module-stub-creator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pingly &#8211; a Roxen module for automatic Twingly pinging</title>
		<link>http://www.poppa.se/blog/pingly-a-roxen-module-for-automatic-twingly-pinging/</link>
		<comments>http://www.poppa.se/blog/pingly-a-roxen-module-for-automatic-twingly-pinging/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 09:49:55 +0000</pubDate>
		<dc:creator>Pontus</dc:creator>
				<category><![CDATA[Roxen]]></category>
		<category><![CDATA[Pike]]></category>
		<category><![CDATA[Share]]></category>
		<category><![CDATA[Twingly]]></category>

		<guid isPermaLink="false">http://www.poppa.se/blog/?p=451</guid>
		<description><![CDATA[Twingly is a blog search engine that focus on indexing the &#8220;blogosphere&#8221; rather than being a generic search engine. Twingly has a ping service that let you ping Twingly when you have new content on your blog so that Twingly can head over there and index the new content asap.
Since Roxen CMS have event hooks [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.twingly.com">Twingly</a> is a blog search engine that focus on indexing the &#8220;blogosphere&#8221; rather than being a generic search engine. Twingly has a ping service that let you ping Twingly when you have new content on your blog so that Twingly can head over there and index the new content asap.</p>
<p>Since <a href="http://www.roxen.com">Roxen</a> CMS have event hooks this module listens for newly published files and when found automatically notifies Twingly about it.</p>
<p>The only thing needed is to set up a config file in the SiteBuilder&#8217;s workarea so that this module knows under which paths newly published content should notify Twingly and with which arguments. But all this is documented in the module.</p>
<p><strong>One note!</strong> If you run a replicated environment install this module on <strong>one</strong> of the frontend servers, not the backend. If installed on a backend Twingly might head over to your site before the new content has been replicated.</p>
<p><a href="/blog/data/scripts/pingly.pike">The Pingly Roxen module</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.poppa.se/blog/pingly-a-roxen-module-for-automatic-twingly-pinging/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>JavaScript minifier filter module for Roxen</title>
		<link>http://www.poppa.se/blog/javascript-minifier-filter-module-for-roxen/</link>
		<comments>http://www.poppa.se/blog/javascript-minifier-filter-module-for-roxen/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 12:17:46 +0000</pubDate>
		<dc:creator>Pontus</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Pike]]></category>
		<category><![CDATA[Roxen]]></category>

		<guid isPermaLink="false">http://www.poppa.se/blog/?p=441</guid>
		<description><![CDATA[Nowadays web sites and web applications tend to be more and more JavaScript driven which results in humongous JavaScript files. It&#8217;s not uncommon to have several 100 of bytes of JavaScript on a site. Of course web browsers cache stuff like JavaScript so that it only is requested from the server once. But judging from [...]]]></description>
			<content:encoded><![CDATA[<p>Nowadays web sites and web applications tend to be more and more JavaScript driven which results in humongous JavaScript files. It&#8217;s not uncommon to have several 100 of bytes of JavaScript on a site. Of course web browsers cache stuff like JavaScript so that it only is requested from the server once. But judging from the visitor logs at work most people only visit our site once a month or so which means that cache will expire and all those scripts has to be requested upon the first visit.</p>
<p>Now, there are several ways to compact JavaScripts: <a href="http://dean.edwards.name/packer/">Packer</a>, <a href="http://yuilibrary.com/downloads/#yuicompressor">YUI Compressor</a>, <a href="http://shrinksafe.dojotoolkit.org/">Shrink Safe</a>, <a href="http://www.crockford.com/javascript/jsmin.html">jsmin</a> and many more. Some of these just remove redundant white space and comments, some obfuscates the code and shortens variable and function names and what not. Many of these scripts and programs are very fine but they require you to manually minify your scripts, and that&#8217;s just a hassle! </p>
<p>But since we use <a href="http://www.roxen.com">Roxen</a> CMS at work things get much easier if you write your own <em>Roxen filter module</em> which automatically minifies JavaScripts on the fly, given they meet certain criteria. And so I did!</p>
<p>I ported the original <a href="http://www.crockford.com/javascript/jsmin.html">jsmin</a> code written in C to <a href="http://pike.ida.liu.se">Pike</a>. Then it was just a matter of creating a simple filter module for Roxen. And then it was all done.</p>
<p>You can use two criteria to determine if a script should be minified or not:</p>
<ol>
<li><strong>Path glob:</strong> In the module settings you can specify any number of directory globs or full paths. If a requested JavaScript either is in a directory matching a glob or is a direct match it will be minified.</li>
<li><strong>Query string variable:</strong> In the module settings you can define a variable name that if exists as a query string variable in the request the JavaScript will be minified. So:
<pre>&lt;script type="text/javascript" src="myscript.js?jsmin=1"&gt;&lt;/script&gt;</pre>
<p>will minify <code>myscript.js</code></li>
</ol>
<p>And that&#8217;s that!</p>
<p><a href="/blog/data/scripts/jsmin.pike">jsmin Roxen filter module</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.poppa.se/blog/javascript-minifier-filter-module-for-roxen/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>GTK hacking in Pike</title>
		<link>http://www.poppa.se/blog/gtk-hacking-in-pike/</link>
		<comments>http://www.poppa.se/blog/gtk-hacking-in-pike/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 23:40:59 +0000</pubDate>
		<dc:creator>Pontus</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Gnome]]></category>
		<category><![CDATA[GTK]]></category>
		<category><![CDATA[Pike]]></category>

		<guid isPermaLink="false">http://www.poppa.se/blog/?p=386</guid>
		<description><![CDATA[I&#8217;ve found out that it&#8217;s great fun programming desktop applications and of course it gets more fun the more you learn. Now I&#8217;m doing a Twitter client in Pike &#8211; my favorite programming language &#8211; mostly because I wanted to try out GTK programming in Pike. I use the good Twitter client Pino &#8211; written [...]]]></description>
			<content:encoded><![CDATA[<p><a href="/blog/data/images/tweepi.jpg" class="no-file"><img src="/blog/data/images/tweepi.jpg/220" class="alignright" alt="Tweepi, the Twitter client written in Pike" /></a>I&#8217;ve found out that it&#8217;s great fun programming desktop applications and of course it gets more fun the more you learn. Now I&#8217;m doing a <a href="http://twitter.com">Twitter</a> client in <a href="http://pike.ida.liu.se">Pike</a> &#8211; my favorite programming language &#8211; mostly because I wanted to try out <a href="http://www.gtk.org/">GTK</a> programming in Pike. I use the good Twitter client <a href="http://pino-app.appspot.com/">Pino</a> &#8211; written in <a href="http://live.gnome.org/Vala/">Vala</a> &#8211; and I have borrowed the concept and layout from it. I call it <strong>Tweepi</strong>.</p>
<p>The only major difference between Tweepi and Pino &#8211; besides they are written in different programming languages &#8211; is that Pino uses WebKit to draw the status messages where I am using good old GTK widgets &#8211; and I guess there are no bindings to WebKit in Pike for that matter <img src='http://www.poppa.se/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>One thing I noticed is that the <code>Gtk.Label</code> widget sucks at displaying longer texts that line wraps. Since the label widget handles some HTML formatting I thought that it would be suitable for displaying the status messages, but the text looked like shit, line wrapping where ever it felt like. And the <code>Gtk.TextView</code> widget doesn&#8217;t handle formatting per default so I Googled some and found that you can format text in <code>Gtk.TextView</code>s by inserting <code>Gtk.TextTag</code>s at desired positions. And since Pike has the most awesome HTML parser It was just a matter of sending the text through the parser and create some <code>Gtk.TextTag</code>s and inserting them at the same position in the text buffer. (Well, actually it wasn&#8217;t that easy but with some help from a Python class I found on the web it was doable).</p>
<p>So now I have a start at something that is a <code>Gtk.HtmlTextView</code> &#8211; actually it inherits <code>Gtk.TextView</code> but has an additional method <code>insert_html_text(string text)</code> &#8211; and albeit quite simple at the moment it&#8217;s worth continuing on. The code for the <code>HtmlTextView</code> is available at my <a href="http://github.com/poppa/Pike-Modules/blob/master/Misc.pmod/GTK2.pmod/module.pmod">Github repository</a>.</p>
<p>In general I find the GTK implementation in Pike to be pretty OK, but there exist some verbose, and tedious, stuff like getting the text from a <code>Gtk.TextView</code>: </p>
<pre><code lang="pike">
Gtk.TextBuffer b = my_textview->get_buffer();
string text = b->get_text(b->get_start_iter(), b->get_end_iter(), 0);
</code></pre>
<p>which in Vala and C# would be done like:</p>
<pre><code lang="vala">
// Vala
string text = my_textview.get_buffer().text;

// C#
string text = myTextView.Buffer.Text;
</code></pre>
<p>Anyway! Tweepi isn&#8217;t done yet but I think I have solved the most tedious stuff and it&#8217;s starting to become useful. It&#8217;ll probably be done in a couple of weeks and I will of course release the sources then.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.poppa.se/blog/gtk-hacking-in-pike/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Gravatar module for Roxen</title>
		<link>http://www.poppa.se/blog/gravatar-module-for-roxen/</link>
		<comments>http://www.poppa.se/blog/gravatar-module-for-roxen/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 13:21:52 +0000</pubDate>
		<dc:creator>Pontus</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[Roxen]]></category>
		<category><![CDATA[Pike]]></category>
		<category><![CDATA[Share]]></category>

		<guid isPermaLink="false">http://www.poppa.se/blog/?p=289</guid>
		<description><![CDATA[Although I&#8217;m working on some social web related Pike modules where a Gravatar module is included I needed a Gravatar module right now at work so I hacked up a standalone Gravatar Roxen module.
This is how it works


  

       &#038;_.name; wrote at 
      [...]]]></description>
			<content:encoded><![CDATA[<p>Although I&#8217;m working on some <a href="/blog/projects/#pike-modules">social web related Pike modules</a> where a <a href="http://gravatar.com">Gravatar</a> module is included I needed a Gravatar module right now at work so I hacked up a standalone Gravatar <a href="http://roxen.com">Roxen</a> module.</p>
<p>This is how it works</p>
<pre><code lang="rxml">
<ul>
  <emit source="sql" host="mydb"
        query="SELECT name, email, `date`, body FROM my_comments"
  >
<li>
      <gravatar-img email="&#038;_.email;" rating="pg" size="32"
                    default-image="/path/to/icon.png"
      /> &#038;_.name; wrote at <date iso-time="&#038;_.date;" />
      <wash-html paragraphify="">&#038;_.body;</wash-html>
    </li>

  </emit>
</ul>

</code></pre>
<p><a href="/blog/data/scripts/gravatar.pike">Download the Gravatar Roxen module</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.poppa.se/blog/gravatar-module-for-roxen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Merging associative arrays in PHP</title>
		<link>http://www.poppa.se/blog/merging-associative-arrays-in-php/</link>
		<comments>http://www.poppa.se/blog/merging-associative-arrays-in-php/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 22:16:50 +0000</pubDate>
		<dc:creator>Pontus</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Pike]]></category>
		<category><![CDATA[Serendipity]]></category>

		<guid isPermaLink="false">/blog/?p=254</guid>
		<description><![CDATA[It&#8217;s nice when serendipity is your friend! I was porting my Bitly class from Pike to PHP &#8211; I know there&#8217;s probably a hundred PHP classes already out there, but mine is better coded   &#8211; and noted by accident that I had used some Pike syntax in my PHP class but it was [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s nice when <a href="http://en.wikipedia.org/wiki/Serendipity">serendipity</a> is your friend! I was porting my <a href="http://bit.ly/">Bitly</a> class from <a href="http://pike.ida.liu.se">Pike</a> to <a href="http://php.net">PHP</a> &#8211; I know there&#8217;s probably a hundred PHP classes already out there, but mine is better coded <img src='http://www.poppa.se/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  &#8211; and noted by accident that I had used some Pike syntax in my PHP class but it was working anyway. So what was I doing? In Pike there&#8217;s separate data type for associative arrays called <code>mapping</code>. In Pike, in general, when merging two objects you just join them with a <code>+</code> sign. Thus merging two mappings you do like</p>
<pre><code lang="pike">
mapping m1 = ([ "key1" : "Value 1", "key2" : "Value 2" ]);
mapping m2 = ([ "key3" : "Value 3" ]);

write("My mapping: %O\n", m1 + m2);
//> My mapping: ([ /* 3 elements */
//>   "key1": "Value 1",
//>   "key2": "Value 2",
//>   "key3": "Value 3"
//> ])</code></pre>
<p>And I noted that I had done the same thing in PHP and the result was perfectly valid:</p>
<pre><code lang="php">
$a1 = array("key1" => "Value 1", "key2" => "Value 2");
$a2 = array("key3" => "Value 3");

echo "My mapping: ";
print_r($a1 + $a2);
//> My mapping: Array
//> (
//>     [key1] => Value 1
//>     [key2] => Value 2
//>     [key3] => Value 3
//> )</code></pre>
<p>This method doesn&#8217;t work on flat array though so there you&#8217;ll still have to use <code><a href="http://php.net/array_merge">array_merge()</a></code>, but pretty nice anyway.</p>
<p>And oh, the PHP Bitly class will be part of the new <a href="/blog/projects/#plib">PLib</a> release once done!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.poppa.se/blog/merging-associative-arrays-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Roxen User Conference (cont&#8217;d)</title>
		<link>http://www.poppa.se/blog/roxen-user-conference-1/</link>
		<comments>http://www.poppa.se/blog/roxen-user-conference-1/#comments</comments>
		<pubDate>Sun, 21 Sep 2008 19:12:15 +0000</pubDate>
		<dc:creator>Pontus</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[Pike]]></category>
		<category><![CDATA[Roxen]]></category>

		<guid isPermaLink="false">http://www.poppa.se/blog/?p=189</guid>
		<description><![CDATA[So the Roxen User Conference has come to an end. It&#8217;s always nice to meet with people who speak the same &#8220;language&#8221; (the language of the geeks perhaps), to share experiences and solutions. And of course it was nice to see the Roxen Editorial Portal in action. That&#8217;s a pretty cool piece of web based [...]]]></description>
			<content:encoded><![CDATA[<p>So the Roxen User Conference has come to an end. It&#8217;s always nice to meet with people who speak the same &#8220;language&#8221; (the language of the geeks perhaps), to share experiences and solutions. And of course it was nice to see the <a href='http://www.roxen.com/products/ep/'>Roxen Editorial Portal</a> in action. That&#8217;s a pretty cool piece of web based software. It was also nice to get a preview of <a href='http://www.roxen.com/products/cms/'>Roxen CMS</a> 5.0. It will have a few new features that will be nice and perhaps the greatest thing is that it will incorporate <a href='http://pike.ida.liu.se'>Pike</a> 7.8 (which in it self hasn&#8217;t been released yet).</p>
<p>Anyway! For me it was a great experience talking to other Roxen customers and share some ideas and views. Oh, and one more nice thing: during the conference Roxen released a community site &#8211; <a href='http://planet.roxen.com/'>planet.roxen.com</a>. I hope it will be a great resource for us Roxen customers and users. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.poppa.se/blog/roxen-user-conference-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updated Roxen trim tag</title>
		<link>http://www.poppa.se/blog/updated-roxen-trim-tag/</link>
		<comments>http://www.poppa.se/blog/updated-roxen-trim-tag/#comments</comments>
		<pubDate>Mon, 04 Jun 2007 18:34:31 +0000</pubDate>
		<dc:creator>Pontus</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Roxen]]></category>
		<category><![CDATA[Pike]]></category>
		<category><![CDATA[Share]]></category>

		<guid isPermaLink="false">http://www.poppa.se/blog/?p=132</guid>
		<description><![CDATA[Jonas Walldén, CTO at Roxen, has improved my RXML tag contribution &#60;trim&#62;&#60;/trim&#62;. The code is now really beautiful and you can tell the difference from the code written by a lamer, as myself, and a real programmer, as Jonas. Jonas told me that the &#60;trim&#62;&#60;/trim&#62; tag will be part of the next Roxen release  [...]]]></description>
			<content:encoded><![CDATA[<p>Jonas Walldén, CTO at <a href='http://www.roxen.com'>Roxen</a>, has improved my <acronym title="RoXen Macro Language">RXML</acronym> tag contribution <code>&lt;trim&gt;&lt;/trim&gt;</code>. The code is now really beautiful and you can tell the difference from the code written by a lamer, as myself, and a real programmer, as Jonas. Jonas told me that the <code>&lt;trim&gt;&lt;/trim&gt;</code> tag will be part of the next Roxen release <img src='http://www.poppa.se/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h2>Download</h2>
<p><a href='/blog/data/scripts/trim-tag.pike'>Roxen trim tag</a><br />
<a href='/blog/data/scripts/trim.pmod'>Pike trim module</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.poppa.se/blog/updated-roxen-trim-tag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bug fix for Syntaxer.pmod</title>
		<link>http://www.poppa.se/blog/bug-fix-for-syntaxerpmod/</link>
		<comments>http://www.poppa.se/blog/bug-fix-for-syntaxerpmod/#comments</comments>
		<pubDate>Mon, 21 May 2007 20:31:57 +0000</pubDate>
		<dc:creator>Pontus</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Pike]]></category>
		<category><![CDATA[Syntaxer]]></category>

		<guid isPermaLink="false">http://www.poppa.se/blog/?p=129</guid>
		<description><![CDATA[It didn&#8217;t take too long to notice that I had f&#8211;ked up the HTMLParser class a little bit. It was how entities was handled that didn&#8217;t really worked as expected &#8211; entities in tag attributes was duplicated and inserted in the tag content &#8211; but the good side of it is that I learned about [...]]]></description>
			<content:encoded><![CDATA[<p>It didn&#8217;t take too long to notice that I had f&#8211;ked up the <code>HTMLParser</code> class a little bit. It was how entities was handled that didn&#8217;t really worked as expected &#8211; entities in tag attributes was duplicated and inserted in the tag content &#8211; but the good side of it is that I learned about the <code>HTMLParser</code> method of the <code>HTMLParser</code> Pike class. I only want to match entities in the data section &#8211; i.e. tag content &#8211; and not in attributes and the <code>HTMLParser</code> method tells you, as the name implies, in what context the entity is found. So my entity callback function now looks like:</p>
<pre><code lang='pike'>//! Entity callback
protected void ecb(Parser.HTML p, string _data)
{
  if (p->context() == "data")
    line += colorize(entify(_data), "entity");
}</code></pre>
<p>which hopefully will be completely bug free now. So one down 854 to go <img src='http://www.poppa.se/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><a href='/blog/data/scripts/codify.tar.gz'>Codify RXML tag and Syntaxer.pmod</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.poppa.se/blog/bug-fix-for-syntaxerpmod/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

