<?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>Eirik Hoem&#039;s Blog &#187; Tips</title>
	<atom:link href="http://blog.eirikhoem.net/index.php/category/tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.eirikhoem.net</link>
	<description>PHP, AS3, Flex, Flash</description>
	<lastBuildDate>Tue, 18 May 2010 17:58:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Book review: Expert PHP5 Tools</title>
		<link>http://blog.eirikhoem.net/index.php/2010/05/18/book-review-expert-php5-tools/</link>
		<comments>http://blog.eirikhoem.net/index.php/2010/05/18/book-review-expert-php5-tools/#comments</comments>
		<pubDate>Tue, 18 May 2010 17:58:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Book]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Review]]></category>

		<guid isPermaLink="false">http://blog.eirikhoem.net/?p=254</guid>
		<description><![CDATA[Book review: Expert PHP 5 Tools
ISBN: 1847198384
ISBN 13: 978-1-847198-38-9
Publisher:Packt Publishing
Author:Dirk Merkel
Short version: If you are working with PHP you&#8217;ll want to read this book. Covering topics like continuous integration, documentation and unit testing thoroughly it gives an insight of great value to any PHP developer.
Slightly longer version: This book is aimed at developers already working [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Book review:</strong> <a href="http://www.packtpub.com/expert-php-5-tools/book/mid/160410eip616?utm_source=blog.eirikhoem.net&amp;utm_medium=affiliate&amp;utm_content=blog&amp;utm_campaign=mdb_003021" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.packtpub.com');">Expert PHP 5 Tools</a><br />
<strong>ISBN:</strong> 1847198384<br />
<strong>ISBN 13:</strong> 978-1-847198-38-9<br />
<strong>Publisher:</strong><a href="http://www.packtpub.com/" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.packtpub.com');">Packt Publishing</a><br />
<strong>Author:</strong><a href="https://www.packtpub.com/authors/profiles/dirk-merkel" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.packtpub.com');">Dirk Merkel</a></p>
<div id="attachment_250" class="wp-caption alignleft" style="width: 241px"><a href="http://www.packtpub.com/expert-php-5-tools/book/mid/160410eip616?utm_source=blog.eirikhoem.net&amp;utm_medium=affiliate&amp;utm_content=blog&amp;utm_campaign=mdb_003021" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.packtpub.com');"><img class="size-medium wp-image-250 " title="Book cover: Expert PHP 5 Tools " src="http://blog.eirikhoem.net/wp-content/uploads/2010/05/expert_php_5_tools_cover-231x300.jpg" alt="Book cover: Expert PHP 5 Tools" width="231" height="300" /></a><p class="wp-caption-text">Book cover: Expert PHP 5 Tools</p></div>
<p><strong>Short version:</strong> If you are working with PHP you&#8217;ll want to read this book. Covering topics like continuous integration, documentation and unit testing thoroughly it gives an insight of great value to any PHP developer.</p>
<p><strong>Slightly longer version:</strong> This book is aimed at developers already working with PHP on a daily basis, or developers which are picking up PHP. It&#8217;s main focus is the environment of the PHP developer. Areas like unit testing, continuous integration, application deployment, proper documentation and version control might already be very familiar if you have been working with PHP for a while, but this book covers each of these important areas in detail and with prime examples on do and dont&#8217;s. Even if you feel like you are doing quite well I&#8217;m sure this book will give you a few &#8220;aha!&#8221; moments. If you are coming from a hobby-background these areas might not be your strongest suit, and this book will help you get a firm grasp on what a professional PHP setup is all about. The chapter on continous integration is based around <a href="http://www.phpundercontrol.org/about.html" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.phpundercontrol.org');">phpUnderControl</a>, which is a nice piece of software for this purpouse. However, I would have liked to see other alternatives like for example <a href="http://hudson-ci.org/" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/hudson-ci.org');">Hudson</a>. Luckily, moving over to a different CI app is fairly easy after having set up a phpUC installation with the <a href="http://phing.info/trac/" target="_self" onclick="javascript:pageTracker._trackPageview ('/outbound/phing.info');">phing/ant</a> configuration.</p>
<p>The book is available both as paperback and eBook from Packt. I&#8217;ve been reading the eBook, which worked quite well for me. PS: Convering the PDF to ePub will destroy some of the formatting.</p>
<p>Check out the sample chapter <a href="http://www.packtpub.com/sites/default/files/8389_Expert%20PHP%20Development_SampleChapter.pdf" title="Sample chapter" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.packtpub.com');"><span>Documentation with phpDocumentor</span></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eirikhoem.net/index.php/2010/05/18/book-review-expert-php5-tools/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Book preview: Expert PHP5 Tools</title>
		<link>http://blog.eirikhoem.net/index.php/2010/05/02/book-preview-expert-php5-tools/</link>
		<comments>http://blog.eirikhoem.net/index.php/2010/05/02/book-preview-expert-php5-tools/#comments</comments>
		<pubDate>Sun, 02 May 2010 10:56:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Book]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://blog.eirikhoem.net/?p=248</guid>
		<description><![CDATA[While I am currently reading PHP5 eCommerce Development I&#8217;ve also got lined up a copy of Expert PHP 5 Tools from Packt.
This book will enable you to take your PHP development skills to an  enterprise level by teaching you the skills and tools necessary to write  maintainable and efficient code. You will learn [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_250" class="wp-caption alignleft" style="width: 241px"><a href="http://www.packtpub.com/expert-php-5-tools/book/mid/160410eip616?utm_source=blog.eirikhoem.net&amp;utm_medium=affiliate&amp;utm_content=blog&amp;utm_campaign=mdb_003021" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.packtpub.com');"><img class="size-medium wp-image-250" title="Book cover: Expert PHP 5 Tools " src="http://blog.eirikhoem.net/wp-content/uploads/2010/05/expert_php_5_tools_cover-231x300.jpg" alt="Book cover: Expert PHP 5 Tools" width="231" height="300" /></a><p class="wp-caption-text">Book cover: Expert PHP 5 Tools</p></div>
<p>While I am currently reading PHP5 eCommerce Development I&#8217;ve also got lined up a copy of <a href="http://www.packtpub.com/expert-php-5-tools/book/mid/160410eip616?utm_source=blog.eirikhoem.net&amp;utm_medium=affiliate&amp;utm_content=blog&amp;utm_campaign=mdb_003021" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.packtpub.com');">Expert PHP 5 Tools</a> from <a href="http://www.packtpub.com/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.packtpub.com');">Packt</a>.</p>
<p><em>This book will enable you to take your PHP development skills to an  enterprise level by teaching you the skills and tools necessary to write  maintainable and efficient code. You will learn how to perform  activities such as unit testing, enforcing coding standards, automating  deployment, and interactive debugging using tools created for PHP  developers – all the information in one place. Your code will be more  maintainable, efficient, and self-documented.</em></p>
<p>Check out the sample chapter <a href="http://www.packtpub.com/sites/default/files/8389_Expert%20PHP%20Development_SampleChapter.pdf" title="Sample chapter" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.packtpub.com');"><span style="font-family: Calibri;">Documentation with phpDocumentor</span></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eirikhoem.net/index.php/2010/05/02/book-preview-expert-php5-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Board migration &#8211; Discus 4.x to vBulletin</title>
		<link>http://blog.eirikhoem.net/index.php/2009/03/18/board-migration-discus-4x-to-vbulletin/</link>
		<comments>http://blog.eirikhoem.net/index.php/2009/03/18/board-migration-discus-4x-to-vbulletin/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 21:06:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Discus]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[vBulletin]]></category>

		<guid isPermaLink="false">http://blog.eirikhoem.net/?p=96</guid>
		<description><![CDATA[A short recap of my experiences with migrating a DiscusWare board to vBulletin]]></description>
			<content:encoded><![CDATA[<p>I just finished the initial trial migration of a <a href="http://www.discusware.com/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.discusware.com');">Discus v4.x</a> based board over to <a href="https://www.vbulletin.com/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.vbulletin.com');">vBulletin</a>.</p>
<p>Now, I&#8217;d like to write a few words on Discus. I cannot see why anyone looking to set up a new board would choose this software. It&#8217;s actually file based (!). Yes, you heard me. The posts, users and threads are stored in (plain) text files. I was quite surprised the first time I got around to checking out what I was supposed to migrate. If you head over to their site and check out a demo-site or two you&#8217;ll notice that the whole board seems a bit &#8230; unprofessional. It currently sells for 149 USD, which is quite amazing when you can get vBulletin for 180USD, or even <a href="http://www.phpbb.com/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.phpbb.com');">phpBB </a>for free. I went with vBulletin because they supported (at least partial) import from Discus, as well as the email based service in case I got stuck.</p>
<p>Now, the data migration. Upon purchasing vBulletin I got a migration utility called ImpEx which supports quite a number of boards to import from. Discus is listed as a tier 3 board, meaning it&#8217;s not actively supported anymore.. not a good sign, but still worth a shot.</p>
<p><strong>Here is a quick recap of the required actions:</strong></p>
<p>1. Download vBulletin and ImpEx from vBulletin.com<br />
2. Create a new database for vBulletin<br />
3. Install vBulletin <a href="http://www.vbulletin.com/docs/html/main/install" onclick="javascript:pageTracker._trackPageview ('/outbound/www.vbulletin.com');">as described here</a>.<br />
4. Install the ImpEx tool <a href="http://www.vbulletin.com/docs/html/main/impex_installation" onclick="javascript:pageTracker._trackPageview ('/outbound/www.vbulletin.com');">as described here</a>.<br />
5. Configure ImpEx <a href="http://www.vbulletin.com/docs/html/main/impex_config" onclick="javascript:pageTracker._trackPageview ('/outbound/www.vbulletin.com');">as described here</a>.<br />
6. Run the ImpEx tool for Discus</p>
<p>Now, in step 6 there are some modules to import. Some of them runs in a matter of seconds, while others takes up to 10 minutes in my case. I&#8217;m not sure if the script actually refreshes, so one might want to up maximum execution time for PHP to be safe.</p>
<p>To my surprise everything went absolutely fine. Not a single hickup in the migration scripts. After the data was imported I followed the <a href="http://www.vbulletin.com/docs/html/main/impex_cleanup" onclick="javascript:pageTracker._trackPageview ('/outbound/www.vbulletin.com');">post-migrate instructions</a> and did some data verification. Everything seemed to be present, but I was not able to see any threads in the forums. I could find them with searching, and when I opened a thread it clearly stated that it was belonging in the correct forum. After looking around for some time I discovered that the forums from Discus was now configured to act as categories. I solved this by going to <strong>Edit Forum -&gt; Act as Forum</strong> and set it to <strong>Yes</strong> for each forum. When I got back to the forum listing everything was in order.</p>
<p>The only things left is to move the forums around some, get a proper language pack and some other minor adjustments. All in I&#8217;m quite satisfied with the whole process. Kudos to vBulletin.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eirikhoem.net/index.php/2009/03/18/board-migration-discus-4x-to-vbulletin/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tip: What every programmer should know about memory</title>
		<link>http://blog.eirikhoem.net/index.php/2008/08/31/tip-what-every-programmer-should-know-about-memory/</link>
		<comments>http://blog.eirikhoem.net/index.php/2008/08/31/tip-what-every-programmer-should-know-about-memory/#comments</comments>
		<pubDate>Sun, 31 Aug 2008 10:17:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Memory]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Unix/Linux]]></category>

		<guid isPermaLink="false">http://blog.eirikhoem.net/index.php/2008/08/31/tip-what-every-programmer-should-know-about-memory/</guid>
		<description><![CDATA[Some time ago a friend of mine tipped me about this article series called &#8220;What every programmer should know about memory&#8221; written by Ulrich Drepper (lead contributor and maintainer of glib). I just recently came around to start reading it. This is a 100 page long text which covers computer memory in detail, with focus [...]]]></description>
			<content:encoded><![CDATA[<p>Some time ago a friend of mine tipped me about this article series called &#8220;<a href="http://lwn.net/Articles/250967/" onclick="javascript:pageTracker._trackPageview ('/outbound/lwn.net');">What every programmer should know about memory</a>&#8221; written by <a href="http://en.wikipedia.org/wiki/Ulrich_Drepper" onclick="javascript:pageTracker._trackPageview ('/outbound/en.wikipedia.org');">Ulrich Drepper</a> (lead contributor and maintainer of glib). I just recently came around to start reading it. This is a 100 page long text which covers computer memory in detail, with focus on how software interacts with memory. From RAM to CPU caches the text moves on to tips on how we as programmers can improve our code when it comes to memory management and performance. A really good read which I suggest every programmer should check out.</p>
<p>Technorati Tags: <a href="http://technorati.com/tag/Hardware" rel="tag">Hardware</a>, <a href="http://technorati.com/tag/Memory" rel="tag"> Memory</a>, <a href="http://technorati.com/tag/Unix%2FLinux" rel="tag"> Unix/Linux</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eirikhoem.net/index.php/2008/08/31/tip-what-every-programmer-should-know-about-memory/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Simple config management for PHP</title>
		<link>http://blog.eirikhoem.net/index.php/2008/05/30/simple-config-management-for-php/</link>
		<comments>http://blog.eirikhoem.net/index.php/2008/05/30/simple-config-management-for-php/#comments</comments>
		<pubDate>Fri, 30 May 2008 07:30:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://blog.eirikhoem.net/index.php/2008/05/30/simple-config-management-for-php/</guid>
		<description><![CDATA[When doing complex applications it&#8217;s often nice to have some sort of system for handling settings. PHP has a nice function called parse_ini_file which can be used to create a basic but still usable setting file feature. A simple class which loads the configuration file and offers some methods to retrieve the values for a [...]]]></description>
			<content:encoded><![CDATA[<p>When doing complex applications it&#8217;s often nice to have some sort of system for handling settings. PHP has a nice function called <a href="http://no2.php.net/parse_ini_file" onclick="javascript:pageTracker._trackPageview ('/outbound/no2.php.net');">parse_ini_file</a> which can be used to create a basic but still usable setting file feature. A simple class which loads the configuration file and offers some methods to retrieve the values for a given key is all that&#8217;s needed. The example I&#8217;m providing is pretty basic, but it&#8217;s still very usable and can be added to almost any application.</p>
<p>First, we need to create a file to hold the settings. It&#8217;s ordinary plaintext and follows the INI format.</p>
<p><strong> Here is a quick sample of some key / value pairs:</strong></p>
<p>[general]<br />
locale = no_NO<br />
company.name = MyCompany</p>
<p>datasource.host = localhost<br />
datasource.database = mydb<br />
datasource.username = user<br />
datasource.password = 1234</p>
<p><strong>The class for accessing the file:</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
</pre></td><td class="code"><pre class="php"><span style="color: #000000; font-weight: bold;">class</span> MyConfigClass<span style="color: #66cc66;">&#123;</span>
  protected <span style="color: #0000ff;">$config</span>;
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#123;</span>
      <span style="color: #0000ff;">$this</span>-&gt;<span style="color: #006600;">config</span> = <span style="color: #000066;">parse_ini_file</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'../conf/myapp.ini'</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getConfig<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$key</span> = <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#123;</span>
      <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$key</span> !== <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#123;</span>
        <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066;">isset</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$this</span>-&gt;<span style="color: #006600;">config</span><span style="color: #66cc66;">&#91;</span><span style="color: #0000ff;">$key</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
        <span style="color: #66cc66;">&#123;</span>
          <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">$this</span>-&gt;<span style="color: #006600;">config</span><span style="color: #66cc66;">&#91;</span><span style="color: #0000ff;">$key</span><span style="color: #66cc66;">&#93;</span>;
        <span style="color: #66cc66;">&#125;</span>
        <span style="color: #b1b100;">else</span>
        <span style="color: #66cc66;">&#123;</span>
          throw <span style="color: #000000; font-weight: bold;">new</span> Exception<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Unknown key '$key' in configuration&quot;</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #66cc66;">&#125;</span>
      <span style="color: #66cc66;">&#125;</span>
      <span style="color: #b1b100;">else</span>
      <span style="color: #66cc66;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">$this</span>-&gt;<span style="color: #006600;">config</span>;
      <span style="color: #66cc66;">&#125;</span>
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> setConfig<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$config</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#123;</span>
&nbsp;
      <span style="color: #0000ff;">$this</span>-&gt;<span style="color: #006600;">config</span> = <span style="color: #0000ff;">$config</span>;
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Usage:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php"><span style="color: #0000ff;">$configManager</span> = <span style="color: #000000; font-weight: bold;">new</span> MyConfigClass<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$value</span> = <span style="color: #0000ff;">$configManager</span>-&gt;<span style="color: #006600;">getConfig</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'datasource.host'</span><span style="color: #66cc66;">&#93;</span>;</pre></td></tr></table></div>

<p>Now, when working on larger application one usually have a application like class, and that&#8217;s a nice place to put this code. When using Prado I usually place the config code in the TApplication class.</p>
<p>Technorati Tags: <a href="http://technorati.com/tag/PHP" rel="tag">PHP</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eirikhoem.net/index.php/2008/05/30/simple-config-management-for-php/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Firefox java problem with Ubuntu 8.04 Solved!</title>
		<link>http://blog.eirikhoem.net/index.php/2008/04/30/firefox-java-problem-with-ubuntu-804-solved/</link>
		<comments>http://blog.eirikhoem.net/index.php/2008/04/30/firefox-java-problem-with-ubuntu-804-solved/#comments</comments>
		<pubDate>Wed, 30 Apr 2008 13:18:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://blog.eirikhoem.net/index.php/2008/04/30/firefox-java-problem-with-ubuntu-804-solved/</guid>
		<description><![CDATA[



I&#8217;ve been struggling with lava support for Firefox after upgrading from Ubuntu 7.10 to 8.04. All I had to do was to remove the package called icedtea-gcjwebplugin. Now, I don&#8217;t know my way around Java anymore, but at least it did the trick. Worth a shot if you have problems.
Update:
John has some more information on [...]]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript"><!--
google_ad_client = "pub-0056923567680782";
/* default */
google_ad_slot = "6546082201";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>I&#8217;ve been struggling with lava support for Firefox after upgrading from Ubuntu 7.10 to 8.04. All I had to do was to <strong>remove the package called icedtea-gcjwebplugin</strong>. Now, I don&#8217;t know my way around Java anymore, but at least it did the trick. Worth a shot if you have problems.</p>
<p>Update:</p>
<p><a href="http://jwylie.blogspot.com/" onclick="javascript:pageTracker._trackPageview ('/outbound/jwylie.blogspot.com');">John</a> has some more information on this issue if the above didn&#8217;t do the trick:</p>
<p><em> I also needed to link to the new plugin….</em></p>
<p><em>cd /usr/lib/firefox-3.0/plugins$<br />
sudo ln -s /usr/lib/jvm/java-6-sun/jre/plugin/i386/ns7/libjavaplugin_oji.so</em></p>
<p>Thanks John!</p>
<p>Technorati Tags: <a href="http://technorati.com/tag/Java" rel="tag">Java</a>, <a href="http://technorati.com/tag/Firefox" rel="tag">Firefox</a>, <a href="http://technorati.com/tag/Ubuntu" rel="tag">Ubuntu</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eirikhoem.net/index.php/2008/04/30/firefox-java-problem-with-ubuntu-804-solved/feed/</wfw:commentRss>
		<slash:comments>34</slash:comments>
		</item>
		<item>
		<title>Handy online regex tool for PHP, Perl, JS and Python</title>
		<link>http://blog.eirikhoem.net/index.php/2008/04/29/handy-online-regex-tool-for-php-perl-js-and-python/</link>
		<comments>http://blog.eirikhoem.net/index.php/2008/04/29/handy-online-regex-tool-for-php-perl-js-and-python/#comments</comments>
		<pubDate>Tue, 29 Apr 2008 10:32:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://blog.eirikhoem.net/index.php/2008/04/29/handy-online-regex-tool-for-php-perl-js-and-python/</guid>
		<description><![CDATA[



A coworker of mine has been working on a ajax enabled regex tool which lets you evaluate regex expressions in several languages (including PHP PCRE and PHP POSIX) with instant results. You can choose which functions to use, such as match, match all, replace, split etc. It also offers some basic help and hints. It&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript"><!--
google_ad_client = "pub-0056923567680782";
/* default */
google_ad_slot = "6546082201";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
A coworker of mine has been working on a ajax enabled regex tool which lets you evaluate regex expressions in several languages (including PHP PCRE and PHP POSIX) with instant results. You can choose which functions to use, such as match, match all, replace, split etc. It also offers some basic help and hints. It&#8217;s really handy when working on those painful expressions.</p>
<p>You can check it out at <a href="http://regex.larsolavtorvik.com/" onclick="javascript:pageTracker._trackPageview ('/outbound/regex.larsolavtorvik.com');">http://regex.larsolavtorvik.com/</a>. Stop by <a href="http://larsolavtorvik.com/" onclick="javascript:pageTracker._trackPageview ('/outbound/larsolavtorvik.com');">his blog</a> as well.</p>
<p>Technorati Tags: <a href="http://technorati.com/tag/PHP" rel="tag">PHP</a>, <a href="http://technorati.com/tag/Perl" rel="tag">Perl</a>, <a href="http://technorati.com/tag/JavaScript" rel="tag">JavaScript</a>, <a href="http://technorati.com/tag/Python" rel="tag">Python</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eirikhoem.net/index.php/2008/04/29/handy-online-regex-tool-for-php-perl-js-and-python/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Populate PDF templates with PHP / FPDF / FPDI</title>
		<link>http://blog.eirikhoem.net/index.php/2008/04/28/populate-pdf-templates-with-php-fpdf-fpdi/</link>
		<comments>http://blog.eirikhoem.net/index.php/2008/04/28/populate-pdf-templates-with-php-fpdf-fpdi/#comments</comments>
		<pubDate>Mon, 28 Apr 2008 13:52:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[PDF]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://blog.eirikhoem.net/index.php/2008/04/28/populate-pdf-templates-with-php-fpdf-fpdi/</guid>
		<description><![CDATA[
Ever wanted to generated PDF documents on the fly with PHP? Perhaps populate a standard contract with a customers name and address? FPDF and FPDI are two neat libraries which greatly helps when working with PDF files. FPDF is the main library for handling PDF files, while FPDI lets your import existing PDF documents into [...]]]></description>
			<content:encoded><![CDATA[<p><!--adsense#shortadd--><br />
Ever wanted to generated PDF documents on the fly with PHP? Perhaps populate a standard contract with a customers name and address? FPDF and FPDI are two neat libraries which greatly helps when working with PDF files. FPDF is the main library for handling PDF files, while FPDI lets your import existing PDF documents into the FPDF documents. In the code sample I&#8217;ve prepared here I&#8217;m importing a PDF template document, writing some information to the document, then sending it to the &#8220;customer&#8221;. FPDF offers several neat ways to expose the generated document, such as a stream to the browser, a string, or just storing it to file. You can download <a href="http://blog.eirikhoem.net/wp-content/uploads/2008/04/pdf_sample.zip" title="PDF Sample code">PDF Sample code</a> to test it.</p>
<p>Be sure to head on over to the <a href="http://www.fpdf.org/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.fpdf.org');">FPDF site</a> and <a href="http://www.setasign.de/products/pdf-php-solutions/fpdi/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.setasign.de');">FPDI site</a> for more information on these two libs. <a href="http://blog.eirikhoem.net/wp-content/uploads/2008/04/pdf_sample.zip" title="PDF Sample code"></a></p>
<p><strong>Related posts:</strong><br />
<a href="http://blog.eirikhoem.net/index.php/2007/06/15/generated-pdfs-over-https-with-internet-explorer/">Generated PDFs over HTTPS with Internet Explorer</a></p>
<p>Technorati Tags: <a href="http://technorati.com/tag/PHP" rel="tag">PHP</a>, <a href="http://technorati.com/tag/PDF" rel="tag">PDF</a>, <a href="http://technorati.com/tag/Frameworks" rel="tag">Frameworks</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eirikhoem.net/index.php/2008/04/28/populate-pdf-templates-with-php-fpdf-fpdi/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Google does a Selenium framework?</title>
		<link>http://blog.eirikhoem.net/index.php/2008/04/25/google-does-a-selenium-framework/</link>
		<comments>http://blog.eirikhoem.net/index.php/2008/04/25/google-does-a-selenium-framework/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 08:00:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://blog.eirikhoem.net/index.php/2008/04/25/google-does-a-selenium-framework/</guid>
		<description><![CDATA[
I just came across this post by Mike Henke, where he writes about a presentation from the Google Automating Testing Conference. Google is working on a framework based on Selenium which they use internally. The post contains some interesting slides in addition to a presentation video.  I&#8217;ve embedded the video in this post for [...]]]></description>
			<content:encoded><![CDATA[<p><!--adsense#shortadd--><br />
I just came across this post by <a href="http://henke.ws/machblog/index.cfm?event=showEntry&amp;entryId=6CE7497E-19B9-BA51-EE3B15FA0CAB9A2D" onclick="javascript:pageTracker._trackPageview ('/outbound/henke.ws');">Mike Henke</a>, where he writes about a presentation from the Google Automating Testing Conference. Google is working on a framework based on Selenium which they use internally. The post contains some interesting slides in addition to a presentation video.  I&#8217;ve embedded the video in this post for your convenience, but I suggest you give Mike a visit.</p>
<p><strong>Update: Video removed, please check the links above.</strong></p>
<p>Technorati Tags: <a href="http://technorati.com/tag/PHP" rel="tag">PHP</a>, <a href="http://technorati.com/tag/Testing" rel="tag">Testing</a>, <a href="http://technorati.com/tag/Frameworks" rel="tag">Frameworks</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eirikhoem.net/index.php/2008/04/25/google-does-a-selenium-framework/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting xsi:type for objects sent over SOAP (inheritance)</title>
		<link>http://blog.eirikhoem.net/index.php/2008/03/17/setting-xsitype-for-objects-sent-over-soap-inheritance/</link>
		<comments>http://blog.eirikhoem.net/index.php/2008/03/17/setting-xsitype-for-objects-sent-over-soap-inheritance/#comments</comments>
		<pubDate>Mon, 17 Mar 2008 14:02:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[SOAP]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[X-Fire]]></category>

		<guid isPermaLink="false">http://blog.eirikhoem.net/?p=28</guid>
		<description><![CDATA[
This post is pretty much a revamp of a previous post called &#8220;Working with X-Fire soap services and inheritance in PHP&#8220;. That title was a bit misleading, and not really that good when it came to providing a sample.
Let&#8217;s say we have a SOAP method called createCustomer(Customer c), and we have a base class called [...]]]></description>
			<content:encoded><![CDATA[<p><!--adsense#shortadd--></p>
<p>This post is pretty much a revamp of a previous post called &#8220;<a href="http://blog.eirikhoem.net/index.php/2007/05/21/working-with-x-fire-soap-services-and-inheritance-in-php/">Working with X-Fire soap services and inheritance in PHP</a>&#8220;. That title was a bit misleading, and not really that good when it came to providing a sample.</p>
<p>Let&#8217;s say we have a SOAP method called createCustomer(Customer c), and we have a base class called Customer, which has to subclasses, Person and Organization. Person has firstname, lastname, while Organization as orgname and orgid. Now, the createCustomer call accepts a object of the class Customer, and any derived classes.</p>
<p>When retrieving a Person / Organization over SOAP, PHP automatically creates instances of the correct classes, but when calling createCustomer, passing a Person / Organization it breaks. Out object is sent as a Customer, but with Person or Organization fields added. The SOAP server expects to find a xsi:type for the object we are sending to tell what kind of Customer it is. It seems like PHP does not set this itself (maybe it should?).</p>
<p>I spent quite some time looking for info on how to specify the xsi:type for the objects, and I finally came across <a href="http://no.php.net/manual/en/function.soap-soapvar-construct.php" onclick="javascript:pageTracker._trackPageview ('/outbound/no.php.net');">SoapVar</a>.</p>
<p>I created a base class which the SOAP classes extended. A method called pack is responsible for setting xsi:type.</p>
<p>(I&#8217;m very aware that my pasted code looks like a mess in this blog. I will fix that ASAP).</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre></td><td class="code"><pre class="php">&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> BaseClass<span style="color: #66cc66;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">private</span>  <span style="color: #0000ff;">$namespace</span> = <span style="color: #ff0000;">&quot;http://model.api.domain.com&quot;</span>; <span style="color: #808080; font-style: italic;">// from your WSDL</span>
  protected <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #000066;">pack</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$obj</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
    <span style="color: #0000ff;">$class_name</span> = <span style="color: #000066;">get_class</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$obj</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #0000ff;">$namespace</span> = <span style="color: #ff0000;">&quot;http://model.api.domain.com&quot;</span>;
    <span style="color: #0000ff;">$pack</span> = <span style="color: #000000; font-weight: bold;">new</span> SoapVar<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$obj</span>, XSD_STRING, <span style="color: #ff0000;">&quot;$class_name&quot;</span>, <span style="color: #0000ff;">$namespace</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">$pack</span>;
  <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> createCustomer <span style="color: #000000; font-weight: bold;">extends</span> BaseClass<span style="color: #66cc66;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> setCustomer<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$customer</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
    <span style="color: #0000ff;">$this</span>-&amp;gt;customer = <span style="color: #0000ff;">$this</span>-&amp;gt;pack<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$customer</span><span style="color: #66cc66;">&#41;</span>;
  <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0000ff;">$customer</span> = <span style="color: #000000; font-weight: bold;">new</span> Person<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0000ff;">$customer</span>-&amp;gt;setName<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;John Doe&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$request</span> = <span style="color: #000000; font-weight: bold;">new</span> createCustomer<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0000ff;">$request</span>-&amp;gt;setAccountID<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">123</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0000ff;">$request</span>-&amp;gt;setCustomer<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$customer</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$client</span>-&amp;gt;createCustomer<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$request</span><span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>That fixed the problems for me atleast.</p>
<p><strong>PS: If your SOAP classes are prefixed you&#8217;ll need to strip the prefix in class_name when creating the SoapVar.</strong></p>
<p><strong> Related posts:</strong></p>
<ul>
<li><a href="http://blog.eirikhoem.net/index.php/2007/05/21/working-with-x-fire-soap-services-and-inheritance-in-php/">Working with X-Fire soap services and inheritance in PHP</a></li>
<li><a href="http://blog.eirikhoem.net/index.php/2008/03/13/array-problems-with-soap-and-php-updated/">Array problems with SOAP and PHP &#8211; Updated</a></li>
</ul>
<p><code><p>Technorati Tags: <a href="http://technorati.com/tag/PHP" rel="tag">PHP</a>, <a href="http://technorati.com/tag/SOAP" rel="tag"> SOAP</a></p>                                      </code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eirikhoem.net/index.php/2008/03/17/setting-xsitype-for-objects-sent-over-soap-inheritance/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
