<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.seld.be/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
	<channel>
		<title>Jordi Boggiano</title>
		<link>http://seld.be/</link>
		<description>Notes on random stuff, thoughts, tutorials, code, ideas, anything that can be put down to letters.</description>
		<pubDate>Thu, 09 Sep 2010 12:48:15 +0200</pubDate>
		<generator>PHP RSSGen 1.0.0 - Seld.be</generator>
		<docs>http://www.rssboard.org/rss-2-0-10</docs>
		<ttl>60</ttl>
		<language>en</language>
		<lastBuildDate>Thu, 03 Jun 2010 17:54:34 +0200</lastBuildDate>
		<category>News</category>
		<category>ActionScript</category>
		<category>PHP</category>
		<category>Web</category>
		<category>JavaScript</category>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.seld.be/blog-seld" /><feedburner:info uri="blog-seld" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license><image><link>http://creativecommons.org/licenses/by-nc-sa/3.0/</link><url>http://creativecommons.org/images/public/somerights20.gif</url><title>Some Rights Reserved</title></image><item>
			<title>Introducing Slippy - HTML Presentations</title>
			<description>&lt;p&gt;Slippy is a HTML Presentation library written with jQuery, it takes a html file in and plays it in any browser.&lt;/p&gt;

&lt;p&gt;It is optimal for programming-related talks since it includes a syntax highlighter and is very easy to use since it's just standard html markup with a few classes to enable specific functions.&lt;/p&gt;

&lt;p&gt;If you are making a talk about Javascript, it can even execute your code samples live and displays alert() boxes nicely instead of using the ugly browser dialog, which -I tried it today- works quite well to prove your point interactively.&lt;/p&gt;

