<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">

	<title type="text">mennovanslooten.nl</title>
	<subtitle type="text"></subtitle>
	<link rel="alternate" type="text/html" href="http://www.mennovanslooten.nl/" />
	<link rel="self" type="application/atom+xml" href="http://www.mennovanslooten.nl/blog/atom/" />
	<updated>2012-01-31T21:13:13+01:00</updated>
	<rights>Copyright (c) 2006, Menno van Slooten</rights>

	<generator uri="http://www.codeigniter.com/" version="1.5.1">Code Igniter</generator>
	<id>tag:mennovanslooten.nl,2006:/blog</id>


			<entry>
			<title>Smooth image zooming with CSS transitions</title>
			<link rel="alternate" type="text/html" href="http://www.mennovanslooten.nl/blog/post/78" />
			<id>tag:mennovanslooten.nl,2012-01-31:/blog/post/78</id>

			<published>2012-01-31T21:13:13+01:00</published>
			<updated>2012-01-31T21:13:13+01:00</updated>
			<author>
				<name>Menno van Slooten</name>
				<!-- email></email -->
				<uri>http://www.mennovanslooten.nl</uri>
			</author>

			<content type="html"><![CDATA[
				<p>A week or so ago, I was experimenting with CSS transitions to see if I could reproduce a nice version of the <a href="http://en.wikipedia.org/wiki/Ken_burns_effect">Ken Burns Effect</a>. Even if you don't know the name, I'm sure you know the effect quite well: a slow, even pan &amp; zoom on a still image. I was a little disappointed to find that <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=663776">Firefox did not play along very well</a>. Even though the transition itself was smooth, the zoom effect was jittery.</p>

&lt;style type="text/css"&gt;
.kenburns-old,
.kenburns-new {
  position: relative;
  overflow: hidden;
  height: 300px;
  margin: 1.5em 0 0 0;
}
.kenburns-old img,
.kenburns-new img {
  width: 100%;
  -webkit-transform-origin: 20% 80%;
  -webkit-transition: -webkit-transform 30s linear;
  -moz-transform-origin: 20% 80%;
  -moz-transition: -moz-transform 30s linear;
}
.kenburns-old img.zoom {
  -webkit-transform: scale(2);
  -moz-transform: scale(2);
}
.kenburns-new img.zoom {
  -webkit-transform: scale(2) rotate(0.1deg);
  -moz-transform: scale(2) rotate(0.1deg);
}
&lt;/style&gt;

<h3>Example</h3>
<p>If you're using Firefox, here's an example of the jittery effect that is produced by standard CSS transition code:</p>

<div class="kenburns-old"><img></div>

<p>Click inside the picture to start the effect. Click again to reverse. It has a very basic setup using CSS3 transitions to scale the image to 200% when clicked:</p>
<pre>
.kenburns img {
    transform-origin: 20% 80%;
    transition: transform 30s linear;
}
.kenburns img.zoom {
    transform: scale(2);
}
</pre>

<p>If you're using Firefox, the effect is currently unpleasantly jittery. I tried lot's of things to fix that, even going to standard JavaScript based animation but I couldn't get rid of the feeling there's probably a very simple fix.</p>

<h3>The fix</h3>

<p>There is a fix! After some experimentation I figured out that <strong>if I added a slight rotation to the effect, it became smooth as butter</strong>. Even if the angle is so small you can't even see the rotation it still has a remarkable effect.</p>

<div class="kenburns-new"><img></div>

<p>Much better, and all I had to do was this:</p>
<pre>
.kenburns img.zoom {
    transform: scale(2) <strong>rotate(0.1deg)</strong>;
}
</pre>			]]></content>
		</entry>
			<entry>
			<title>Article on CSS-tricks.com</title>
			<link rel="alternate" type="text/html" href="http://www.mennovanslooten.nl/blog/post/77" />
			<id>tag:mennovanslooten.nl,2012-01-11:/blog/post/77</id>

			<published>2012-01-11T00:14:57+01:00</published>
			<updated>2012-01-11T00:14:57+01:00</updated>
			<author>
				<name>Menno van Slooten</name>
				<!-- email></email -->
				<uri>http://www.mennovanslooten.nl</uri>
			</author>

			<content type="html"><![CDATA[
				<p>Almost two years ago, through a series of happy accidents and sheer luck, I ended up in Mountain View, CA to <a href="/blog/post/75">present</a> at the Bay Area jQuery conference. I remember being in the conference center with the other speakers that morning, before registration opened. I'm not sure if he could tell I was feeling a little nervous and intimidated, but  it was at that moment that <a href="http://chriscoyier.net/">Chris Coyier</a> introduced himself to me.</p>

<p><a href="http://www.flickr.com/photos/dougneiner/4555181685/in/photostream/"><img src="/static/gfx/chris_doug_me.jpg" alt="" title="A picture of Chris Coyier, Doug Neiner and myself. Photo by Doug Neiner: http://dougneiner.com"/></a> Chris is the man behind <a href="http://css-tricks.com/">CSS-Tricks</a>, a very popular website for web developers. At the time I was reluctant to admit to Chris that I had never heard of it but since then I've visited it countless times. A month or so ago, I had an idea for an article about CSS and I asked Chris if he accepts contributions. As it  turned out he does.</p>

<p><strong><a href="http://css-tricks.com/better-tabs-with-round-out-borders/">You can find the article here.</a></strong></p>

<p>It's about using <code>:before</code> and <code>:after</code> to create the "rounded out" borders at the bottom of a tab control. The technique is a result of some experiments that I did at my new job at <a href="http://www.aanzee.nl">Aan Zee</a>. Since they really encourage their employees to share knowledge and expertise I will publish a Dutch translation of the article on their blog as well.</p>

<p>Anyway, I want to thank Chris for making me feel at ease at that conference two years ago as well as for publishing my article. He's an awesome and friendly guy and I really hope I will have the chance to meet him at some future conference.</p>			]]></content>
		</entry>
			<entry>
			<title>So you want to speak at a jQuery conference?</title>
			<link rel="alternate" type="text/html" href="http://www.mennovanslooten.nl/blog/post/76" />
			<id>tag:mennovanslooten.nl,2010-10-19:/blog/post/76</id>

			<published>2010-10-19T23:45:11+02:00</published>
			<updated>2010-10-19T23:45:11+02:00</updated>
			<author>
				<name>Menno van Slooten</name>
				<!-- email></email -->
				<uri>http://www.mennovanslooten.nl</uri>
			</author>

			<content type="html"><![CDATA[
				    <p>As I write this, I'm sitting in a <a href="http://www.aristocafeboston.com/">Boston coffee shop</a> recovering from the fantastic jQuery conference that was held there last weekend. Like at this year's event in San Francisco, I was a speaker and based on a couple of discussions I had with various members of the jQuery community, I decided to write about the process of becoming a speaker at one of their events which is an experience I highly recommend.</p>

    <p>When you look at this year's speaker lists in <a href="http://events.jquery.org/2010/boston/speakers/">Boston</a> and <a href="http://events.jquery.org/2010/sf-bay-area/speakers/">San Francisco</a> you might think that unless you are a jQuery team member or an influential JavaScript developer it's very difficult to become a speaker at these events. As someone who used to think the same I can't blame you and as someone who is an obvious exception to this "rule" I thought it would be a good idea to set the record straight. I'd like to tell you about becoming a speaker, how the process works and what you can expect if you are chosen as a speaker at one of these events.</p>
    <h2>Becoming a speaker</h2>
    <p>After talking with a number of visitors of last weekend's event it became clear that even if they had <em>wanted</em> to speak, they had no idea about when and where to apply and when they were explained how the process works the general response was "yeah, but the odds of actually being selected must be very small". As I will explain later, chances are better than you think. First, however, I'll explain the process.</p>
    <p>As soon as a jQuery event is announced, via <a href="http://twitter.com/#!/jquery/status/22107712898">Twitter</a> or the <a href="http://blog.jquery.com/2010/07/20/jquery-conferences-2010-call-for-speakers/">jQuery</a> blog, a <a href="http://bit.ly/a3vcCS">call for speakers form</a> is opened. Through this form, you can enter your contact details, the title and a 150 word abstract of your presentation. If you're wondering what such an abstract should look like, the talk abstracts on past event websites are a pretty good indication. You can submit as many proposals as you like.</p>
    <p>After the deadline passes, a selection process is started during which all proposals are considered. Contrary to what you might think, the jQuery team members go through the exact same process. From what I've heard of John Resig and the other team members the most important aspect they're looking for is diversity. They want unique angles and ideas so they can create an event with plenty of variation. A direct link to jQuery is definitely nice but by no means required. When the selection process is completed, all submitters receive an email about whether or not they have been selected.</p>
    <p>Did I say the chances of being selected are not as small as you'd might think? You'd probably be as surprised as I was to hear that for the Boston event a little less than half of all submissions were accepted.</p>
    <h2>Being a speaker</h2>
    <p>The following will be my personal reflection on what it's like to be a speaker but many other speakers have expressed to me feeling exactly the same. For me, receiving the <em>congratulations, you've been accepted</em> email released feelings of tremendous excitement combined with a general sense of <em>OMGWTF</em> because I realized I would have to go through with it now. I was expected to go up on a stage and talk for 45 minutes to a room full of people I never met so I better make sure I have something to say and I know what I'm talking about. It is now time for some serious preparation.</p>
    <h3>Preparation</h3>
    <p>If there's anything I want to share with you about this phase it is that preparing for a presentation <em>sucks</em>. Really, it is no fun at all. Depending on what you might be presenting about, there's a presentation document to prepare, there's demos to write and plenty of rehearsing to do. For pretty much every speaker I've encountered this continues until right before the actual presentation and the closer it gets the worse it feels. You will be nervous and it will feel horrible. Take comfort in this, however: as soon as you get up on the stage, the crowd becomes quiet and you begin speaking the nervousness will almost completely disappear.</p>
    <h3>Being selected</h3>
    <p>If you're selected you are expected to make your travel arrangements. The hotel and most meals are taken care of by the jQuery organisation. Speakers don't get paid but do get travel costs reimbursed up to about $400. You'll be added to a mailing list for speakers where you can ask any question you have. For the San Francisco conference I used this mailing list to bum a ride from the airport to the hotel from <a href="http://richardwaldron.com/">Rick Waldron</a>.</p>
    <p>During the event you'll realize how nice the jQuery team is. The people involved are very approachable and do their best to really make you feel a part of it all. You'll have a chance to interact with some of the most influential people in JavaScript development so make the most of it. Being a speaker at these events may involve a lot of effort and stress, but the reward is substantial. This year's events were easily the two highlights of 2010 for me and I cannot recommend trying it once highly enough. If you are interested feel free to <a href="/blog/contact/">drop me a line</a>.</p>
    <p>Coincidentally, Garann Means, a fellow speaker in Boston decided to <a href="http://www.garann.com/dev/2010/templates-slides-presenting-for-the-first-time-and-omg-massive-freakout/">write about her experiences</a> in being a first-time speaker.</p>
			]]></content>
		</entry>
			<entry>
			<title>jQuery Bay Area Conference 2010</title>
			<link rel="alternate" type="text/html" href="http://www.mennovanslooten.nl/blog/post/75" />
			<id>tag:mennovanslooten.nl,2010-04-27:/blog/post/75</id>

			<published>2010-04-27T08:29:36+02:00</published>
			<updated>2010-04-27T08:29:36+02:00</updated>
			<author>
				<name>Menno van Slooten</name>
				<!-- email></email -->
				<uri>http://www.mennovanslooten.nl</uri>
			</author>

			<content type="html"><![CDATA[
				<p><a href="http://www.flickr.com/photos/dougneiner/4555793190/"><img src="http://farm5.static.flickr.com/4026/4555793190_9c486500a8_m.jpg" alt="" title="A picture taken of my presentation by Doug Neiner"/></a> This weekend I was in Mountain View to speak at the <a href="http://events.jquery.org/2010/sf-bay-area/">jQuery Bay Area Conference 2010</a> which was incredible. It was really amazing to meet so many passionate JavaScript developers and an honor to be part of that group for 2 days. <a href="http://speakerrate.com/talks/2976-automated-ui-testing-with-jquery">My presentation</a> was about automated UI testing and focused on a framework I have developed at <a href="http://www.ebuddy.com">eBuddy</a> to do UI testing on <a href="http://web.ebuddy.com">our new web messenger</a>.</p>

<p>Although the presentation was a bit messy (the room's technician hijacked my laptop for a couple of minutes to fix an issue with one of the screens), the framework seemed to struck a chord with many developers. Afterwards it was made very clear by some of them that I should get it out in the open as soon as possible. I specifically asked them "how?" and it was unanimously decided <a href="http://github.com/mennovanslooten/UITest">it should definitely be on GitHub</a>. So there you go.</p>

<p>Unfortunately, from the San Francisco hotel I'm currently staying in, I can't seem to get a good enough connection to this site's FTP server or otherwise I would have put up a demo and made my slides available. That will have to wait until I get back to The Netherlands. I will try to start adding some useful documentation as well.</p>

<p>I really hope some people in the jQuery community will pick up this ball and start running with it. Several people at the conference said it could be a useful tool including some jQuery and jQuery UI team members. If you like it, please send some love in eBuddy's direction since they were the ones who allowed me to develop <em>and</em> release it in the first place.</p>

<p>I would like to thank the jQuery team and all the other speakers having me there and making this weekend an unforgettable experience. Hopefully, I can meet you all at another conference in the near future. Perhaps <em>jQuery Amsterdam 2010</em>?</p>

<p><strong>P.S.</strong> Ralph Whitbeck and Rey Bango of the official jQuery podcast interviewed me right after the presentation and <a href="http://blip.tv/file/3579912">put up the video as well</a> and I <a href="http://www.slideshare.net/mennovanslooten/jquery-bay-area-conference-2010">put up the slides as well</a>.</p>
			]]></content>
		</entry>
			<entry>
			<title>New eBuddy Web Messenger</title>
			<link rel="alternate" type="text/html" href="http://www.mennovanslooten.nl/blog/post/73" />
			<id>tag:mennovanslooten.nl,2010-02-12:/blog/post/73</id>

			<published>2010-02-12T11:56:59+01:00</published>
			<updated>2010-02-12T11:56:59+01:00</updated>
			<author>
				<name>Menno van Slooten</name>
				<!-- email></email -->
				<uri>http://www.mennovanslooten.nl</uri>
			</author>

			<content type="html"><![CDATA[
				<p><img src="/static/gfx/aurora2.png" alt=""/> It's been awfully quiet out here but now I have some actual news to share with you. At <a href="http://www.ebuddy.com">eBuddy</a> headquarters in Amsterdam, I've been working with my team on creating a new web messenger.</p>

<p>Even though eBuddy's current web messenger is an awesome product and – with over 2,5 million users daily – the most popular multi-network IM client on the web, it definitely has its shortcomings, both for users as well as for the developers working on it. The new messenger has been designed from the ground up to overcome these shortcomings, creating a product that is both easier to work with as well as to work on.</p>

<p>In the future, I'd like to tell you about some of the technical improvements we've made, such as the publish/subscribe based architecture and the custom made automated GUI testsuite. For now, I'll just point you straight towards <a href="http://web.ebuddy.com">web.ebuddy.com</a> and hope you'll have a great chat experience. If you have any remarks, don't hesitate to contact me via the link below or click the "Feedback" button at the top of the messenger.</p>			]]></content>
		</entry>
			<entry>
			<title>Plasma effects</title>
			<link rel="alternate" type="text/html" href="http://www.mennovanslooten.nl/blog/post/72" />
			<id>tag:mennovanslooten.nl,2009-02-02:/blog/post/72</id>

			<published>2009-02-02T09:27:37+01:00</published>
			<updated>2009-02-02T09:27:37+01:00</updated>
			<author>
				<name>Menno van Slooten</name>
				<!-- email></email -->
				<uri>http://www.mennovanslooten.nl</uri>
			</author>

			<content type="html"><![CDATA[
				<p>I recently tried to recreate the famous <em>plasma effect</em> that was often used in the demo scene. Since I didn't know a lot about it and how to achieve it I had to do some research first. I thought I'd write a little bit about what the effect is and how I ended up implementing it.</p>
&lt;style type="text/css"&gt;
    #target {
        margin:1.5em 0 0 1.5em;
        width:256px;
        height:256px;
        float:right;
        position:relative;
        xleft:16px;
        xtop:16px;
        background:#E7E7CC url(/static/gfx/plasma_0.gif) no-repeat;
    }
    
    #target div {
        position:absolute;
    }
&lt;/style&gt;

<div id="target"></div>
[removed][removed]

<p>Click inside the square on the right to see the plasma effect in action. Click again to stop the animation.</p>

<p>First a little disclaimer: usually, these effects are coded by very smart, very math-savvy programmers that know their target system inside and out. None of these attributes apply to me so I just brute-forced my way through the implementation making convenient choices whereever possible:</p>

<ol>
    <li>The canvas is 32 units wide and 32 units high.</li>
    <li>One such unit is an 8 by 8 pixed <code>div</code> element, making the total width and height 256 pixels.</li>
    <li>The color pallette will consist of 256 colors.</li>
</ol>

<p>After some research I found that the principle behind the effect is really simple. The base is any function <em>f</em>(x, y, t) = n where x and y are the coordinates in the canvas, t is the time and n is an integer between 0-256, representing a color in the palette. When we have such a function we initiate by drawing the canvas for t=0 after which we redraw the canvas periodically for new values of t, which generates the 'flowing' colors. The next step was to find such a function.</p>

<h3>The first function</h3>

<img src="/static/gfx/plasma_1.gif" style="float:right; margin:1.5em 0 0 1.5em;" width="128" height="128"/>
<p>Remember that the output of the function should stay in the 0-256 range. The easiest way to guarantee this is to base our functions on <em>sin</em> and <em>cos</em>, since their result is always between -1 and 1. For clarity I will not discuss the normalization from floats between -1 and 1 to integers between 0 and 256 here so we can suffice with <em>f</em> being in the -1 to 1 range.</p>

<p>A simple example of the type of function we're looking for is then: <em>f</em>(x) = sin(x / 40.74). The 40.74 is to make our <em>sin</em> have a period of about 256. If we then map the output to a greyscale palette where 0 is black and 255 is white we get something like the picture on the right.</p>

<h3>The second function</h3>

<img src="/static/gfx/plasma_2.gif" style="float:right; margin:1.5em 0 0 1.5em;" width="128" height="128"/>
<p>Looks nice, but it doesn't resemble a plasma effect, so let's investigate a little further for a nice function. Something that's used often in this effect is the sinus of a distance to a certain point in the canvas. Here's such a function: <em>f</em>(x, y) = sin(distance(x, y, 128, 256) / 40.74), where distance(x1, y1, x2, y2) is the distance between (x1, y1) and (x2, y2). In our case we're measuring the distance to the center of the bottom edge. Mapping this to our palette we'd get something like the picture on the right again.</p>

<h3>Combining two functions</h3>

<img src="/static/gfx/plasma_3.gif" style="float:right; margin:1.5em 0 0 1.5em;" width="128" height="128"/>
<p>The last picture already looked a bit more like a good base for a plasma effect. The interesting stuff happens if we combine the two functions and average their results. As you can see in the picture on the right, this is getting pretty close to the effect we're looking for: flowing, asymmetrical blobs of color. Two things remain: finding a nicer palette of colors to map and adding in some animation.</p>

<h3>Animation</h3>

<p>Adding animation is reasonably straightforward. We just introduce a variable <em>t</em> in a strategic place to our functions which we continuously increment. Usually for these effects t starts at 0 and is incremented by 1 each step. In my experience floating point arithmetic isn't particularly slower than integer arithmetic in JavaScript so I chose to increment by 0.1 because it was more convenient. Here's an example of the 2 previous functions with the added t variable:</p>
<ol>
    <li><strong>f(x, t) = sin(x / 40.74 + t)</strong> - which gives the effect of the first pattern moving to the left.</li>
    <li><strong>f(x, y, t) = sin(distance(x, y, (128 * sin(-t) + 128), (128 * cos(-t) + 128)) / 40.74)</strong> - which gives the effect of the second pattern rotating around the center of the canvas.</li>
</ol>

<h3>Colors</h3>

<p>Believe it or not, we're not completely done with sinus and cosinus yet. The nicest effects are achieved with palettes that smoothly 'wrap around'. These types of palettes are usually generated with mathematical functions. Here's a few examples where for each palette we iterate i from 0-256 and the red, green and blue values are normalized to 0-256 integers again:</p>

<p><img src="/static/gfx/plasma_palette_1.gif"/>
<em>red</em>(i) = sin(π * i / 32)<br/>
<em>green</em>(i) = sin(π * i / 64)<br/>
<em>blue</em>(i) = sin(π * i / 128)</p>

<p><img src="/static/gfx/plasma_palette_2.gif"/>
<em>red</em>(i) = 0<br/>
<em>green</em>(i) = cos(π * i / 128)<br/>
<em>blue</em>(i) = sin(π * i / 128)</p>

<p><img src="/static/gfx/plasma_palette_3.gif"/>
<em>red</em>(i) = cos(π * i / 128)<br/>
<em>green</em>(i) = sin(π * i / 128)<br/>
<em>blue</em>(i) = 0</p>

<p>Combining all this: the functions, the animation, the palette I ended up with the plasma effect shown above. It should be clear right now that there is an endless range of possibilities for variations on this theme. Like so many things I write about this started of as a little 'how does that work?'-experiment. This is how I think it works but if you're reading this and have a better idea, don't hesitate and <a href="/blog/contact/">let me know</a>!</p>			]]></content>
		</entry>
			<entry>
			<title>Flexible panel layouts revisited</title>
			<link rel="alternate" type="text/html" href="http://www.mennovanslooten.nl/blog/post/71" />
			<id>tag:mennovanslooten.nl,2009-01-28:/blog/post/71</id>

			<published>2009-01-28T10:33:18+01:00</published>
			<updated>2009-01-28T10:33:18+01:00</updated>
			<author>
				<name>Menno van Slooten</name>
				<!-- email></email -->
				<uri>http://www.mennovanslooten.nl</uri>
			</author>

			<content type="html"><![CDATA[
				<p>A couple of years ago I wrote a small post about what I call "panel layouts" and how to create them with CSS. I've used the method succesfully for a number of projects since then but there was always something that bothered me: to make it work, browsers had to be forced to render in the <em>content box model</em> using a forced <em>quirks mode</em>. Recently I started using another way, that eliminated this problem.</p>

<h3>Flexible panels</h3>
<p><img src="/static/gfx/outlook_layout.gif" alt=""/> <strong>The ideal I'm trying to achieve is to have a <strong>viewport-filling layout</strong> with flexible and fixed panels combined.</strong> A common example is what I usually refer to as the "Outlook layout". Here's <a href="http://experiments.mennovanslooten.nl/2008/panels/panels.html">a more complex example</a>.</p>
<p>The hard part here is to have flexible panels that fill whatever space isn't taken up by other (fixed) panels. Ideally you'd be able to write something like this:</p>
<pre>
.contentPanel {
    width: calc(100% - 200px);
    height: calc(100% - 400px);
}
</pre>
<p>...which in CSS3, <a href="http://www.w3.org/TR/css3-values/#calc">you will be able to</a>.  However, we're not going to wait for that, so we're going to use an often-ignored feature of CSS: <strong>if you have an absolutely positioned element and you specify <code>left</code> and <code>right</code> but not <code>width</code>, the width becomes flexible</strong>: the edges stick to their coordinates. The same goes for <code>height</code> if you spefify <code>top</code> and <code>bottom</code>. Using this technique, we can get what we want:</p>
<pre>
.contentPanel {
    position: absolute;
    left: 200px;
    right: 0;
    top: 400px;
    bottom:0;
}
</pre>
<p>But the story doesn't end here. Although this technique runs fine in (standards mode) IE7, IE6 does not support it. For this browser, we will use an even rarer technique: <code>[removed])</code>.</p>
<p><code>[removed])</code> is an IE-only CSS statement that works a lot like <code>calc()</code> mentioned above. With it, you can assign the result of a JScript expression to a CSS property. In our case:</p>
<pre>
.contentPanel {
    width: [removed]this[removed].clientWidth - 200 + 'px');
    height: [removed]this[removed].clientHeight - 400 + 'px');
}
</pre>
<h3>An example</h3>
<p>Let's create an example to illustrate the two techniques and how to combine them. Here's a set of three panels, the top one fixed height, the left one fixed width, the remaining one flexible:</p>

<div id="panels">
    <div id="panelTop"><code>#panelTop</code></div>
    <div id="panelLeft"><code>#panelLeft</code></div>
    <div id="panelRight"><code>#panelRight</code>
    [removed]
    function setPanelWidth(w) {
        document.getElementById('panels').style.width = w + '%';
    }
    [removed]
    <p>Click the buttons to set the total width.</p>
    <button>50%</button>
    <button>75%</button>
    <button>100%</button>
    </div>
</div>

&lt;style type="text/css"&gt;
#panels {
    width:100%;
    height:10em;
    position:relative;
}

#panelTop, #panelLeft, #panelRight {
    position:absolute;
    left:0;
    top:0;
    overflow:auto;
}

