<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Eat my monkeydust</title>
	
	<link>http://eatmymonkeydust.com</link>
	<description>Life, PHP and Symfony - straight from the monkey's mouth</description>
	<lastBuildDate>Sat, 03 Oct 2009 22:16:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/EatMyMonkeydust" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Random words and phrases – Pondus inspired</title>
		<link>http://feedproxy.google.com/~r/EatMyMonkeydust/~3/NfuVB5pbn_8/</link>
		<comments>http://eatmymonkeydust.com/2009/10/random-words-and-phrases-pondus-inspired/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 17:09:10 +0000</pubDate>
		<dc:creator>Russ</dc:creator>
				<category><![CDATA[Learn Norwegian]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://eatmymonkeydust.com/?p=233</guid>
		<description><![CDATA[I har ikke skrevet anything for a while, so whilst I read the new edition of Pondus I figured I might as well note a few nice ord and phrases I stumble across. I&#8217;ll also mention a few day-to-day things that I&#8217;ve come across that may be nyttig. Oh, and of course be a bit [...]]]></description>
			<content:encoded><![CDATA[<p>I <strong>har ikke skrevet</strong> anything for a while, so whilst I read the new edition of Pondus I figured I might as well note a few nice <strong>ord</strong> and phrases I stumble across. I&#8217;ll also mention a few day-to-day things that I&#8217;ve come across that may be <strong>nyttig</strong>. Oh, and of course be a bit<strong> forsiktig </strong>with the &#8220;<strong>Pondus ord</strong>&#8221; because many of them are of course quite &#8220;slangy&#8221;!</p>
<ul>
<li><strong>Det står ingenting på denne lappen</strong> &#8211; There is nothing on this ticket</li>
<li><strong>Overbevist</strong> &#8211; Satisfied</li>
<li><strong>Vellykket</strong> &#8211; Successful</li>
<li><strong>Du er nødt til å&#8230;</strong> &#8211; You really have to&#8230;</li>
<li><strong>Ta en blund &#8211; </strong>Take a nap</li>
<li><strong>Kan jeg få en sånn</strong> &#8211; May I have one of those/these? (Whilst pointing at something)</li>
<li><strong>Kjempeflaks</strong> &#8211; Really lucky</li>
<li><strong>Kollisjonsputer</strong> &#8211; Airbags</li>
<li><strong>Jeg må tidlig opp</strong> &#8211; I have to be up early</li>
<li><strong>Litt skuffa</strong> &#8211; A bit disappointed</li>
<li><strong>Vidunderlig</strong> &#8211; Wonderful</li>
<li><strong>Jeg er lei av&#8230;</strong> &#8211; I&#8217;m sick of&#8230;</li>
<li><strong>Jeg vil du skal&#8230;</strong> &#8211; I would like you to&#8230;</li>
<li><strong>Åpenbart</strong> &#8211; Obviously</li>
<li><strong>Ødelegge</strong> &#8211; Destroy</li>
<li><strong>Takk og lov!</strong> &#8211; Thank goodness!</li>
</ul>
<p>*vis words that I like:</p>
<ul>
<li><strong>Sannsynligvis &#8211; </strong>Probably<strong><br />
</strong></li>
<li><strong>Tilfeldigvis &#8211; </strong>Accidentally</li>
<li><strong>Forhåpentligvis</strong> &#8211; Hopefully</li>
<li><strong>Heldigvis &#8211; </strong>Luckily</li>
</ul>
<p>* P.s. When I write <strong>på engelsk</strong> I am borrowing a format that I really like, used by Kari in her <a href="http://www.transparent.com/norwegian/" target="_blank">Norwegian blog</a>. I urge you to subscribe to that one too!</p>
<img src="http://feeds.feedburner.com/~r/EatMyMonkeydust/~4/NfuVB5pbn_8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://eatmymonkeydust.com/2009/10/random-words-and-phrases-pondus-inspired/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://eatmymonkeydust.com/2009/10/random-words-and-phrases-pondus-inspired/</feedburner:origLink></item>
		<item>
		<title>PHP Session settings ignored?</title>
		<link>http://feedproxy.google.com/~r/EatMyMonkeydust/~3/VN3XQZQqyIw/</link>
		<comments>http://eatmymonkeydust.com/2009/10/php-session-settings-ignored/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 16:43:37 +0000</pubDate>
		<dc:creator>Russ</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[lamp]]></category>
		<category><![CDATA[session]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://eatmymonkeydust.com/?p=229</guid>
		<description><![CDATA[I just read an extremely interesting post which explains an unwanted side effect of garbage collection by some Debian based systems. This cleanup process causes (maybe amongst other things) sessions to be cleared every 24 minutes, regardless of any ini setting you have set after the php.ini file is parsed (for example using ini_set() &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>I just read an <a href="http://elephpants.blog.linpro.no/2009/10/02/unwanted-end-of-sessions/">extremely interesting post</a> which explains an unwanted side effect of garbage collection by some Debian based systems. This cleanup process causes (maybe amongst other things) sessions to be cleared every 24 minutes, regardless of any ini setting you have set after the php.ini file is parsed (for example using ini_set() &#8211; if you are a symfony user, this is done during initialisation based on a setting in your factories.yml file).</p>
<p>Check it out: <a href="http://elephpants.blog.linpro.no/2009/10/02/unwanted-end-of-sessions/">http://elephpants.blog.linpro.no/2009/10/02/unwanted-end-of-sessions/</a></p>
<img src="http://feeds.feedburner.com/~r/EatMyMonkeydust/~4/VN3XQZQqyIw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://eatmymonkeydust.com/2009/10/php-session-settings-ignored/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://eatmymonkeydust.com/2009/10/php-session-settings-ignored/</feedburner:origLink></item>
		<item>
		<title>Symfony forms – Flexible widgets based on user credentials</title>
		<link>http://feedproxy.google.com/~r/EatMyMonkeydust/~3/C_2S_4pK8O4/</link>
		<comments>http://eatmymonkeydust.com/2009/08/symfony-forms-flexible-widgets-based-on-user-credentials/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 13:42:09 +0000</pubDate>
		<dc:creator>Russ</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[best practice]]></category>
		<category><![CDATA[dependency injection]]></category>
		<category><![CDATA[widgets]]></category>

		<guid isPermaLink="false">http://eatmymonkeydust.com/?p=215</guid>
		<description><![CDATA[Background
This issue has come up many times in the symfony forum and on IRC, and whilst it seems like a fairly trivial one, it is important to discuss the best practice around it. Often we want to modify a form based on something outside the form&#8217;s scope, like a user&#8217;s credentials or the page they [...]]]></description>
			<content:encoded><![CDATA[<h2>Background</h2>
<p>This issue has come up many times in the symfony forum and on IRC, and whilst it seems like a fairly trivial one, it is important to discuss the best practice around it. Often we want to modify a form based on something outside the form&#8217;s scope, like a user&#8217;s credentials or the page they are on, or maybe some session values &#8211; lets take the example of a dropdown widget where admin users get to see a few more options.</p>
<h2>The bad way</h2>
<p>Everyone that has been using symfony for a while is aware of the context singleton. This magic sprite allows us to grab all sorts of information about the context we are in, including the user, session, request, view, and many more things. Whilst it certainly has its place, most of the time, however, we should avoid using it. The clue to the reason why is carefully disguised in the class name &#8220;Context&#8221;.</p>
<p>When we refer to a context in our code, we are locking ourselves in to the fact that the context must exist, so every time we use it we are basically saying that this class can now only be used in a symfony project with a fully initialised symfony stack hanging over it.  This becomes a problem in things like unit tests, where you have to mock up a loaded context object with bells and whistles in order to test a simple function or class.</p>
<p>So this is what you might think of doing:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// In your form class</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> configure<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$choices</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;something boring&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;something dull&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000088;">$currentUser</span> <span style="color: #339933;">=</span> sfContext<span style="color: #339933;">::</span><span style="color: #004000;">getInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getUser</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$currentUser</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isAuthenticated</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$currentUser</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">hasCredential</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;admin&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$choices</span> <span style="color: #339933;">+=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">5</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;something cool&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">6</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;something leet&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// ....</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>The reason this is bad is that the forms framework is a standalone framework &#8211; it should be possible to pick up your form class and drop it into any project. It should also be possible to test it independently of symfony, without being tied in by sfContext. So what is the better way?</p>
<h2>The dependency injection approach</h2>
<p>You might read that and think &#8220;woah, this is getting complicated!&#8221; but we&#8217;re not talking about dependency injection containers here, we&#8217;re simply saying that you can make your form object depend on something to run. The thing it depends on should not be the context singleton, it should be the minimum thing that the form needs to operate correctly &#8211; which in this case, is a user object that supports credentials.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// In your actions.class.php</span>
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">form</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> myForm<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;currentUser&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getUser</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// In your form class</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// ...</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">is_object</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getOption</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;currentUser&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getOption</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;currentUser&quot;</span><span style="color: #009900;">&#41;</span> instanceof sfUser<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  throw <span style="color: #000000; font-weight: bold;">new</span> InvalidArgumentException<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;You must pass a user object as an option to this form!);
}</span></pre></div></div>

<p>The test here is where we are making this form &#8220;dependent&#8221; on a user object. In this case we are insisting that the object is an instance of sfUser, which you may argue is tying us in to symfony again, but you could use any test here to ensure that the object will have the necessary functionality you need, maybe check for the existence of a &#8220;hasCredential()&#8221; method for example.</p>
<p>When writing a test for this form class, we now only need to instantiate a user object and load it with some credentials &#8211; much easier than doing the same thing and locking into a context singleton. There may be other times when this form could be useful in a lightweight environment, where you can get speedy access to a user object but don&#8217;t want the overhead of the symfony context &#8211; you might not think of one now, but it&#8217;s best to code this way and you&#8217;ll have less reasons to kick yourself further down the line.</p>
<h2>The completed code, for our single widget form</h2>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// In your form class</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> configure<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">is_object</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getOption</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;currentUser&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getOption</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;currentUser&quot;</span><span style="color: #009900;">&#41;</span> instanceof sfUser<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> 
  <span style="color: #009900;">&#123;</span>
    throw <span style="color: #000000; font-weight: bold;">new</span> InvalidArgumentException<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;You must pass a user object as an option to this form!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #b1b100;">else</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$currentUser</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getOption</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;currentUser&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000088;">$choices</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;something boring&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;something dull&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$currentUser</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isAuthenticated</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$currentUser</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">hasCredential</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;admin&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$choices</span> <span style="color: #339933;">+=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">5</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;something cool&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">6</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;something leet&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">widgetSchema</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'my_dropdown'</span><span style="color: #009900;">&#93;</span>    <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> sfWidgetFormChoice<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;choices&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$choices</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">validatorSchema</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'my_dropdown'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> sfValidatorChoice<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;choices&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$choices</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #009900;">&#125;</span></pre></div></div>

<h2>Wrap up</h2>
<p>Think about this example the next time you think about modifying a query based on a user object, or session value in a peer class, or Doctrine table class&#8230; Maybe you should have passed a parameter there too? Every class and method you write, think about how you can reuse it, will it even be possible the way you have written it? If something simply <strong>must</strong> be coded in a symfony specific way, think about making a parent and a child class for the problem you are trying to solve. In the parent class, you can make things as generic as possible &#8211; so you can re-use that class to your heart&#8217;s content. In the child class, you can add the symfony specific code &#8211; kept to a minimum.</p>
<img src="http://feeds.feedburner.com/~r/EatMyMonkeydust/~4/C_2S_4pK8O4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://eatmymonkeydust.com/2009/08/symfony-forms-flexible-widgets-based-on-user-credentials/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		<feedburner:origLink>http://eatmymonkeydust.com/2009/08/symfony-forms-flexible-widgets-based-on-user-credentials/</feedburner:origLink></item>
		<item>
		<title>Chris Ryan inspired Norwegian vocabulary – Blodpenger chapter 1</title>
		<link>http://feedproxy.google.com/~r/EatMyMonkeydust/~3/HKYZy4NZOFU/</link>
		<comments>http://eatmymonkeydust.com/2009/06/random-chris-ryan-inspired-norwegian-vocabulary-bloodpenger-chapter1/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 21:22:35 +0000</pubDate>
		<dc:creator>Russ</dc:creator>
				<category><![CDATA[Learn Norwegian]]></category>

		<guid isPermaLink="false">http://eatmymonkeydust.com/?p=213</guid>
		<description><![CDATA[Why?
I haven&#8217;t been too active lately with the Norwegian blog, mostly because of the usal lame excuse regarding time and too much work and all that. One thing I have been doing lately is reading, or at least trying to read the Chris Ryan book &#8220;Blodpenger&#8221;, and during this reading several words crop up that [...]]]></description>
			<content:encoded><![CDATA[<h1>Why?</h1>
<p>I haven&#8217;t been too active lately with the Norwegian blog, mostly because of the usal lame excuse regarding time and too much work and all that. One thing I have been doing lately is reading, or at least trying to read the Chris Ryan book &#8220;Blodpenger&#8221;, and during this reading several words crop up that are interesting &#8211; but which I forget way too quickly.</p>
<p>Hopefully by sharing some of them here, it will help me to remember, and also give me a quick reference point for when I inevitably forget again!</p>
<h1>Some words &#8211; from prologue and chapter 1</h1>
<ul>
<li>Sylige &#8211; visible</li>
<li>Stram &#8211; tight (fingrene var stram)</li>
<li>Forvridd &#8211; contorted, mangled, twisted (På ringfingeren satt en forvridd gullring)</li>
<li>Dugg &#8211; dew</li>
<li>Grundigere &#8211; thoughtfully</li>
<li>Bøye &#8211; bend (han bøyde seg = he bent over)</li>
<li>Tilhøre &#8211; belong to (måtte ha tilørt en kvinne)</li>
<li>Halvannen &#8211; one and a half</li>
<li>en Grop ( a ditch)</li>
<li>Peste &#8211; panted (den peste mens den løp)</li>
<li>Ryggsøyle &#8211; spine</li>
<li>Mistanke &#8211; suspicion</li>
<li>Nøyaktig &#8211; precisely</li>
<li>Gjørmete &#8211; muddy</li>
<li>Gned &#8211; rubbed</li>
<li>Slør &#8211; veil</li>
<li>Blikk &#8211; look, glance (hun løftet blikket)</li>
<li>Lynraskt &#8211; very quickly, blazingly, &#8220;at light speed&#8221;</li>
<li>Påføre &#8211; cause, bring upon</li>
<li>Som ventet &#8211; as expected (den var som ventet)</li>
<li>Ifølge &#8211; according to</li>
<li>Somle &#8211; faff, dawdle, time waste</li>
<li>Myke halsen &#8211; stiff neck</li>
<li>Klesplagg &#8211; Garment, Item of clothing (et nytt klesplagg)</li>
<li>Øreflippen &#8211; the earlobe</li>
<li>Slikket &#8211; licked</li>
<li>Åndsfraværende &#8211; vacantly (Han slikket øreflippen hennes åndsfraværende)</li>
<li>Ånd &#8211; spirit, Fraværende &#8211; absent</li>
<li>Bekymret &#8211; worried, concerned (det som bekymret ham)</li>
<li>Fortjener &#8211; deserve</li>
<li>Halvt fordervet &#8211; half to death (han slo henne halv fordervet)</li>
<li>Tillatelse &#8211; permission</li>
</ul>
<p>And that&#8217;s not even the whole chapter&#8230;</p>
<img src="http://feeds.feedburner.com/~r/EatMyMonkeydust/~4/HKYZy4NZOFU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://eatmymonkeydust.com/2009/06/random-chris-ryan-inspired-norwegian-vocabulary-bloodpenger-chapter1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://eatmymonkeydust.com/2009/06/random-chris-ryan-inspired-norwegian-vocabulary-bloodpenger-chapter1/</feedburner:origLink></item>
		<item>
		<title>Doctrine Gotchas – delete cascade, SoftDelete and foreignType</title>
		<link>http://feedproxy.google.com/~r/EatMyMonkeydust/~3/vvZ8ojE-b1A/</link>
		<comments>http://eatmymonkeydust.com/2009/05/doctrine-gotchas-delete-cascade-sofdelete-and-foreigntype/#comments</comments>
		<pubDate>Sat, 16 May 2009 13:41:43 +0000</pubDate>
		<dc:creator>Russ</dc:creator>
				<category><![CDATA[Doctrine]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[cascade]]></category>
		<category><![CDATA[delete]]></category>
		<category><![CDATA[foreign key]]></category>
		<category><![CDATA[foreignType]]></category>
		<category><![CDATA[relations]]></category>
		<category><![CDATA[transitive persistence]]></category>

		<guid isPermaLink="false">http://eatmymonkeydust.com/?p=204</guid>
		<description><![CDATA[These are mistakes anyone can make, as proved by our team of experienced developers who only came across these late into a project &#8211; after developing with Doctrine for over 6 months.
Cascading / Transitive persistence
In Doctrine there are two ways to define a cascade, one will tell Doctrine what to do, the other defines how [...]]]></description>
			<content:encoded><![CDATA[<p>These are mistakes anyone can make, as proved by our team of experienced developers who only came across these late into a project &#8211; after developing with Doctrine for over 6 months.</p>
<h2>Cascading / Transitive persistence</h2>
<p>In Doctrine there are two ways to define a cascade, one will tell Doctrine what to do, the other defines how that condition is set up on your database when Doctrine builds the sql commands. The reason this was a gotcha for me, is that we only ever used one of the types, and were completely unaware of the other one! The Doctrine manual is quite long, and unless you&#8217;ve read it several times cover to cover it&#8217;s easy to miss these things &#8211; although next time I will at least be reading the appropriate section of the manual, regardless of what I <em>think</em> I already know.</p>
<p>So, you want a delete cascade? You might do something like this in your yaml file:</p>

<div class="wp_syntax"><div class="code"><pre class="yaml" style="font-family:monospace;">PhoneNumber:
  columns:
    user_id:
      type: integer
  relations:
    User:
      class:       User
      local:       user_id
      foreign:     id
      onDelete:    CASCADE</pre></div></div>

<p>What the above definition says is that this phone number is connected to a user, and if the user record is deleted &#8211; in order to maintain database integrity with foreign keys, the corresponding phone number records should also be deleted. This is perfect behaviour &#8211; but Doctrine does not do anything with it, it simply sets up the database to handle it, so if you are using a dbms that supports delete cascades then everything will be handled at the database level.</p>
<h3>Adding softDelete to the equation</h3>
<p>So here comes the gotcha, all of our tables use the softDelete behaviour &#8211; which means that instead of the row being deleted, a flag is set (deleted=true) which then magically makes the row appear deleted in all your queries (Providing you have <a href="http://www.doctrine-project.org/documentation/manual/1_1/en/behaviors:core-behaviors:softdelete">dql callbacks turned on</a>). This means that the row is never actually deleted at the databse level, and thus the cascade is never applied. Now I always knew this, I mean I wouldn&#8217;t install a behaviour before knowing what it does right? What I wrongly assumed was that the call to onDelete: CASCADE would take care of &#8220;soft deleting&#8221; my relations too, but it doesn&#8217;t, in fact that line is effectively useless when combined with softDelete. For that you need to set the doctrine cascade parameter:</p>

<div class="wp_syntax"><div class="code"><pre class="yaml" style="font-family:monospace;">PhoneNumber:
  actAs: [softDelete]
  columns:
    user_id:
      type: integer
  relations:
    User:
      class:       User
      local:       user_id
      foreign:     id
      foreignType: one
      cascade:     [delete]</pre></div></div>

<p>Now the behaviour will be as expected. If you are using softDelete and your application has a lot of delete operations, you should take some time to understand what is happening, because Doctrine must fetch and load all of the related objects and then check their relations and cascade settings and so on, so in a large system deleting a single user could result in quite a lot of database queries and cpu time. It is for this reason that database level cascades are preferable, so maybe being more picky about which models you apply the softDelete behaviour would be prudent. <a href="http://www.doctrine-project.org/documentation/manual/1_1/en/defining-models:transitive-persistence">Learn more about Doctrine Transitive Persistance</a>.</p>
<h2>Defining types of foreign key relations</h2>
<p>This one is also one of those &#8220;read the manual&#8221; situations, but similarly to the above example what caught us out here is that we again thought that there was only one option for defining what we wanted to do, when in fact there were too parameters we should have been considering. This gotcha also only applies if you are defining your relations in a yaml file, as the problem lies in it&#8217;s interpretation when Doctrine builds the base classes.</p>
<p>Look at the following example:</p>

<div class="wp_syntax"><div class="code"><pre class="yaml" style="font-family:monospace;">User:
  columns:
    payment_id:
      type: integer
      notnull: true
  relations:
    Payments:
      class:       Payment
      local:       payment_id
      foreign:     id
      foreignType: many</pre></div></div>

<p>The intention was that a user could have multiple payments, and it seemed to make sense to define it using the foreignType parameter above, however when the model was built &#8211; this always related in a $this->hasOne(&#8230;) statement being created, because what was actually happening is that we were not defining the relationship at the other end, we were actually defining it at the local end! So foreignType: many actually means &#8220;Many users can have one payment&#8221; &#8211; hence the interpretation of $this->hasOne(..)</p>
<p>In actual fact using the foreignType key is mostly useless, as Doctrine &#8220;guesses&#8221; this side of the relationship. It&#8217;s only necessary if Doctrine guesses incorrectly and you need to override it, our example above should actually have been using the &#8220;type&#8221; parameter, which defines the relationship from the other perspective:</p>

<div class="wp_syntax"><div class="code"><pre class="yaml" style="font-family:monospace;">User:
  columns:
    payment_id:
      type: integer
      notnull: true
  relations:
    Payments:
      class:    Payment
      local:    payment_id
      foreign:  id
      type:     many</pre></div></div>

<p>Adding [ foreignType: one ] to this schema declaration would have no offect, as Doctrine would guess it to be the case (in this example). The above declaration will now correctly form a $this->hasMany(&#8230;) statement in your base class. To make it easy to remember, just forget about foreignType all together unless you come across a special case where you nee it &#8211; and prepend the word &#8220;has&#8221; to the type parameter, that should give you a clue as to what you are defining.</p>
<p>So, with one-to-one relationships, the type parameter is unnecessary, with one-to-many you specify the type: many (Doctrine will guess the one part) and with many-to-one you also do not need to specify the type as it will be guessed based on how you&#8217;ve got the relation set up from the other model&#8217;s perspective.</p>
<p><a href="http://www.doctrine-project.org/documentation/manual/1_1/en/defining-models:relationships:foreign-key-associations">Read more about relations in the Doctrine manual.</a></p>
<h2>Conclusion</h2>
<p>it&#8217;s hard to believe that after 6 months of coding a large application that currently has over 30,000 lines of code and growing we could have a schema file with several useless calls to onDelete: CASCADE and even more useless calls to foreignType. It&#8217;s even harder to believe that in the early days of the project, we simply overrode the setup methods to add the relations that we needed, when the Schema.yml file failed to come up with the goods. Next time I think I&#8217;ll spend a little more time with the documentation, although we are <em>of course</em> experts now &#8211; so maybe next time we won&#8217;t need to? <img src='http://eatmymonkeydust.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/EatMyMonkeydust/~4/vvZ8ojE-b1A" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://eatmymonkeydust.com/2009/05/doctrine-gotchas-delete-cascade-sofdelete-and-foreigntype/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://eatmymonkeydust.com/2009/05/doctrine-gotchas-delete-cascade-sofdelete-and-foreigntype/</feedburner:origLink></item>
		<item>
		<title>PHP TestFest Norway 2009</title>
		<link>http://feedproxy.google.com/~r/EatMyMonkeydust/~3/QvQm9dlqFD4/</link>
		<comments>http://eatmymonkeydust.com/2009/05/php-testfest-norway-2009/#comments</comments>
		<pubDate>Thu, 07 May 2009 14:33:34 +0000</pubDate>
		<dc:creator>Russ</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Symfony]]></category>

		<guid isPermaLink="false">http://eatmymonkeydust.com/?p=198</guid>
		<description><![CDATA[
If you use PHP and have ever wondered why you get something so cool for free, maybe a little tang of guilt can creep in. Contributing to the language in one way or another is a great way to pay something back, and there are many ways to do so, one of which is to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://php.no/node/323"><img class="alignright" title="TestFest logo Norwegian style" src="http://eatmymonkeydust.com/testfestnorway.jpg" alt="Test Fest Norway 2009" width="192" height="219" /></a></p>
<p>If you use PHP and have ever wondered why you get something so cool for free, maybe a little tang of guilt can creep in. Contributing to the language in one way or another is a great way to pay something back, and there are many ways to do so, one of which is to write tests&#8230;.</p>
<p>Tests keep the code sane. Every time things change, the tests can be run to make sure that everything still works ok &#8211; just like the php tests you (hopefully) write in your own projects. The best way to maintain this stability for the language itself is also to have as much code covered by tests as possible.</p>
<p>Every year, the PHP team organises <a href="http://qa.php.net/testfest.php">TestFes</a>t, aiming to introduce testing to the masses in the most straightforward way. All you have to do is find out where your nearest event is being held and sign up. You will be given everything you need and assisted in every way to help you write at least one test &#8211; hopefully many more.</p>
<p>Details of TestFest 2009 Norway have just been released, if you are in the area, <a title="TestFest 2009 Norway" href="http://php.no/node/323">check it out</a>!</p>
<img src="http://feeds.feedburner.com/~r/EatMyMonkeydust/~4/QvQm9dlqFD4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://eatmymonkeydust.com/2009/05/php-testfest-norway-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://eatmymonkeydust.com/2009/05/php-testfest-norway-2009/</feedburner:origLink></item>
		<item>
		<title>Aker – from farm to fame</title>
		<link>http://feedproxy.google.com/~r/EatMyMonkeydust/~3/NFVi5sYumGU/</link>
		<comments>http://eatmymonkeydust.com/2009/05/aker-from-farm-to-fame/#comments</comments>
		<pubDate>Sun, 03 May 2009 15:19:51 +0000</pubDate>
		<dc:creator>Russ</dc:creator>
				<category><![CDATA[Learn Norwegian]]></category>

		<guid isPermaLink="false">http://eatmymonkeydust.com/?p=181</guid>
		<description><![CDATA[Background
The word Aker comes up a lot in and around Oslo, and after a brief discussion about it yesterday, it struck me that using familiar names can help us to learn less familiar vocabulary.
The word comes from old Norse for &#8220;acre&#8221; and was the name of an old farm, which helped to name a church [...]]]></description>
			<content:encoded><![CDATA[<h2>Background</h2>
<p>The word <strong>Aker</strong> comes up a lot in and around Oslo, and after a brief discussion about it yesterday, it struck me that using familiar names can help us to learn less familiar vocabulary.</p>
<p>The word comes from old Norse for &#8220;acre&#8221; and was the name of an old farm, which helped to name a church (the old Aker church) which then went on to name the district and spawn the other things we know and love today. You can read more about that on the <a href="http://en.wikipedia.org/wiki/Aker,_Norway">Wikipedia page</a>. </p>
<h2>Words to learn that &#8220;Aker&#8221; can help us to remember</h2>
<ul>
<li>Hus = House &#8211; You should be familiar with <a href="http://en.wikipedia.org/wiki/Akershus">Akershus</a> (county), literally &#8220;the House of Aker&#8221; but don&#8217;t read too much into that without reading the following reference also:</li>
<li>Festning = Fortress &#8211; <a href="http://en.wikipedia.org/wiki/Akershus_festning">Akershus Festning</a> is the fortress overlooking the Oslo Fjord. It&#8217;s name fully expanded means something like &#8220;The fortified house of Aker&#8221;. The district of Akershus was named after the fortress, not the other way around!</li>
<li>Elv = River (feminine so &#8220;the river&#8221; is &#8220;elva&#8221;) &#8211; <a href="http://en.wikipedia.org/wiki/Akerselva">Akerselva</a> is the river that runs through Oslo, literally &#8220;the river of Aker&#8221;</li>
<li>Østre = Eastern &#8211; one of the main roads running in an Easterly direction out of Oslo parallel to the E6 is <a href="http://www.gulesider.no/kart/#lat%3D6644821.01055%26lon%3D601713.11047%26zoom%3D15%26layers%3DB0000%26id%3Da_205411%26offset%3D0%26tab%3Daddress">Østre Aker Vei</a>, literally &#8220;Eastern Aker road&#8221;. We may already know that &#8220;Øst&#8221; means &#8220;East&#8221; so this helps us to remember the method to convert to &#8220;Eastern&#8221;.</li>
<li>Brygge = Jetty &#8211; You need to be in the marine industry to know exactly how this would translate in English (wharf, quay, mooring, dock, etc), but jetty is probably closest. Situated in the Oslo habour is the trendy district of <a href="http://en.wikipedia.org/wiki/Aker_brygge">Aker Brygge </a> where you will find shops, restaurants, apartments and more. (You should also be aware that Brygge can be a verb &#8211; to brew).</li>
<li>Sykehus = Hospital &#8211; &#8220;Aker Sykehus&#8221; and &#8220;Akershus sykehus&#8221; (Known as A-hus) are 2 of the hospitals serving Akershus.</li>
<li>Gamle Kirke = Old church &#8211; <a href="http://en.wikipedia.org/wiki/Old_Aker_Church">Gamle Aker kirke</a> is one of the reasons for the name, and is the oldest existing building in Oslo.</li>
<li>Bakke = Hill &#8211; <a href="http://www.gulesider.no/kart/#lat%3D6644236.47956%26lon%3D597831.96098%26zoom%3D16%26layers%3DB0000%26id%3Da_10000013318%26offset%3D0%26tab%3Daddress">Akersbakken</a> is the hill that Gamle Aker Kirke resides on, and also the name of the adjacent road</li>
</ul>
<h2>Summary</h2>
<p>Hopefully reading some interesting facts and making some connections in your brain between vocabulary and real world situations will help to improve your (and my) Norwegian. I have certainly learned a few things from producing this blog post, and I hope you do from reading it <img src='http://eatmymonkeydust.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/EatMyMonkeydust/~4/NFVi5sYumGU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://eatmymonkeydust.com/2009/05/aker-from-farm-to-fame/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://eatmymonkeydust.com/2009/05/aker-from-farm-to-fame/</feedburner:origLink></item>
		<item>
		<title>Norwegian phrase of the day – 20/04/09 (Oversvømmelse)</title>
		<link>http://feedproxy.google.com/~r/EatMyMonkeydust/~3/9-ShFiilwu4/</link>
		<comments>http://eatmymonkeydust.com/2009/04/norwegian-phrase-of-the-day-20-04-09-oversvommelse/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 13:01:47 +0000</pubDate>
		<dc:creator>Russ</dc:creator>
				<category><![CDATA[Learn Norwegian]]></category>
		<category><![CDATA[Phrase of the day]]></category>
		<category><![CDATA[flood]]></category>
		<category><![CDATA[oversvømmelse]]></category>

		<guid isPermaLink="false">http://eatmymonkeydust.com/?p=174</guid>
		<description><![CDATA[Preface
It has been a while since the last one, sorry about that! I have been orienteering in England and dealing with a bout of conjunctivitis but I&#8217;m back in the office now and raring to go. Today&#8217;s phrase got a bit messy because I&#8217;m still a bit tired and out of practice &#8211; so forgive [...]]]></description>
			<content:encoded><![CDATA[<h2>Preface</h2>
<p>It has been a while since the last one, sorry about that! I have been orienteering in England and dealing with a bout of conjunctivitis but I&#8217;m back in the office now and raring to go. Today&#8217;s phrase got a bit messy because I&#8217;m still a bit tired and out of practice &#8211; so forgive me, but also be thankful there are a few points to discuss <img src='http://eatmymonkeydust.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h2>Today&#8217;s word: Oversvømmelse</h2>
<ul>
<li>Translation: Flood</li>
<li>Pronunciation: <em>aw</em>-ver-shvur-merl-ser</li>
</ul>
<h2>First attempt</h2>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">Det har vært så lenge
siden jeg har skrivet
noen ting, derfor trenger jeg
en oversvømmelse av inspirasjon!
Siden jeg er ikke helt sikker om
setningen opp der, skal jeg også
sier at oversvømmelse i fjor
i England var kjempedårlig og
mange folk måtte dro fra husene deres.
Det var bra vær for ender!</pre></div></div>

<p>Errors/Observations:</p>
<ul>
<li>There is not really a Norwegian equivalent for &#8220;it has been so long since&#8221; so we should stick with &#8220;it is so long since&#8221;, <strong>det er så lenge siden</strong></li>
<li>å skrive, skrev, <strong>har skrevet</strong></li>
<li><strong>derfor</strong> does not really work here, we can replace it with <strong>at jeg trenger</strong></li>
<li>Ikke placement can be tricky, in this sentence (a subordinate clause) ikke must precede the finite verb: <strong>Siden jeg ikke er helt sikker</strong></li>
<li>Om and På can also be tricky for English speakers &#8211; here we should use <strong>sikker på</strong></li>
<li>The next sentence is a bit messy, and is better written as <strong>forige setning</strong>, or <strong>sentingen over</strong></li>
<li>&#8220;Skal jeg også sier at&#8221; is better written as <strong>vil jeg også si at</strong>. Vil and Skal can also cause some difficulties, since skal generally means &#8220;will, shall&#8221; and vil generally means &#8220;would like to, want to&#8221;. Sier should also have been in the infinitive, å si.</li>
<li><strong>kjempedårlig</strong> does not really work in this context, so we can introduce a new word: <strong>forferdelig</strong> (terrible)</li>
<li><strong>dro</strong> should be <strong>dra</strong>, as in English you would say &#8220;had to leave&#8221; not &#8220;had to left&#8221;.</li>
<li>Since we are talking about their own houses, we should say <strong>husene sine</strong>, otherwise we could be referring to &#8220;their&#8221; as in anybodies houses.</li>
</ul>
<p>Final edit:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">Det er så lenge
siden jeg har skrevet
noen ting at jeg trenger
en oversvømmelse av inspirasjon!
Siden jeg ikke er helt sikker på
forrige setning, vil jeg også
si at oversvømmelse i fjor
i England var forferdelig, og
mange folk måtte dra fra husene sine.
Det var bra vær for ender!</pre></div></div>

<p>Translation:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">It has been so long since
I have written anything that
I need a flood of inspiration!
Since I'm not totally sure about
the previous sentence, I will also
say that the floods last year
in England were terrible and many
people had to leave their houses.
It was nice weather for ducks!</pre></div></div>

<img src="http://feeds.feedburner.com/~r/EatMyMonkeydust/~4/9-ShFiilwu4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://eatmymonkeydust.com/2009/04/norwegian-phrase-of-the-day-20-04-09-oversvommelse/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://eatmymonkeydust.com/2009/04/norwegian-phrase-of-the-day-20-04-09-oversvommelse/</feedburner:origLink></item>
		<item>
		<title>Russ is short for Russell… or is it?</title>
		<link>http://feedproxy.google.com/~r/EatMyMonkeydust/~3/lqLNdIhoBns/</link>
		<comments>http://eatmymonkeydust.com/2009/04/russ-is-short-for-russell-or-is-it/#comments</comments>
		<pubDate>Thu, 09 Apr 2009 10:31:32 +0000</pubDate>
		<dc:creator>Russ</dc:creator>
				<category><![CDATA[Learn Norwegian]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[russ]]></category>
		<category><![CDATA[russ.no]]></category>
		<category><![CDATA[russell]]></category>
		<category><![CDATA[suit]]></category>
		<category><![CDATA[university]]></category>

		<guid isPermaLink="false">http://eatmymonkeydust.com/?p=172</guid>
		<description><![CDATA[Even before I came to Norway, I knew that I would have problems with my name because in recent years I&#8217;ve decided to use the shortened version (Russ) rather than it&#8217;s true form (Russell). Every time people ask my name, it takes a few tries to convince them that yes, I am named after the [...]]]></description>
			<content:encoded><![CDATA[<p>Even before I came to Norway, I knew that I would have problems with my name because in recent years I&#8217;ve decided to use the shortened version (Russ) rather than it&#8217;s true form (Russell). Every time people ask my name, it takes a few tries to convince them that yes, I am named after the end of year student celebrations that take place every year in Norway!</p>
<p>In fact, I applied for a job for the Norwegian &#8220;Russ service&#8221; web service (russ.no) which would have been pretty cool, as then I would have been russ@russ.no</p>
<p>Anyway, the reason I started writing this was because of the <a href="http://www.transparent.com/norwegian/2009/04/08/russ-not-short-for-russell/">Russ is not short for Russell blog post</a> which I&#8217;ve just read, do take a look and think of how it is for me and my name during this time of celebration and chaos.</p>
<img src="http://feeds.feedburner.com/~r/EatMyMonkeydust/~4/lqLNdIhoBns" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://eatmymonkeydust.com/2009/04/russ-is-short-for-russell-or-is-it/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://eatmymonkeydust.com/2009/04/russ-is-short-for-russell-or-is-it/</feedburner:origLink></item>
		<item>
		<title>Norwegian phrase of the day – 03/04/09 (hurtig)</title>
		<link>http://feedproxy.google.com/~r/EatMyMonkeydust/~3/W_lHmKsQD18/</link>
		<comments>http://eatmymonkeydust.com/2009/04/norwegian-phrase-of-the-day-030409-hurtig/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 13:08:04 +0000</pubDate>
		<dc:creator>Russ</dc:creator>
				<category><![CDATA[Learn Norwegian]]></category>
		<category><![CDATA[Phrase of the day]]></category>

		<guid isPermaLink="false">http://eatmymonkeydust.com/?p=166</guid>
		<description><![CDATA[Todays word: Hurtig

English translation: Fast, rapid, quick
Pronunciation: hewt-ti

First attempt

Om sommeren i England
noe tid i August er det et veldig stort, og veldig
fint arrangement som heter &#34;RIAT&#34;.
Når vi bodde i England, prøvde vi alltid
å besøke det fordi det var kjempe morsomt å
se på alle de hurtigefly som kom fra
mange land :o)

Errors/Observations:

I wasn&#8217;t sure about the first [...]]]></description>
			<content:encoded><![CDATA[<h2>Todays word: Hurtig</h2>
<ul>
<li>English translation: Fast, rapid, quick</li>
<li>Pronunciation: <em>hewt</em>-ti</li>
</ul>
<h2>First attempt</h2>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">Om sommeren i England
noe tid i August er det et veldig stort, og veldig
fint arrangement som heter &quot;RIAT&quot;.
Når vi bodde i England, prøvde vi alltid
å besøke det fordi det var kjempe morsomt å
se på alle de hurtigefly som kom fra
mange land :o)</pre></div></div>

<p>Errors/Observations:</p>
<ul>
<li>I wasn&#8217;t sure about the first sentence as I wanted to say &#8220;during the Summer, some time in August&#8221; but that does not really work the same way in Norwegian. Adding a few commas and changing it to &#8220;en helg i August&#8221; works in this case.</li>
<li>Similarly in English, adding <em>veldig</em> before every adjective in a sentence is a little bit &#8220;over-emphasising&#8221;, so the latter one(s) can be skipped</li>
<li><b>kjempe morsomt</b> &#8211; this is one of those joining up word scenarios! Quite often with <b>kjempe</b> followed by an adjective, the words can be joined &#8211; in this case <b>kjempemorsomt</b></li>
<li>One last error, and it&#8217;s a bit of a noob mistake as we were doing so well&#8230; we are talking about a definitive collection of aircraft &#8220;de hurtige&#8230;&#8221; so we must add &#8220;ene&#8221; to form <b>de hurtigeflyene</b></li>
<li><b>Når</b> changes to <b>Da</b> &#8211; see comments below</li>
</ul>
<p>Final edit:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">Om sommeren i England,
en helg i August, er det et veldig stort, fint arrangement 
som heter &quot;RIAT&quot;.
Da vi bodde i England, prøvde vi alltid
å besøke det fordi det var kjempemorsomt å
se på alle de hurtige flyene som kom fra
mange land :o)</pre></div></div>

<p>Translation:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">During the Summer in England, one weekend in August,
there is a very big, fine show/arrangement called &quot;RIAT&quot;.
When we lived in England, we always tried to visit it because
it was really fun to see all the fast planes that came
from many countries :o)</pre></div></div>

<p>Link: RIAT &#8211; <a href="http://airtattoo.com/">The Royal International Air Tattoo</a></p>
<img src="http://feeds.feedburner.com/~r/EatMyMonkeydust/~4/W_lHmKsQD18" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://eatmymonkeydust.com/2009/04/norwegian-phrase-of-the-day-030409-hurtig/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		<feedburner:origLink>http://eatmymonkeydust.com/2009/04/norwegian-phrase-of-the-day-030409-hurtig/</feedburner:origLink></item>
	</channel>
</rss>