&lt;p&gt;You can find the sources on &lt;a href="http://github.com/Seldaek/slippy"&gt;github&lt;/a&gt;, view the &lt;a href="http://slides.seld.be/?file=2010-05-30+Example.html"&gt;example slide deck&lt;/a&gt; which includes some documentation or view the slides for the small talk I gave today about Javascript Events on my Slippy &lt;a href="http://slides.seld.be/"&gt;slide repository&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Obviously feedback is very much welcome and even though it's not perfect yet, I hope it'll be useful to others. More docs and styling fixes (the dark grey background wasn't too visible on a projector, my bad) should come soon as I have more talks planned, and the slide repository page will receive some love as well when I have time.&lt;/p&gt; &lt;a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fseld.be%2Fnotes%2Fintroducing-slippy-html-presentations&amp;service=bit.ly"&gt;Retweet&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/blog-seld/~4/Qd4OgS2Rg6U" height="1" width="1"/&gt;</description>
			<link>http://feeds.seld.be/~r/blog-seld/~3/Qd4OgS2Rg6U/introducing-slippy-html-presentations</link>
			<pubDate>Thu, 03 Jun 2010 17:54:34 +0200</pubDate>
			<guid isPermaLink="false">http://seld.be/notes/introducing-slippy-html-presentations</guid>
			<category>News</category>
			<category>PHP</category>
			<category>JavaScript</category>
		<feedburner:origLink>http://seld.be/notes/introducing-slippy-html-presentations</feedburner:origLink></item>
		<item>
			<title>HTML5 my ads</title>
			<description>&lt;p&gt;First came Flash. Then came advertisers that thought it'd be great to abuse it. Then came Flashblocktm and friends. The geeks don't like Flash, it's evil.&lt;/p&gt;

&lt;p&gt;Now the iPhone &amp; iPad don't have Flash, but they're the shit. Advertisers want a part of the shit of course, and they can put shiny ads in native apps, but not in the open apps that are websites. Thank god there is HTML5, geeks love it, it's all great. So you've got solutions like &lt;a href="http://smokescreen.us/"&gt;SmokeScreen&lt;/a&gt; developing. It's Flash without Flash, everyone should be happy right?&lt;/p&gt;

&lt;p&gt;Have you looked at their demos? Ads. Yes. I'm not saying they won't do more one day, but for now the target market seems to be advertisers, so that they can put out Flash-like ads in HTML5, reach the iDevices and to kill two birds with one stone, they'll reach the geeks that run Flashblock. And all that while interpreting Flash content so it'll most likely be more of a resource hog than Flash is.&lt;/p&gt;

&lt;p&gt;What's the solution? CanvasBlock? Noscript? In the end people will find ways to abuse anything.&lt;/p&gt;

&lt;p&gt;Of course Apple could come back to the table and implement Flash in the next iPhone OS, instead of having us suck up some half-working slow Flash ersatz on top of completely broken sites.&lt;/p&gt; &lt;a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fseld.be%2Fnotes%2Fhtml5-my-ads&amp;service=bit.ly"&gt;Retweet&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/blog-seld/~4/_L_gcLigL9Y" height="1" width="1"/&gt;</description>
			<link>http://feeds.seld.be/~r/blog-seld/~3/_L_gcLigL9Y/html5-my-ads</link>
			<pubDate>Wed, 02 Jun 2010 13:30:11 +0200</pubDate>
			<guid isPermaLink="false">http://seld.be/notes/html5-my-ads</guid>
			<category>Web</category>
			<category>JavaScript</category>
		<feedburner:origLink>http://seld.be/notes/html5-my-ads</feedburner:origLink></item>
		<item>
			<title>Unpredictable hashes for humans</title>
			<description>&lt;p&gt;It is not uncommon for web developers to have to generate random ids or hashes, for instance large scale project or frameworks may want to implement their own PHP session handlers either completely abstracted in their API, or overloading PHP's internal API using &lt;a href="http://php.net/session_set_save_handler"&gt;session_set_save_handler()&lt;/a&gt;. If you do so, unless you want to entrust PHP's core to do it, one thing you will have to take care of is generating unique session ids to send as a cookie to your users, allowing the session to persist. Other common use cases for such unique hashes is to generate CSRF tokens to insert in forms or URLs, and finally authentication tokens for email validation or such.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://seld.be/notes/unpredictable-hashes-for-humans"&gt;Proceed to the article&lt;/a&gt; to learn more about it in a -hopefully- easy to grasp way, this wasn't written for security experts but rather any PHP coder out there that is remotely interested in security, and you really should.&lt;/p&gt; &lt;a href="http://seld.be/notes/unpredictable-hashes-for-humans"&gt;Read more...&lt;/a&gt; &lt;a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fseld.be%2Fnotes%2Funpredictable-hashes-for-humans&amp;service=bit.ly"&gt;Retweet&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/blog-seld/~4/Zo6NR0A1j-w" height="1" width="1"/&gt;</description>
			<link>http://feeds.seld.be/~r/blog-seld/~3/Zo6NR0A1j-w/unpredictable-hashes-for-humans</link>
			<pubDate>Mon, 10 May 2010 08:24:32 +0200</pubDate>
			<guid isPermaLink="false">http://seld.be/notes/unpredictable-hashes-for-humans</guid>
			<category>PHP</category>
		<feedburner:origLink>http://seld.be/notes/unpredictable-hashes-for-humans</feedburner:origLink></item>
		<item>
			<title>Project management in PHP with Arbit</title>
			<description>&lt;p&gt;I would like to attract everyone's attention on the 0.3-alpha release of &lt;a href="http://arbitracker.org/"&gt;Arbit&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For those that do not know Arbit yet, it is a project management and issue tracker build in PHP. It uses CouchDB as a storage backend by default but work to support RDBMS via PDO is in progress.&lt;/p&gt;

&lt;p&gt;Interestingly, it also provides experimental support for continuous integration, also fully PHP-based, unlike other popular solutions. This is not enabled by default in this release since it isn't fully ready but feel free to stop by the irc channel (#arbit on freenode) to know more.&lt;/p&gt;

&lt;p&gt;The &lt;a href="http://arbitracker.org/news/0010_released_0_3-alpha.html"&gt;full announcement&lt;/a&gt; contains details about what we fixed and implemented in the 0.3.&lt;/p&gt;

Get involved!

&lt;p&gt;As all open source projects, Arbit needs your help, I joined the project early this year and we have had a few contributions from other people since then, but we can always use more help. Therefore if you are interested and wish to take part by developing new features, fixing bugs or at least &lt;a href="http://tracker.arbitracker.org/arbit"&gt;reporting them&lt;/a&gt;, please don't hesitate and get in touch! And as &lt;a href="http://naramore.net/blog/why-people-don-t-contribute-to-os-projects-and-what-we-can-do-about-it"&gt;Elizabeth Naramore&lt;/a&gt;'s article recently pointed out most people are afraid to contribute, I would like to say that no matter how skilled you are, contributions are welcomed. We will provide assistance if needed.&lt;/p&gt; &lt;a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fseld.be%2Fnotes%2Fproject-management-in-php-with-arbit&amp;service=bit.ly"&gt;Retweet&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/blog-seld/~4/BnTKeQk-mmE" height="1" width="1"/&gt;</description>
			<link>http://feeds.seld.be/~r/blog-seld/~3/BnTKeQk-mmE/project-management-in-php-with-arbit</link>
			<pubDate>Mon, 05 Apr 2010 13:21:03 +0200</pubDate>
			<guid isPermaLink="false">http://seld.be/notes/project-management-in-php-with-arbit</guid>
			<category>News</category>
			<category>PHP</category>
		<feedburner:origLink>http://seld.be/notes/project-management-in-php-with-arbit</feedburner:origLink></item>
		<item>
			<title>New design</title>
			<description>&lt;p&gt;In recent news, this site got a new design, I thought I could make the content more readable and accessible, so I killed my old templates and style sheets and started from scratch, without photoshop this time.&lt;/p&gt;

&lt;p&gt;There is also mobile browser (android/iphone) support which is by the way achieved with this very interesting CSS media instruction:&lt;/p&gt;

&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;/mobile.css&amp;quot; media=&amp;quot;only screen and (max-device-width: 800px)&amp;quot; /&amp;gt;

&lt;p&gt;This means any device with a monitor less than or exactly 800px wide will load the mobile.css file on top of the default one. Note that using media="handheld" is not working for recent smartphones that consider themselves greater than old school internet-enabled cellphones, so this is the only way to do it.&lt;/p&gt;

&lt;p&gt;Any feedback, especially bad, is appreciated.&lt;/p&gt; &lt;a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fseld.be%2Fnotes%2Fnew-design&amp;service=bit.ly"&gt;Retweet&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/blog-seld/~4/tIp9tSZ9Hmw" height="1" width="1"/&gt;</description>
			<link>http://feeds.seld.be/~r/blog-seld/~3/tIp9tSZ9Hmw/new-design</link>
			<pubDate>Sat, 03 Apr 2010 18:29:03 +0200</pubDate>
			<guid isPermaLink="false">http://seld.be/notes/new-design</guid>
			<category>News</category>
		<feedburner:origLink>http://seld.be/notes/new-design</feedburner:origLink></item>
		<item>
			<title>Including open source in the hiring process</title>
			<description>&lt;p&gt;We were discussing the difficulty of the hiring process from a company point of view last week at the &lt;a href="http://github.com/"&gt;github&lt;/a&gt; &lt;a href="http://www.symfony-live.com/github-meetup"&gt;meetup&lt;/a&gt; in Paris, and more specifically how hard it is to get quality people without relying on test assignments, which most agree are total bullshit, or on a couple of interviews, which can also be very misleading since it depends a lot on the person's social skills, or lack thereof.&lt;/p&gt;
&lt;p&gt;One big thing that is overlooked in my opinion is participation in open source projects, be it a single patch or long term commitment. As an employer you can see that the guy has enough interest in programming in general that he has taken the extra step to contribute something, and also that his work was accepted by a peer as valid. It is obviously not the full story and we all know some open source projects' code is utter crap (disclaimer, this also applies to closed source software, you just don't get to see it), but I still believe it gives you a better metric than just some code the guy did (or didn't) code and is presenting to you during an interview.&lt;/p&gt;
&lt;p&gt;You can use &lt;a href="http://www.ohloh.net/"&gt;ohloh&lt;/a&gt; to track your &lt;a href="http://www.ohloh.net/accounts/Seldaek"&gt;open-source-CV of sorts&lt;/a&gt;, and I would very much like it if more companies would push the open source involvement forward in their job ads, probably not as a requirement but at least as a big plus. It would benefit both companies that are trying to hire good people, and good people to be recognized. Of course it would also benefit the open source community at large if the work you do there gets you more recognition, pushing more people to take the leap to contribute. It is definitely helping already, if only for the contacts you get, which are always good when looking for a job, but increasing the perceived benefit of contributing to the open source world would be great, so I would very much like if all you HR people would give it a thought, and other readers please mention it to HR in your company, or your friends looking for work, your little brother starting to study, anyone can contribute.&lt;/p&gt;
&lt;p&gt;Any other ideas on how to find great developers? Is your company using open source as a criteria? Did it help?&lt;/p&gt; &lt;a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fseld.be%2Fnotes%2Fincluding-open-source-in-the-hiring-process&amp;service=bit.ly"&gt;Retweet&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/blog-seld/~4/fdDg5htdepU" height="1" width="1"/&gt;</description>
			<link>http://feeds.seld.be/~r/blog-seld/~3/fdDg5htdepU/including-open-source-in-the-hiring-process</link>
			<pubDate>Mon, 22 Feb 2010 20:21:24 +0100</pubDate>
			<guid isPermaLink="false">http://seld.be/notes/including-open-source-in-the-hiring-process</guid>
			<category>PHP</category>
		<feedburner:origLink>http://seld.be/notes/including-open-source-in-the-hiring-process</feedburner:origLink></item>
		<item>
			<title>Symfony Live 2010 - Symfony2, speaking and stuff</title>
			<description>&lt;p&gt;Overall the &lt;a href="http://www.symfony-live.com/"&gt;conference&lt;/a&gt; was pretty interesting since I don't have a lot of experience with &lt;a href="http://www.symfony-project.org/"&gt;symfony&lt;/a&gt; I learned quite a bunch of things about it's usage. I also met a lot of nice people, and ended the trip yesterday evening at the &lt;a href="http://github.com/"&gt;github&lt;/a&gt; &lt;a href="http://www.symfony-live.com/github-meetup"&gt;meetup&lt;/a&gt;, after going for food with a couple &lt;a href="http://phpbb.com"&gt;phpBB&lt;/a&gt; guys who are really much nicer than the forum software they stand for. They were also very open to us bashing phpBB and seem to be headed towards a &lt;a href="http://area51.phpbb.com/"&gt;brighter future&lt;/a&gt; for the next version, which I'm sure nobody will complain about.&lt;/p&gt;
&lt;p&gt;I also had my first session at a conference, accompanying &lt;a href="http://pooteeweet.org/"&gt;Lukas&lt;/a&gt; though so I wasn't really flying by myself yet but it was still a nice and interesting (and stressful) experience that I will try to renew. We didn't get all that much &lt;a href="http://joind.in/talk/view/1410/"&gt;feedback&lt;/a&gt; by the way so feel free to do so (also here if you are too lazy to register on joind.in), the organizers need it and obviously I wonder how the talk was received as well.&lt;/p&gt;
&lt;p&gt;As for &lt;a href="http://www.symfony-reloaded.org/"&gt;Symfony 2&lt;/a&gt; (which now comes with a capital S please), I kind of saw the flexibility coming since we already implemented the dependency injection container in our &lt;a href="http://okapi.liip.ch/"&gt;Okapi framework&lt;/a&gt; at &lt;a href="http://liip.ch/"&gt;Liip&lt;/a&gt;, but I was still impressed by the jump away from symfony (1) Fabien conceded, many people would have tried to keep more BC at the cost of going forward, and I'm really glad he didn't, I think it will pay in the long run. The new version of the framework will basically be able to be totally ripped apart to fit your needs better if you have high performance requirements, which was the major pain point of symfony 1 as far as I'm concerned, and one of our reasons to keep working on Okapi which is pretty much a baseline micro-framework you can build upon. We will have to see if adopting Symfony in its place will make sense, but it sounds promising and it would offload some maintenance away from us which is always good.&lt;/p&gt;
&lt;p&gt;Obviously Symfony 2 isn't going to be stable for a while, and there are some rough edges that still need to be discussed and improved, mostly in the way bundles are handled imo, but it looks very good already and I'll definitely give it a try asap. I would also encourage everyone to do so, especially framework developers, because the dependency injection is a pretty awesome thing to have, both for the testability of code and flexibility of the development process. Although if it's your only interest in it, checking out the Okapi 2 &lt;a href="http://svn.liip.ch/repos/public/okapi2"&gt;core&lt;/a&gt; (or the &lt;a href="http://liip.to"&gt;liip.to&lt;/a&gt; app &lt;a href="http://svn.liip.ch/repos/public/misc/liipto/branches/okapi2/"&gt;ported to use it&lt;/a&gt;) is probably easier as there is less code to read, and we didn't add any of the abstraction to the dependency injection layer that Symfony 2 has.&lt;/p&gt; &lt;a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fseld.be%2Fnotes%2Fsymfony-live-2010-symfony2-speaking-and-stuff&amp;service=bit.ly"&gt;Retweet&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/blog-seld/~4/mLNc01a02Qw" height="1" width="1"/&gt;</description>
			<link>http://feeds.seld.be/~r/blog-seld/~3/mLNc01a02Qw/symfony-live-2010-symfony2-speaking-and-stuff</link>
			<pubDate>Thu, 18 Feb 2010 19:48:42 +0100</pubDate>
			<guid isPermaLink="false">http://seld.be/notes/symfony-live-2010-symfony2-speaking-and-stuff</guid>
			<category>PHP</category>
		<feedburner:origLink>http://seld.be/notes/symfony-live-2010-symfony2-speaking-and-stuff</feedburner:origLink></item>
		<item>
			<title>Dwoo is better than Twig</title>
			<description>&lt;p&gt;It's lame catchy title day, a more appropriate one would be &amp;quot;Think for yourself&amp;quot;, but I want to get my point across.&lt;/p&gt;
&lt;p&gt;This is a general purpose idea of course, I don't think there is any case in your life where you shouldn't think for yourself, but this particular post is about programming.&lt;/p&gt;
&lt;p&gt;I just read someone (and I won't name names, it's not relevant) that was pondering using &lt;a href="http://dwoo.org"&gt;Dwoo&lt;/a&gt; or &lt;a href="http://www.twig-project.org"&gt;Twig&lt;/a&gt; in his CMS, who ended up picking Twig because, and I quote: &amp;quot;but twig says they're better than dwoo so ...&amp;quot;. Now I sincerely couldn't care less if someone decides to use something else over Dwoo - which I'm working on in case you wouldn't know. It's your own choice, and even I wouldn't say Dwoo is the best choice for every damned purpose out there.&lt;/p&gt;
&lt;p&gt;What bothers me though, is that obviously the guy read Fabien Potencier's article about php &lt;a href="http://fabien.potencier.org/article/34/templating-engines-in-php"&gt;template engines&lt;/a&gt;, which was obviously not so much of an objective post, but that has already been discussed so let's not go to deep into it. Anyway, the guy most likely read it, and all it says about Dwoo to dismiss it is &amp;quot;Unfortunately, Dwoo has no sandbox feature and its core is not flexible enough&amp;quot;. So.. out of this most enlightening comment, you decide to trust Fabien and just assume Twig is better? I just don't get it.&lt;/p&gt;
&lt;p&gt;So again, please, just think for yourself.&lt;/p&gt; &lt;a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fseld.be%2Fnotes%2Fdwoo-is-better-than-twig&amp;service=bit.ly"&gt;Retweet&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/blog-seld/~4/uJiQSIBWKSo" height="1" width="1"/&gt;</description>
			<link>http://feeds.seld.be/~r/blog-seld/~3/uJiQSIBWKSo/dwoo-is-better-than-twig</link>
			<pubDate>Tue, 08 Dec 2009 09:58:14 +0100</pubDate>
			<guid isPermaLink="false">http://seld.be/notes/dwoo-is-better-than-twig</guid>
			<category>PHP</category>
		<feedburner:origLink>http://seld.be/notes/dwoo-is-better-than-twig</feedburner:origLink></item>
		<item>
			<title>Major glob() fail</title>
			<description>&lt;p&gt;I just had the pleasure of discovering another of PHP's little quirks and since it's been almost a year since my last post, I thought it would be a good occasion.&lt;/p&gt;
&lt;p&gt;Working on some personal project that lists a bunch of stuff on my hard drive, I found out that directories that contain square brackets (those []) don't return any results for the simple reason that glob reads [stuff] as a character class, just like in regular expressions. When you know it it makes perfect sense, but when you don't, the &lt;a href="http://docs.php.net/manual/en/function.glob.php"&gt;documentation&lt;/a&gt; is really not so helpful. Of course it mentions libc's glob() and unix shells, but not everyone knows what that implies at first glance.&lt;/p&gt;
&lt;p&gt;My first reaction when I noticed that those directories were missing was to try and escape them with backslashes, which works on unix systems, but not on windows since the backslash is the directory separator. The cross platform solution is to enclose them in brackets (i.e. [[]), which effectively creates a character class with only the opening bracket in it, so it matches correctly.&lt;/p&gt;
&lt;p&gt;I then wrote this glob_quote function which, just like preg_quote, escapes the meta characters that glob uses.&lt;/p&gt;
function glob_quote($str) { 
    $from = array( '[', '*', '?'); 
    $to = array('[[]', '[*]', '[?]'); 
    return str_replace($from, $to, $str); 
}
&lt;p&gt;Another detail worth noting while I'm at it is that this problem also occurs when you do glob('*.txt') if your &lt;a href="http://docs.php.net/manual/en/function.getcwd.php"&gt;cwd&lt;/a&gt; contains brackets, since in this case the cwd is pre-pended to the pattern, the solution being to escape it as well as such:&lt;br /&gt;glob(glob_quote(getcwd()).DIRECTORY_SEPARATOR.'*.txt');&lt;/p&gt;
&lt;p&gt;That's it for today, so until next year..&lt;/p&gt; &lt;a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fseld.be%2Fnotes%2Fmajor-glob-fail&amp;service=bit.ly"&gt;Retweet&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/blog-seld/~4/wyS__yhVoqM" height="1" width="1"/&gt;</description>
			<link>http://feeds.seld.be/~r/blog-seld/~3/wyS__yhVoqM/major-glob-fail</link>
			<pubDate>Wed, 02 Dec 2009 20:15:40 +0100</pubDate>
			<guid isPermaLink="false">http://seld.be/notes/major-glob-fail</guid>
			<category>PHP</category>
		<feedburner:origLink>http://seld.be/notes/major-glob-fail</feedburner:origLink></item>
		<item>
			<title>Multiton base class</title>
			<description>&lt;p&gt;While I like the &lt;a href="http://en.wikipedia.org/wiki/Singleton_pattern"&gt;Singleton&lt;/a&gt; pattern every now and then, I prefer the flexibility that the &lt;a href="http://en.wikipedia.org/wiki/Multiton"&gt;Multiton&lt;/a&gt; potentially offers, and well it's just an extended version of the Singleton, so it's "compatible" with the Singleton model.&lt;/p&gt;
&lt;p&gt;Anyway, to the point, PHP5.3 is coming, and with Late Static Binding you can do a base Multiton (or Singleton if you insist), which wasn't possible before. Now I like this very much because you can simply extend it rather than rewriting those (few, I know, but still) lines each time.  &lt;/p&gt; &lt;a href="http://seld.be/notes/multiton-base-class"&gt;Read more...&lt;/a&gt; &lt;a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fseld.be%2Fnotes%2Fmultiton-base-class&amp;service=bit.ly"&gt;Retweet&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/blog-seld/~4/lKxaFkzCTIQ" height="1" width="1"/&gt;</description>
			<link>http://feeds.seld.be/~r/blog-seld/~3/lKxaFkzCTIQ/multiton-base-class</link>
			<pubDate>Tue, 23 Dec 2008 01:40:00 +0100</pubDate>
			<guid isPermaLink="false">http://seld.be/notes/multiton-base-class</guid>
			<category>PHP</category>
		<feedburner:origLink>http://seld.be/notes/multiton-base-class</feedburner:origLink></item>
		<item>
			<title>The joys of user stylesheets</title>
			<description>&lt;p&gt;User stylesheets are a way to inject some CSS in all the sites you visit, each browser has his own way of &lt;a href="http://www.squarefree.com/userstyles/user-style-sheets.html"&gt;setting it up&lt;/a&gt; (if you use opera step 2 there should be replaced with: "Tools &amp;gt; Preferences &amp;gt; Advanced &amp;gt; Content &amp;gt; Style Options &amp;gt; Select your css file in My stylesheet"), but the idea is always the same.&lt;/p&gt;
&lt;p&gt;I've recently found a couple of use for these styles so I thought I might as well share :&lt;/p&gt;
Changing gmail's font
&lt;p&gt;I like gmail, but losing my dear monospaced font was annoying me - especially when reading code-related mails with snippets in them. So this little hack allows you to choose the font used in the mail body area of the page. It's made for the "old" gmail interface since I don't have the new one yet, but it can probably be adapted if it doesn't work with the new one.&lt;/p&gt;
.XoqCub .ArwC7c {
  font:16px proggytinytt, &amp;quot;courier new&amp;quot;, courier !important;
  font-size:16px !important;
}
&lt;p&gt;This uses the &lt;a href="http://www.proggyfonts.com/"&gt;proggytinytt&lt;/a&gt; font by the way, which is my font of choice for all monospace purposes, however if you don't have it it falls back on courier new/courier.&lt;/p&gt;
Saving flickr's images peacefully
&lt;p&gt;Some images on flickr seem to be protected with a file called spaceball.gif that's overlayed onto the actual image, so that when you right-click it to save, you hit the transparent gif and can't save the image. With the help of that great CSS3 selector :nth-child(N), you can make sure you hide the gif if it's there.&lt;/p&gt;
.photoImgDiv img:nth-child(2) {
	display:none !important;
}
&lt;p&gt;If you've anything useful, feel free to post it in the comments.&lt;/p&gt; &lt;a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fseld.be%2Fnotes%2Fthe-joys-of-user-css&amp;service=bit.ly"&gt;Retweet&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/blog-seld/~4/EAsGF0iIGPA" height="1" width="1"/&gt;</description>
			<link>http://feeds.seld.be/~r/blog-seld/~3/EAsGF0iIGPA/the-joys-of-user-css</link>
			<pubDate>Fri, 28 Nov 2008 17:13:33 +0100</pubDate>
			<guid isPermaLink="false">http://seld.be/notes/the-joys-of-user-css</guid>
			<category>Web</category>
		<feedburner:origLink>http://seld.be/notes/the-joys-of-user-css</feedburner:origLink></item>
		<item>
			<title>Dwoo v1.0 is out</title>
			<description>&lt;p&gt;Now that Dwoo's user base has grown a bit and that I've received enough feedback and fixed quite a bunch of bugs and design flaws, I feel confident it's time to go stable, so here comes &lt;a href="http://dwoo.org/download"&gt;Dwoo 1.0.0&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;For those that missed it, Dwoo is a template engine compatible with Smarty templates, with a lot of new features and syntax sugar and a new PHP5 codebase, if you want to read more I suggest you have a look at &lt;a href="http://seld.be/notes/who-let-the-dwoo-out"&gt;my earlier post&lt;/a&gt;, and its &lt;a href="http://dwoo.org"&gt;website&lt;/a&gt;.&lt;/p&gt; &lt;a href="http://seld.be/notes/dwoo-v1-0-is-out"&gt;Read more...&lt;/a&gt; &lt;a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fseld.be%2Fnotes%2Fdwoo-v1-0-is-out&amp;service=bit.ly"&gt;Retweet&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/blog-seld/~4/UZwNHgGePA0" height="1" width="1"/&gt;</description>
			<link>http://feeds.seld.be/~r/blog-seld/~3/UZwNHgGePA0/dwoo-v1-0-is-out</link>
			<pubDate>Fri, 24 Oct 2008 23:00:00 +0200</pubDate>
			<guid isPermaLink="false">http://seld.be/notes/dwoo-v1-0-is-out</guid>
			<category>PHP</category>
		<feedburner:origLink>http://seld.be/notes/dwoo-v1-0-is-out</feedburner:origLink></item>
		<item>
			<title>Installing Habari on Lighttpd</title>
			<description>&lt;p&gt;Just a small post about &lt;a href="http://habariproject.org/en/"&gt;Habari&lt;/a&gt; installation over Lighttpd, since it is not really documented anywhere that I could find.&lt;/p&gt;&lt;p&gt;I will assume that you know how to run php scripts on your server, and start from there. So once you have unpacked Habari files in say /home/seld/domain.com/, all you need to do is add the following to your lighttpd.conf file&amp;nbsp;:&lt;/p&gt;
$HTTP[&amp;quot;host&amp;quot;] =~ &amp;quot;^(www\.)?domain\.com$&amp;quot; { 
    server.document-root =  &amp;quot;/home/seld/domain.com&amp;quot; 
    url.rewrite-once =  ( 
        &amp;quot;^/(?!scripts/|3rdparty/|system/|doc/)(.*)$&amp;quot; =&amp;gt;  &amp;quot;/index.php&amp;quot; 
    ) 
}
&lt;p&gt;With this setup, your blog must lie in the top level directory ( &lt;a href="http://domain.com/"&gt;http://domain.com/&lt;/a&gt; ), should you want to install it in a subdirectory, you need to add it to the url rewrite, for example to install in &lt;a href="http://domain.com/blog/"&gt;http://domain.com/blog/&lt;/a&gt; you would need&amp;nbsp;to&amp;nbsp;replace&amp;nbsp;line&amp;nbsp;4&amp;nbsp;with :&lt;/p&gt;&lt;p&gt;&amp;quot;^/blog/(?!scripts/|3rdparty/|system/|doc/)(.*)$&amp;quot; =&amp;gt; &amp;nbsp;&amp;quot;/blog/index.php&amp;quot;&lt;/p&gt; &lt;a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fseld.be%2Fnotes%2Finstalling-habari-on-lighttpd&amp;service=bit.ly"&gt;Retweet&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/blog-seld/~4/lOy1_nOitdk" height="1" width="1"/&gt;</description>
			<link>http://feeds.seld.be/~r/blog-seld/~3/lOy1_nOitdk/installing-habari-on-lighttpd</link>
			<pubDate>Sat, 02 Aug 2008 23:32:43 +0200</pubDate>
			<guid isPermaLink="false">http://seld.be/notes/installing-habari-on-lighttpd</guid>
			<category>Web</category>
		<feedburner:origLink>http://seld.be/notes/installing-habari-on-lighttpd</feedburner:origLink></item>
		<item>
			<title>Who let the Dwoo out ?</title>
			<description>&lt;p&gt;Four months have passed since I started on this project and I finally feel that it is stable enough to make an announcement and have more people trying it.&lt;/p&gt;&lt;p&gt;So what is it ? &lt;a href="http://dwoo.org/"&gt;Dwoo&lt;/a&gt; is a PHP5 template engine. Another one you might think, indeed but with every new project comes a new vision, and hopefully you will like mine.&lt;/p&gt; &lt;a href="http://seld.be/notes/who-let-the-dwoo-out"&gt;Read more...&lt;/a&gt; &lt;a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fseld.be%2Fnotes%2Fwho-let-the-dwoo-out&amp;service=bit.ly"&gt;Retweet&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/blog-seld/~4/YToeTQBw_XM" height="1" width="1"/&gt;</description>
			<link>http://feeds.seld.be/~r/blog-seld/~3/YToeTQBw_XM/who-let-the-dwoo-out</link>
			<pubDate>Tue, 13 May 2008 00:47:41 +0200</pubDate>
			<guid isPermaLink="false">http://seld.be/notes/who-let-the-dwoo-out</guid>
			<category>PHP</category>
		<feedburner:origLink>http://seld.be/notes/who-let-the-dwoo-out</feedburner:origLink></item>
		<item>
			<title>Random Seeds - Ordering Disorder</title>
			<description>&lt;p&gt;Randomness is great, that's a fact, it's very useful in many areas of programming, and is especially good to build non-repetitive games. However in some cases, it's useful to be able to reproduce randomness. &lt;/p&gt;
&lt;p&gt;Let's say you have a Tetris game or a puzzle that randomizes it's different elements before the game start. It might be a nice feature to offer a &amp;quot;Try again&amp;quot; button, which would allow the player to replay the exact same game, to see if he performs better. Or you may want to have two players play the same game to compete against each other, while still playing a random game.&lt;/p&gt;
&lt;p&gt;There are two approach to this, the first and maybe the most straightforward is to log the random somewhere to be able to replay it. This works of course, but it forces you to implement the entire logging process, and it uses memory. That's not efficient.&lt;/p&gt; &lt;a href="http://seld.be/notes/random-seeds-ordering-disorder"&gt;Read more...&lt;/a&gt; &lt;a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fseld.be%2Fnotes%2Frandom-seeds-ordering-disorder&amp;service=bit.ly"&gt;Retweet&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/blog-seld/~4/mc-QfYhHr5o" height="1" width="1"/&gt;</description>
			<link>http://feeds.seld.be/~r/blog-seld/~3/mc-QfYhHr5o/random-seeds-ordering-disorder</link>
			<pubDate>Thu, 13 Mar 2008 10:28:12 +0100</pubDate>
			<guid isPermaLink="false">http://seld.be/notes/random-seeds-ordering-disorder</guid>
			<category>ActionScript</category>
		<feedburner:origLink>http://seld.be/notes/random-seeds-ordering-disorder</feedburner:origLink></item>
		<item>
			<title>AS3 and the Display List, addChildAt magic.</title>
			<description>&lt;p&gt;ActionScript 3 introduced the Display List, which is the new version of the old depth system that AS1/2 had, and the Display Objects, which replace the MovieClip, but extending the idea a lot since now there are many types of objects that can be added to the Display List.&lt;/p&gt;&lt;p&gt;There are many advantages to this implementation, you don't HAVE to provide a depth anymore, the Display Object names are optional as well, and it's all more consistent as the only way to add an object to the list is through AddChild/AddChildAt, no more createEmptyMovieClip, attachMovie, etc.&lt;/p&gt;&lt;p&gt;All of this is quite easy to adjust to as it's really nicer and more powerful than AS2 was, but until recently I was stuck with my old habits of using depths. What I mean is that, in AS2, if you did ten times createEmptyMovieClip('name',0); then only one MovieClip was left at the end, as each new MovieClip created was overwriting the previous at depth 0.&lt;/p&gt;&lt;p&gt;I recently wanted to add an object at the bottom of the stack, to display it as a background. So I looked at my options, and since I was still thinking in the &amp;quot;AS2 way&amp;quot;, I thought about using swapDepths (now swapChildren) on all the current objects to move them up and free the zero-depth. &lt;/p&gt;&lt;p&gt;But then when I went into the documentation to check if this could be done more efficiently with a new method I didn't know of, I realized that the addChildAt method, if set to an already occupied index, will not overwrite it as it happened before. Instead it will just push all the objects up to make room for your newly added object. This is a really great feature, which allows you to really forget all about depths. swapChildrenAt acts in the very same way, allowing to move things around without having to worry about keeping track of all your used depths.&lt;/p&gt; &lt;a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fseld.be%2Fnotes%2Fas3-and-the-display-list-addchildat-magic&amp;service=bit.ly"&gt;Retweet&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/blog-seld/~4/zqwddW1TDBE" height="1" width="1"/&gt;</description>
			<link>http://feeds.seld.be/~r/blog-seld/~3/zqwddW1TDBE/as3-and-the-display-list-addchildat-magic</link>
			<pubDate>Fri, 21 Dec 2007 11:51:01 +0100</pubDate>
			<guid isPermaLink="false">http://seld.be/notes/as3-and-the-display-list-addchildat-magic</guid>
			<category>ActionScript</category>
		<feedburner:origLink>http://seld.be/notes/as3-and-the-display-list-addchildat-magic</feedburner:origLink></item>
		<item>
			<title>PHP RSS Generator</title>
			<description>&lt;p&gt;As part of my work on my CMS (and website as this site is running on it), I decided to code a RSS feed builder. This could easily be made as a standalone class so I thought I would &lt;a href="http://seld.be/code/rss-generator/downloads"&gt;share it&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;The package is made of two files, one being the feed and the other one representing an item (i.e. an article). It works nicely as you can see from all the feeds I set up in here, and it supports the RSS2.0 standard entirely. &lt;/p&gt; &lt;a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fseld.be%2Fnotes%2Fphp-rss-generator&amp;service=bit.ly"&gt;Retweet&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/blog-seld/~4/_o1JMpyq3u4" height="1" width="1"/&gt;</description>
			<link>http://feeds.seld.be/~r/blog-seld/~3/_o1JMpyq3u4/php-rss-generator</link>
			<pubDate>Tue, 18 Dec 2007 20:44:43 +0100</pubDate>
			<guid isPermaLink="false">http://seld.be/notes/php-rss-generator</guid>
			<category>News</category>
			<category>PHP</category>
		<feedburner:origLink>http://seld.be/notes/php-rss-generator</feedburner:origLink></item>
		<item>
			<title>Heat maps drawing in Flash</title>
			<description>&lt;p&gt;Someone was looking for help to draw Heat Maps in Flash this afternoon on #flash and as I found the matter interesting I gave it a shot.&lt;/p&gt;
&lt;p&gt;I managed to do it by drawing grey circles with 1-5% opacity to a BitmapData object, which works a lot faster than working with Arrays to sum up all the values. &lt;/p&gt;
&lt;p&gt;After that first pass the class scans the whole BitmapData to find the peak value and then uses that peak to scale all values and enhance the contrast of the image. At the same time, the pixels are colored depending on their value, which creates the &amp;quot;heat&amp;quot; look.&lt;/p&gt;
&lt;p&gt;However, with a high resolution and thousands of heat spots, the process is taking a while to complete so I thought I would use this occasion to try and implement a render loop that computes chunks of data on every frame instead of running all at once and freezing the player. And here is the result, although the heat map doesn't match the underlying map.&lt;/p&gt; &lt;a href="http://seld.be/notes/heat-maps-drawing-in-flash"&gt;Read more...&lt;/a&gt; &lt;a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fseld.be%2Fnotes%2Fheat-maps-drawing-in-flash&amp;service=bit.ly"&gt;Retweet&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/blog-seld/~4/b9yFVtywJUM" height="1" width="1"/&gt;</description>
			<link>http://feeds.seld.be/~r/blog-seld/~3/b9yFVtywJUM/heat-maps-drawing-in-flash</link>
			<pubDate>Sun, 16 Dec 2007 03:22:37 +0100</pubDate>
			<guid isPermaLink="false">http://seld.be/notes/heat-maps-drawing-in-flash</guid>
			<category>ActionScript</category>
		<feedburner:origLink>http://seld.be/notes/heat-maps-drawing-in-flash</feedburner:origLink></item>
		<item>
			<title>ActionScript 3 Language file for GeSHi</title>
			<description>&lt;p&gt;As I wanted to post AS3 code with syntax coloring, I researched it a bit and found &lt;a href="http://qbnz.com/highlighter/"&gt;GeSHi&lt;/a&gt;, a PHP syntax highlighter, for which you can create language files quite easily. There is currently no AS3 file available in GeSHi though, so I decided to build one.&lt;/p&gt;&lt;p&gt;For now it's available here, but I hope it will make it into GeSHi's next releases. It's following the FlexBuilder2 colors for the default style, but it is stylable with CSS.&lt;/p&gt;&lt;p&gt;Should you see any missing keyword or anything, please contact me so I can update it.&lt;/p&gt;&lt;p&gt;Edit : I updated this file to v1.0.1, I was so focused on scraping data that I forgot the &amp;quot;this&amp;quot; keyword in the process, that's now fixed. &lt;/p&gt;&lt;p&gt;Download : &lt;a href="http://seld.be/code/as3-for-geshi/downloads"&gt;AS3 Language file&lt;/a&gt;&lt;/p&gt; &lt;a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fseld.be%2Fnotes%2Factionscript-3-language-file-for-geshi&amp;service=bit.ly"&gt;Retweet&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/blog-seld/~4/BaiKOpaLCho" height="1" width="1"/&gt;</description>
			<link>http://feeds.seld.be/~r/blog-seld/~3/BaiKOpaLCho/actionscript-3-language-file-for-geshi</link>
			<pubDate>Fri, 30 Nov 2007 17:36:28 +0100</pubDate>
			<guid isPermaLink="false">http://seld.be/notes/actionscript-3-language-file-for-geshi</guid>
			<category>ActionScript</category>
			<category>PHP</category>
		<feedburner:origLink>http://seld.be/notes/actionscript-3-language-file-for-geshi</feedburner:origLink></item>
		<item>
			<title>Throwing errors before a super() statement</title>
			<description>&lt;p&gt;Lately I was building a class which takes XML as it's configuration, reads part of it and then calls super()&amp;nbsp;with some parameters.&lt;/p&gt;&lt;p&gt;However I&amp;nbsp;wanted&amp;nbsp;to throw an error if the XML did not contain valid settings, and Flex doesn't let you do that. Upon compilation it returns an error saying 1201: A super statement cannot occur after a this, super, return, or throw statement.&lt;/p&gt;&lt;p&gt;Fortunately,&amp;nbsp;it's&amp;nbsp;possible&amp;nbsp;to&amp;nbsp;overcome&amp;nbsp;this&amp;nbsp;by&amp;nbsp;creating&amp;nbsp;a&amp;nbsp;helper&amp;nbsp;function&amp;nbsp;or&amp;nbsp;class that will throw the&amp;nbsp;error&amp;nbsp;for&amp;nbsp;you, so that's what I did with my ErrorThrower class. It is as simple as it can get, and it fools the compiler alright.&lt;/p&gt;

package com.seld.errors 
{ 
     public class ErrorThrower 
     { 
         public function ErrorThrower(msg:String, id:int = 0):void 
         { 
             throw new Error(msg, id); 
         } 
     } 
}

&lt;p&gt;Then&amp;nbsp;with that class, instead&amp;nbsp;of&amp;nbsp;doing&amp;nbsp;throw new Exception('foo');&amp;nbsp;you just do new ErrorThrower(msg);&amp;nbsp;and it will be compiled,&amp;nbsp;error&amp;nbsp;free. &lt;/p&gt; &lt;a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fseld.be%2Fnotes%2Fthrowing-errors-before-a-super-statement&amp;service=bit.ly"&gt;Retweet&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/blog-seld/~4/OHBxXbJC1B4" height="1" width="1"/&gt;</description>
			<link>http://feeds.seld.be/~r/blog-seld/~3/OHBxXbJC1B4/throwing-errors-before-a-super-statement</link>
			<pubDate>Tue, 27 Nov 2007 17:30:47 +0100</pubDate>
			<guid isPermaLink="false">http://seld.be/notes/throwing-errors-before-a-super-statement</guid>
			<category>ActionScript</category>
		<feedburner:origLink>http://seld.be/notes/throwing-errors-before-a-super-statement</feedburner:origLink></item>
		<item>
			<title>The Renewal</title>
			<description>&lt;p&gt;After some months of heavy procrastination, I finally took the time to put my new website online, so here it is, although it's still quite empty as of today. &lt;/p&gt;&lt;p&gt;Hopefully I will have time to complete what needs to be done soon.&lt;/p&gt; &lt;a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fseld.be%2Fnotes%2Fthe-renewal&amp;service=bit.ly"&gt;Retweet&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/blog-seld/~4/SvABbB1ZPdI" height="1" width="1"/&gt;</description>
			<link>http://feeds.seld.be/~r/blog-seld/~3/SvABbB1ZPdI/the-renewal</link>
			<pubDate>Fri, 09 Nov 2007 03:30:34 +0100</pubDate>
			<guid isPermaLink="false">http://seld.be/notes/the-renewal</guid>
			<category>News</category>
		<feedburner:origLink>http://seld.be/notes/the-renewal</feedburner:origLink></item>
	</channel>
</rss>