#panelTop {
    width:100%;
    height:20px;
    background:#F7F7CC;
}

#panelLeft {
    top:20px;
    width:100px;
    bottom:0;
    height:[removed]this[removed].clientHeight - 20 + 'px');
    background:#CCF7F7;
}

#panelRight {
    top:20px;
    left:100px;
    right:0;
    bottom:0;
    width:[removed]this[removed].clientWidth - 100 + 'px');
    height:[removed]this[removed].clientHeight - 20 + 'px');
    background:#F7CCF7;
}
&lt;/style&gt;

<p>As you can see, <code>#panelRight</code> fills up whatever space remains. Its CSS is very simple:</p>
<pre>
#panelRight {
    top:20px;
    left:100px;
    right:0;
    bottom:0;
    width:[removed]this[removed].clientWidth - 100 + 'px');
    height:[removed]this[removed].clientHeight - 20 + 'px');
    background:#F7CCF7;
}
</pre>

<h3>Issues</h3>
<p><code>expression</code> Is of course a non-standard CSS property that will invalidate your CSS file. Browsers that don't support it will gracefully ignore it (as they should) but the W3C CSS validator will not. There are several ways to hide the code from validators (i.e. conditional comments) so if you care about validating your CSS you should take some extra steps there.</p> 
<p>Another issue is that I haven't found a way yet to combine multiple flexible  panels horizontally or vertically. The method works beautifully, however, in my experience and makes it really easy to define flexible page layouts with just a few lines of CSS and the most basic HTML.</p>			]]></content>
		</entry>
			<entry>
			<title>More JavaScript combinatorics</title>
			<link rel="alternate" type="text/html" href="http://www.mennovanslooten.nl/blog/post/70" />
			<id>tag:mennovanslooten.nl,2009-01-27:/blog/post/70</id>

			<published>2009-01-27T08:18:22+01:00</published>
			<updated>2009-01-27T08:18:22+01:00</updated>
			<author>
				<name>Menno van Slooten</name>
				<!-- email></email -->
				<uri>http://www.mennovanslooten.nl</uri>
			</author>

			<content type="html"><![CDATA[
				<p>An email sent by a reader of <a href="http://www.mennovanslooten.nl/blog/post/51">my previous post about combinatorics</a> renewed my interest in the subject. As I wrote in that particular post I didn't really understand why the code did what it did. It was actually the result of an almost evolutionary process of trial and error until I was confident it did what it should do.</p>

<h3>Another method</h3>
<p>A reader called Fabrice pointed out another way to get the same results using bitmasks. For example, when you want to get <em>all</em> the combinations of items from <code>[0,1,2]</code> you create a list binary representations of the numbers 1 to (2<sup>3</sup>-1):</p>
<ol>
<li><code>001</code></li>
<li><code>010</code></li>
<li><code>011</code></li>
<li><code>100</code></li>
<li><code>101</code></li>
<li><code>110</code></li>
<li><code>111</code></li>
</ol>
<p>Applying each of these numbers as a mask to the original array gives us all the combinations:</p>
<ol>
<li><code>001 × [0,1,2] = [2]</code></li>
<li><code>010 × [0,1,2] = [1]</code></li>
<li><code>011 × [0,1,2] = [1,2]</code></li>
<li><code>100 × [0,1,2] = [0]</code></li>
<li><code>101 × [0,1,2] = [0,2]</code></li>
<li><code>110 × [0,1,2] = [0,1]</code></li>
<li><code>111 × [0,1,2] = [0,1,2]</code></li>
</ol>

<p>It's a very simple algorithm to understand and to implement. Since this returns all possible combinations the only thing left is filtering for results of a certain length. Here's an implementation in JavaScript as an extension on the array prototype:</p>

<pre class="JavaScript" name="code">
Array.prototype.combinate2 = function( length ) {
    var result = [];
    // iterate from 1 to 2<sup>n</sup>
    for (var i = 1; i &lt; Math.pow(2, this.length) - 1; i++) {
         var combination = [];
         // For each value of i, check the individual 'bits' (powers of 2
         // components). If 2<sup>m</sup> is a component of i then this[m] is a
         // part of this combination
         for (var j = 0; j &lt; i; j++) {
             var mask = Math.pow(2,j);
             if (i &amp; mask) {
                 combination.push(this[j]);
             }
         }
         if (combination.length === length) {
             result.push(combination);
         }
    }
    
    return result;
}
</pre>

<h3>Performance problems</h3>
<p>Unfortunately, the simplicity of the algorithm comes with a price: the time it takes to execute increases much more quickly with the length of the array than the other one. If I knew something about big O-notation I could probably write something profound about why this is the case. It's a shame I don't because I feel it would really help understanding stuff like this. On the other hand, after having taken another look at the code from the original post I now fully understand what it does. Perhaps I will dedicate another post to that subject.</p>			]]></content>
		</entry>
			<entry>
			<title>Kings of Code 2008</title>
			<link rel="alternate" type="text/html" href="http://www.mennovanslooten.nl/blog/post/67" />
			<id>tag:mennovanslooten.nl,2008-05-28:/blog/post/67</id>

			<published>2008-05-28T22:13:19+02:00</published>
			<updated>2008-05-28T22:13:19+02:00</updated>
			<author>
				<name>Menno van Slooten</name>
				<!-- email></email -->
				<uri>http://www.mennovanslooten.nl</uri>
			</author>

			<content type="html"><![CDATA[
				<p>
<img src="/static/gfx/logo-kingsofcode.png"/>
Yesterday I attended the Kings of Code event for web developers where I had the opportunity to present on a topic very close to my heart: the development of front-end development. Of course I also saw most of the other speakers. Here's a little review of the day.</p>

<h3>Peter Paul Koch (<a href="http://www.quirksmode.org/">Quirksmode</a>)</h3>
<p>First up, at 9:30 AM, was PPK with a <a href="http://www.quirksmode.org/blog/archives/2008/05/kings_of_code_s.html">presentation on cross-browser JavaScript event handling</a>. Most people were in on time, for a change and there were an amazingly little amount of laptops being opened by attendees. (something that usually annoys me alot) PPK, obviously no stranger to presenting delivered a flawless and technically very deep presentation about the differences between the W3C's events spec and the real world as implemented by Safari, IE, Opera and Firefox. Quote of the day: "I think I'll start looking into this Firebug thing, I hear it's pretty good."</p>

<h3>Folke Lemaitre (<a href="http://netlog.com/">Netlog</a>)</h3>
<p>Next up, was Folke who presented on the scaling of Netlog's back-end architecture. As a front-end developer, most of that stuff was somewhat over my head but interesting nonetheless. I know my eBuddy colleagues who deal with the scaling of our own platform were listening attentively :)</p>

<h3>Mark Birbeck (<a href="http://www.w3.org/">W3C</a>)</h3>
<p>After the morning break, Mark Birbeck took the stage with a presentation about markup languages that I'm sure was not to everybody's tastes. I found it to be the most interesting talk of the day because he concluded that markup languages like XForms and SMIL are an excellent way to abstract the complexity of JavaScript away. That's something that I've been preaching since the early days of <a href="http://www.backbase.com">Backbase</a> (and by the way, my subject of the <a href="http://www.mennovanslooten.nl/blog/post/43">presentation I gave at XTech</a> 2006). Later on, I realized why Mark's name was so familiar. He was once responsible for building a plugin for IE that added XForms support.</p>

<h3>Nate Abele (<a href="http://cakephp.org/">CakePHP</a>)</h3>
<p>Lots of controversy ensued when the first Nate took the mic. After a brief introduction about what frameworks are and why and when you should use one, he proceeded to rip apart some well-known competitors of his CakePHP framework: <a href="http://framework.zend.com/">Zend</a>, <a href="http://codeigniter.com/">CodeIgniter</a> (on which this blog is built) and <a href="http://rubyonrails.org/">Rails</a>. It was quite funny actually and I found him to be refreshingly honest. A welcome change from the let's-pet-each-other-on-the-back- syndrome.</p>

<h3>Nate Koechley (<a href="http://yahoo.com/">Yahoo!</a>)</h3>
<p>Unfortunately I had to miss this one, as I had to be someplace else. I heard it was really good though; a very comprehensive presentation about startup performance, even though a lot of the material was well-known to the crowd.</p>

<h3>Open Source Pitches</h3>
<p>As I still had to prepare some slides for my presentation I decided to miss out on these. I heard there was a lot of disappointment that the 5-minute Phusion Passenger pitch was spent on promoting Rails, in stead of Passenger.</p>

<h3>Menno van Slooten (<a href="http://ebuddy.com">eBuddy</a>)</h3>
<p>I didn't see this one, but I heard it was pretty good ;) In all seriousness, I was really bloody nervous but luckily it was a very friendly crowd with lots of my old friends and colleagues. The presentation itself went pretty smooth in my experience with only a few hickups. If there's a next time I'll cover a more technical subject since I feel more at ease with that than with yesterday's subject matter: a look into the future of front-end developers. Here's <a href="http://www.flickr.com/photos/25246539@N05/2528818496/">a picture of me</a> during the presentation.</p>

<h3>John Resig (<a href="http://jquery.com">jQuery</a>)</h3>
<p>John absolutely blazed through a presentation that was obviously normally delivered in a much bigger timeslot. He took the big 4 in the world of Open Source JavaScript frameworks: jQuery, <a href="http://developer.yahoo.com/yui/">YUI</a>, <a href="http://dojotoolkit.org/">Dojo</a> and <a href="http://www.prototypejs.org/">Prototype</a> and compared them on various levels, from unit test coverage to CSS selector speed. It was very, very interesting, but I think the crowd would have appreciated a more spicy presentation (for instance about processing.js) a bit more. At the end of his presentation he mentioned he was working on a new DOM CSS selector module (I believe he called it Sizzle) and showed a table with some query benchmarks that looked very impressive. I hope to see more of that soon.</p>

<h3>Drinks at 11</h3>
<p>Luckily my bosses were willing to be the main sponsor for the drinks afterwards in the <a href="http://www.worldsbestbars.com/public/venue_listing.jsp?categoryId=1&currentVenueId=a68">excellent Club 11</a>. The atmosphere was good, with the DJ playing some nice Motown soul &amp; R&amp;B tracks. People were stopping me to tell me what they thought of my presentation and the worst criticism I received was "I liked your presentation but I don't agree with what you said." I can certainly live with that.</p>

<h3>Overall</h3>
<p>I have nothing but good words for the organisation and the visiting crowd. The whole event was flawlessly orchestrated and the atmosphere was extremely enjoyable. I heard the coffee wasn't that good, but that's about it. In the end, I only regret not taking more time to talk JavaScript with Resig, PPK and Koechley. So thanks to Sander and the rest of the crew and I hope I can be a part of future events as well.</p>
			]]></content>
		</entry>
			<entry>
			<title>Speaking at Kings of Code</title>
			<link rel="alternate" type="text/html" href="http://www.mennovanslooten.nl/blog/post/66" />
			<id>tag:mennovanslooten.nl,2008-05-23:/blog/post/66</id>

			<published>2008-05-23T09:26:17+02:00</published>
			<updated>2008-05-23T09:26:17+02:00</updated>
			<author>
				<name>Menno van Slooten</name>
				<!-- email></email -->
				<uri>http://www.mennovanslooten.nl</uri>
			</author>

			<content type="html"><![CDATA[
				<p>I am really, really pleased to write that I'll be speaking at the (Dutch) <a href="http://kingsofcode.nl/">Kings of Code</a> developers gathering next week, alongside such illustrious names as <a href="http://ejohn.org/">John Resig</a> and <a href="http://quirksmode.org/">Peter Paul Koch</a>. I was lucky enough to get into contact with the organisers through my employer, <a href="http://www.ebuddy.com">eBuddy</a> and thankfully they found some room in their busy schedule for me to deliver a presentation on the future of front-end development.</p>			]]></content>
		</entry>
	</feed>
