<?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>The Nordhagen</title>
	<atom:link href="http://www.oyvindnordhagen.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.oyvindnordhagen.com/blog</link>
	<description>Øyvind Nordhagen on ActionScript and other things</description>
	<lastBuildDate>Tue, 08 Jun 2010 12:25:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Writing a decent API</title>
		<link>http://www.oyvindnordhagen.com/blog/2010/06/08/writing-a-decent-api/</link>
		<comments>http://www.oyvindnordhagen.com/blog/2010/06/08/writing-a-decent-api/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 23:12:41 +0000</pubDate>
		<dc:creator>Øyvind</dc:creator>
				<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Problems & Solutions]]></category>

		<guid isPermaLink="false">http://www.oyvindnordhagen.com/blog/?p=385</guid>
		<description><![CDATA[Over the last 6 months I&#8217;ve had to employ many Flash libraries that I have not worked with before. What strikes me is how poorly documented they are and how badly written some of them are. I won&#8217;t mention names, but I suspect some of you have an idea of where to find code like [...]]]></description>
			<content:encoded><![CDATA[<p>Over the last 6 months I&#8217;ve had to employ many Flash libraries that I have not worked with before. What strikes me is how poorly documented they are and how badly written some of them are. I won&#8217;t mention names, but I suspect some of you have an idea of where to find code like this. In order to make the world a better place — as always — here are two reminders that would help.</p>
<h3>Use coding standards and best practices</h3>
<p>Proper method names, argument names, argument types and return values are crucial to the mere mortals trying to use your API. Keep an eye on your naming schemes! Use the common denominator of data types when you can and create specialized value objects when necessary. This method signature might make perfect sense to you at a time of writing:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p385code5'); return false;">View Code</a> ACTIONSCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3855"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p385code5"><pre class="actionscript" style="font-family:monospace;">getCoords<span style="color: #66cc66;">&#40;</span> arg1:<span style="color: #66cc66;">*</span>, arg2:<span style="color: #66cc66;">*</span>, ar3:<span style="color: #66cc66;">*</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Object</span></pre></td></tr></table></div>

<p>&#8230;but please clean that up when you release it to the general public! Answer me this: What kind of coordinates are we requesting? What kind of input is expected and what are their types? And what the hell does that generic return type contain exactly?? Might I suggest something like:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p385code6'); return false;">View Code</a> ACTIONSCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3856"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p385code6"><pre class="actionscript" style="font-family:monospace;">getCityCoordinates<span style="color: #66cc66;">&#40;</span> region:<span style="color: #0066CC;">String</span>, country:<span style="color: #0066CC;">String</span>, city:<span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#41;</span>:Coordinates</pre></td></tr></table></div>

<p>You might think this kind of thing is trivial and basic. And it is, hence my bafflement when I read stuff like the first example in library released as the official API for one of the more common social media RIAs. You couldn&#8217;t imagine how many APIs out there break away from such common sense.</p>
<h3>Clean up after yourself!</h3>
<p>There are libraries out there without a single line terminated by a semi colon. As we know, the semis are optional, but they can cause the dreaded &#8220;internal build error/classes may not be nested&#8221; situation in Eclipse-based IDEs which usually eats up at least half a day of valuable time. I&#8217;ve had it happen to me, and needless to say I don&#8217;t consider semi colons to be optional. I use FDT to write my code and I have it set up to present me with an error whenever it comes across an unterminated line.</p>
<p>Other known culprits of internal build error are empty constructs like if-, for-, while and switch statements in addition to empty classes and interfaces. If there are incomplete sections in the API, pull them out and make sure the rest of the code doesn&#8217;t reference them.</p>
<h3>Write proper ASDocs</h3>
<p>How many libraries out there merely repeat the method signatures in the ASDocs? Then what&#8217;s the point? Most sane people use advances IDEs that will present ASDocs even inline with the code hinting, so make the most of it when the function and argument names cannot convey the full purpose of a property, event or method. To demonstrate, I will give an example from the ASDocs of <a href="http://www.oyvindnordhagen.com/blog/olog">my own logger utility, the Olog</a>. I will not be humble in this case, because Olog&#8217;s ASDocs are in fact immaculate.</p>
<p>The main logic is spread across 10 classes, but there&#8217;s only two access points to the log console; the specialized event type and the Olog class itself. The Olog class serves a single purpose: It is the <em>interface</em>, the <em>Application Programming <strong>Interface</strong></em>. It serves as the entry and exit point and the position of all the documentation. The core of the module is not as pretty, but that&#8217;s my problem. The Olog class consists of well named functions and getters and setters, all with comprehensive and highly cohesive ASDocs. In a sense you could say that this class&#8217; primary purpose is to act as the black surface coating in the black box principle; it&#8217;s there to stop the reader from digging deeper, or should I say to make it totally unnecessary to dig deeper. Most of the methods have a single line in them, a call to another core method. This allows this class to focus on the task of providing decent documentation. The ASDocs are generated from this file.</p>
<p>This is a method from within the core of Olog:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p385code7'); return false;">View Code</a> ACTIONSCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3857"><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code" id="p385code7"><pre class="actionscript" style="font-family:monospace;">internal <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">function</span> newTimeMarker<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">name</span>:<span style="color: #0066CC;">String</span> = <span style="color: #000000; font-weight: bold;">null</span>, origin:<span style="color: #0066CC;">Object</span> = <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">int</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> n:<span style="color: #0066CC;">String</span> = <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">name</span><span style="color: #66cc66;">&#41;</span> ? <span style="color: #0066CC;">name</span> : <span style="color: #ff0000;">&quot;Operation&quot;</span>;
	<span style="color: #000000; font-weight: bold;">var</span> o:<span style="color: #0066CC;">String</span> = Otils.<span style="color: #006600;">parseOrigin</span><span style="color: #66cc66;">&#40;</span> origin <span style="color: #66cc66;">&#41;</span>;
	<span style="color: #000000; font-weight: bold;">var</span> t:<span style="color: #0066CC;">int</span> = <span style="color: #0066CC;">getTimer</span><span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">&#41;</span>;
	<span style="color: #b1b100;">return</span> _runTimeMarkers.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">&#91;</span>n, t, o<span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#41;</span> - <span style="color: #cc66cc;">1</span>;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>But from the outside of the box it appears like this:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p385code8'); return false;">View Code</a> ACTIONSCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3858"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code" id="p385code8"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/**
* Creates a timing marker that you can later complete by calling completeTimeMarker() to
* output the time in between.
* @param name String reference to use when the marker completes an results are displayed.
* @return An integer ID to use as argument when calling completeTimeMarker().
* @see completeTimeMarker()
*/</span>
<span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">function</span> newTimeMarker<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">name</span>:<span style="color: #0066CC;">String</span> = <span style="color: #000000; font-weight: bold;">null</span>, origin:<span style="color: #0066CC;">Object</span> = <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">int</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #b1b100;">return</span> Ocore.<span style="color: #006600;">newTimeMarker</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">name</span> , origin <span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>Thats a ratio of 5:2 of respectively documentation and actual code! By using the Olog class as a dedicated API layer, I&#8217;m able to use that class as both a source of proper ASDocs and a structural reference for myself.</p>
<p>Now, pretty please&#8230;?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oyvindnordhagen.com/blog/2010/06/08/writing-a-decent-api/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Microphone confirmation dialog not showing in Firefox</title>
		<link>http://www.oyvindnordhagen.com/blog/2010/05/11/microphone-confirmation-dialog-not-showing-in-firefox/</link>
		<comments>http://www.oyvindnordhagen.com/blog/2010/05/11/microphone-confirmation-dialog-not-showing-in-firefox/#comments</comments>
		<pubDate>Tue, 11 May 2010 07:58:59 +0000</pubDate>
		<dc:creator>Øyvind</dc:creator>
				<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Problems & Solutions]]></category>
		<category><![CDATA[access]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[confirmation]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[microphone]]></category>
		<category><![CDATA[swfobject]]></category>

		<guid isPermaLink="false">http://www.oyvindnordhagen.com/blog/?p=377</guid>
		<description><![CDATA[A few days ago I was struggling with an application that made use of the client computer&#8217;s microphone for crucial functions. The problem was that the built-in security settings panel for granting access to the microphone did not open in Firefox on the Mac.
Normally, whenever you do this:
var mic:Microphone = Microphone.getMicrophone();
The Flash Player automatically opens [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago I was struggling with an application that made use of the client computer&#8217;s microphone for crucial functions. The problem was that the built-in security settings panel for granting access to the microphone did not open in Firefox on the Mac.</p>
<p>Normally, whenever you do this:</p>
<pre class="actionscript3" line="1">var mic:Microphone = Microphone.getMicrophone();</pre>
<p>The Flash Player automatically opens this panel to ask the user to allow the microphone to be connected:<br />
<a href="http://www.oyvindnordhagen.com/blog/wp-content/uploads/2010/05/Skjermbilde-2010-05-11-kl.-09.39.27.png" rel="lightbox[377]"><img class="alignnone size-full wp-image-378" title="Flash Player Microphone confirmation dialog box" src="http://www.oyvindnordhagen.com/blog/wp-content/uploads/2010/05/Skjermbilde-2010-05-11-kl.-09.39.27.png" alt="Flash Player Microphone confirmation dialog box" width="534" height="212" /></a></p>
<p>Of course this panel is never invoked if the user has the settings set to always allow or always deny, but very few do.</p>
<p>When this sucker never presented itself, I naturally thought that I was doing something wrong. Let&#8217;s face it, that&#8217;s the most probable cause. But after a while I noticed that the problem was specific to Firefox on the Mac. Knowing that SWFObject has had it&#8217;s issues with FIrefox in the past, I tried swapping it out for the jQueryFlash plugin, and voilà! How the JavaScript insertion method of the flash content could possibly cause it is beyond me. Honestly I don&#8217;t have the JS knowledge or interest to investigate either, seeing as I had a solution.</p>
<p>With SWFObject 1.5 there was a problem causing the stageWidth and stageHeight to be 0 for a certain time after the movie was loaded. That might be relevant in this case as well, but the microphone dialog was supposed to open long after the movie was fully loaded. That kinda rules it out.</p>
<p>So now you know. Don&#8217;t spend an entire night on this, like I did.</p>
<p>Get the Flash plugin for jQuery here:<br />
<a href="http://jquery.lukelutman.com/plugins/flash/">http://jquery.lukelutman.com/plugins/flash/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.oyvindnordhagen.com/blog/2010/05/11/microphone-confirmation-dialog-not-showing-in-firefox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Iceland&#8217;s new volcano</title>
		<link>http://www.oyvindnordhagen.com/blog/2010/04/08/icelands-new-volcano/</link>
		<comments>http://www.oyvindnordhagen.com/blog/2010/04/08/icelands-new-volcano/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 20:48:52 +0000</pubDate>
		<dc:creator>Øyvind</dc:creator>
				<category><![CDATA[Photography]]></category>
		<category><![CDATA[eruption]]></category>
		<category><![CDATA[helicopter]]></category>
		<category><![CDATA[iceland]]></category>
		<category><![CDATA[lava]]></category>
		<category><![CDATA[volcano]]></category>

		<guid isPermaLink="false">http://www.oyvindnordhagen.com/blog/?p=371</guid>
		<description><![CDATA[I&#8217;ve just added a new photo set to Flickr. These are from a helicopter ride given to me by Elva and my awesome extended Icelandic and Norwegian family, as a pre-birthday gift. It&#8217;s made as a chronological photo story with comments to each image. Clicking on any of the images will take you to that [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just added a new photo set to Flickr. These are from a helicopter ride given to me by Elva and my awesome extended Icelandic and Norwegian family, as a pre-birthday gift. It&#8217;s made as a chronological photo story with comments to each image. Clicking on any of the images will take you to that image in the photo set, but what I really wish you would do is click the first one and proceed from there. Hope you enjoy it!</p>
<p class="flickrTag_container"><a href="http://www.flickr.com/photos/10744072@N06/4502827372/in/set-72157623803995142/" class="flickr"><img src="http://farm3.static.flickr.com/2710/4502827372_999b8811fd_s.jpg" alt="Boarding the chopper" class="flickr square set"  title="I've never been in a helicopter before, so that alone made me very excited. It was a beautiful one as well. Capable of 10 passengers."/></a><a href="http://www.flickr.com/photos/10744072@N06/4502827262/in/set-72157623803995142/" class="flickr"><img src="http://farm5.static.flickr.com/4066/4502827262_56c9e2a2ac_s.jpg" alt="Heli noobs" class="flickr square set"  title="Properly dressed, but heli noobs we all were. Cramming ourselves in inch by inch as our jackets deflated..."/></a><a href="http://www.flickr.com/photos/10744072@N06/4502827126/in/set-72157623803995142/" class="flickr"><img src="http://farm5.static.flickr.com/4028/4502827126_b6536d3e27_s.jpg" alt="The guide and the pilot" class="flickr square set"  title="Most of the time what was said was in icelandic. And allthough I'm getting better at it, much of it was lost in translation."/></a><a href="http://www.flickr.com/photos/10744072@N06/4502827044/in/set-72157623803995142/" class="flickr"><img src="http://farm3.static.flickr.com/2690/4502827044_62823642c9_s.jpg" alt="Closing in on the glacier" class="flickr square set"  title="We were to land on a nearby glacier to watch the eruption from there, but before we did, the pilot took us on a thrill ride across the site in all possible directions. Here is our first sight of the volcano."/></a><a href="http://www.flickr.com/photos/10744072@N06/4502826958/in/set-72157623803995142/" class="flickr"><img src="http://farm5.static.flickr.com/4049/4502826958_2ddf4d672c_s.jpg" alt="Holy smokes, Batman!" class="flickr square set"  title="The lava and the consequent rivers of it melt the snow and ice as it travels. This causes massive amounts of steam and smoke. There have been several near-accidents because of a phenomena which occurs when lava melts the ice underneath. People tend to think it's safe to walk closer to the lava rivers than the eruption site itself. But what happens is that the snow and ice they run over starts boiling, causing smaller, steam powered eruptions that throw the lava back up."/></a><a href="http://www.flickr.com/photos/10744072@N06/4502826856/in/set-72157623803995142/" class="flickr"><img src="http://farm5.static.flickr.com/4005/4502826856_f278369311_s.jpg" alt="Heat. Smoke. Blast." class="flickr square set"  title="The character of the eruption &amp;quot;pulses&amp;quot; varies much like a geysir. Some blasts are just thousands of fragments, others more like solid fire."/></a><a href="http://www.flickr.com/photos/10744072@N06/4502826752/in/set-72157623803995142/" class="flickr"><img src="http://farm5.static.flickr.com/4033/4502826752_191c7468ae_s.jpg" alt="Fire!" class="flickr square set"  title="At this point, the pilot took us perhaps closer than what was comfortable for some of us, and then tilted the chopper slightly to its side for a better view."/></a><a href="http://www.flickr.com/photos/10744072@N06/4502826632/in/set-72157623803995142/" class="flickr"><img src="http://farm3.static.flickr.com/2752/4502826632_1b45a48c6f_s.jpg" alt="Black sand" class="flickr square set"  title="Our landing site was part black lava sand, part snow. Looking down as I got out of the helicopter, this was were I was standing."/></a><a href="http://www.flickr.com/photos/10744072@N06/4502826486/in/set-72157623803995142/" class="flickr"><img src="http://farm5.static.flickr.com/4055/4502826486_35ff1ed5f7_s.jpg" alt="Black and white, only not" class="flickr square set"  title="Looking up from my feet gave me a stunning view. This landscape is litterally colorless. This might look like a black and white photo, but its actually in full color. Beautiful grey shades, no photoshopping needed."/></a><a href="http://www.flickr.com/photos/10744072@N06/4502826396/in/set-72157623803995142/" class="flickr"><img src="http://farm3.static.flickr.com/2723/4502826396_6c182d1501_s.jpg" alt="Glacier noobs" class="flickr square set"  title="The guide (in the yellow hi-vis) trying to manage a herd of tourists about to get a chopper blade crew cut."/></a><a href="http://www.flickr.com/photos/10744072@N06/4502192419/in/set-72157623803995142/" class="flickr"><img src="http://farm3.static.flickr.com/2731/4502192419_63977c4140_s.jpg" alt="Run to the hills" class="flickr square set"  title="As we got our bearings in order and crawled the next hill, we found ourselves approximately 200 meters from the eruption site. Good thing I'd just bought a new telephoto lens."/></a><a href="http://www.flickr.com/photos/10744072@N06/4502192317/in/set-72157623803995142/" class="flickr"><img src="http://farm5.static.flickr.com/4065/4502192317_8eb90d6f55_s.jpg" alt="Audiovisual" class="flickr square set"  title="Despite the distance, we could hear the sound from the eruptions. Almost like a huge distant waterfall starting and stopping. The view was spectacular."/></a><a href="http://www.flickr.com/photos/10744072@N06/4502192145/in/set-72157623803995142/" class="flickr"><img src="http://farm5.static.flickr.com/4070/4502192145_2ce09312e9_s.jpg" alt="Siblings" class="flickr square set"  title="Just the day before the leftmost of these three volcanoes was born."/></a><a href="http://www.flickr.com/photos/10744072@N06/4502825920/in/set-72157623803995142/" class="flickr"><img src="http://farm5.static.flickr.com/4054/4502825920_69590bb43c_s.jpg" alt="Boom!" class="flickr square set"  title="Cool, ain't it?"/></a><a href="http://www.flickr.com/photos/10744072@N06/4502825838/in/set-72157623803995142/" class="flickr"><img src="http://farm3.static.flickr.com/2678/4502825838_c2b4df1f78_s.jpg" alt="Stunned" class="flickr square set"  title="One last look before taking off again."/></a><a href="http://www.flickr.com/photos/10744072@N06/4502191903/in/set-72157623803995142/" class="flickr"><img src="http://farm5.static.flickr.com/4058/4502191903_88c6682616_s.jpg" alt="Rivers" class="flickr square set"  title="As we flew back, we got a better look at the lava rivers. This really looks like hell on earh."/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.oyvindnordhagen.com/blog/2010/04/08/icelands-new-volcano/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Jordbærpikene—en restaurantanmeldelse i revers</title>
		<link>http://www.oyvindnordhagen.com/blog/2010/03/19/jordbaerpikene/</link>
		<comments>http://www.oyvindnordhagen.com/blog/2010/03/19/jordbaerpikene/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 14:35:18 +0000</pubDate>
		<dc:creator>Øyvind</dc:creator>
				<category><![CDATA[Bacterial]]></category>
		<category><![CDATA[Culture]]></category>
		<category><![CDATA[General thoughts]]></category>
		<category><![CDATA[Shout!]]></category>
		<category><![CDATA[Spread The Word]]></category>
		<category><![CDATA[anmeldelse]]></category>
		<category><![CDATA[cafe]]></category>
		<category><![CDATA[hvaltorget]]></category>
		<category><![CDATA[hvaltorvet]]></category>
		<category><![CDATA[hygiene]]></category>
		<category><![CDATA[Jordbæpikene]]></category>
		<category><![CDATA[kjede]]></category>
		<category><![CDATA[matforgiftning]]></category>
		<category><![CDATA[mattilsynet]]></category>
		<category><![CDATA[Sandefjord]]></category>

		<guid isPermaLink="false">http://www.oyvindnordhagen.com/blog/?p=338</guid>
		<description><![CDATA[Anmeldelser av spisesteder på norsk var aldri med i planene for denne bloggen. Det kommer antakelig ikke flere heller, men noen ganger må man gjøre et unntak. For ordens skyld må jeg påpeke at dette kun gjelder Jordbærpikenes avdeling på Hvaltorvet i Sandefjord.
Jordbærpikene er en kjede med spisesteder som etablerer franciser på kjøpesentra. De kan [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_346" class="wp-caption alignnone" style="width: 580px"><img class="size-full wp-image-346" title="JP_meny" src="http://www.oyvindnordhagen.com/blog/wp-content/uploads/2010/03/JP_meny.jpg" alt="" width="570" height="217" /><p class="wp-caption-text">Faksimile fra jordbarpikene.no—et nettsted laget i 2009 med flashintro a-la 1998!</p></div>
<p><em>Anmeldelser av spisesteder på norsk var aldri med i planene for denne bloggen. Det kommer antakelig ikke flere heller, men noen ganger må man gjøre et unntak. For ordens skyld må jeg påpeke at dette kun gjelder Jordbærpikenes avdeling på Hvaltorvet i Sandefjord.</em></p>
<p><a href="http://jordbarpikene.no/" target="_blank">Jordbærpikene</a> er en kjede med spisesteder som etablerer franciser på kjøpesentra. De kan derfor sammenlignes med <a href="http://www.cafeopus.no/" target="_blank">Cafe Opus</a> og <a href="http://www.lecafe.no/" target="_blank">Le Café</a>, men det kan de vanlige anmelderne får gjøre. Jeg er mer opptatt av å se på hva som er unikt med nettopp konseptet Jordbærpikene. Etter 3 besøk siden åpningen av nye Hvaltorvet i Sandefjord sommeren 2010, slår det meg at å vurdere dette spisestedet etter vanlige parametre ikke ville være rettferdig. Baserer man seg på opplevd innsats, kundepleie og kunnskap om næringsmiddeldrift hos personalet, blir det tydelig at dette er et spisested som <em>ønsker</em> å være i bunnklassen. Det finnes ingen annen logisk slutning, så derfor skal jeg vurdere hvordan det presterer på en omvendt skala. Oppsummert blir det da slik:</p>
<p><img class="alignnone size-full wp-image-344" title="JP_terning" src="http://www.oyvindnordhagen.com/blog/wp-content/uploads/2010/03/JP_terning.jpg" alt="" width="570" height="200" /></p>
<h3>Første besøk</h3>
<p>Sommeren 2009 åpner nyoppussede og utvidede Hvaltorvet i Sandefjord med ikke mindre fire spisesteder. Min lille familie og jeg stikker innom en lørdag under en handletur. Fruen bestiller hamburger, det gjør også jeg. Til sønnen vår på 2 år blir vi anbefalt en pastavariant med pesto. Vi takker ja og finner oss et bord.</p>
<p>20 minutter passerer og vi begynner virkelig å bli imponerte over både ventetiden og mangelen på tilbakemelding. Men skal det bli toppkarakter må for all del ikke delikatessene ankomme med et beklagende smil helt enda. <em>Skal de klare å stå løpet ut?</em> Ja! Etter en hel halvtime ankommer guttungens pasta i hendene på en servitør som gjør alt for å unngå blikkontakt. Enda ett kvarter senere kommer burgerne, fortsatt uten et forståelsesfullt smil eller noe som helst tilbud om kompensasjon for den lange ventetiden. Dette er rett og slett utklassing! Aldri før har jeg opplevd maken til ignorant kundepleie. Og bedre blir det når det viser seg at pastaen min sønn har fått smaker absolutt ingenting, følgelig spiser han heller mine pommes frites. Den smaker iallefall salt, mens burgeren er helt ålreit.</p>
<p>Derfor: Ingen toppscore på mat i denne omgang. Derimot betaler vi 470 kroner, så det står til en sekser på pris, og på service klarer de målene sine med god margin.</p>
<h3>Andre besøk</h3>
<p>Imponert over innsatsen sist sommer, bestemmer vi oss i januar i år å se om Jordbærpikene kan fascinere oss med sin håpløshet enda en gang. Vi tar et mer kaféaktig besøk denne gangen; kaffe og kake. Min samboer bestiller gulrotkake og kaffe latte. Svart kaffe og eplekake til meg. Men &#8220;Den [Jordbærpikene sin eplekake] serveres med krem&#8221; (dette får jeg repetert ordrett flere ganger under den påfølgende samtalen). Jeg har aldri vært spesielt begeistret for krem.</p>
<p style="padding-left: 30px;"><em>–Jeg skal ha eplekake, men tror du jeg kan få den med is istedet for krem?<br />
–Den serveres med krem.<br />
–Ja, jeg vet det, men jeg spør allikevel om jeg kan få den med iskrem.<br />
–Men vi har ikke iskrem<br />
–Kan du ikke bare bytte ut kremen med en liten porsjon fra soft-is-maskinen bak deg da?<br />
–Ja, men det er ikke inkludert, så da må du betale ekstra for det.</em></p>
<p>Jeg svarer lett leende, som for å vise resten av køen at jeg synes dette var en litt unødvendig diskusjon, at det er helt i orden. Jeg får min eplekake med soft-is, betaler ekstra og finner bordet hvor min samboer har satt seg ned for lengst. Hvis jeg var Jerry Seinfeld ville straks reist meg igjen, spasert tilbake til disken, satt øynene i damen på baksiden og etterlyst kremen. Jeg har nemlig betalt full pris for eplekake med krem, men jeg har også betalt for soft-is og bare fått en av delene. At jeg ikke vil ha kremen er irrelevant i en prinsippiell diskusjon. Jeg har fortsatt betalt for den og damen insisterte jo på å ta ekstra betalt for is. Men køen er lang og jeg er hverken Jerry Seinfeld eller damen bak disken, så jeg slår meg til ro med at det ser ut som det skal bli en bra score denne gangen også.</p>
<p>Matmessig gikk ikke dette besøket så bra. Gulrotkaken var ganske søt, fet og ufrisk, men eplekaken var ganske god, hvertfall med soft-is. Prismessig går dette helt til topps, og spesielt sett i sammenheng med service. Når køen er lang og en kunde ønsker en helt uproblematsik spesialbestilling, ville det være helt uhørt å late som man er serviceinnstillt. Istedet velger personalet her å ta en diskusjon med kunden sin, i påhør av hele resten av køen. Kunden får på denne måten inntrykk av at dersom man betaler over 200 kroner for to kopper kaffe og to kakestykker, skulle det bare mangle at man tar ekstra betalt for en spiseskje soft-is!</p>
<p>Med andre ord: Full pott på både pris og service. Litt trekk for god eplekake.</p>
<h3>Tredje <span style="font-weight: normal;">(og garantert siste)</span> besøk <span style="font-weight: normal;">(hos Jordbærpikene for resten av mitt liv)</span></h3>
<p><img class="alignnone size-full wp-image-342" title="JP_header" src="http://www.oyvindnordhagen.com/blog/wp-content/uploads/2010/03/JP_header.jpg" alt="" width="570" height="350" /></p>
<p>Jeg er den typen som tror på tilfeldigheter. Derfor går det ikke lenge før jeg er tilbake på Jordbærpikene etter dette siste, helt spesielle besøket. Denne gang alene. Jeg er noen ærend på kjøpesenteret og har ikke spist middag. Jeg er litt forkjølet og tenker at det passer å få i seg litt sunn middag i dag. Man må jo tenke på immunforsvaret. Inn på Jordbærpikene nok en gang. Klokken er 19.15 og senteret stenger om 45 minutter, så kjøkkenet er allerede stengt. Men salat? Joda! Kylling- og pastasalat har de stående klart til meg. Jeg slår til og tar med en eplemost, tilsammen 155 kroner.</p>
<p>Prisen er kanskje ikke helt imponerende denne gangen, men jeg skulle nok hatt med kamera. Fatet jeg får dette servert på kan nemlig best sammenlignes med et sausenebb. Men hvilken rolle spiller vel mengden når maten vokser i munnen på denne måten! Det er noe eget ved å spise kylling som har vært romtemperert i over et halvt døgn, på en seng av gress og hvitløksdressing, laget på sæterrømme, med tørr foccacia til som er fuktet med harskt smør.</p>
<p>Dessverre var det ikke mye service å beskrive denne gangen, ettersom min omgang med personalet begrenset seg til bestilling og betaling. Muligens blir det et lite pluss for ikke å ha advart meg mot matens tilstand og alder. For det er maten som står i fokus etter dette besøket, eller snarere konsekvensene av den.</p>
<p>Nøyaktig 12 timer etter at jeg forlot Jordbærpikene denne dagen kom det første av en serie toalettbesøk som i skrivende stund fortsatt ikke er over. De er så hyppige at cisterna knapt rekkers å fylles mellom slaga og de er så mange at dehydrering må kompenseres for med elektrolyttpulver. Mat: terningkast seks.</p>
<h3>Konklusjon</h3>
<p>For å ta den alvorlige hatten på et øyeblikk: Jeg har selv jobbet i handels- og servicenæringen og håndtert kunder med alle slags ønsker stående i 10 timer i strekk. Det er ikke vanskelig. Tar ting for lang tid, sier man i fra og beklager, og helst også tilbyr man et plaster på såret. Ønsker kunden en endring som er uproblematisk, er det sånn det blir. Må man legge på prisen for noe som åpenbart ikke er inkludert er det underforstått og unødvendig å diskutere i påhør av andre kunder (og må man egentlig plusse på prisen når man erstatter krem med soft-is i en bestilling på over 200 kroner en travel lørdag?). Ingen ønsker å være den som lager kø, og ingen ønsker å oppfattes som vanskelig. Og ikke minst; steng heller butikken enn å gjøre kundene syke. Det resulterer bare i dårlig omtale som dette.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oyvindnordhagen.com/blog/2010/03/19/jordbaerpikene/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Olog &#8211; finally.</title>
		<link>http://www.oyvindnordhagen.com/blog/2010/03/08/olog-finally/</link>
		<comments>http://www.oyvindnordhagen.com/blog/2010/03/08/olog-finally/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 05:20:47 +0000</pubDate>
		<dc:creator>Øyvind</dc:creator>
				<category><![CDATA[AILogger]]></category>
		<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Olog]]></category>

		<guid isPermaLink="false">http://www.oyvindnordhagen.com/blog/?p=324</guid>
		<description><![CDATA[
Olog (formerly, AILogger formerly OKtrace, formerly text field on stage..) is a logging utility I have been using since the early days. The previous version, AILogger has been the most feature rich to date. But over the years a need to rewrite the whole thing has been growing more and more urgent. It actually started [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-293" title="OlogWindow" src="http://www.oyvindnordhagen.com/blog/wp-content/uploads/2010/03/OlogWindow.png" alt="" width="570" height="319" /></p>
<p>Olog (formerly, AILogger formerly OKtrace, formerly text field on stage..) is a logging utility I have been using since the early days. The previous version, AILogger has been the most feature rich to date. But over the years a need to rewrite the whole thing has been growing more and more urgent. It actually started life as an AS1 text field on stage, and was then made into an AS2 class which was then refactored for AS3. But after a while it became evident that it had been patched up too many times to do new things and was in desperate need of some overhaulin&#8217;.</p>
<p>It&#8217;s about time it took its name from its father as well, so I&#8217;m abandoning the scheme of naming it after my employer. (OKTrace = Okular, AILogger = Allegro Interaktiv). It has always been my pet project, so I&#8217;m taking it with me everywhere I go from now on. I also wanted a short name, seeing as I&#8217;ll be typing it a lot, so Olog it is (the &#8220;O&#8221; from Oyvind).</p>
<p>So this time it&#8217;ll be different, I promise! Olog 0.9 is actually AILogger 1.2 and then some in terms of features, but the first step in making it was &#8220;File &gt; New&#8221;. It&#8217;s completely rewritten, and no copy-paste this time. It has been tagging along during my latest project and so it has seen plenty of action already. I&#8217;ve tested it quite thoroughly, but it&#8217;s hard to say what happens when you try to live on your own for the first time. That&#8217;s why I have humbly versioned it 0.9b for now.</p>
<h2>New features</h2>
<p>Here are some new things you might like:</p>
<ul>
<li>Full featured window interface. Minimize/maximize/close buttons, double click on title bar to minimize. Moveable and resizable.</li>
<li>Selective line numbers, time-since-movie start and clock time for each line. These can all be turned of or off during run time.</li>
<li>Filtering of log levels. Pressing number keys 0-5 filters the log to show only those severity levels (color). Esc to escape.</li>
<li>Automatic update check. Olog will check for a new version once a week if you let it and notify you if there&#8217;s a newer version.</li>
<li>Save log to text/XML.</li>
<li>Persistent window state. Position, size, minimized/maximized state is remembered so you don&#8217;t have to keep moving it out of the way each time you compile.</li>
<li>Run time markers. Set a new named point-in-time marker, which you can later complete to display load/execution times.</li>
<li>Support for AILoggerEvents, but Olog has it&#8217;s own OlogEvent as well for loosely coupled logging.</li>
<li>Stacking of repeated messages.</li>
<li>Full ASDoc documentation.</li>
</ul>
<p><a href="http://www.oyvindnordhagen.com/blog/olog/">The olog page on my blog</a> has all the links you need, <a href="http://olog.googlecode.com/files/Olog0.9b.zip">direct ZIP download</a>, <a href="http://olog.googlecode.com/svn/trunk/">SVN repo access</a>, <a href="http://www.oyvindnordhagen.com/olog/docs/">asdoc documentation</a>, <a href="http://code.google.com/p/olog/">Google Code homepage</a> and even a <a href="http://www.oyvindnordhagen.com/blog/olog/">simple demo</a>. I&#8217;ll love to hear it if you have feedback!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oyvindnordhagen.com/blog/2010/03/08/olog-finally/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Waking up with aXbo S.P.A.C</title>
		<link>http://www.oyvindnordhagen.com/blog/2010/03/03/waking-up-with-axbo/</link>
		<comments>http://www.oyvindnordhagen.com/blog/2010/03/03/waking-up-with-axbo/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 20:42:46 +0000</pubDate>
		<dc:creator>Øyvind</dc:creator>
				<category><![CDATA[Gadgets]]></category>
		<category><![CDATA[alarm]]></category>
		<category><![CDATA[axbo]]></category>
		<category><![CDATA[bio]]></category>
		<category><![CDATA[clock]]></category>
		<category><![CDATA[cycle]]></category>
		<category><![CDATA[rhythm]]></category>
		<category><![CDATA[S.P.A.C.]]></category>
		<category><![CDATA[sleep]]></category>

		<guid isPermaLink="false">http://www.oyvindnordhagen.com/blog/?p=269</guid>
		<description><![CDATA[aXbo is a bio-rhythmic Sleep.Phase.Alarm.Clock promising to revolutionize the way you wake up every morning. Put simple, it works by identifying the different phases of sleep in your sleep cycle based on your amount of body movement. It then wakes you up at a time of light sleep, when you are most likely to feel well [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_271" class="wp-caption alignnone" style="width: 580px"><img class="size-full wp-image-271" title="AxboClock" src="http://www.oyvindnordhagen.com/blog/wp-content/uploads/2010/03/AxboClock.jpg" alt="The aXbo sleep phase alarm clock" width="570" height="349" /><p class="wp-caption-text">The aXbo sleep phase alarm clock</p></div>
<p>aXbo is a bio-rhythmic <strong>S</strong>leep.<strong>P</strong>hase.<strong>A</strong>larm.<strong>C</strong>lock promising to revolutionize the way you wake up every morning. Put simple, it works by identifying the different phases of sleep in your sleep cycle based on your amount of body movement. It then wakes you up at a time of light sleep, when you are most likely to feel well and rested. Two months ago I got a new job that requires a two hour commute, which means getting up at 6.30 three days a week. After being a tormented B-person all my life, I decided to buy this device i&#8217;d heard about in an attempt to make my mornings easier. I have now used it for a few days, so here&#8217;s how it&#8217;s working so far.</p>
<h2>In practicality</h2>
<p>First things first: This is a pricey product, costing just shy of 200 euros for the two-person edition. You buy it from <a href="http://www.axbo.com">www.axbo.com</a>, an Austrian website which in—typical German tradition—defaults to German. Mine was delivered in two weeks &#8220;due to strong demand&#8221;. The initial experience was somewhat limp in my case because it wouldn&#8217;t charge properly. After some time of emailing with their support people, it seemed that there was a problem with the power adapter/cable. Hence I ripped the front plate off, cut away some purposeless plastic thingies, extracted the three AAA batteries and let them charge in a normal battery charger. That worked while I waited for a new power adapter to arrive in the mail.</p>
<p>Setup is done though the menus on the clock with a couple of buttons and a scroll wheel on the side. Pretty standard stuff. My version is made for two people, and any time you do something relating to only one of them, the corresponding icon is displayed topmost in the LCD (see article image). You get a range of six different wake-up sounds, all surprisingly &#8220;alarm-ish&#8221; for a device that&#8217;s comes across as very gentle in all other aspects. I opted for the chirping birds and went to sleep.</p>
<h2>While you sleep—some theory</h2>
<p>A wristband is what enables the clock to register body movement. They come in man- and lady-size, one of each in my delivery. Inside it is a removable sensor, and the  Austrians are very specific about wearing it the right way on your left arm.</p>
<div id="attachment_272" class="wp-caption alignnone" style="width: 580px"><img class="size-full wp-image-272" title="AxboWristbands" src="http://www.oyvindnordhagen.com/blog/wp-content/uploads/2010/03/AxboWristbands.jpg" alt="aXbo wristbands used for recording your movements during sleep" width="570" height="380" /><p class="wp-caption-text">aXbo wristbands used for recording your movements during sleep</p></div>
<p>As explained thoroughly and way better on the aXbo&#8217;s own website, you move less in deep phases of sleep and more in the light ones. The scientists illustrate sleep cycles with a &#8220;hypnogramme&#8221;, so I thought I&#8217;d give it a shot.</p>
<p><img class="alignright" title="Hypnogramme" src="http://www.oyvindnordhagen.com/blog/wp-content/uploads/2010/03/Hypnogramme-300x189.jpg" alt="A typical, highly simplified hypnogramme" width="300" height="189" />In order to avoid copyright infringement, I drew you the illustration to the right. It&#8217;s not accurate in any way, but it gets the job done in explaining that you first enter a long, deep sleep phase, followed by waves of gradually shorter and lighter ones. This typically goes on for a period of 7-9 hours for a normal adult.</p>
<h2>Waking up</h2>
<p>If you wake up remembering your dreams, you most likely woke up from a REM-stage. This is better than waking up from deep sleep, but still not ideal. What you want is to wake up from the lightest sleep stage possible, shown as peaks in the hypnogramme. The aXbo predicts your next light sleep phase and wakes you as close as possible within a 30 minute window. Should your sleep cycle be out of sync with the alarm time you&#8217;ve set, the alarm will go off at that time. The same goes for if you forget to wear the wristband, or if the batteries are too drained to safely spend them on the sensing.</p>
<p>One thing I particularly like about the aXbo is your lack of choice when it comes to it&#8217;s core features. The wake-up window is 30 minutes, and that&#8217;s that. No configuration for a two hour snooze. And speaking of fans of the snooze button (we know who we are!), you won&#8217;t have much luck here, because there isn&#8217;t any. But what you do get is a button on the wristband that lets you turn the backlight on during the night to check how long you&#8217;ve gone without falling asleep. And more importantly, it is also used for silencing the alarm after it goes off . I usually feel a little woozy just after waking up (who doesn&#8217;t), so I like to sit upright in bed for a couple of minutes before putting my feet on the cold floor. This might be disobedient to the recommendation in the manual that says to get up immediately, but it works for me.</p>
<div id="attachment_273" class="wp-caption alignnone" style="width: 580px"><img class="size-full wp-image-273" title="AxboGlow" src="http://www.oyvindnordhagen.com/blog/wp-content/uploads/2010/03/AxboGlow.jpg" alt="The aXbo glows quite brightly and also illuminates the wall behind it" width="570" height="380" /><p class="wp-caption-text">The aXbo glows when you push the button on the wristband (firmly)</p></div>
<h2>So how does it feeeel?</h2>
<p>I&#8217;ll be a little cautious for now since I&#8217;ve only used it for a few days. But to me this seems like a step forward. The aXbo has yet to wake me up at the precise time I set it to, which can only mean that it has found a better time for me to get up. And so far I have not felt broken and beaten at that time like I usually do. Some mornings however, I have had the pleasure of experiencing something which is a bit of a rarity for me: The feeling of being ready to get out of bed. I suppose it is a little early to attribute it all to the clock, but I&#8217;m definitely thinking that there might be something to this device.</p>
<p>I will try to write some more about my experiences with the aXbo after having used it for a month or two. In the mean time, if you want to read up about sleep cycles, sleep phases and what not you probably know where to look.</p>
<p>PS. There&#8217;s also free data collection and analysis software for both PC and Mac available from the aXbo website if you want to get utterly German about your sleep. And also, writing the aXbo name with a lowercase &#8220;a&#8221; and a capital &#8220;X&#8221; is really not that cool, but apparently that&#8217;s its name.</p>
<h2>Ads</h2>
<p>I just had to link up these hilarious TV ads for the aXbo. I hope their sleep research is better than their metaphors (and the voice actor&#8217;s English):</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/qutz5gOs3z8&amp;hl=en_US&amp;fs=1&amp;color1=0xe1600f&amp;color2=0xfebd01" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="385" src="http://www.youtube.com/v/qutz5gOs3z8&amp;hl=en_US&amp;fs=1&amp;color1=0xe1600f&amp;color2=0xfebd01" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/kxsk3czp9ak&amp;hl=en_US&amp;fs=1&amp;color1=0xe1600f&amp;color2=0xfebd01" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="385" src="http://www.youtube.com/v/kxsk3czp9ak&amp;hl=en_US&amp;fs=1&amp;color1=0xe1600f&amp;color2=0xfebd01" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.oyvindnordhagen.com/blog/2010/03/03/waking-up-with-axbo/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Regular Expression matching empty switch statements</title>
		<link>http://www.oyvindnordhagen.com/blog/2010/02/07/regular-expression-matching-empty-switch-statements/</link>
		<comments>http://www.oyvindnordhagen.com/blog/2010/02/07/regular-expression-matching-empty-switch-statements/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 22:21:38 +0000</pubDate>
		<dc:creator>Øyvind</dc:creator>
				<category><![CDATA[General thoughts]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[empty]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[internal]]></category>
		<category><![CDATA[match]]></category>
		<category><![CDATA[regepx]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[statement]]></category>
		<category><![CDATA[switch]]></category>

		<guid isPermaLink="false">http://www.oyvindnordhagen.com/blog/2010/02/07/regular-expression-matching-empty-switch-statements/</guid>
		<description><![CDATA[In my continuing effort to track down a particularly nasty case of internal build error/classes must not be nested in Flash Builder. I ran a regex to find empty switch statements. These are notoriously known for causing this error, so in follow up to my post about regex for finding unterminated lines (another possible culprit), [...]]]></description>
			<content:encoded><![CDATA[<p>In my continuing effort to track down a particularly nasty case of internal build error/classes must not be nested in Flash Builder. I ran a regex to find empty switch statements. These are notoriously known for causing this error, so in follow up to my post about regex for finding unterminated lines (another possible culprit), here is a RegExp that matches empty switch statements:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p265code10'); return false;">View Code</a> REGEXP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p26510"><td class="code" id="p265code10"><pre class="regexp" style="font-family:monospace;">switch\s*?\(.*\).*\{\s*+\}</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.oyvindnordhagen.com/blog/2010/02/07/regular-expression-matching-empty-switch-statements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RegExp matching unterminated ActionScript lines (semicolon)</title>
		<link>http://www.oyvindnordhagen.com/blog/2010/02/04/regexp-matching-unterminated-actionscript-lines-semicolon/</link>
		<comments>http://www.oyvindnordhagen.com/blog/2010/02/04/regexp-matching-unterminated-actionscript-lines-semicolon/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 10:42:11 +0000</pubDate>
		<dc:creator>Øyvind</dc:creator>
				<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Problems & Solutions]]></category>

		<guid isPermaLink="false">http://www.oyvindnordhagen.com/blog/?p=251</guid>
		<description><![CDATA[
Today I had the dreaded &#8220;1131: Internal build error&#8221; in Flash Builder coupled with the &#8220;Classes must not be nested error&#8221; despite no classes actually being nested. Googling around, I found a few posts that provide some tips towards a solution. The most frequent two of which are empty switch statements and ActionScript lines that [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-254" title="Skjermbilde 2010-02-04 kl. 11.40.44" src="http://www.oyvindnordhagen.com/blog/wp-content/uploads/2010/02/Skjermbilde-2010-02-04-kl.-11.40.44.png" alt="Skjermbilde 2010-02-04 kl. 11.40.44" width="570" height="91" /></p>
<p>Today I had the dreaded &#8220;1131: Internal build error&#8221; in Flash Builder coupled with the &#8220;Classes must not be nested error&#8221; despite no classes actually being nested. Googling around, I found a few posts that provide some tips towards a solution. The most frequent two of which are empty switch statements and ActionScript lines that are not properly terminated with a semicolon. The project in questing uses over 100 classes, so I decided to create a RegExp for use in &#8220;Find In Files&#8221; to search for lines that were not properly terminated.</p>
<p>As an extra caveat, many types of lines in programming are not supposed to be terminated, so the RegExp is quite long and I have not been able to test it any more than the said 100-class project I&#8217;m working on.</p>
<p><strong>NOTE: This might macth some multiline ASDoc comments, empty lines and method argument lists spanning multiple lines as well.</strong></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p251code12'); return false;">View Code</a> REGEXP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p25112"><td class="code" id="p251code12"><pre class="regexp" style="font-family:monospace;">(?sim)(?&lt;!/\*)^\t*((?!\{|\}|@)(?!function|import|class|embed|SWF|if|else|switch|case|while|for|event|try|catch|finally|package|default|//|/\*|\*/)[^;])+$(?!.*\*/)</pre></td></tr></table></div>

<p>Here are the posts I found:</p>
<ul>
<li><a href="http://rjowen.wordpress.com/2007/06/21/internal-build-error-or-classes-must-not-be-nested-error/" target="_blank">flex&#8217;d: “Internal Build Error” or “Classes Must Not Be Nested” error</a></li>
<li><a href="http://www.insideria.com/2009/09/fixed-an-internal-build-error.html">Inside RIA: Fixed: &#8220;An internal build error has occurred&#8221; with FB3 &amp; Galileo</a></li>
<li><a href="http://www.tink.ws/blog/an-internal-build-error-has-occurred-switch-statement/" target="_blank">Tink: An internal build error has occurred (switch statement)</a></li>
<li><a href="http://michael.omnicypher.com/2007/02/internal-build-error.html" target="_blank">Michael Imhoff: Internal Build Error</a></li>
<li><a href="http://www.judahfrangipane.com/blog/?p=212" target="_blank">judah’s blog: Internal Build Error</a></li>
</ul>
<p>EDIT: Added &#8220;default&#8221; to the RegExp. If anyone has any improvements to this, please let me know. Especially on how to make it not match so many empty lines.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oyvindnordhagen.com/blog/2010/02/04/regexp-matching-unterminated-actionscript-lines-semicolon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The case for Apples closed platform model</title>
		<link>http://www.oyvindnordhagen.com/blog/2010/01/29/the-case-for-apples-closed-platform-model/</link>
		<comments>http://www.oyvindnordhagen.com/blog/2010/01/29/the-case-for-apples-closed-platform-model/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 23:42:54 +0000</pubDate>
		<dc:creator>Øyvind</dc:creator>
				<category><![CDATA[Culture]]></category>
		<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://www.oyvindnordhagen.com/blog/?p=243</guid>
		<description><![CDATA[I&#8217;m getting really fed up by the unjustified apple bashing that goes on these days. Just 24 hours after the launch of the iPad and the net is overflowing with whining complaints about Apples continuing stance against a more open platform model when it comes to hardware and the App Store. Again.
Before reading on, you [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m getting really fed up by the unjustified apple bashing that goes on these days. Just 24 hours after the launch of the iPad and the net is overflowing with whining complaints about Apples continuing stance against a more open platform model when it comes to hardware and the App Store. Again.</p>
<p>Before reading on, you probably wonder if I&#8217;m a fanboy myself. The answer to that is both yes and no. Yes because there&#8217;s no denying the abundance of Apple made devices and solutions that enrich my daily life, both professionally and personnally. No because I have no problem recognizing the faults and strangeness to be found in the Apple eco system. But this is not about Apple in general, but the specific case of the path Apple has chosen when it comes to app third party development, approval and distribution.</p>
<p><a href="http://al3x.net/2010/01/28/ipad.html">Alex Payne writes on his blog</a>:</p>
<blockquote><p>The iPad demonstrates that if Apple is listening to these complaints, they simply don’t care. This is why I say that the iPad is a cynical thing: Apple can’t – or won’t – conceive of a future for personal computing that is both elegant and open, usable and free.</p></blockquote>
<p>This pisses me off because it lacks perspective. If a company is manufacturing products in low-cost countries, well aware that the cheap production price comes at a high health price for the workers—and lets face it, maybe Apple is— then that&#8217;s cynical. But choosing a strategy that locks as much as possible of the inner workings of a commercial device down, simply isn&#8217;t. It might be disappointing at worst. Some argue in their own right that it&#8217;s unwise. But the bottom line is that it&#8217;s the right of any business, just as it&#8217;s the consumers right to choose not to spend their money there. The majority of western world economies are based on this general principle, and whether we like it or not, it applies to Apple as well. Complaining about cynicism in this context tells me you haven&#8217;t thought this through.</p>
<p>As explained by Steve and his subordinates on numerous occations, Apple believes they need control over as many aspects of their production and delivery chain as possible in order to deliver the best user experience they can. Remember, this is a belief converted to a strategy that Apple applies to the products they make and own. This has enabled them to create breakthrough products that raises the bar for everyone else in the industry and has led to real paradigm shifts in the way we work, play and communicate. HTC, Nokia/Symbian and the rest haven&#8217;t even come close in terms of sales and widespread adoption. No matter how hard you try and pick that statement apart and devaluate it, there&#8217;s no denying the fact that the sales, adoption rate and most importantly; customer satisfaction tell the same story. Apple puts this down to the very same platform model that&#8217;s been getting the worst of the tech press lately. You may argue that an equal success would have been possible if Apple had taken their combined product design, UI design and engineering wizardry and walked the open road, and you may even be proven right one day. But so far that&#8217;s been the path of their jealous competitors.</p>
<p>What I explain to many fresh switchers from PC to Mac is that to get the best experience you kind of have to buy into the whole eco system of the Mac. I don&#8217;t particularly like to give that advice, but it&#8217;s the truth. Apple has a vision. Where that vision deviates from many other&#8217;s is in the holistic nature of it; the fact that Apple products are designed to work best with other Apple (approved) products and to make more decisions and assumptions on the user&#8217;s behalf. To make all this possible it makes sense to control larger parts of the environment the product lives in.</p>
<p>As a user interface developer, I&#8217;m the middle man between the designer and the back end developers, which puts me at the center of UI/business logic debate. From this experience I know how challenging it can be to get a success from the collaboration involving just three creators that might even be used to working with each other. The designer has the vision, I may share it and execute it or break it depending on several factors. The backend guy might do either himself. Expand that example to involving, hardware, firmware, OS, software, peripherals <em>and</em> third party providers, and you can easily see why anyone might choose to keep this all under the same roof, within the same company culture, under the same visionary leader. You can easily say it&#8217;s hard enough as it is without providing the means for others to mess with it all they want.</p>
<p>I suspect that inside most of us, we like the idea of openness an sharing. I&#8217;m no different and as a Flash Developer I try to make my own contribution whenever I can. If Apple were to go 180 in the question of an open platform, I would certainly applaud them for it. Until then I&#8217;m a generally happy, relatively IT problem-free participant in the Apple eco system.</p>
<p>&#8230;and I&#8217;m not getting an <span style="text-decoration: line-through;">iSlate</span> <span style="text-decoration: line-through;">iTablet</span> <span style="text-decoration: line-through;">iTampon</span> iPad because I also think it&#8217;s an oversized iPod Touch and I don&#8217;t have a need for it. Loving my iPhone though!</p>
<p>EDIT: A few links to great posts on the subject:</p>
<ul>
<li><a href="http://www.rinich.com/post/358597818/i-love-walled-gardens">I Love Walled Gardens, by Rory Marinich</a></li>
<li><a href="http://blog.jaggeree.com/post/357787918/why-the-ipad-may-be-just-what-we-need-for-digital">jaggeree /Blog : : Why the iPad may be just what we need for Digital Inclusion</a></li>
<li><a href="http://www.guardian.co.uk/technology/2010/jan/29/stephen-fry-apple-ipad">Stephen Fry: why the Apple iPad is here to stay | The Guardian</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.oyvindnordhagen.com/blog/2010/01/29/the-case-for-apples-closed-platform-model/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SlowLoader &#8211; Easy bandwidth simulation util for Flash</title>
		<link>http://www.oyvindnordhagen.com/blog/2010/01/06/slowloader-easy-bandwidth-simulation-util-for-flash/</link>
		<comments>http://www.oyvindnordhagen.com/blog/2010/01/06/slowloader-easy-bandwidth-simulation-util-for-flash/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 20:58:32 +0000</pubDate>
		<dc:creator>Øyvind</dc:creator>
				<category><![CDATA[Freebies]]></category>
		<category><![CDATA[General thoughts]]></category>
		<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[bandwidth]]></category>
		<category><![CDATA[connection speed]]></category>
		<category><![CDATA[simulation]]></category>
		<category><![CDATA[SlowLoader]]></category>
		<category><![CDATA[throttle]]></category>

		<guid isPermaLink="false">http://www.oyvindnordhagen.com/blog/?p=234</guid>
		<description><![CDATA[Today I was working on a project with real strange issues related to the duration of load operations. I decided to throw together a class that would enable me to throttle the download speed of the Loader class when used locally. Simply strangle the bandwidth by entering the desired speed in the load method and [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was working on a project with real strange issues related to the duration of load operations. I decided to throw together a class that would enable me to throttle the download speed of the Loader class when used locally. Simply strangle the bandwidth by entering the desired speed in the load method and you&#8217;re good to go.</p>
<p><a href="/public/SlowLoader.zip"><img class="alignleft size-full wp-image-54" src="http://www.oyvindnordhagen.com/blog/wp-content/uploads/2008/01/zip.gif" alt="" width="32" height="32" /></a><a href="/public/SlowLoader.zip"><br />
Download SlowLoader.as</a></p>
<p>It works very much the same way as the Loader class with the only difference being that you add your event listeners directly to the SlowLoader instance instead of the contentLoaderInfo instance of the Loader instance. Other than that it dispatches the same events as the Loader class does so it should be fairly simple to swap it for a regular Loader when you&#8217;re done. I&#8217;ve also included and example class. Here&#8217;s an excerpt of it:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p234code14'); return false;">View Code</a> ACTIONSCRIPT3</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p23414"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p234code14"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> l<span style="color: #000066; font-weight: bold;">:</span>SlowLoader = <span style="color: #0033ff; font-weight: bold;">new</span> SlowLoader<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
l<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">ProgressEvent</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">PROGRESS</span><span style="color: #000066; font-weight: bold;">,</span> _updateProgress<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
l<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">INIT</span><span style="color: #000066; font-weight: bold;">,</span> _showImage<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
l<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">load</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">URLRequest</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;file.jpg&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">512</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0.9</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></td></tr></table></div>

<p>NOTE: SlowLoader was developed for my own use, which means that it dispatches AILoggerEvents for printing log messages from it. AILogger is also included in the ZIP file and <a href="http://ailogger.googlecode.com">you can read more about it here</a>. If you do not wish to use it, feel free to strip these lines out of the class.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oyvindnordhagen.com/blog/2010/01/06/slowloader-easy-bandwidth-simulation-util-for-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
