<?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 Tech in Journalism</title>
	<atom:link href="https://martinove.dk/feed/" rel="self" type="application/rss+xml" />
	<link>https://martinove.dk</link>
	<description>tips for webworkers</description>
	<lastBuildDate>Tue, 18 Feb 2020 20:10:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.3.8</generator>
	<item>
		<title>Omregn.nu &#124; an AngularJS side project</title>
		<link>https://martinove.dk/2016/06/06/omregn-nu-an-angularjs-side-project/</link>
		
		<dc:creator><![CDATA[Martin Ove Christensen]]></dc:creator>
		<pubDate>Mon, 06 Jun 2016 21:22:13 +0000</pubDate>
				<category><![CDATA[Ikke kategoriseret]]></category>
		<category><![CDATA[AngularJS]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[omregn.nu]]></category>
		<guid isPermaLink="false">http://martinove.dk/?p=1096</guid>

					<description><![CDATA[<p>I finally got around to deploying the AngularJS version of omregn.nu. Omregn.nu is a web app for converting units. The web app exists in an extremely crowded space and is by no means anything new. Omregn.nu has one thing going for it though, it&#8217;s mobile friendly. However, all of that doesn&#8217;t matter; the main purpose of [&#8230;]</p>
<p>The post <a href="https://martinove.dk/2016/06/06/omregn-nu-an-angularjs-side-project/">Omregn.nu | an AngularJS side project</a> first appeared on <a href="https://martinove.dk">The Tech in Journalism</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>I finally got around to deploying the <a href="https://angularjs.org/" target="_blank">AngularJS</a> version of <a href="http://omregn.nu/" target="_blank">omregn.nu</a>.</p>
<p><a href="http://omregn.nu/" target="_blank">Omregn.nu</a> is a web app for converting units. The web app exists in an extremely crowded space and is by no means anything new. <a href="http://omregn.nu/" target="_blank">Omregn.nu</a> has one thing going for it though, it&#8217;s mobile friendly.</p>
<p>However, all of that doesn&#8217;t matter; the main purpose of omregn.nu has been to learn <a href="https://angularjs.org/" target="_blank">AngularJS</a> and <a href="https://docs.angularjs.org/tutorial/step_09" target="_blank">routing by AngularJS</a>.</p>
<h2>Refactoring from <a href="https://jquery.com/" target="_blank">jQuery</a> to <a href="https://angularjs.org/" target="_blank">AngularJS</a></h2>
<p>The first version of <a href="http://omregn.nu/" target="_blank">omregn.nu</a> was written in <a href="https://jquery.com/" target="_blank">jQuery</a> using a classic paradigm:</p>
<ol>
<li>Change in input field causes</li>
<li>JavaScript to calculate resulting values and</li>
<li><a href="https://jquery.com/" target="_blank">jQuery</a> updates the frontend.</li>
</ol>
<p>Basic and event driven.</p>
<p>I wanted to do more though, and I&#8217;ve been wanting to work with routing and canonical urls for a while. Enter <a href="https://docs.angularjs.org/tutorial/step_09" target="_blank">routing with AngularJS</a> and a head-first dive into thinking in MWC.</p>
<h2>The model is king</h2>
<p>With <a href="https://angularjs.org/" target="_blank">AngularJS</a>, I needed to get rid of all the event hooks, thinking differently about where values come from. With <a href="https://angularjs.org/" target="_blank">AngularJS</a>, the model, the M in MWC, is king. You have to focus on updating the model and just make the frontend follow suit.</p>
<p>I also had to get into routing and the intricacies of <a href="https://docs.angularjs.org/api/ngRoute" target="_blank">ngRoute</a>, keeping the url-bar and to current unit and value into sync. My hope is that at some point, it&#8217;s going to become SEO awesome.</p>
<h2>Deep SEO</h2>
<p>Check this out:</p>
<p><img decoding="async" fetchpriority="high" class="wp-image-1100 size-full alignnone" src="http://martinove.dk/wp-content/uploads/2016/06/angularjs-routing-seo.png" alt="AngularJS routing SEO" width="627" height="197" srcset="https://martinove.dk/wp-content/uploads/2016/06/angularjs-routing-seo.png 627w, https://martinove.dk/wp-content/uploads/2016/06/angularjs-routing-seo-300x94.png 300w" sizes="(max-width: 627px) 100vw, 627px" /></p>
<p>This is Google hitting deep and dynamic content &#8211; score!</p>
<p>I am definitely going to work further on this &#8211; preferably hitting the <a href="https://en.wikipedia.org/wiki/Knowledge_Graph" target="_blank">Knowledge Graph</a> with a vengeance at some point. I don&#8217;t think I could have done this without <a href="https://angularjs.org/" target="_blank">AngularJS</a> routing.</p>
<p>Hit me at <a href="https://twitter.com/mocdotcom" target="_blank">@mocdotcom</a> if you have any questions.</p><p>The post <a href="https://martinove.dk/2016/06/06/omregn-nu-an-angularjs-side-project/">Omregn.nu | an AngularJS side project</a> first appeared on <a href="https://martinove.dk">The Tech in Journalism</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Vector Racer 0.3 &#8211; Responsive canvas</title>
		<link>https://martinove.dk/2016/02/07/vector-racer-0-3-responsive-canvas/</link>
		
		<dc:creator><![CDATA[Martin Ove Christensen]]></dc:creator>
		<pubDate>Sun, 07 Feb 2016 20:10:51 +0000</pubDate>
				<category><![CDATA[Ikke kategoriseret]]></category>
		<category><![CDATA[Game Development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Vector Racer]]></category>
		<guid isPermaLink="false">http://martinove.dk/?p=1090</guid>

					<description><![CDATA[<p>Vector Racer has reached version 0.3 and the major improvement in this release is the mobile UI. The game runs in a HTML Canvas element, and the canvas element need to have a width and height defined in pixels. That goes against responsive web design for mobile which relies heavily on relative units for layout. In [&#8230;]</p>
<p>The post <a href="https://martinove.dk/2016/02/07/vector-racer-0-3-responsive-canvas/">Vector Racer 0.3 – Responsive canvas</a> first appeared on <a href="https://martinove.dk">The Tech in Journalism</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Vector Racer has reached version 0.3 and the major improvement in this release is the mobile UI.<span id="more-1090"></span></p>
<p>The game runs in a HTML Canvas element, and the canvas element need to have a width and height defined in pixels. That goes against responsive web design for mobile which relies heavily on relative units for layout.</p>
<p>In short: On mobile, you want to be able to fill the width of the screen regardless of differences in screen resolution:</p>
<p><img decoding="async" class="alignnone size-medium wp-image-1091" src="http://martinove.dk/wp-content/uploads/2016/02/0-3_screenshot_mobile-169x300.png" alt="Version 0.3 on mobile screenshot." width="169" height="300" srcset="https://martinove.dk/wp-content/uploads/2016/02/0-3_screenshot_mobile-169x300.png 169w, https://martinove.dk/wp-content/uploads/2016/02/0-3_screenshot_mobile-768x1365.png 768w, https://martinove.dk/wp-content/uploads/2016/02/0-3_screenshot_mobile-576x1024.png 576w, https://martinove.dk/wp-content/uploads/2016/02/0-3_screenshot_mobile-984x1749.png 984w, https://martinove.dk/wp-content/uploads/2016/02/0-3_screenshot_mobile.png 1080w" sizes="(max-width: 169px) 100vw, 169px" /></p>
<h2>Responsive canvas through scale()</h2>
<p>For a while, I didn&#8217;t think that the canvas could become responsive since the canvas element is so pixel bound.</p>
<p>Every canvas method and, subsequently, all my game logic is pixel based. Having to recalculate would be a nightmare, I thought.</p>
<p>Enter the scale() method: <a href="http://www.w3schools.com/tags/canvas_scale.asp" target="_blank">http://www.w3schools.com/tags/canvas_scale.asp</a></p>
<p>The scale() method lets me keep all my game logic untouched and just scale the drawings on the canvas and the width and height of the element.</p>
<p>To scale the canvas using JavaScript, I&#8217;m doing this if the screen is less than 800px:</p>
<pre>var resizeCanvas = function() {
  var game = document.getElementById("game");
  var canvas = game.getContext("2d");

  var screenWidth = screen.width;
  var gameWidth = game.width;
  var gameHeight = game.height;
  
  var widthRatio = screenWidth / gameWidth;
  game.width = gameWidth * widthRatio;
  game.height = gameHeight * widthRatio;
  
  canvas.scale(widthRatio, widthRatio);
};
</pre>
<p>Basically, I:</p>
<ul>
<li>Get width of screen on device (360px on Nexus 5)</li>
<li>Get a ratio by dividing that by the original game width (800px)</li>
<li>Scale width and height using the ratio (0.45 on Nexus 5)</li>
<li>Set the width and height attribute of the HTML canvas element itself accordingly</li>
</ul>
<p>This allows me to incorporate the canvas element into a responsive layout and thus create a sensible, responsive layout for all screen sizes.</p>
<p>Enjoy!</p>
<p><a style="text-align: center; color: #fff; background-color: #0c0; padding: 1em;" href="http://martinove.dk/games/vectorracer/" target="_blank"><strong>PLAY NOW</strong></a></p><p>The post <a href="https://martinove.dk/2016/02/07/vector-racer-0-3-responsive-canvas/">Vector Racer 0.3 – Responsive canvas</a> first appeared on <a href="https://martinove.dk">The Tech in Journalism</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Vector Racer 0.25 &#8211; Mobile Controls</title>
		<link>https://martinove.dk/2016/02/02/vector-racer-0-25-mobile-controls/</link>
		
		<dc:creator><![CDATA[Martin Ove Christensen]]></dc:creator>
		<pubDate>Tue, 02 Feb 2016 22:19:07 +0000</pubDate>
				<category><![CDATA[Ikke kategoriseret]]></category>
		<category><![CDATA[Game Development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Vector Racer]]></category>
		<guid isPermaLink="false">http://martinove.dk/?p=1087</guid>

					<description><![CDATA[<p>Version 0.25 of Vector Racer offers the first implementation of a mobile interface via on screen buttons. The buttons do not work perfectly &#8211; far from it &#8211; but they do provide a means to play on mobile devices. That&#8217;s the short update of today. Enjoy. PLAY NOW</p>
<p>The post <a href="https://martinove.dk/2016/02/02/vector-racer-0-25-mobile-controls/">Vector Racer 0.25 – Mobile Controls</a> first appeared on <a href="https://martinove.dk">The Tech in Journalism</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Version 0.25 of Vector Racer offers the first implementation of a mobile interface via on screen buttons.</p>
<p>The buttons do not work perfectly &#8211; far from it &#8211; but they do provide a means to play on mobile devices.</p>
<p>That&#8217;s the short update of today. Enjoy.</p>
<p><a style="text-align: center; color: #fff; background-color: #0c0; padding: 1em;" href="http://martinove.dk/games/vectorracer/" target="_blank"><strong>PLAY NOW</strong></a></p><p>The post <a href="https://martinove.dk/2016/02/02/vector-racer-0-25-mobile-controls/">Vector Racer 0.25 – Mobile Controls</a> first appeared on <a href="https://martinove.dk">The Tech in Journalism</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Vector Racer 0.2 &#8211; #winning</title>
		<link>https://martinove.dk/2016/01/30/vector-racer-0-2-winning/</link>
		
		<dc:creator><![CDATA[Martin Ove Christensen]]></dc:creator>
		<pubDate>Sat, 30 Jan 2016 16:54:23 +0000</pubDate>
				<category><![CDATA[Ikke kategoriseret]]></category>
		<category><![CDATA[Game Development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Vector Racer]]></category>
		<guid isPermaLink="false">http://martinove.dk/?p=1073</guid>

					<description><![CDATA[<p>Vector Racer 0.2 is out! And I&#8217;m glad to say that I&#8217;ve solved the two primary issues in version 0.1: Detecting collisions if the player path crosses an obstacle Determining when a player does a lap So now, you are actually able to win the game! And you are able to determine if you&#8217;re better [&#8230;]</p>
<p>The post <a href="https://martinove.dk/2016/01/30/vector-racer-0-2-winning/">Vector Racer 0.2 – #winning</a> first appeared on <a href="https://martinove.dk">The Tech in Journalism</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><a href="http://martinove.dk/games/vectorracer/" target="_blank">Vector Racer 0.2</a> is out! And I&#8217;m glad to say that I&#8217;ve solved the two primary issues in <a href="http://martinove.dk/2016/01/24/vector-racer-0-1/">version 0.1</a>:</p>
<ul>
<li>Detecting collisions if the player path crosses an obstacle</li>
<li>Determining when a player does a lap</li>
</ul>
<p>So now, you are actually able to win the game! And you are able to determine if you&#8217;re better than your buddy since the number of steps are declared upon crossing the finish line.</p>
<p>My record is 42(!). What&#8217;s yours?</p>
<p><a style="text-align: center; color: #fff; background-color: #0c0; padding: 1em;" href="http://martinove.dk/games/vectorracer/" target="_blank"><strong>PLAY NOW</strong></a><span id="more-1073"></span></p>
<h2>Better collision-detection</h2>
<p>Second issue was that collision was only detected where the player &#8216;landed&#8217; at each step. Given enough speed, it was easy to drive right through obstacles.</p>
<p>I&#8217;ve added collision details to three extra points between two positions, making it hard to drive through obstacles but still allowing for cutting a few corners.</p>
<p>Here&#8217;s the concept. Finding the mid-point between the old and new position:</p>
<figure id="attachment_1076" aria-describedby="caption-attachment-1076" style="width: 1280px" class="wp-caption alignnone"><a href="http://martinove.dk/wp-content/uploads/2016/01/vectorsplit.png"><img decoding="async" class="size-full wp-image-1076" src="http://martinove.dk/wp-content/uploads/2016/01/vectorsplit.png" alt="Vector split" width="1280" height="960" srcset="https://martinove.dk/wp-content/uploads/2016/01/vectorsplit.png 1280w, https://martinove.dk/wp-content/uploads/2016/01/vectorsplit-300x225.png 300w, https://martinove.dk/wp-content/uploads/2016/01/vectorsplit-1024x768.png 1024w, https://martinove.dk/wp-content/uploads/2016/01/vectorsplit-984x738.png 984w" sizes="(max-width: 1280px) 100vw, 1280px" /></a><figcaption id="caption-attachment-1076" class="wp-caption-text">Finding the mid-point between two points is an easy way to increase resolution.</figcaption></figure>
<p>And how the code looks. Not very generalized.</p>
<pre>var vectorSplit = function(start, end) {
  var splits = [];
  var mid = { x:((end.x - start.x) / 2) + start.x, y:((end.y - start.y) / 2) + start.y };
  var start_mid = { x:((mid.x - start.x) / 2) + start.x, y:((mid.y - start.y) / 2) + start.y };
  var mid_end = { x:((end.x - mid.x) / 2) + mid.x, y:((end.y - mid.y) / 2) + mid.y };
  splits.push(start);
  splits.push(start_mid);
  splits.push(mid);
  splits.push(mid_end);
  splits.push(end);
  return(splits);
};
</pre>
<p>I guess the right way to do it would be something along the line of <a href="https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm" target="_blank">Bresenham&#8217;s line algorithm</a> but that&#8217;s not going to happen anytime soon.</p>
<h2>To Do</h2>
<p>The most pressing issues going forward is:</p>
<ul>
<li>Implement UI for mobile(who uses laptops for casual gaming anymore?)</li>
<li>Add UI response during the selection process.</li>
<li>Add information area for things like laps, steps etc.</li>
</ul><p>The post <a href="https://martinove.dk/2016/01/30/vector-racer-0-2-winning/">Vector Racer 0.2 – #winning</a> first appeared on <a href="https://martinove.dk">The Tech in Journalism</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Vector Racer 0.1</title>
		<link>https://martinove.dk/2016/01/24/vector-racer-0-1/</link>
					<comments>https://martinove.dk/2016/01/24/vector-racer-0-1/#comments</comments>
		
		<dc:creator><![CDATA[Martin Ove Christensen]]></dc:creator>
		<pubDate>Sun, 24 Jan 2016 20:44:58 +0000</pubDate>
				<category><![CDATA[Ikke kategoriseret]]></category>
		<category><![CDATA[Game Development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Vector Racer]]></category>
		<guid isPermaLink="false">http://martinove.dk/?p=1068</guid>

					<description><![CDATA[<p>I&#8217;ve just started developing a vector racing game. Check it out here: http://martinove.dk/games/vectorracer/ Vector racing is by no means a new category of game, but it&#8217;s still a fun exercise to engage in. I started development on Saturday, reaching 0.1 on Sunday. In version 0.1, you can: Move around the track using keyboard Create tracks using rectangles [&#8230;]</p>
<p>The post <a href="https://martinove.dk/2016/01/24/vector-racer-0-1/">Vector Racer 0.1</a> first appeared on <a href="https://martinove.dk">The Tech in Journalism</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>I&#8217;ve just started developing a vector racing game. Check it out here: <a href="http://martinove.dk/games/vectorracer/" target="_blank">http://martinove.dk/games/vectorracer/</a><span id="more-1068"></span></p>
<p>Vector racing is by no means a new category of game, but it&#8217;s still a fun exercise to engage in.</p>
<p>I started development on Saturday, reaching 0.1 on Sunday.</p>
<p>In version 0.1, you can:</p>
<ul>
<li>Move around the track using keyboard</li>
<li>Create tracks using rectangles</li>
<li>Detect collisions if the player lands in an obstacles (you can drive through them)</li>
</ul>
<p>The most pressing issues now are:</p>
<ul>
<li>Detecting collisions if the player path crosses an obstacle</li>
<li>Determining when a player does a lap</li>
</ul>
<p>I&#8217;m looking forward to developing this further!</p>
<p>In case you feel like playing a better vector racer than mine, check out <a href="http://harmmade.com/vectorracer/" target="_blank">http://harmmade.com/vectorracer/</a>, it&#8217;s awesome!</p><p>The post <a href="https://martinove.dk/2016/01/24/vector-racer-0-1/">Vector Racer 0.1</a> first appeared on <a href="https://martinove.dk">The Tech in Journalism</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://martinove.dk/2016/01/24/vector-racer-0-1/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>HTML for webredaktører</title>
		<link>https://martinove.dk/2015/08/22/html-for-webredaktorer/</link>
		
		<dc:creator><![CDATA[Martin Ove Christensen]]></dc:creator>
		<pubDate>Sat, 22 Aug 2015 17:43:23 +0000</pubDate>
				<category><![CDATA[How-to]]></category>
		<category><![CDATA[På dansk]]></category>
		<guid isPermaLink="false">http://martinove.dk/?p=1023</guid>

					<description><![CDATA[<p>Webredaktører oplever det hver dag. Der er kopieret tekst ind på hjemmesiden, og uanset hvad du gør, bliver der ved med at dukke andre skrifttyper, størrelser, afstande, farver, m.m. op i teksten. Funktionerne i CMS&#8217;ets editor til at rydde formatering hjælper ikke, og problemet består, uanset hvad du gør. Til sidst spørger du den nærmeste, [&#8230;]</p>
<p>The post <a href="https://martinove.dk/2015/08/22/html-for-webredaktorer/">HTML for webredaktører</a> first appeared on <a href="https://martinove.dk">The Tech in Journalism</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Webredaktører oplever det hver dag. Der er kopieret tekst ind på hjemmesiden, og uanset hvad du gør, bliver der ved med at dukke andre skrifttyper, størrelser, afstande, farver, m.m. op i teksten.</p>
<p>Funktionerne i CMS&#8217;ets editor til at rydde formatering hjælper ikke, og problemet består, uanset hvad du gør. Til sidst spørger du den nærmeste, der kan lidt kode. Personen klikker på kode-knappen i editoren, alt bliver volapyk, og på kort tid er problemet væk.</p>
<p>Det kan du også lære &#8211; og det er nemt!<span id="more-1023"></span></p>
<h3>Den gyldne regel</h3>
<p>Enhver webredaktør bør huske den gyldne regel, når det kommer til at kopiere indhold fra andre kilder som Word-dokumenter, andre hjemmesider osv.: Kopier altid først indholdet over i et program, der fjerner al formatering.</p>
<p>I Windows er et udmærket bud Notepad. På MAC kan TextEdit bruges, hvis man husker at sætte formateringen til &#8220;Plain text&#8221;.</p>
<p>Det fjerner de fleste problemer, men sommetider kan der stadig dukke tekststykker op med forskellige farve, størrelse eller skrifttype.</p>
<p>En gennemsnitlig artikel på nettet består af få forskellige elementer som afsnit, overskrifter, punktopstillinger og links. Hvis du ved, hvordan ‘ren’ kode ser ud, så kan du nemt opdage de dele, der giver problemer.</p>
<h3>Sådan finder du koden</h3>
<p>Langt de fleste webredaktører skriver i editorer, der giver mulighed for at se koden bag formateringen. Det er forskelligt, hvordan koden kaldes frem, men som regel finder du en knap, der hedder &#8220;View source&#8221;, &#8220;&lt;/&gt;&#8221; eller, som i WordPress, ved at skifte fra &#8220;Visual&#8221;-modus til &#8220;Text&#8221;-modus.</p>
<p>Når først du kan se koden, har du næsten ubegrænset mulighed udrydde uønsket formatering.</p>
<h3>Afsnit</h3>
<p>Afsnit er det, der fylder mest i de fleste artikler på nettet.</p>
<p>Et afsnit ser sådan ud i kode:</p>
<pre>&lt;p&gt;Det her er et afsnit.&lt;/p&gt;</pre>
<p>Det ovenstående giver:</p>
<pre>Det her er et afsnit.</pre>
<p>Afsnit er et såkaldt block-level element. Dvs. at hvert element ikke vises ved siden af hinanden, men under og over.</p>
<p>Denne kode:</p>
<pre>&lt;p&gt;Afsnittet vises på block-level.&lt;/p&gt;
&lt;p&gt;Det står altså ikke efter hinanden.&lt;/p&gt;</pre>
<p>Giver dette:</p>
<pre>Afsnittet vises på block-level.
Det står altså ikke efter hinanden.</pre>
<p>I HTML-kode gør det ingen forskel, om der er mellemrum i koden eller om der er linjeskift.</p>
<p>Denne kode:</p>
<pre>&lt;p&gt;Første afsnit.&lt;/p&gt;&lt;p&gt;Andet afsnit.&lt;/p&gt;&lt;p&gt;Tredje afsnit.&lt;/p&gt;</pre>
<p>Giver dette:</p>
<pre>Første afsnit.
Andet afsnit.
Tredje afsnit.</pre>
<p>Det er vigtigt at være opmærksom på, for ofte er koden til en artikel én stor klump uden nogen linjeskift eller opsætning.</p>
<h3>Typiske fejl</h3>
<p>Det er meget ofte i afsnittene, at der er fejl i koden. Teksten bliver kopieret fra f.eks. Word, og der er gemmer sig koder, som skaber problemer.</p>
<p>Her er et typisk eksempel:</p>
<pre>&lt;p style="font-size: 20px;"&gt;Hele dette afsnit bliver vist med skriftstørrelse 20.&lt;/p&gt;</pre>
<p>Giver dette:</p>
<pre><span style="font-size: 20px;">Hele dette afsnit bliver vist med skriftstørrelse 20.</span></pre>
<p>Bemærk stykket style=&#8221;font-size: 20px;&#8221;. Det stykke kode gør, at hele afsnittet vises med skriftstørrelse 20. Ofte er det skriftstørrelse eller skrifttype, der bliver kopieret med over.</p>
<p>Samme type fejl kan også se sådan ud:</p>
<pre>&lt;p&gt;Dette afsnit bliver vist med normal skriftstørrelse, men &lt;span style="font-size: 20px;"&gt;dette bliver vist med skriftstørrelse 20.&lt;/span&gt;&lt;/p&gt;</pre>
<p>Det giver:</p>
<pre>Dette afsnit bliver vist med normal skriftstørrelse, men <span style="font-size: 20px;">dette bliver vist med skriftstørrelse 20.</span></pre>
<p>Span-tagget gør det muligt at lave andre farver, størrelser osv. midt i en linje. Det er derfor også en jævnlig gæst, der sniger sig med ind i editoren fra f.eks. Word.</p>
<p>I det ovenstående vil løsningen være helt at fjerne span-tagget, så der står:</p>
<pre>&lt;p&gt;Dette afsnit bliver vist med normal skriftstørrelse, og nu gør dette også.&lt;/p&gt;</pre>
<p>Det giver:</p>
<pre>Dette afsnit bliver vist med normal skriftstørrelse, og nu gør dette også.</pre>
<h3>&#8216;Ren&#8217; kode</h3>
<p>Nøglen til at kunne gennemskue HTML-kode og finde problemet, er at vide, hvad koden bør indeholde.</p>
<p>Nogle tags er i sin simpleste form mere enkle end andre. Et afsnit behøver som vist ovenfor blot at bestå at et start-tag og et slut-tag:</p>
<pre>&lt;p&gt;&lt;/p&gt;</pre>
<p>Andre elementer på siden er mere indviklede. Det gælder f.eks. lister:</p>
<pre>&lt;ul&gt;
  &lt;li&gt;Første&lt;/li&gt;
  &lt;li&gt;Anden&lt;/li&gt;
  &lt;li&gt;Tredje&lt;/li&gt;
&lt;/ul&gt;</pre>
<p>Giver dette:</p>
<pre>• Første
• Anden
• Tredje</pre>
<p>Hvert punkt på listen består af et list-item-tag med start og slut ligesom afsnittet. Men i modsætning til afsnittet omkranses de enkelte punkter på listen af tagget for &#8220;Unordered list&#8221;.</p>
<p>Bemærk at det også her er ligegyldigt, om der er linjeskift i koden. Denne kode er giver nøjagtig det samme som ovenfor:</p>
<pre>&lt;ul&gt;&lt;li&gt;Første&lt;/li&gt;&lt;li&gt;Anden&lt;/li&gt;&lt;li&gt;Tredje&lt;/li&gt;&lt;/ul&gt;</pre>
<h3>Elementer med attributter</h3>
<p>Nogle elementer har tags, der skal bruge mere yderligere oplysninger for at fungere. Det sker ved attributter. Det kan være forvirrende, for faktisk var det en attribut, der gav problemerne med skriftstørrelsen i de tidligere eksempler!</p>
<p>Et af de tags, der skal bruge en attribut for at fungere, er tagget for links:</p>
<pre>&lt;a href="http://dr.dk"&gt;Klik her for at komme til dr.dk&lt;/a&gt;</pre>
<p>Det giver:</p>
<pre><a href="http://dr.dk">Klik her for at komme til dr.dk</a></pre>
<p>Attributten er i dette tilfælde dér, linket fører til. Et link giver ingen mening uden, så det skal være der. Det er denne del af koden:</p>
<pre>href="http://dr.dk"</pre>
<p>Det samme gælder for et andet almindeligt element på hjemmesider, nemlig billeder. Tagget for et billede giver ingen mening, hvis ikke det har en adresse at hente billedet fra.</p>
<p>Denne kode:</p>
<pre>&lt;img src="http://martinove.dk/wp-content/uploads/2015/08/DSC_5284_fuld-1-e1440275753497.jpg" /&gt;</pre>
<p>Giver dette:</p>
<pre><img decoding="async" src="http://martinove.dk/wp-content/uploads/2015/08/DSC_5284_fuld-1-e1440275753497.jpg" alt="" /></pre>
<p>Tagget for billeder er ét af dem, der ikke har en start og en slutning. Trækker man adressen til billedet fra, står der blot:</p>
<pre>&lt;img src="" /&gt;</pre>
<p>Det er altså med andre ord ikke alle attributter, der giver problemer, tværtimod. Nogle er nødvendige.</p>
<h3>Opslagsværk</h3>
<p>Nedenfor finder du en liste over de mest almindelige elementer.</p>
<p>Afsnit:</p>
<pre>&lt;p&gt;&lt;/p&gt;</pre>
<p>Link:</p>
<pre>&lt;a href=""&gt;&lt;/a&gt;</pre>
<p>Billede:</p>
<pre>&lt;img src="" /&gt;</pre>
<p>Liste (uordnet):</p>
<pre>&lt;ul&gt;
  &lt;li&gt;&lt;/li&gt;
&lt;/ul&gt;</pre>
<p>Liste (ordnet):</p>
<pre>&lt;ol&gt;
  &lt;li&gt;&lt;/li&gt;
&lt;/ol&gt;</pre>
<p>Fed tekst:</p>
<pre>&lt;strong&gt;&lt;/strong&gt;</pre>
<p>Overskrifter (i varierende størrelse):</p>
<pre>&lt;h1&gt;&lt;/h1&gt;

&lt;h2&gt;&lt;/h2&gt;

&lt;h3&gt;&lt;/h3&gt;

&lt;h4&gt;&lt;/h4&gt;

&lt;h5&gt;&lt;/h5&gt;

&lt;h6&gt;&lt;/h6&gt;</pre>
<h3></h3>
<h3>Kontakt</h3>
<p>Giver denne artikel mening? Har den hjulpet dig eller er det volapyk?</p>
<p>Fang mig på <a href="https://twitter.com/mocdotcom" target="_blank">@mocdotcom</a> eller <a href="https://www.google.com/+MartinOveChristensen" target="_blank">google.com/+MartinOveChristensen</a>, og stang mig en kommentar eller spørgsmål.</p>
<p>Du kan også kommentere historien på Medium:<br />
<script src="https://static.medium.com/embed.js" async=""></script><a class="m-story" href="https://medium.com/@mocdotcom/html-for-webredakt%C3%B8rer-54575a6cf608" data-collapsed="true">HTML for webredaktører</a></p><p>The post <a href="https://martinove.dk/2015/08/22/html-for-webredaktorer/">HTML for webredaktører</a> first appeared on <a href="https://martinove.dk">The Tech in Journalism</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>JavaScript game &#8211; yay!</title>
		<link>https://martinove.dk/2015/01/05/javascript-game-yay/</link>
		
		<dc:creator><![CDATA[Martin Ove Christensen]]></dc:creator>
		<pubDate>Mon, 05 Jan 2015 17:21:52 +0000</pubDate>
				<category><![CDATA[Ikke kategoriseret]]></category>
		<guid isPermaLink="false">http://martinove.dk/?p=998</guid>

					<description><![CDATA[<p>Yay! My first JavaScript game &#8211; sort of. Basically I saw a video of Mary Rose Cook live coding Space Invaders in 30 minutes and wanted to get my fingers dirty. I thought the programming was awesome and I wanted to get some practice by replicating it, so I did. After that, I started improving [&#8230;]</p>
<p>The post <a href="https://martinove.dk/2015/01/05/javascript-game-yay/">JavaScript game – yay!</a> first appeared on <a href="https://martinove.dk">The Tech in Journalism</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><script src="https://martinove.dk/js/spaceinvaders.js"></script><br />
<canvas id="myCanvas" width="300px" height="300px" style="border-style:solid; float: right;"></canvas></p>
<p><script type="text/javascript">
    window.onload = function() {
        new Game("myCanvas");
    };
</script></p>
<p>Yay! My first JavaScript game &#8211; sort of.</p>
<p>Basically I saw a video of <a target="_blank" href="https://twitter.com/maryrosecook">Mary Rose Cook</a> live coding Space Invaders in 30 minutes and wanted to get my fingers dirty.</p>
<p>I thought the programming was awesome and I wanted to get some practice by replicating it, so I did.</p>
<p>After that, I started improving on it. Mainly, I did levels of incrementing difficulty and menues.</p>
<p><strong>Press &#8220;Z&#8221; to shoot</strong> and check out the video of the live coding &#8211; it&#8217;s badass: <a href="http://vimeo.com/105955605" target="_blank">http://vimeo.com/105955605</a></p><p>The post <a href="https://martinove.dk/2015/01/05/javascript-game-yay/">JavaScript game – yay!</a> first appeared on <a href="https://martinove.dk">The Tech in Journalism</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Solved: Unable to format disk on dlink NAS</title>
		<link>https://martinove.dk/2014/02/18/solved-unable-to-format-disk-on-dlink-nas/</link>
		
		<dc:creator><![CDATA[Martin Ove Christensen]]></dc:creator>
		<pubDate>Tue, 18 Feb 2014 17:14:40 +0000</pubDate>
				<category><![CDATA[Ikke kategoriseret]]></category>
		<category><![CDATA[dlink]]></category>
		<category><![CDATA[DNS-320L]]></category>
		<category><![CDATA[format]]></category>
		<category><![CDATA[NAS]]></category>
		<category><![CDATA[RAID1]]></category>
		<guid isPermaLink="false">http://martinove.dk/?p=974</guid>

					<description><![CDATA[<p>Here&#8217;s the deal: I wanted to extend the standard configuration on my dlink DNS-320L by adding a second disk to form a RAID1. The biggest problem was to format the new disk. No matter what I did, the button saying &#8220;Set RAID and re-format&#8221; in the dlink management software was greyed out. I tried shutting [&#8230;]</p>
<p>The post <a href="https://martinove.dk/2014/02/18/solved-unable-to-format-disk-on-dlink-nas/">Solved: Unable to format disk on dlink NAS</a> first appeared on <a href="https://martinove.dk">The Tech in Journalism</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Here&#8217;s the deal: I wanted to extend the standard configuration on my dlink DNS-320L by adding a second disk to form a RAID1.</p>
<p>The biggest problem was to format the new disk. No matter what I did, the button saying &#8220;Set RAID and re-format&#8221; in the dlink management software was greyed out.</p>
<p>I tried shutting down the NAS, insert the new disk in slot 1, no avail. Shutting down, inserting in slot 2, no avail. I did this numerous times. Performed S.M.A.R.T checks, scanned the disk again and again. Nothing worked.</p>
<p>You know what did? Using Internet Explorer!</p>
<p>Yup, apparently the dlink software doesn&#8217;t like Chrome.</p>
<p>So, there you have it. I hope you encounter this post in a search someday and it saves you a few hours.</p><p>The post <a href="https://martinove.dk/2014/02/18/solved-unable-to-format-disk-on-dlink-nas/">Solved: Unable to format disk on dlink NAS</a> first appeared on <a href="https://martinove.dk">The Tech in Journalism</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Events in and out of Google Maps</title>
		<link>https://martinove.dk/2011/04/01/events-in-and-out-of-google-maps/</link>
		
		<dc:creator><![CDATA[Martin Ove Christensen]]></dc:creator>
		<pubDate>Fri, 01 Apr 2011 11:40:27 +0000</pubDate>
				<category><![CDATA[How-to]]></category>
		<category><![CDATA[dHTML]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[Interactive Graphics]]></category>
		<category><![CDATA[javascript]]></category>
		<guid isPermaLink="false">http://martinove.dk/?p=871</guid>

					<description><![CDATA[<p>Google Maps allows for events to affect the website surrounding it and vice versa. Here's an example and some pointers on how to do it yourself.</p>
<p>The post <a href="https://martinove.dk/2011/04/01/events-in-and-out-of-google-maps/">Events in and out of Google Maps</a> first appeared on <a href="https://martinove.dk">The Tech in Journalism</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Check out how to get events from a Google Maps object to the rest of test webpage.<br />
<span id="more-871"></span><br />
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script><script src="http://martinove.dk/js/jquery-1.5.1.min.js" type="text/javascript"></script><script src="http://martinove.dk/js/main_31032011.js" type="text/javascript"></script></p>
<div id="map_canvas_31032011"></div>
<div id="content_wrapper_31032011">
<div id="menu_31032011">
<h6>Evakueringszonerne<br />
nær Fukushima</h6>
<ul id="menuList">
<li id="overblikMenu">Overblik</li>
<li id="20kmMenu">20 km zonen</li>
<li id="30kmMenu">30 km zonen</li>
</ul>
</div>
<div id="content_31032011">
<div id="overblik">
<h2>Fordrevet på ubestemt tid</h2>
<p>Situationen omkring atomkraftværket Fukushima 1 er stadig meget kritisk, og den øgede stråling har betydet, at mange indbyggere i området er blevet evakueret.</p>
<p>Minderne fra Tjernobyl trænger sig på, for der er endnu ingen, der ved, hvornår området igen er sikkert at bo i.</p>
<p>Klik på evakueringszonerne for at læse nærmere om, hvad det betyder at bo inden for henholdvis 20 og 30 km fra atomkraftværket.</p>
</div>
<div id="20">
<h2>78.000 uden hjem og tidshorisont</h2>
<p>Omkring 78.000 japanere, som boede inden for 20 km af Fukushima 1-værket, er blevet evakueret.</p>
<p>Det er endnu uvist, hvornår de igen kan komme tilbage til deres hjem, men de bliver ikke i løbet af de første dage eller uger, forklarer de japanske myndigheder.</p>
</div>
<div id="30">
<h2>62.000 påvirket</h2>
<p>Der bor 62.000 japanere mellem 20 og 30 km fra atomkraftværket. De er blevet opfordret til at forlade området af de japanske myndigheder. Forlader de ikke området, bør de holde sig indendøre.</p>
<p>Evakueringszonen omkring Tjernobylværket var også 30 km. Inden for den grænse er der &#8211; 25 år efter &#8211; stadig næsten mennesketomt.</p>
</div>
</div>
</div>
<hr />
<p><strong>Using circles and events in Google Maps &#8211; the nerdy part</strong><!--more--></p>
<p>Here&#8217;s a little something I did after reading about the contaminated areas around the Fukushima Dai-ichi Power Plant. The danish newspaper <a href="http://www.information.dk/telegram/264039">Information has a piece here</a>, <a href="http://edition.cnn.com/2011/WORLD/asiapcf/04/01/japan.nuclear.reactors/index.html?iref=allsearch">CNN got a piece here</a>.</p>
<p>The basic idea is to use the maps object &#8220;circle&#8221; to quickly put a clickable element on the map. Clicking the the circle will then of course present the relevant information. In this example I use JQuery to show() and hide() the corresponding information.</p>
<p><strong>Effects &#8211; It&#8217;s a usability thing</strong></p>
<p>To make the graphic seem responsive to the user I&#8217;ve added some small effects. This is quite important as it bring life to the graphic, I wanna <em>see</em> that something happens when I click something.</p>
<p>In this example, two effects are applied when clicking either of the circles. <strong>1</strong>. The width of the line at the outer rim of the clicked circle goes from 1 pixel to 2 pixels. <strong>2</strong>. The font-weigth of the corresponding list item goes bold.</p>
<p>The same thing happens when you click to list items, except for &#8220;Overblik&#8221;, which just puts both the circles line width to it&#8217;s standard of 1 pixel.</p>
<p><strong>Make the map and site &#8220;listen&#8221; to each other</strong></p>
<p>I won&#8217;t go in details about events in this post. You can get a taste of it here: <a href="http://www.w3schools.com/dhtml/dhtml_events.asp">HTML Events</a>.</p>
<p>For those of you familiar with events fired in the standard HTML DOM, I&#8217;ll just point you in the right direction for making the map respond to DOM events and vice versa.</p>
<p>Google Maps has it&#8217;s own object model inside it. The map itself and various objects like polygons and so on can fire events like you&#8217;re used to from the HTML DOM. That makes the Google Map an powerful anchor for your dynamic website.</p>
<p>The information of events can also flow the opposite way by adding a DOM Listener to the map. In this example I use that feature for listening to clicks on the menu items, which in turn makes the corresponding circle respond by increasing it&#8217;s line width to 2 pixels. You can find all about event handling in Google Maps here: <a href="http://code.google.com/intl/da/apis/maps/documentation/javascript/events.html">Google Maps JavaScript API V3 Events</a>.</p>
<p><strong>End note</strong></p>
<p>First of all, if you&#8217;ve been reading this far, thank you! This is nerdy stuff, but the result are worth it.</p>
<p>Next of, the map seems to have issues when embedded in WordPress. If you take a look at the zoom status bar, it&#8217;s pretty much gone. Also, the satellite images doesn&#8217;t load right when you&#8217;re zoomed in. I&#8217;m not quite sure what to do about it.</p>
<p>That&#8217;s it, thanks for reading! Question and comments are more than welcome, of course.</p><p>The post <a href="https://martinove.dk/2011/04/01/events-in-and-out-of-google-maps/">Events in and out of Google Maps</a> first appeared on <a href="https://martinove.dk">The Tech in Journalism</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Bye bye, text bubble in Google Maps</title>
		<link>https://martinove.dk/2011/03/18/bye-bye-text-bubble-in-google-maps/</link>
		
		<dc:creator><![CDATA[Martin Ove Christensen]]></dc:creator>
		<pubDate>Fri, 18 Mar 2011 13:17:46 +0000</pubDate>
				<category><![CDATA[Freeware]]></category>
		<category><![CDATA[dHTML]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Interactive Graphics]]></category>
		<category><![CDATA[javascript]]></category>
		<guid isPermaLink="false">http://martinove.dk/?p=717</guid>

					<description><![CDATA[<p>Orkanen Katrina 29.08.2005 Orkanen Katrina ramte USA og gjorde især skade på byen New Orleans. Også de omkringliggende områder blev ramt, som f.eks. byen Mobile i staten Alabama. Water covers Royal Street in downtown Mobile, Ala., as Hurricane Katrina hit the Gulf Coast on Sunday, August 29, 2005. (photo and caption: au_Tiger01 @ flickr.com) Jordskælv [&#8230;]</p>
<p>The post <a href="https://martinove.dk/2011/03/18/bye-bye-text-bubble-in-google-maps/">Bye bye, text bubble in Google Maps</a> first appeared on <a href="https://martinove.dk">The Tech in Journalism</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><span id="more-717"></span></p>
<style type="text/css" media="screen">@import "http://martinove.dk/js/css_alternativ.css";</style>
<style type="text/css">
.gemt { display: none; }
#map_canvas {width: 580px; }
#infographic {height: 500px;}
</style>
<p><script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script><br />
<script type="text/javascript" src="http://martinove.dk/js/jquery-1.5.min.js"></script><br />
<script type="text/javascript" src="http://martinove.dk/js/map_alternativ.js"></script></p>
<div id="infographic">
<div id="infoPanel">
<div id="katrinaResume" class="gemt" >
<h2>Orkanen Katrina</h2>
<h3>29.08.2005</h3>
<p>Orkanen Katrina ramte USA og gjorde især skade på byen New Orleans.</p>
</p></div>
<div id="katrinaFull" class="gemt">
<p>Også de omkringliggende områder blev ramt, som f.eks. byen Mobile i staten Alabama.</p>
<p>			<a href="http://www.flickr.com/photos/au_tiger01/110282519/" title="HURRICANE KATRINA by au_tiger01, on Flickr"><br />
			<img decoding="async" class="imgFull" src="http://farm1.static.flickr.com/54/110282519_8e64abde4e.jpg" width="580" alt="HURRICANE KATRINA" /><br />
			</a><br />
			<br />
			<small>Water covers Royal Street in downtown Mobile, Ala., as Hurricane Katrina hit the Gulf Coast on Sunday, August 29, 2005. (photo and caption: au_Tiger01 @ flickr.com)</small>
		</div>
<div id="China_SichuanResume" class="gemt">
<h2>Jordskælv i Sichuan</h2>
<h3>12.05.2008</h3>
</p></div>
<div id="China_SichuanFull" class="gemt">
<p>Jordskælvet i Sichuan provinsen kostede næsten 70.000 mennesker livet og 11 millioner kinesere deres hjem.</p>
<p>		<a href="http://www.flickr.com/photos/remkotanis/3252492758/" title="Sichuan Earthquake May 2008 by Remko Tanis, on Flickr"><br />
		<img decoding="async" class="imgFull" src="http://farm4.static.flickr.com/3263/3252492758_5b2989c65a.jpg" width="580 alt="Sichuan Earthquake May 2008" /><br />
		</a><br />
		<br />
		<small>Collapsed buildings after the 12 May 2008 earthquake in Hanwang, Sichuan, China (photo and caption: Remko Tanis @ flickr.com)</small>
		</div>
</div>
<div id="map_canvas"></div>
</div>
<p><small>The text bubble is often not the best way to show of information in Google Maps. This is a custom layout which uses the user events of Google Maps the show the relevant information. Very buggy and only a crude sketch for now.</small></p>
<p><em>By: Martin Ove Christensen</em></p>
<p>Google Maps is very widely used, and with good reason. It&#8217;s very easy to create maps, and you can customize the information shown in the text bubbles by embedding images and so on.</p>
<p>One thing I hate, though, is getting pushed around a map, which is to small to display all the information, that the publisher wants to show. Here&#8217;s one example, and it&#8217;s even a mild one from the danish tv-station, TV2: <a href="http://nyhederne.tv2.dk/article.php/id-38243088:verdens-dyreste-naturkatastrofer.html">Verdens dyreste naturkatastrofer(Worlds most expensive natural disasters)</a></p>
<p><script type="text/javascript">
initialize();
</script></p>
<p>In each text bubble, there&#8217;s a link to a gallery of pictures, one from each of the disasters. Linking and galleries are good, but it&#8217;s a shame that I have to leave the map to look at the pictures.</p>
<p><strong>Cue: JavaScript, CSS and HTML</strong></p>
<p>I believe that the cure is this: Learn! Learn how to make good use of the small space you have, by making the web dynamic. It&#8217;s built into the web, and my example doesn&#8217;t use anything but supported standards for browsers. The technologies are free too, so there&#8217;s no excuse.</p>
<p>Designing dynamic web elements have another thing going for it too. If it&#8217;s well designed, it will entice the curiosity of the user, eager to explore what lies beneath other elements on the map. Of course, there&#8217;s a potential pitfall in this too. The interactive and dynamic element may become incomprehensible and the user may &#8220;give up&#8221; on exploring it as a result of losing the general view. This is a design consideration.</p>
<p>Dynamic web elements are also very interesting, when it comes to mobile devices. The small screen make for a great challenge on how to present information in an intuitive manner without making the content too shallow.</p>
<p>That&#8217;s it. I hope you enjoyed checking out this crude example. Questions and comments are welcome, of course.</p>
<p>Thanks for reading!</p><p>The post <a href="https://martinove.dk/2011/03/18/bye-bye-text-bubble-in-google-maps/">Bye bye, text bubble in Google Maps</a> first appeared on <a href="https://martinove.dk">The Tech in Journalism</a>.</p>]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
