<?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; Share</title>
	<atom:link href="http://www.poppa.se/blog/tag/share/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>Notification area icons in Ubuntu 11.04</title>
		<link>http://www.poppa.se/blog/notification-area-icons-in-ubuntu-11-04/</link>
		<comments>http://www.poppa.se/blog/notification-area-icons-in-ubuntu-11-04/#comments</comments>
		<pubDate>Tue, 03 May 2011 21:46:19 +0000</pubDate>
		<dc:creator>Pontus</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[gsettings]]></category>
		<category><![CDATA[GTK]]></category>
		<category><![CDATA[Share]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.poppa.se/blog/?p=486</guid>
		<description><![CDATA[If you&#8217;r an Ubuntu user and have upgraded to 11.04 and use the new desktop environment Unity, you might have noticed that some applications that implement the GTK status icon doesn&#8217;t show up in the notification area &#8211; or tray or systray as it also may be called.
The reason for this is that Ubuntu now [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;r an Ubuntu user and have upgraded to 11.04 and use the new desktop environment Unity, you might have noticed that some applications that implement the GTK status icon doesn&#8217;t show up in the notification area &#8211; or tray or systray as it also may be called.</p>
<p>The reason for this is that Ubuntu now utilise a &#8220;whitelist&#8221; for which applications can be displayed in the notification area. You can (maybe not that) easily add any application to the whitelist by invoking the command <code>gsettings</code> in the following way:</p>
<pre><code lang="shell">
gsettings set com.canonical.Unity.Panel systray-whitelist ['app-1', 'app-2', 'app-3']
</code></pre>
<p>Now, this can be quite a difficult command to remember and since you will need to first grab the whitelist, alter it, and then put it back. Since I&#8217;m lame at Bash I thought it would be a nice misson to create a Bash script that makes this interference simpler, just to pick up some more Bash knowledge. So I did!</p>
<p>The script can be used like this:</p>
<pre><code lang="shell">
# Add MyApplication to whitelist
systray-whitelist add MyApplication

# Remove MyApplication from whitelist
systray-whitelist remove MyApplication

# Show applications in whitelist
systray-whitelist show
</code></pre>
<p>And that&#8217;s that.</p>
<p><a href="/blog/data/scripts/systray-whitelist" class="download">Download systray-whitelist</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.poppa.se/blog/notification-area-icons-in-ubuntu-11-04/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>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>UTF-8 encoding/decoding in C</title>
		<link>http://www.poppa.se/blog/utf-8-encodingdecoding-in-c/</link>
		<comments>http://www.poppa.se/blog/utf-8-encodingdecoding-in-c/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 18:45:52 +0000</pubDate>
		<dc:creator>Pontus</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Share]]></category>

		<guid isPermaLink="false">http://www.poppa.se/blog/?p=10</guid>
		<description><![CDATA[I was working on a simple database to Excel XML exporter the other day and decided to write it in C. Now, the problem was that since the Swedish language contains non-ascii characters the output needs to be UTF-8 encoded. C doesn&#8217;t have a built-in function for this &#8211; it seems I should add since [...]]]></description>
			<content:encoded><![CDATA[<p>I was working on a simple database to Excel XML exporter the other day and decided to write it in C. Now, the problem was that since the Swedish language contains non-<a href="http://en.wikipedia.org/wiki/Ascii">ascii</a> characters the output needs to be <a href="http://en.wikipedia.org/wiki/UTF-8">UTF-8</a> encoded. C doesn&#8217;t have a built-in function for this &#8211; it seems I should add since I&#8217;m a C rookie &#8211; and no matter how I searched at Google I couldn&#8217;t find anything useful. So I thought&#8230;</p>
<h2>Look at PHP</h2>
<p>&#8230;why not look at the source code of <a href="http://php.net/">PHP</a> and see how the PHP functions <code>utf8_encode</code> and <code>utf8_decode</code> are being done. So I downloaded the source of PHP and with a little <code>find . -name *.c -print | xargs grep "utf8_encode"</code> I found the functions in <code>xml.c</code>. Thankfully they weren&#8217;t too complicated &#8211; when dug out from the rest of the XML functions &#8211; so I didn&#8217;t take too long before I had them as standalone functions.</p>
<p>This is how they are used:</p>
<pre><code lang="cpp">#include "utf8.h"

int main(int argc, char **argv)
{
  char *iso_str = "Pontus Östlund";
  char *utf8_str;

  utf8_str = utf8_encode(iso_str);
  iso_str  = utf8_decode(utf8_str);

  return 0;
}</code></pre>
<p>And it seems to be working quite OK!</p>
<p><a href="https://github.com/poppa/PlayStation/tree/master/c/utf8">Sources at <strong>Github</strong></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.poppa.se/blog/utf-8-encodingdecoding-in-c/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Firefox Domain-Swapper extension</title>
		<link>http://www.poppa.se/blog/firefox-domain-swapper/</link>
		<comments>http://www.poppa.se/blog/firefox-domain-swapper/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 18:41:01 +0000</pubDate>
		<dc:creator>Pontus</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Share]]></category>

		<guid isPermaLink="false">http://www.poppa.se/blog/?p=195</guid>
		<description><![CDATA[Anybody working on a replicated web site (with an edit/backend server and one or more frontend servers) with perhaps lots of sub sites has probably experienced the hassle of switching domains between the backends and frontends.
Say you get an email saying: Can you change &#8230; to &#8230; on http://some-front-end.com/some/path/to/a/page.html. You click on the link, since [...]]]></description>
			<content:encoded><![CDATA[<p>Anybody working on a replicated web site (with an edit/backend server and one or more frontend servers) with perhaps lots of sub sites has probably experienced the hassle of switching domains between the backends and frontends.</p>
<p>Say you get an email saying: Can you change &#8230; to &#8230; on <code>http://some-front-end.com/some/path/to/a/page.html</code>. You click on the link, since you&#8217;r lazy, and then have to change the domain in the address bar to your backend domain and 40% of the time you misspell and have to go up there again and&#8230;</p>
<p>Anyhow! I got tired of this so I created a domain swapping extension to Firefox. It adds a context menu (right-click on any page) where you can choose to change to another domain &#8211; the URL will stay intact.</p>
<p>So if you are working with replicated sites the extension is free to download at:<br/><br />
 <a href='http://www.tekniskaverken.se/fishnet/code/domain-swapper/index.xml'>http://www.tekniskaverken.se/fishnet&#8230;pper/index.xml</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.poppa.se/blog/firefox-domain-swapper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A couple of wallpapers</title>
		<link>http://www.poppa.se/blog/a-couple-of-wallpapers/</link>
		<comments>http://www.poppa.se/blog/a-couple-of-wallpapers/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 23:13:42 +0000</pubDate>
		<dc:creator>Pontus</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[GIMP]]></category>
		<category><![CDATA[Photoshop]]></category>
		<category><![CDATA[Share]]></category>

		<guid isPermaLink="false">http://www.poppa.se/blog/?p=192</guid>
		<description><![CDATA[Lately I have found a new time waste &#8211; playing with Photoshop and Gimp to create desktop wallpapers. I must say Gimp isn&#8217;t too bad although it&#8217;s quite far behind Photoshop when it comes to usability and especially layer styles. I downloaded a plug-in that works pretty well and similar to the effects in Photoshop, [...]]]></description>
			<content:encoded><![CDATA[<p>Lately I have found a new time waste &#8211; playing with Photoshop and <a href='http://www.gimp.org'>Gimp</a> to create desktop wallpapers. I must say Gimp isn&#8217;t too bad although it&#8217;s quite far behind Photoshop when it comes to usability and especially layer styles. I downloaded a <a href='http://registry.gimp.org/node/186'>plug-in</a> that works pretty well and similar to the effects in Photoshop, but the big difference is that the effects will be put in separate layers in Gimp which means you can&#8217;t fine tune them in real time afterwards. And one really misses the layer folders! Anyway, Gimp works pretty well and when you get used to the differences from Photoshop and you learn the shortcuts it&#8217;s quite usable after all.</p>
<p>All wallpaper are in 1680&#215;1050px</p>
<p><strong>Chocolate</strong> &#8211; Made with Photoshop<br />
<a href="/blog/data/images/chocolate.jpg"><img src="/blog/data/images/chocolate.jpg/680" alt="Chocolate" /></a></p>
<p><strong>Fairytale</strong> &#8211; Made with Photoshop (image and butterfly from <a href='http://www.sxc.hu'>Stock exchange</a>)<br />
<a href="/blog/data/images/fairytale.jpg"><img src="/blog/data/images/fairytale.jpg/680" alt="Chocolate" /></a></p>
<p><strong>Gnome Shield</strong> &#8211; Made with Photoshop<br />
<a href="/blog/data/images/gnome-shield.jpg"><img src="/blog/data/images/gnome-shield.jpg/680" alt="Gnome Shield" /></a></p>
<p><strong>Gnome Shield 2</strong> &#8211; Made with Gimp<br />
<a href="/blog/data/images/gnome-shield-2.jpg"><img src="/blog/data/images/gnome-shield-2.jpg/680" alt="Gnome Shield 2" /></a></p>
<p><strong>Gnome Shield 4</strong> &#8211; Made with Gimp<br />
<a href="/blog/data/images/gnome-shield-4.jpg"><img src="/blog/data/images/gnome-shield-4.jpg/680" alt="Gnome Shield 4" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.poppa.se/blog/a-couple-of-wallpapers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Roxen Application Launcher 0.3</title>
		<link>http://www.poppa.se/blog/roxen-application-launcher-1/</link>
		<comments>http://www.poppa.se/blog/roxen-application-launcher-1/#comments</comments>
		<pubDate>Wed, 18 Jun 2008 15:54:19 +0000</pubDate>
		<dc:creator>Pontus</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Roxen]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Gnome]]></category>
		<category><![CDATA[Share]]></category>

		<guid isPermaLink="false">http://www.poppa.se/blog/?p=178</guid>
		<description><![CDATA[I just created an updated version of Roxen Launcher. I got an error report from one who tried to build the application:
./ApplCon.cs(232,24): error CS0122:
&#8216;System.Net.Sockets.TcpListener.Server&#8217; is inaccessible due
to its protection level
An explanation of the error can be found at MSDN. The reason seems to be due to TcpListener.Server being a protected property but I tried to [...]]]></description>
			<content:encoded><![CDATA[<p>I just created an updated version of Roxen Launcher. I got an error report from one who tried to build the application:</p>
<p style="padding-left: 30px;">./ApplCon.cs(232,24): error CS0122:<br />
&#8216;System.Net.Sockets.TcpListener.Server&#8217; is inaccessible due<br />
to its protection level</p>
<p>An <a href="http://msdn.microsoft.com/en-us/library/ha94aebs.aspx">explanation of the error</a> can be found at MSDN. The reason seems to be due to <code>TcpListener.Server</code> being a protected property but I tried to access it as public. The strange thing is that I didn&#8217;t get an error about it nor on my machine at home or at work. Now I created a derived class of <code>TcpListener.Server</code> so that I can access the protected property.</p>
<p>We&#8217;ll see if it works!</p>
<p><a href="/blog/data/roxenlauncher-0.3.tar.gz">Roxen Application Launcher</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.poppa.se/blog/roxen-application-launcher-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Roxen Application Launcher for Linux</title>
		<link>http://www.poppa.se/blog/roxen-application-launcher/</link>
		<comments>http://www.poppa.se/blog/roxen-application-launcher/#comments</comments>
		<pubDate>Sun, 04 May 2008 17:57:56 +0000</pubDate>
		<dc:creator>Pontus</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Roxen]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Gnome]]></category>
		<category><![CDATA[GTK]]></category>
		<category><![CDATA[Share]]></category>

		<guid isPermaLink="false">http://www.poppa.se/blog/?p=165</guid>
		<description><![CDATA[I thought I should broaden my C# knowledge a bit and you know how it is: To learn new stuff you need a real project to work on or else you will lose the fire sooner than later. So I came up with a good project that is actually useful to me: Porting Roxen&#8217;s &#8220;Application [...]]]></description>
			<content:encoded><![CDATA[<p>I thought I should broaden my C# knowledge a bit and you know how it is: To learn new stuff you need a real project to work on or else you will lose the fire sooner than later. So I came up with a good project that is actually useful to me: Porting <a href='http://www.roxen.com'>Roxen</a>&#8217;s &#8220;Application Launcher&#8221; to C#. There&#8217;s nothing wrong with the original one, written in <a href='http://pike.ida.liu.se'>Pike</a>, except that it uses <a href='http://www.gtk.org/'>GTK</a> 1 which is quite hideous (in an aesthetic meaning) compared to the newer GTK 2. And I also though it would be cool to create a panel applet (in the notification area of <a href='http://www.gnome.org'>Gnome</a> so you could put the Application Launcher in the background).</p>
<p>BTW: For those of you not knowing what the heck Roxen&#8217;s Application Launcher (AL here after) is here&#8217;s a brief explanation: Files in <a href='http://www.roxen.com/products/cms/'>Roxen CMS</a> is stored in a <a href='http://www.nongnu.org/cvs/'>CVS</a> file system which means that you don&#8217;t deal with files the way you normally do. To manage files you use a web browser interface (which is a darn good one I might add) but sometimes you actually want to edit files in your standard desktop application. And it is here the AL comes to play. You can download a file through the browser interface so that the file is opened in the AL. AL will then open the file in the desktop application you have associated with the file&#8217;s content-type. When you make your changes and saves them the AL will directly upload the changes to the server. So in short I could have said: The Application Launcher is a means to edit files on a remote Roxen server with a preferred desktop application.</p>
<h2>The obstacles</h2>
<p>I must say I&#8217;ve learned a lot from this project! </p>
<p><strong>First off:</strong> If you download a file for editing and the AL is already started you don&#8217;t want to start a new instance of AL (this is something I have never ever thought about before &#8211; in general terms, not just concerning AL) but when you do think about it you find that it&#8217;s not a piece of cake to solve. I solved it the way it is solved in the original AL. The first instance of AL that is started also starts a &#8220;socket server&#8221; that listens for incoming traffic on a given port on the local IP. When a new instance is started it first checks if it can connect to said port and if it can it sends the arguments through the socket to the first instance which then handles the request. The second instance is simply terminated when it has send the data though the socket.</p>
<p>So there I had to do some socket programming. Great fun <img src='http://www.poppa.se/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Secondly:</strong> Stuff happens in the background of AL &#8211; data send through the socket remember &#8211; which means that nothing happens when you try to update the Graphical User Interface. (NOTE! This is the first more advanced desktop application I&#8217;ve done.) After &#8220;Google-ing&#8221; around a bit I came to know that this was a real newbie problem <img src='http://www.poppa.se/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  The thing is that the GUI can only be updated through the same thread that started it so when using background threads  &#8211; implicitly that&#8217;s what I&#8217;m doing although handled by the asynchronous callback infrastructure of C# &#8211; you need to make sure the GUI is updated through the main thread. This is the most simple way so solve it:</p>
<pre><code lang='cs'>Gtk.Application.Invoke(delegate{
  CallFunctionToUpdateGUI();
});</code></pre>
<p>That&#8217;s not too difficult when you know it <img src='http://www.poppa.se/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><strong>Thirdly:</strong> The AL is sending data back and forth through the HTTP protocol which means we have to use some sort of HTTP client. C# has a couple of ways to do this but unfortunately they came up short, or I couldn&#8217;t use them anyway. I didn&#8217;t manage to figure out exactly why I always caught an exception saying something like: <em>A protocol violation occurred!</em>. I&#8217;m far from the only one who have fought with this and it has something to do with the headers sent from the remote server. You can invoke &#8220;unsafe header parsing&#8221; but that was to much of a hassle so I created my own little HTTP client.</p>
<p>One big annoying thing with C# is that is seems almost impossible to turn data from streams into strings without having to use any one of the <code>System.Text.Encoding.*</code> classes/objects which in my case meant that images and files in binary form got seriously fucked up. I manged to solve this my never turning the data into a string but keeping it as a <code>System.Text.Encoding.*</code> all the way from request to response to saving to disk. It was rather irritating but at the same time nice when solved (and I learned a whole bunch about <code>System.Text.Encoding.*</code>, <code>System.Text.Encoding.*</code>, <code>System.Text.Encoding.*</code> and <code>System.Text.Encoding.*</code>.)</p>
<p><strong>Finally:</strong> Of course I learned a great deal more about C# but this blog post is starting to get pretty excessive so I will round it off by saying that <a href='http://monodevelop.org'>MonoDevelop</a> is starting to become pretty darn good! I just upgraded to the latest version of <a href='http://www.ubuntu.com'>Ubuntu</a> and that also meant that I got the latest MonoDevelop and I must say it&#8217;s more stable than ever (although it occasionally crashes) and a whole bunch of new features are in place. One I havn&#8217;t used before &#8211; although it might have existed before &#8211; is the &#8220;Deployment&#8221; stuff. It creates a package with configure and make files for optimal compilation. Really smooth!</p>
<h2>Source and screens</h2>
<p>I will finish off by adding the source files and a few screen shots:</p>
<p><a href='/blog/data/roxenlauncher-0.2.tar.gz'>Roxen Application Launcher</a></p>
<p><strong>Screen shot 1: Just a standard view</strong><br />
<a href="/blog/data/images/rl/RoxenLauncher-1.png"><img src="/blog/data/images/rl/RoxenLauncher-1.png/680" alt="Roxen Application Launcher 1"/></a></p>
<p><strong>Screen shot 2: The panel applet in action</strong><br />
<a href="/blog/data/images/rl/RoxenLauncher-2.png"><img src="/blog/data/images/rl/RoxenLauncher-2.png/680" alt="Roxen Application Launcher 2"/></a></p>
<p><strong>Screen shot 3: The Application Launcher in Swedish</strong><br />
<a href="/blog/data/images/rl/RoxenLauncher-3.png"><img src="/blog/data/images/rl/RoxenLauncher-3.png/680" alt="Roxen Application Launcher 3"/></a></p>
<p><strong>Screen shot 4: Adding support for a new content type</strong><br />
<a href="/blog/data/images/rl/RoxenLauncher-4.png"><img src="/blog/data/images/rl/RoxenLauncher-4.png/680" alt="Roxen Application Launcher 4"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.poppa.se/blog/roxen-application-launcher/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Script for adding all new files in a SVN repository</title>
		<link>http://www.poppa.se/blog/svn-script-for-adding/</link>
		<comments>http://www.poppa.se/blog/svn-script-for-adding/#comments</comments>
		<pubDate>Thu, 26 Jul 2007 19:14:15 +0000</pubDate>
		<dc:creator>Pontus</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Share]]></category>
		<category><![CDATA[Subversion]]></category>

		<guid isPermaLink="false">http://www.poppa.se/blog/?p=138</guid>
		<description><![CDATA[When working with revision controlled stuff you sometimes add loads of new files to an already existing repository. Then when you are about to check in the next revision you have forgotten where all the new files are and you probably don&#8217;t feel like writing svn add thefile too many times. This is of course [...]]]></description>
			<content:encoded><![CDATA[<p>When working with revision controlled stuff you sometimes add loads of new files to an already existing repository. Then when you are about to check in the next revision you have forgotten where all the new files are and you probably don&#8217;t feel like writing <code>svn add thefile</code> too many times. This is of course no problem if you&#8217;r using a decent SVN client &#8211; like Tortoise SVN on Windows &#8211; but I prefer the command line so the solution was writing a script that adds all new files in a directory structure to the SVN repository.</p>
<p>There are &#8220;one liners&#8221; for this but I wanted a bit more flexibility and ease of use so I wrote the a script that also lets you define regexp patterns for files you don&#8217;t want to add even if they exist in the directory structure.</p>
<p>This is how to use it:</p>
<pre><code lang='shell'># Add all new files
svnadd path/to/repository/
# Add all new files except those matching the regexp
svnadd -s ".*.txt|tmp/.*" path/to/repository/
# Add all new files except those matching the regexp in
# the file defined by the "-f" flag
svnadd -f regexp.txt path/to/repository/</code></pre>
<p>Quite easy! If you don&#8217;t feel like remembering the pattern for files to skip, put the regexp in a file and use the <code>svn add thefile</code> flag.</p>
<pre><code lang='shell'>#!/bin/bash
##########################################################################
#
# Script for adding all new files in a directory structure to an SVN
# repository.
#
# copyright © 2007 Pontus Östlund <spam@poppa.se>
#
# The svnadd script is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# The svnadd script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
#
##########################################################################

while getopts "s:f:h" opts
do
  case $opts in
    s) skip="$OPTARG";;
    f) if [ -f "$OPTARG" ]; then
         skip=$(head -n 1 $OPTARG)
       else
         echo "$OPTARG doesn't exist!"
       fi
       ;;
    h) help=1;;
  esac
done

shift $(($OPTIND - 1))

if [ -z $1 ] || [ "$help" ]; then
  echo "About: svnadd enables you to add all new files in [dir] to a "
       "subversion repository"
  echo "Usage: svnadd [flags] [dir]"
  echo
  echo "  -s
<pattern>  Regexp pattern for files to skip"
  echo "  -f
<path>     Path to file containing regexp for files to skip"
  echo "                The regexp should be placed in line one!"
  echo "  [dir]         The path to the repository"
  echo
  echo "Example: svnadd svnsrc/"
  echo "Example: svnadd -s 'tmp/.*.xml' svnsrc/"
  echo "Example: svnadd -f regexp.txt svnsrc/"
  echo

  exit 0
fi

dir=$1

if [ ! -d "$dir" ]; then
  echo "$dir is not a directory"
  exit 1
fi

while read status file; do
  if [ "$status" = "?" ]; then
    res=$( echo "$file" | egrep -o "$skip" )
    if [ -z "$res" ]; then
      svn add "$file"
    fi
  fi
done<<EOF
$( svn st "$dir" )
EOF

exit 0</code></pre>
<h2>Download</h2>
<p><a href='/blog/data/scripts/svnadd'>svnadd</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.poppa.se/blog/svn-script-for-adding/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PHP documentation browser</title>
		<link>http://www.poppa.se/blog/php-documentation-browser/</link>
		<comments>http://www.poppa.se/blog/php-documentation-browser/#comments</comments>
		<pubDate>Fri, 20 Jul 2007 20:41:36 +0000</pubDate>
		<dc:creator>Pontus</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Share]]></category>

		<guid isPermaLink="false">http://www.poppa.se/blog/?p=135</guid>
		<description><![CDATA[Even though I have my vacation right now I need to hack some 
What I have done is a PHP documentation browser, I simply call it PHPDoc Browser, for GNU/Linux to read the PHP documentation locally on the computer (it&#8217;s a little bit like CHM for Windows). This little app isn&#8217;t that necessary but I [...]]]></description>
			<content:encoded><![CDATA[<p>Even though I have my vacation right now I need to hack some <img src='http://www.poppa.se/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
What I have done is a PHP documentation browser, I simply call it <em>PHPDoc Browser</em>, for GNU/Linux to read the PHP documentation locally on the computer (it&#8217;s a little bit like <a href='http://en.wikipedia.org/wiki/Microsoft_Compiled_HTML_Help'>CHM</a> for Windows). This little app isn&#8217;t that necessary but I thought it was a great thing for learning new stuff: The application is written in <a href='http://www.mono-project.com'>Mono</a>/C# and uses <a href='http://www.sqlite.org/'>SQLite</a> for storing the search index.</p>
<h2>Difference from CHM</h2>
<p>Although there&#8217;s a CHM equivalent, <a href='http://xchm.sourceforge.net/'>XCHM</a>, for Unix like systems I decided that my application serves a purpose: What I like about the PHP manual is that you can hit www.php.net/the_function in you browser and you will get the documentation for &#8220;the_function&#8221;. Of course I implemented the same functionality in <em>PHPDoc Browser</em>. You can also do a wild card search like &#8220;array_*&#8221; and you will get a list of all &#8220;array_*&#8221; functions. </p>
<p>I also implemented a free text search but that&#8217;s not &#8220;a real&#8221; FTS at the moment. FTS in SQLite in a little bit harder than in <a href='http://www.mysql.com'>MySQL</a> so while awaiting the next SQLite version the FTS is a bit of a hack. But you can quote the search to narrow it down <img src='http://www.poppa.se/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<h2>What&#8217;s learned?</h2>
<p>Most of the unnecessary stuff I do I do to learn and the <em>PHPDoc Browser</em> is no exception. I learned how to use SQLite in Mono/C# and I also wrote a self contained installer in Bash, and Bash I havn&#8217;t really touch although I&#8217;ve been using GNU/Linux for 6-7 years! I found it quite fun writing the installer <img src='http://www.poppa.se/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h2>Howto</h2>
<p>If you would like to try it out:</p>
<ol>
<li>Download the install script</li>
<li>Un-tar it (`tar zxvf phpdocbrowser-installer.tgz`)</li>
<li>Make sure the script is executable (`chmod +x phpdocbrowser-installer`)</li>
<li>Open a console and run the installer: <code>./phpdocbrowser-installer</code></li>
<li>Answer the questions and you&#8217;r ready to go.</li>
</ol>
<p>The script will create a directory, <code>./phpdocbrowser-installer</code>, in your home directory in wich you will find <code>./phpdocbrowser-installer</code>, <code>./phpdocbrowser-installer</code> and a directory, <code>./phpdocbrowser-installer</code>, with the PHP documentation. A &#8220;run script&#8221; will also be installed either in <code>./phpdocbrowser-installer</code> or in your home directory depending on how you answered the questions and if you agreed to create a desktop shortcut one will hopefully appear on your desktop (havn&#8217;t tested this on KDE but it should work fine in Gnome).</p>
<p>To run the application hit the desktop shortcut, if one was created, or invoke <code>./phpdocbrowser-installer</code> from a console. </p>
<p>If you wish to remove the <em>PHPDoc Browser</em> run the following from a console:<br />
<code>./phpdocbrowser-installer</code>.</p>
<p>And that&#8217;s that!</p>
<h2>Download</h2>
<p><a href='/blog/data/scripts/phpdocbrowser-installer.tgz'>PHPDoc Browser</a></p>
<h2>Screen shots</h2>
<p><a href="/blog/data/images/phpdoc-1.png"><img src="/blog/data/images/phpdoc-1.png/680" alt="PHPDoc"/></a></p>
<p><a href="/blog/data/images/phpdoc-2.png"><img src="/blog/data/images/phpdoc-2.png/680" alt="PHPDoc2"/></a></p>
<p><a href="/blog/data/images/phpdoc3.png"><img src="/blog/data/images/phpdoc3.png/680" alt="PHPDoc3"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.poppa.se/blog/php-documentation-browser/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

