<?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>RND Websites</title>
	<atom:link href="http://ronderksen.nl/feed/" rel="self" type="application/rss+xml" />
	<link>http://ronderksen.nl</link>
	<description></description>
	<lastBuildDate>Sat, 25 May 2013 15:19:14 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Debugging Mocha tests in WebStorm</title>
		<link>http://ronderksen.nl/2012/05/03/debugging-mocha-tests-in-webstorm/</link>
		<comments>http://ronderksen.nl/2012/05/03/debugging-mocha-tests-in-webstorm/#comments</comments>
		<pubDate>Thu, 03 May 2012 06:19:50 +0000</pubDate>
		<dc:creator>Ron</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[mocha.js]]></category>
		<category><![CDATA[unit testing]]></category>

		<guid isPermaLink="false">http://ronderksen.nl/?p=214</guid>
		<description><![CDATA[I&#8217;m a recent convert to the WebStorm IDE and for Node development especially, the debugger is a godsent. No longer do I need to add console.log statements to my code to figure out what&#8217;s going on, I can just set a breakpoint and go from there. Simply awesome! However, I wasn&#8217;t able to do this [...]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m a recent convert to the <a href="http://www.jetbrains.com/webstorm/">WebStorm IDE</a> and for Node development especially, the debugger is a godsent. No longer do I need to add console.log statements to my code to figure out what&#8217;s going on, I can just set a breakpoint and go from there. Simply awesome! However, I wasn&#8217;t able to do this for Mocha test scripts. I tried <a href="http://yieldthedog.github.com/blog/2012/03/12/configure-webstorm-to-run-and-debug-mocha-tests/">these instructions</a> that I found, but that didn&#8217;t work for me.</p>
<p>When I came across a post on Stack Overflow asking if <a href="http://stackoverflow.com/questions/9692807/mocha-as-a-library">Mocha could be used as a Node.JS module</a>, I immediately figured out the solution. Create a Node.js script, include Mocha as a module and start the tests like that. Using the Mocha JS API, this was a simple task.</p>
<pre class="brush: jscript; title: ; notranslate">
var Mocha = require('mocha'),
	path = require('path'),
	fs = require('fs');

var mocha = new Mocha({
	reporter: 'dot',
	ui: 'bdd',
	timeout: 999999
});

var testDir = './test/';

fs.readdir(testDir, function (err, files) {
	if (err) {
		console.log(err);
		return;
	}
	files.forEach(function (file) {
		if (path.extname(file) === '.js') {
			console.log('adding test file: %s', file);
			mocha.addFile(testDir + file);
		}
	});

	var runner = mocha.run(function () {
		console.log('finished');
	});

	runner.on('pass', function (test) {
		console.log('... %s passed', test.title);
	});

	runner.on('fail', function (test) {
		console.log('... %s failed', test.title);
	});
});
</pre>
<p>The only problem is the Mocha timeout setting. When you&#8217;re debugging, the timer will continue to run, so by the time you are done debugging, the timeout will have fired. Of course, this can be solved by setting the timeout value to a sufficiently high value for debugging. Running the tests can actually be done more easily by invoking mocha from the command line.</p>
]]></content:encoded>
			<wfw:commentRss>http://ronderksen.nl/2012/05/03/debugging-mocha-tests-in-webstorm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use Mocha.js to unit test YUI</title>
		<link>http://ronderksen.nl/2012/04/26/how-to-use-mocha-js-to-unit-test-yui/</link>
		<comments>http://ronderksen.nl/2012/04/26/how-to-use-mocha-js-to-unit-test-yui/#comments</comments>
		<pubDate>Thu, 26 Apr 2012 19:11:21 +0000</pubDate>
		<dc:creator>Ron</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[mocha.js]]></category>
		<category><![CDATA[unit testing]]></category>
		<category><![CDATA[YUI]]></category>

		<guid isPermaLink="false">http://ronderksen.nl/?p=208</guid>
		<description><![CDATA[We&#8217;ve recently started using YUI as the basis for a new version of our product. It&#8217;s a very solid library, which provides a lot of high quality code. And although YUI has a nice testing framework as well, we wanted to use Mocha.js, so we could run tests continuously. At first, it was unclear how [...]]]></description>
				<content:encoded><![CDATA[<p>We&#8217;ve recently started using <a href="http://yuilibrary.com" target="_blank">YUI</a> as the basis for a new version of our product. It&#8217;s a very solid library, which provides a lot of high quality code. And although YUI has a nice testing framework as well, we wanted to use <a href="http://visionmedia.github.com/mocha/" target="_blank">Mocha.js</a>, so we could run tests continuously. At first, it was unclear how to integrate YUI into Mocha tests, but in the end the solution was very simple:</p>
<pre class="brush: jscript; title: ; notranslate">
var path = require(&quot;path&quot;),
    YUI = require(&quot;yui3&quot;).YUI,
    chai = require(&quot;chai&quot;),
    expect = chai.expect;

(function () {
    describe(&quot;MyModule&quot;, function () {
        var Y, myModule;

        before(function (done) {
            Y = YUI({
                modules: {
                    'mymodule': {
                        fullpath: path.join(__dirname, '../modules/mymodule.js')
                    }
                }
            }).use(['base','mymodule'], function () {
                done();
            });
        });

        beforeEach(function (done) {
            myModule = new Y.MyModule();
            done();
        });

        it('should instantiate the MyModule class', function (done) {
            expect(myModule).to.be.a('object');
            done();
        });

        it('should have a title', function (done) {
            myModule.set('title', 'test');
            expect(myModule.get('title')).to.be.equal('test');
            done();
        });

        it('should have a description', function (done) {
            myModule.set('description', 'test description');
            expect(myModule.get('description')).to.be.equal('test description');
            done();
        });
    });
})();
</pre>
<p>The trick is to use the &#8216;before&#8217; method of Mocha.js to create a YUI sandbox and assign that to a variable that is in the larger scope, so it can be accessed in the other classes. To make sure everything has loaded, the &#8216;before&#8217; method&#8217;s &#8216;done()&#8217; call should be done inside the callback function of YUI&#8217;s use method.<br />
And finally, the required YUI modules for custom modules aren&#8217;t loaded properly, unless they are mentioned in the use method&#8217;s first parameter.</p>
<p>Questions? Ping me on <a href="http://twitter.com/ronderksen">Twitter</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://ronderksen.nl/2012/04/26/how-to-use-mocha-js-to-unit-test-yui/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Robbed</title>
		<link>http://ronderksen.nl/2012/04/08/robbed/</link>
		<comments>http://ronderksen.nl/2012/04/08/robbed/#comments</comments>
		<pubDate>Sun, 08 Apr 2012 08:28:52 +0000</pubDate>
		<dc:creator>Ron</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://ronderksen.nl/?p=206</guid>
		<description><![CDATA[Two nights ago, we were rudely awakened by loud noises coming from downstairs. I immediately knew what was happening: someone was breaking into our house, probably to grab our iMac. By the time I got to the room the bastards were gone, leaving broken glass all over the room. They smashed a window, probably using [...]]]></description>
				<content:encoded><![CDATA[<p>Two nights ago, we were rudely awakened by loud noises coming from downstairs. I immediately knew what was happening: someone was breaking into our house, probably to grab our iMac. By the time I got to the room the bastards were gone, leaving broken glass all over the room. They smashed a window, probably using a sledgehammer. The window was doubleglazed, and the outside pane was almost a centimeter thick. It took them at least five swings to break the glass. But within a few minutes they were through, managed to grab the computer and drive off on their scooter.</p>
<p>We immediately called the police and they responded quickly, sending units to search for the scum that stole our computer. Sadly, but not unexpected, they didn&#8217;t find anyone. The police arrived 10-15 minutes later at the house and did their best to calm us down and get our statement. Our neighbours also came out right after it happened. Considering we all just moved here and haven&#8217;t really got to know each other, I was very grateful that they were there for us. One neighbour actually saw the direction they took off in, but it didn&#8217;t help in the recovery of our computer.</p>
<p>The day after, I just went to work as if nothing happened, but all day I had a knot in my stomach. Luckily, work was a good distraction. That night we had already planned to go out, so we did that, again as if nothing happened. But in the back of my head, the memory still lingered. The exhaustion kicked in when we got home and both of us had a pretty good night&#8217;s sleep.</p>
<p>Yesterday, I finally managed to get a good look at the room and the broken glass everywhere. Perhaps foolishly, I let it sink in, because I wanted to trigger the feelings that were slumbering inside. The most prevalent feeling was anger. I&#8217;m so mad that someone took a sledgehammer to our house, smashed our window and grabbed our computer that held a lot of personal stuff, like the original photos from the birth of our little girl (luckily we had the best pictures backed up on the net). Last night, I woke up around the same time as the break in happened. I lay awake for an hour, thinking of all the things I would&#8217;ve done if I had managed to get down there in time. All the time I felt that knot in my stomach grow bigger. I can still feel it now. I want to get rid of it, I want to get past this and feel safe and happy in my home again. I won&#8217;t let those bastards make me feel like a victim, like I somehow deserved what happened. They had no right, whatever they might think about that themselves. I live in a terrific country, where no one has to steal to survive. It&#8217;s pure, unadulterated envy that made them do what they did. They saw something they wanted to have, and instead of working for it and earning the money to buy it, they had to invade my home to get mine.</p>
<p>Next week, our window will be fixed, all the broken glass will be removed and hopefully, the room will look like nothing happened, so we can move past this. I hope that whoever did this, will, at some point, be held accountable and be punished for their evil. In the meantime, I will overcome my fear and move on with my life.</p>
]]></content:encoded>
			<wfw:commentRss>http://ronderksen.nl/2012/04/08/robbed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fronteers 2011 &#8211; The videos</title>
		<link>http://ronderksen.nl/2011/10/18/fronteers-2011-the-videos/</link>
		<comments>http://ronderksen.nl/2011/10/18/fronteers-2011-the-videos/#comments</comments>
		<pubDate>Tue, 18 Oct 2011 10:36:30 +0000</pubDate>
		<dc:creator>Ron</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://ronderksen.nl/?p=188</guid>
		<description><![CDATA[All the presentations at Fronteers 2011 have been recorded, and the first presentation (The Future is Native by Aral Balkan) has now been uploaded to vimeo, the other talks will follow soon. View the presentation below: Aral Balkan &#124; The Future is Native &#124; Fronteers 2011 from Fronteers on Vimeo. All videos will appear on [...]]]></description>
				<content:encoded><![CDATA[<p>All the presentations at Fronteers 2011 have been recorded, and the first presentation (The Future is Native by Aral Balkan) has now been uploaded to vimeo, the other talks will follow soon. View the presentation below:</p>
<p><iframe src="http://player.vimeo.com/video/30659519?title=0&amp;byline=0&amp;portrait=0" width="500" height="282" frameborder="0" webkitAllowFullScreen allowFullScreen></iframe>
<p><a href="http://vimeo.com/30659519">Aral Balkan | The Future is Native | Fronteers 2011</a> from <a href="http://vimeo.com/fronteers">Fronteers</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p>All videos will appear on this page at a later time:<br />
<a href="http://vimeo.com/channels/fronteers11#30659519">http://vimeo.com/channels/fronteers11#30659519</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ronderksen.nl/2011/10/18/fronteers-2011-the-videos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fronteers 2011 Day 2 &#8211; more thoughts</title>
		<link>http://ronderksen.nl/2011/10/10/fronteers-2011-day-2-more-thoughts/</link>
		<comments>http://ronderksen.nl/2011/10/10/fronteers-2011-day-2-more-thoughts/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 18:05:34 +0000</pubDate>
		<dc:creator>Ron</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://ronderksen.nl/?p=168</guid>
		<description><![CDATA[The second day promised to match the quality and depth of the talks on the first day and it totally fulfilled that promise. Although it started off a bit rocky for me, because I arrived about 20 minutes late for the first presentation, I still managed to get the most important information out of it. [...]]]></description>
				<content:encoded><![CDATA[<p>The second day promised to match the quality and depth of the talks on the first day and it totally fulfilled that promise. Although it started off a bit rocky for me, because I arrived about 20 minutes late for the first presentation, I still managed to get the most important information out of it. So let&#8217;s go through the various talks.<span id="more-168"></span></p>
<h2>Web Components and Model Driven Views &#8211; Alex Russell</h2>
<p><a href="http://twitter.com/slightlylate">Alex Russell</a> works at Google on improving the open web and building Chrome Frame, the IE plugin that allows Chrome to take over the rendering (basically). He started off the second day of the conference with the current state of browsers in the world and from there moved on to some new features that are coming to the latest browsers soon: web components. Alex built it up slowly, starting of with <a href="http://html5doctor.com/the-scoped-attribute/">scoped CSS</a>. Simply put, this allows you to style an element by including a style tag within the element containing the CSS rules for it. It&#8217;s already available in some browsers, I think (maybe only in nightly builds). He then followed up with HTML component templates, which do what it says on the tin: you write a block of HTML, insert some scoped CSS, wrap it in a template tag and you&#8217;re done. Then you can use JavaScript to link in some data which controls how often the template is rendered.</p>
<p>At Informaat we&#8217;re building something with similar features, but that could become much easier using these innovations. Although I don&#8217;t see a use for this in a regular website, it will be much easier to build a web app. For instance, if you need a login box, you can make it into a web component and make it very easily reusable. I&#8217;m interested to hear and read more about this, but I&#8217;ll have to look at Alex&#8217;s presentation again when the video is up on the Fronteers website.</p>
<h2>The New Developer Workflow &#8211; Divya Manian</h2>
<p>Following up after the break was Opera&#8217;s <a href="http://twitter.com/divya">Divya Manian</a>, talking about <a href="http://nimbu.in/fronteers/">the new developer workflow</a>. She was a big fan of <a href="http://sass-lang.com/">SASS</a>/<a href="http://compass-style.org/">Compass</a>, which are CSS preprocessors. They allow you to use mixins, variables and functions within a CSS-like syntax. This code is then run through a tool that converts it all to CSS. Another one of her points was the fact that Photoshop mockups don&#8217;t account for things like interaction, impatient users and the general complexity of the web. This makes it hard to build a site based on nothing more than a few Photoshop files.</p>
<p>She then moved on to the 2012 workflow for a developer:</p>
<ol>
<li>Get to know your developer tools, use the browser to see where you are heading.</li>
<li>Make use of Version Control Systems to go through iterations of the project. Divya advised to get to know Hg or Git.</li>
<li>Make design choices based on the supported feature set. The web ecosystem is much larger nowadays, when you decide to use a certain new feature, you need to figure out what to with browsers that don&#8217;t support (fully).</li>
<li>Have a policy on when to use polyfills. Polyfills are usually for the older browsers, like IE7/8, that don&#8217;t have very capable JavaScript engines. This means that if you put in too many polyfills, these browsers will grind to a halt. She mentions several polyfills that are bad to use, because of performance.</li>
<li>Vendor prefixes are a necessary evil, you can use <a href="http://prefixr.com">prefixr</a> to generate the needed code.</li>
<li>Use preprocessors. They make life much easier when working with complex CSS. Also keep in mind the lifecycle of W3C specs. Once they turn into Candidate Recommendations, the browser vendors will start to accept prefix-less properties.</li>
<li>Build scripts also help to make life easier and optimize stuff for deployment.</li>
</ol>
<h2>HTML5 Forms  KISS time &#8211; Robert Nyman</h2>
<p>Mozilla&#8217;s <a href="http://twitter.com/robertnyman">Robert Nyman</a> is one of my personal favourite speakers, because he comes across like a regular developer. Don&#8217;t get me wrong, he&#8217;s good at what he does, but he doesn&#8217;t make me feel like I&#8217;ve just started <img src='http://ronderksen.nl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . At Fronteers 2011 he spoke about <a href="http://www.slideshare.net/robnyman/html5-forms-kiss-time-fronteers">HTML5 form elements</a> and his talk basically proved that although it is possible to use them in production, you will need to explain to your client or boss that <a href="http://dowebsitesneedtolookexactlythesameineverybrowser.com/">websites don&#8217;t have to look the same in every browser</a>. The implentations for certain aspects (like error messages) vary wildly between browsers, as do the styling capabilities. It is being worked on and with the current release rate of chrome and firefox, it should improve in those browsers pretty soon.</p>
<p>After a short introduction, he started with a summary of the new input types. These are mostly useful for mobile browsers (read: iPhone and Android) as they support various input methods for specific fields (e.g. a date picker for an &lt;input type=&#8221;date&#8221;&gt; field). Next up were the various new attributes, e.g formaction, formenctype, formmethod, formnovalidate and formtarget on submit buttons. Robert showed a slide with these last attributes on an &lt;input type=&#8221;submit&#8221;&gt;, but they will work on the &lt;button&gt; element as well (<a href="https://developer.mozilla.org/en/HTML/Element/button">source</a>). He also mentioned the other new attributes, but that list is too long to repeat here. Check his slides for those <img src='http://ronderksen.nl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>He moved on to the few new form elements in HTML5, starting with the &lt;datalist&gt; element. By adding the list attribute on an &lt;input type=&#8221;text&#8221;&gt; element and setting the value to the id of the &lt;datalist&gt; element, HTML5 allows us to create a combobox field; a field where you can type in text and it then shows you items from the datalist that match the typed text. At any time, you can click on an item in the list to put it in the text field. Useful stuff!</p>
<p>After a couple of more elements, he moved on to the built-in form validation of HTML5. Most of this stuff is already quite well documented on the web, but I noticed a few things that I hadn&#8217;t heard yet.</p>
<ul>
<li>First was that having a field that was hidden and required, would result in weird behaviour in various browsers. Some would show a dialog, others wouldn&#8217;t. Chrome and IE wouldn&#8217;t submit the form.</li>
<li>Email validations don&#8217;t allow for international characters, e.g. röbert@html5.com wouldn&#8217;t validate, even though it&#8217;s a valid email address.</li>
<li>If you use pattern matching, empty fields will validate.</li>
<li>Chrome will use the title attribute in the error message for required fields. Other browsers will just show &#8220;this field is required&#8221;. Mozilla has a vendor-prefixed attribute called x-moz-errormessage that will let you specify an error message.</li>
<li>Luckily, javascript can resolve that by using the setCustomValidity method. All browsers respect this and will show the message set by this method. However, using this method will totally kill the checkValidity method.</li>
</ul>
<p>The final part of  Robert&#8217;s presentation discussed the styling of these new form elements. There are various pseudo-classes available for styling required, valid, invalid and out-of-range fields. However, a big shortcoming of using the invalid pseudoselector is that it applies from page load. So before you&#8217;ve even had a chance to type anything, you&#8217;re already wrong. Firefox fixes this with the moz-ui-invalid and moz-ui-valid pseudoselectors, which is of course vendor specific.</p>
<h2>CreativeJS, beauty in the browser &#8211; Seb Lee-Delisle</h2>
<p>I&#8217;ll be honest, this was the most inspiring presentation of the entire conference. <a href="http://twitter.com/seb_ly">Seb Lee-Delisle</a> makes some really nice stuff, like this <a href="http://vimeo.com/944162">digital, interactive fireworks</a>. The first half hour of his talk, he showed us how it&#8217;s very easy to create a particle that behaves semi-realistically. The trick is to not try to emulate every little bit of physics, but just enough to convince an audience that it&#8217;s real. By uncommenting a few lines in code he had already written, he managed to show us how realistic looking smoke could trail your mouse cursor. It might not be something you&#8217;d implement on the corporate website tomorrow, but it does show the creative and beautiful side of programming. A nice change from insurance forms!</p>
<p>The second half was even more impressive. By using the conference wifi (which was excellent by the way!), Seb took control of our iPhones and Android phones and after several crashes of the software, he managed to sync us up and use each phone as a pixel to display something silly, like an animated pacman. I&#8217;ve never seen a presentation with live coding where the code failed so miserably at times and yet have an audience cheering with enthousiasm through the whole thing. Nerds can be so easy to please <img src='http://ronderksen.nl/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> . Again, it&#8217;s not very useful in a corporate environment, but it&#8217;s as much fun as you can have with a couple of phones this side of Wordfeud!</p>
<h2>jQuery and the Open Source process &#8211; John Resig</h2>
<p>Mr. jQuery himself explained how to successfully run an open source project. Basically, it all boils down to a few key things:</p>
<ul>
<li>Always listen to your users. Help them through every step of the learning process by offering tutorials, advanced documentation and being there with advice when they ask for it on a forum or mailing list.</li>
<li>Make your API easy to understand and use, and keep it consistent across releases.</li>
</ul>
<p>There was more to his story, and hopefully he will release his slides soon, so I can jog my memory <img src='http://ronderksen.nl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h2>In your @font-face &#8211; Jake Archibald</h2>
<p><a href="http://twitter.com/jaffathecake">Jake Archibald</a> is a presenter that always knows how to get the audience laughing. The secret is pretty easy: just throw some cocks in your presentation and talk about cool stuff in a nice northern English accent and most audiences will enjoy it. To be fair, in this presentation, he only had one cock, and it was right at the start to explain he wouldn&#8217;t use them anymore. So what did he talk about? Well, Jake did extensive research into <a href="http://speakerdeck.com/u/jaffathecake/p/in-your-font-face">fonts on the web</a>. Starting off with an explanation about how it came to be that fonts even can be licensed (they&#8217;re not art, but after converting them to svg, they can be licensed as computer programs). After that history lesson, he moved on to explain how fonts moved through various DRM-riddled formats and that that&#8217;s why various browsers only support a specific font type.</p>
<p>He then moves on to fonts in the browser. Apparently, 17 years ago it was very easy. One &lt;link rel=&#8221;FONTDEF&#8221;&gt; declaration at the top, and via the &lt;font&gt; tag, the font could be used. Netscape supported it natively, IE needed a plugin. Happiness. Then IE4 came along with something called &#8220;embedded fonts&#8221;, which basically are TTF fonts in a DRM container. This worked with the @font-face declaration in CSS. CSS2 brought some more stuff to @font-face: the format specifier. This way, you could include various formats, supported in various browsers.  And now, there&#8217;s CSS3 and we need 4 font declarations: eot, woff, truetype and svg. I agree with Jake, the world has become a better place in those 17 years.</p>
<p>So after arriving in the present day, he takes a look at how various browsers support the various bits of the @font-face declaration. He&#8217;s looked at what is supported and which browser downloads each font. The results are pretty bad. Several browsers download all fonts, even though they don&#8217;t use them.  To make matters worse, IE&lt;9 has a bug where it doesn&#8217;t quite get the multiple declarations so it needs a # after the .eot filename. And of course, there&#8217;s compatibility mode, which makes matters even more screwed up, because it fails to comprehend the format specifier and therefore downloads no fonts at all. If you look at one slide from this presentation, make sure it&#8217;s slide #38. That shows the progress we&#8217;ve made in 17 years <img src='http://ronderksen.nl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>After having sorted that mess, Mr. Archibald moves on to more misery: how fonts are downloaded. Apparently, it&#8217;s possible to have fonts consisting of only one (or a few) characters and the browser should figure out if it needs a font to render an element. Chrome/Safari load the first font as soon as the page starts loading, and all other fonts are loaded sequentially after the HTML is done. They never get round to firing the onload event. Firefox does it slightly better, by loading the first font same as Webkit, and then loading the other fonts in parallel after the HTML is done. IE just loads everything from the start, whether it&#8217;s needed or not. So if you use a font only on certain pages but not on others on your site, make sure that the pages that don&#8217;t use it don&#8217;t have the @font-face declaration in their stylesheet. It&#8217;s also possible to make Webkit behave like Firefox by adding a unicode-range property in the @font-face declaration. This property allows you to specify the characters the font contains. Oh, and Opera really makes a mess of things&#8230;</p>
<p>If you use fonts, try to optimize them by removing all glyphs that you don&#8217;t use in your text. For example, if you write in English, there&#8217;s no need to have charaacters with umlauts in your font, as they&#8217;re never used in English. If you do this, most fonts should be manageable after gzipping. You could also remove hinting, but that basically screws everything up, except the file size, so don&#8217;t do it.</p>
<p>The last part of his presentation was about how things looked while the fonts were being downloaded. IE9/Opera first display the text in a normal font and once the font is loaded, they re-render it in the specified font. Webkit doesn&#8217;t display only text that has a standard font, all other text is not shown until the font is loaded. IE8 doesn&#8217;t show anything at all until fonts are loaded. The trick to fix IE8 is to declare font-face inline, before  external CSS and before scripts, or load the font asynchronously. Google has created something called <a href="http://code.google.com/apis/webfonts/docs/webfont_loader.html">webfont loader</a>, which allows you to have different styles for when the font isn&#8217;t loaded, when it&#8217;s loading and when it&#8217;s done.</p>
<p>Jake closes his presentation with a quick list of the various formats and how they came to be. He then uses a metaphor that I won&#8217;t repeat here, but let&#8217;s say we&#8217;re in a spot where we should say &#8220;stop!&#8221; If you want to know what I mean, just check out his slides.</p>
<h2>The prestige of being a web developer &#8211; Christian Heilman</h2>
<p>The final talk of Fronteers 2011 is always a motivational speech; something to make you leave the venue with your blood pumping with a desire to code the most awesome stuff ever. Just like last year, <a href="http://twitter.com/codepo8">Chris Heilman</a> had the honour of getting us all riled up. He&#8217;s an awesome speaker and very capable of getting 500 developers in a coding frenzy. I&#8217;m not gonna reiterate his entire speech here, because he has already <a href="http://www.wait-till-i.com/2011/10/07/the-prestige-of-being-a-web-developer-fronteers-11/">posted it on his own website.</a> However, I will add my own thoughts about his presentation.</p>
<p>Basically, I agree with Christian. If I look at myself, after visiting such a conference, I&#8217;m always ecstatic about using the new stuff that I&#8217;ve seen. I might play around a bit with it, maybe show it to a few coworkers and then never actually implement it in an actual website. I also almost never take a piece of code from the net, look at what I&#8217;m missing from it, or what could make it even better and add that to existing code. I&#8217;d rather build something myself. In my defense, I&#8217;m not alone in this (hence Heilman&#8217;s lecture). I also recognize the hostility that he describes towards Flash developers. Not from me personally, but I do see it on the web. I think Flash devs have had a lot of time to figure out how to do awesome stuff with limited resources, and we can definitely benefit from their knowledge. An example of this is <a href="http://box2d-js.sourceforge.net/">box2d.js</a>, which is a JavaScript (+ Canvas) translation of an ActionScript library for 2d physics. Great stuff, that will definitely bring more creativity and beautiful sites to the web.</p>
<p>I loved his use of Darwin&#8217;s often misquoted quote:</p>
<p>“It is not the strongest of the species that survive, nor the most intelligent, but the ones most responsive to change.”—Charles Darwin</p>
<p>Web technology is one of the most responsive technologies on the web. Therefore it will most likely survive and evolve to become even better. We need to figure out how to bring the cutting edge stuff into our day to day work and using it to move the web forward.</p>
<p>Finally, I also agree with his statement that we don&#8217;t necessary all need to be &#8220;rockstars&#8221;. We need to work together, not just on making awesomeness (as Leslie Jensen-Inman calls it), but also on making better documentation (e.g. adding some information to the <a href="https://developer.mozilla.org/en-US/">Mozilla Developer Network</a> or replying to a question on stackoverflow.com, etc.) And if you want to create an example, use something like <a href="http://jsfiddle.net">jsfiddle.net</a>, so others can take what you&#8217;ve made and improve upon it.</p>
<p>Heck, I&#8217;ll make a promise right now: once a week, I will spend time to add documentation to the MDN wiki. That should make Mr. Heilman happy <img src='http://ronderksen.nl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://ronderksen.nl/2011/10/10/fronteers-2011-day-2-more-thoughts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fronteers conference 2011 Day 1 &#8211; my thoughts</title>
		<link>http://ronderksen.nl/2011/10/07/fronteers-conference-2011-day-1/</link>
		<comments>http://ronderksen.nl/2011/10/07/fronteers-conference-2011-day-1/#comments</comments>
		<pubDate>Fri, 07 Oct 2011 21:59:15 +0000</pubDate>
		<dc:creator>Ron</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://ronderksen.nl/?p=165</guid>
		<description><![CDATA[The past two days, I&#8217;ve been at the Fronteers 2011 conference. Fronteers is the Dutch trade union for front end developers and this is the fifth year they&#8217;ve organized this conference. Last year was the first time I went to the conference, which was okay. This year&#8217;s conference, however, was very much worth the time [...]]]></description>
				<content:encoded><![CDATA[<p>The past two days, I&#8217;ve been at the Fronteers 2011 conference. Fronteers is the Dutch trade union for front end developers and this is the fifth year they&#8217;ve organized this conference. Last year was the first time I went to the conference, which was okay. This year&#8217;s conference, however, was very much worth the time and money spent.</p>
<p><span id="more-165"></span></p>
<h2>The Future is Native &#8211; Aral Balkan</h2>
<p>The conference started with a great talk by <a href="http://twitter.com/aral">Aral Balkan</a> titled &#8220;The Future is Native&#8221;. Of course, that&#8217;s a pretty daring title at a web conference, considering the whole &#8220;web vs. native&#8221; debate. Being a web developer, I had to disagree with his presentation title, but as it turned out, it didn&#8217;t cover the whole talk. He started off with how we are basically cyborgs; we use all kinds of technology to extend our physical capabilities. A simple watch enables us to tell the time exactly, a smartphone allows us to communicate with people around the globe, etc. One of these extensions is the web, however, it is limited due to the fact that it&#8217;s separated from the OS by the browser.  This hinders the user experience, as it stops web apps from doing everything a native app can do. The web also has a few advantages over native, however.<br />
Firstly, web apps don&#8217;t have to be installed. You can just go to a URL and you&#8217;re good to go. Native is catching up with this with app stores.<br />
Secondly, the web is universally accessible (e.g. from anywhere on any device). This will always be difficult for a native app.<br />
Finally, it&#8217;s easy for a web application to always have up-to-date data, a native app will have to set up some sort of sync. The concept of &#8220;always connected&#8221; is still a pipe dream.</p>
<p>After this comparison, Aral bridged over to the importance of the user experience. He goes on how we build things for other people to use, that means that the user experience is more important than our needs as developers. This is what makes UX design extremely difficult. If you first take away non-verbal communication, then take away spoken communication, you are making it very hard for humans to communicate. Now imagine how hard it is for machines and humans to communicate: that is what UX design is about.</p>
<p>The presentation is finished off with the explanation that good UX design makes a user feel superhuman. The example Aral shows is a comparison between an airplane ticket machine in Sweden and in Norway. The Swedish version requires a lot of user actions, and includes many instructions on what to do and even a phone to call someone for help. The Norwegian version only requires you to swipe your credit card. It makes your life easier, not harder. That is what good UX design is all about.</p>
<p>I liked Aral&#8217;s presentation style and at first his talk was a bit too conceptual for me personally. After letting it sink in for a while, I could pick out more and more useful bits.</p>
<h2>Accessibility for the modern web &#8211; Derek Featherstone</h2>
<p>Before I discuss this presentation, I have to admit that accessibility for me is a not just an elephant in the room, but a whole herd of elephants in the room. I know it&#8217;s important, but somehow I never get around to applying it or researching how to do it. To all disabled people that surf the web, I therefore apologize. So on to the talk by <a href="http://twitter.com/feather">Derek Featherstone</a>. Derek showed off several techniques to improve existing websites through Greasemonkey scripts. For example, making Google Maps more accessible by adding an interface that uses actual HTML buttons. This allows tools for disabled people to create an interface for their users by binding spoken commands to these buttons.</p>
<p>He then went on to show some examples of code that was totally inaccessible. The example that stuck in my mind were some checkboxes on Amazon.com, that actually weren&#8217;t checkboxes, but a whole bunch of tags that were styled to look like checkboxes. This made it impossible for screen readers to recognize them.</p>
<p>As I said, accessibility is the elephant in the room for me, but I&#8217;m not alone. Derek&#8217;s examples show that it happens on many sites, even those made by large companies that made their name on the web. I do see the importance of it, so I should make some time available to learn about this.</p>
<h2>CSS3 Secrets: 10 things you might not know about CSS3 &#8211; Lea Verou</h2>
<p>The next talk was by <a href="http://twitter.com/LeaVerou">Lea Verou</a>, one of the rising stars within our trade. I went to the workshop she gave the day before the conference (which was excellent), so this talk was more or less a summary of that day for me. The ten secrets are:</p>
<ol>
<li>Advanced transition functions with the cubic-bezier() function<br />
Lea kicked off with showing us her <a href="http://cubic-bezier.com/">web tool for making cubic-bezier curves</a> that can be used in CSS3 transitions to control the easing of the animation.</li>
<li>Border-radius: using percentage values to make scalable circles and ellipses<br />
Everyone by now has played with border-radiuses, but no one has played with them like Lea has. She did <a href="http://leaverou.me/2010/10/the-curious-case-of-border-radius50/">a lot of research</a> to see how this property can be used. One of her conclusions was that to make scalable ellipses you shouldn&#8217;t use pixel values, but percentages for the horizontal and vertical radii.</li>
<li>Achieve multiple outlines on a box by using multiple shadows and the spread parameter<br />
The box-shadow property is usually used with three pixel parameters and a colour value. However, it allows a fourth value that controls the spread of the shadow. By using this value, it is possible to create multiple &#8220;borders&#8221; around a box.</li>
<li>Making pointer events pass through overlaying elements by adding <code>pointer-events: none;</code><br />
Setting the pointer-event property to none allows the browser to allow clicks on an element to syphon through to underlying elements. This can be used to make nicer select fields, for example, by overlaying the arrow button with an image. However, several people on Twitter noted that it&#8217;s also a risky CSS property, as it makes it easier to create a clickjacking hack.</li>
<li>Adjusting tab size for code display with <code>tab-size: 4</code><br />
This may or may not be very useful for many websites, but if you write about code often and use tabs to indent that code (which, of course, is the only correct way), you can adjust the tab size with this property.</li>
<li>Doing cool stuff with <code>:nth-child</code>, <code>:nth-last-child</code> and <code>:first-child</code> pseudoselector to select elements with a certain amount of siblings.<br />
On their own, these pseudoselectors are relatively straightforward to use. However, if you combine them, it&#8217;s possible to create a selector that targets all matching elements, if the total number is larger than a certain amount. If I recall correctly, it was something like this:<br />
:first-child:nth-last-child(n+2), :first-child:nth-last-child(n+2) ~ b</li>
<li>Styling checkboxes and radiobuttons with the <code>:focus</code> and <code>:checked</code> pseudos<br />
I forgot how she did this exactly, but luckily, her <a href="http://leaverou.me/css3-secrets/">slides are online</a>. So, what she does is this: first, she hides the checkbox. Then she adds some generated content (e.g. an icon), and finally using the focus and checked pseudoselectors, she changes the text color on that generated content.</li>
<li>Use new CSS3 mouse cursors like <code>cursor: none;</code> (in games for instance) or <code>cursor: not-allowed;</code><br />
There are a lot of new CSS3 mouse cursors. She lists them all in her slides and I&#8217;m sure they might come in handy at some point. cursor: row-resize and cursor: col-resize sound pretty useful for manipulating tables, for example.</li>
<li>Create background patterns with CSS3 gradients (check out her <a href="http://leaverou.me/css3patterns/">pattern library too</a>)<br />
This is probably the most awesome secret she shared. These gradients can be used to create some wild patterns, and I&#8217;m very impressed with some of the patterns she managed to create.</li>
<li>Position your background by using <code>background-origin</code><br />
The last secret explains how the background can be aligned on the content-box, so that when you change the padding on the containing element, the background will reposition itself so it stays within the padding. Could be useful.</li>
</ol>
<p>Well, what can I add to this? The presentation was very well executed. Lea has created her own presentation framework in HTML/CSS/JS that allows her to do live coding from within her slides, manipulating elements on those slides. It makes the whole thing feel very magical.</p>
<h2>HTML5 Semantics: you too can be a bedwetting antfucker &#8211; Bruce Lawson</h2>
<p>After an excellent lunch, it was up to <a href="http://twitter.com/brucel">Bruce Lawson</a> to keep us all from falling asleep, and I can say he managed that perfectly. The thing that everyone will remember about this presentation is use of <a href="http://en.wikipedia.org/wiki/Bikini#Mankini">a mankini</a> to explain the difference between the section and article elements (basically, a section can be cut up in pieces, while an article is a single entity, much like said mankini). But that was halfway through his talk, let&#8217;s not get ahead of ourselves!</p>
<p>Bruce started off, after some silliness about a certain Dutch word, with the elements that have been kicked out of the HTML spec in its latest incarnation. Things like &lt;center&gt;, &lt;font&gt; and &lt;big&gt; and some attributes on other elements. Basically nothing that any sane front end developer still uses. He then went on to mention the sexy new elements, like &lt;video&gt;, &lt;audio&gt; and &lt;canvas&gt;, followed by a few elements that probably won&#8217;t see a lot of use in the western hemisphere (&lt;ruby&gt;, &lt;rp&gt; and &lt;rt&gt;). He also mentioned the element that a lot of historians had been waiting for: &lt;time&gt;. Except that they still can&#8217;t use it, because it didn&#8217;t allow for approximate times, like &#8220;first century&#8221;.</p>
<p>Some more tags followed and then he went over to role attributes and why there&#8217;s no &lt;content&gt; element (basically, it&#8217;s because the browser can figure out that whatever&#8217;s left after it found all sections, articles, headers and footers, must be the content.</p>
<p>This was another presentation that was told with a lot of (slightly rude) jokes, but the content was again very useful. Of course, if you follow the developments on HTML5 a little bit, there wasn&#8217;t much news in Bruce&#8217;s talk, but it&#8217;s always very good to get all the relevant info in a short and funny summary. He was also a good sport, and <a href="http://www.slideshare.net/brucelawson/you-too-can-be-a-bedwetting-antfucker-bruce-lawson-opera-fronteers-2011">uploaded his slides</a>.</p>
<h2>Go with the Flow &#8211; Stephen Hay</h2>
<p><a href="http://twitter.com/stephenhay">Stephen Hay</a> normally has good talks, but I found this one a bit dry. He talked about the various layout mechanisms that are in development at the W3C, like flexbox and grid layout. There&#8217;s not a lot that stuck with me, but that also might have had something to do with a belated post lunch dip. I can point you <a href="http://www.slideshare.net/stephenhay/go-with-the-flow-9595283">to his slides</a> to make up for this lack of information.</p>
<h2>The Future of CSS &#8211; Current Experiments and Near-Future Reality &#8211; Tab Atkins, Jr.</h2>
<p>I have to admit I never heard of <a href="http://twitter.com/tabatkins">Tab Atkins</a> before this conference, but I came to the conclusion that he does a lot of good work on the CSS specs that he&#8217;s working on. He basically told us about the things that will be coming to CSS in the near future. He started off by talking about <a href="http://dev.w3.org/csswg/css3-images/">image values</a> in CSS, which allows for things like fallback images (e.g. if a browser can&#8217;t handle SVG, give it a PNG or a GIF, and if that fails, just give it a colour) or defining the image resolution in the CSS, so that the browser understands how to render the image properly.<br />
The next subject were the small changes that have been made to gradients spec, like changing the way the degrees are interpreted (0deg is now north, 90deg is east) and using directional keywords, like left now indicate the direction where the gradient goes, instead of where it starts. The final change was for radial gradients, which now allow to be sized.<br />
Another interesting tidbit was the use of elements as background for other elements, which makes creating a list of thumbnails next to a big image easier. It also allows for the use of canvas as a background.<br />
Next point on the list was the ::marker pseudoselector which allows you to style list markers. By making use of the @counter-style rule, it will also be possible to define very specific list styles.<br />
Tab then moved into the same area that Stephen talked about: CSS layout modules; he quickly explained flexbox and grid layout.</p>
<p>As an encore he quickly showed off the use of CSS variables, basically the stuff that SASS/LESS preprocessors allow you to do in CSS now. He explained that the CSS Working Group looks at all these initiatives and tries to pick out the features that they feel are good additions to CSS and create a spec for those features.</p>
<p>There was some more info in his talk, which you can find in <a href="http://www.xanthir.com/talks/2011-10-06/">the slides</a>, but this was the stuff that I found most interesting. Browsers will begin to support these new features pretty soon, so it&#8217;s good to get familiar with them. Tab also implored us to play around with these new features when they become available in browsers, so we can point out bugs and omissions in the specs and implementations and make them even better.</p>
<p><span class="Apple-style-span" style="font-size: 20px; font-weight: bold;">Passion. Purpose. Promise. Pursuit. &#8211; Leslie Jensen-Inman</span></p>
<p>The last talk of the day was by <a href="http://twitter.com/jenseninman">Leslie Jensen-Inman</a> and it was a daring move by the organisation to add it to the schedule. I personally liked the <a href="http://speakerdeck.com/u/jenseninman/p/passion-purpose-promise-pursuit">core of the message</a> (and comic book fans always have a plus in my book <img src='http://ronderksen.nl/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ), but it was a bit too &#8220;soft&#8221; for a lot of people. The feedback during the talk reflected this. The core revolved around the four words from the title and how one leads to the next. If you have passion for a certain subject, it gives you purpose (to explore the subject).  You can foster this purpose by making a promise pertaining to the subject. And by sticking to the promise you can pursue your purpose and fulfill your promise.</p>
<p>In my opinion, this message is no different than the message that Christian Heilmann had in his closing speech at last year&#8217;s Fronteers conference. If you&#8217;re passionate about web development, then you should put effort into it and you&#8217;ll find that the results of that effort will be very rewarding, fueling your passion. The way it was packaged by Leslie might not appeal to everyone, and I accept that. However, I found the Twitter comments derogatory and disrespectful and I spoke my mind about that at the time.</p>
<p>Anyway, I still think it&#8217;s good that the Fronteers organisation doesn&#8217;t overlook the human side of the trade and gives a platform to this kind of motivational talks. It was best said by the @FronteersConf account on Twitter: &#8220;Remember: if you wouldn’t have passion for your job, you wouldn’t be here today.&#8221;</p>
<p>Another point that is sort of related to this, is that Fronteers is also dedicated to educating people about front end development and showing what Leslie did with her students, shows that there are many ways to educate people about this exciting area we all work in.</p>
]]></content:encoded>
			<wfw:commentRss>http://ronderksen.nl/2011/10/07/fronteers-conference-2011-day-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>30 days</title>
		<link>http://ronderksen.nl/2011/09/25/30-days-3/</link>
		<comments>http://ronderksen.nl/2011/09/25/30-days-3/#comments</comments>
		<pubDate>Sun, 25 Sep 2011 19:35:17 +0000</pubDate>
		<dc:creator>Ron</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://ronderksen.nl/?p=161</guid>
		<description><![CDATA[A few days ago, I watched the TED presentation by Matt Cutts where he explains how he changed things in his life by trying out new things for thirty days. Towards the end of his presentation he also admits that it doesn&#8217;t always work, like when he tried to go thirty days without sugar. However, I think that the [...]]]></description>
				<content:encoded><![CDATA[<p>A few days ago, I watched the <a href="http://www.ted.com/talks/matt_cutts_try_something_new_for_30_days.html">TED presentation</a> by <a href="http://www.mattcutts.com/blog/">Matt Cutts</a> where he explains how he changed things in his life by trying out new things for thirty days. Towards the end of his presentation he also admits that it doesn&#8217;t always work, like when he tried to go thirty days without sugar. However, I think that the essence of his story might work for me. I usually set enormous goals for myself and then never start them, because I decide upfront that there&#8217;s no way I can achieve said goals.</p>
<p>One of those things is improving my JavaScript and general programming skills. I try to keep up with new developments, but I hardly ever sit down and play around with code, unless my day job requires it. Of course, my life has changed enormously after the birth of my daughter and it&#8217;s been a very tiring few months. But that is quieting down now, so I feel this is a good time to start this experiment.</p>
<p>So what am I going to do? For the next thirty days (starting tomorrow, Monday 26th), I&#8217;m going to spend at least two nights a week on improving my skills, instead of improving being a couch potato. Because my kid usually doesn&#8217;t sleep before 8pm, and I need to get some sleep as well, a night will consist of two to three hours. So, let&#8217;s see how it went on October, 26th!</p>
]]></content:encoded>
			<wfw:commentRss>http://ronderksen.nl/2011/09/25/30-days-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recreating a C64 game</title>
		<link>http://ronderksen.nl/2011/03/24/recreating-a-c64-game/</link>
		<comments>http://ronderksen.nl/2011/03/24/recreating-a-c64-game/#comments</comments>
		<pubDate>Thu, 24 Mar 2011 22:07:51 +0000</pubDate>
		<dc:creator>Ron</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://ronderksen.nl/?p=107</guid>
		<description><![CDATA[To challenge myself as JavaScript programmer and to learn new things, I&#8217;ve decided to try and rebuild a Commodore 64 educational game called &#8220;Topography Netherlands&#8221;. I couldn&#8217;t find a C64 video of it, but this MSX version is basically the same. The idea is that the game gives you a name of a Dutch city [...]]]></description>
				<content:encoded><![CDATA[<p>To challenge myself as JavaScript programmer and to learn new things, I&#8217;ve decided to try and rebuild a Commodore 64 educational game called &#8220;Topography Netherlands&#8221;. I couldn&#8217;t find a C64 video of it, but <a href="http://www.youtube.com/watch?v=eVuAAdcSlFo">this MSX version</a> is basically the same. The idea is that the game gives you a name of a Dutch city and you need to fly there as fast as possible. The goal is to score as many points as you can in a set amount of time. The game was intended to teach younger children the location of Dutch cities. Later versions of the game also offered German and European maps.</p>
<p>As you can tell from the video, the game isn&#8217;t that complex. Here&#8217;s my shopping list:</p>
<ul>
<li>an animation of a helicopter</li>
<li>a map of the Netherlands</li>
<li>coordinates of all Dutch cities</li>
<li>a clock</li>
<li>a scoring system</li>
<li>a randomizer to select different cities</li>
<li>some form of collision detection to determine if the helicopter is at the required location on the map</li>
<li>a way to convert keyboard presses into directional controls</li>
</ul>
<p>To make things slightly more interesting, I want to use a canvas element. It would probably be easier to use a collection of divs, but where&#8217;s the challenge in that, right?</p>
<p>I&#8217;ve already found <a href="http://www.imergis.nl/map/2011-NL-Gemeenten-1800px.png">a nice, large map</a> with all Dutch municipalities on it that I can use as a basis for my map and for my coordinates list.</p>
<p>As I&#8217;m doing this in my spare time, I&#8217;m giving myself one month to finish it. Also, I&#8217;m not going to use any library (except for excanvas.js to make it work in IE as well). Reason for this is that I&#8217;m not used to work without the safety net of a framework, and I notice that it limits me in being a good JS programmer (basically, I&#8217;m too used to the Prototype.js idiom). This will probably mean that I&#8217;ll need to look at code optimization at some point.</p>
<p>I&#8217;ll start on this next week, after a weekend of relaxing. I hope you (read: someone) will follow my endeavours and maybe learn something from it (as I hope I will).</p>
]]></content:encoded>
			<wfw:commentRss>http://ronderksen.nl/2011/03/24/recreating-a-c64-game/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The problem of massive CSS</title>
		<link>http://ronderksen.nl/2010/12/06/the-problem-of-massive-css/</link>
		<comments>http://ronderksen.nl/2010/12/06/the-problem-of-massive-css/#comments</comments>
		<pubDate>Mon, 06 Dec 2010 14:55:59 +0000</pubDate>
		<dc:creator>Ron</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://ronderksen.nl/?p=94</guid>
		<description><![CDATA[In the past few years, I&#8217;ve worked on several big websites as part of a front end team. And all those sites have the same problem: a cancerous growth of CSS. The problem starts out small; a designer changes the look of a new component of the site in such a way that existing CSS [...]]]></description>
				<content:encoded><![CDATA[<p>In the past few years, I&#8217;ve worked on several big websites as part of a front end team. And all those sites have the same problem: a cancerous growth of CSS. The problem starts out small; a designer changes the look of a new component of the site in such a way that existing CSS classes can&#8217;t be used, so the developer adds some new classes. However, over the years this process turns a few hundred lines of CSS into a few thousand lines (or even more than a few). And at some point the developer might not even try to reuse CSS code, because it&#8217;s easier to add a few more classes than to find the proper classes in all those lines of CSS. And so the problem of massive CSS is born. </p>
<p>So what is the solution for this problem? In my opinion, the solution has multiple layers. Firstly, for a large site a very strictly adhered style guide and component guide is a requirement. It might not be as much fun for the designers, but it is a very good way to maintain cohesion in the designs across a site. Secondly, build the component with reusability in mind. Don&#8217;t make them location dependent (i.e. it should be possible to put a component in the main column and in the sidebar without adding new CSS). This is quite difficult, but not impossible. If there is no other way, make sure to document this in your CSS and HTML. However, the hardest part to solving the issue is getting people on board with any new solution. People don&#8217;t like change, and there are actually people that thrive in the chaos of massive CSS. </p>
<p>Technically speaking, I think the best solution is <a href="http://www.stubbornella.com">Nicole Sullivan</a>&#8216;s <a href="https://github.com/stubbornella/oocss/wiki/">Object Oriented CSS</a> approach. Although the link goes to Github, it&#8217;s not only a technical solution, it&#8217;s a mindset solution (just like OOP). You need to learn to &#8220;see&#8221; the &#8220;objects&#8221; in a page that can work with the OOCSS approach. OOCSS also isn&#8217;t a silver bullet, you can&#8217;t use it for every single part of your website. However, it can work for the interface elements of your site: the elements that keep popping up all over your site. Things like content boxes, a picture with some text or a form field and label. The clue of OOCSS is figuring out a singular way of building a component and then sticking with it. Of course you can extend a component so that it becomes a new component (just as you extend a class in OOP), but you shouldn&#8217;t have two components that look similar on the same level in your &#8220;OOCSS hierarchy&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://ronderksen.nl/2010/12/06/the-problem-of-massive-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML5 forms with fallback for non-supporting browsers</title>
		<link>http://ronderksen.nl/2010/10/18/html5-forms-with-fallback-for-non-supporting-browsers/</link>
		<comments>http://ronderksen.nl/2010/10/18/html5-forms-with-fallback-for-non-supporting-browsers/#comments</comments>
		<pubDate>Mon, 18 Oct 2010 09:53:27 +0000</pubDate>
		<dc:creator>Ron</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://ronderksen.nl/?p=82</guid>
		<description><![CDATA[Last week, I did some research into creating fallbacks for the new HTML5 form elements, such as email fields, date fields, etc. As it turns out, this is very easy. I used Modernizr for the feature detection. Although it&#8217;s just a 5k script, you could easily extract the required code from it if you want [...]]]></description>
				<content:encoded><![CDATA[<p>Last week, I did some research into creating fallbacks for the new HTML5 form elements, such as email fields, date fields, etc. As it turns out, this is very easy. I used <a href="http://www.modernizr.com">Modernizr</a> for the feature detection. Although it&#8217;s just a 5k script, you could easily extract the required code from it if you want to keep your footprint to a minimum.</p>
<p>Based on the Modernizr results, I applied a CSS class for design purposes and attached event handlers. For example, the code below handles the &#8220;required&#8221; attribute.</p>
<pre class="brush: jscript; title: ; notranslate">
function validateRequired(e) {
var fld = e.element(),
ph = fld.getAttribute('placeholder') || '';
if (fld.value === '' || fld.value === ph) {
console.log('field ' + fld.id + ' is required');
fld.removeClassName('validated');
} else {
fld.addClassName('validated');
}
}

if (!Modernizr.input.required) {
$$('input[required]').invoke('addClassName', 'required')
.invoke('observe', 'blur', validateRequired);
}
</pre>
<p>I use Prototype.js as my framework of choice, but it can be done just as well with other frameworks or plain javascript. As long as you use Element.getAttribute you can access the new attributes without any problems in all browsers. Of course, this is just proof-of-concept code, so it needs some tidying up for actual production use. I&#8217;ll probably create a full Prototype.js library of modules to handle the various attributes and field types. I&#8217;m also figuring out a good way to handle data-* attributes so you get an easy way to access those. My aim is to stay as close as possible to the official spec for those interfaces.</p>
<p>I&#8217;ve tested the code in IE6, IE7, IE8, Firefox 3.0, Firefox 3.6, Safari 5 (Win), Chrome 6 and Opera 10 and they all work as expected.</p>
]]></content:encoded>
			<wfw:commentRss>http://ronderksen.nl/2010/10/18/html5-forms-with-fallback-for-non-supporting-browsers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
