nl//YorHel's utterly useless webloghttp://yorhel.nl/#nfo_bindexUltimate bl44tz0rPostgreSQL is sexyhttp://yorhel.nl/#nfo_b030What used to be two stored procedures (of which one was recursive), two temporary VIEWs and several subqueries in PostgreSQL 8.3, has now been reduced to one, <del>simple</del> and elegant query in 8.4. Thanks to the introduction of <a href="http://www.postgresql.org/docs/8.4/static/queries-with.html">WITH</a> queries. (and some optimization on my part, I can't say my previous solution was really efficient) <pre> <b>INSERT INTO</b> tags_vn_inherit <b>WITH RECURSIVE</b> tags_vn_all(lvl, tag, vid, uid, vote, spoiler, meta) <b>AS</b> ( <b>SELECT</b> 15, tag, vid, uid, vote, spoiler, false <b>FROM</b> tags_vn <b>UNION ALL</b> <b>SELECT</b> lvl-1, tp.parent, ta.vid, ta.uid, ta.vote, ta.spoiler, t.meta <b>FROM</b> tags_vn_all ta <b>JOIN</b> tags_parents tp <b>ON</b> tp.tag = ta.tag <b>JOIN</b> tags t <b>ON</b> t.id = tp.parent <b>WHERE</b> t.state = 2 <b>AND</b> ta.lvl &gt; 0 ) <b>SELECT</b> tag, vid, <i>COUNT(</i>uid<i>)</i> AS users, <i>AVG(</i>vote<i>)</i>::real <b>AS</b> rating, (<i>CASE WHEN AVG(</i>spoiler<i>)</i> &lt; 0.7 <i>THEN</i> 0 <i>WHEN AVG(</i>spoiler<i>)</i> &gt; 1.3 <i>THEN</i> 2 <i>ELSE</i> 1 <i>END</i>)::smallint <b>AS</b> spoiler <b>FROM</b> ( <b>SELECT</b> tag, vid, uid, <i>MAX(</i>vote<i>)</i>::real, <i>COALESCE(AVG(</i>spoiler<i>)</i>, 0<i>)</i>::real <b>FROM</b> tags_vn_all <b>WHERE NOT</b> meta <b>GROUP BY</b> tag, vid, uid ) <b>AS</b> t(tag, vid, uid, vote, spoiler) <b>GROUP BY</b> tag, vid <b>HAVING</b> <i>AVG(</i>vote<i>)</i> > 0; </pre> Isn't that just cute?<br /> <br /> <i style="font-size: 9px; font-style: normal;">(Sorry, I'm too lazy to explain what that query does, just check the PostgreSQL docs and our <a href="http://g.blicky.net/vndb.git/tree/util/dump.sql?id=2.9"> database structure</a> if you absolutely need to know)</i>spam@yorhel.nlSat, 28 Nov 2009 23:00:00 CEThttp://yorhel.nl/#nfo_b030Mailu dayo! Bokenasu♥http://yorhel.nl/#nfo_b029I've been looking for a good new-mail-sound for a while now, and was pleasantly surprised while playing <a href="http://vndb.org/v382">Chaos;Head</a>: the protagonist has a totally awesome sound configured whenever he receives mail. Finding and extracting the sound from the game data files was easier than I had anticipated it to be, but I'll share the file with you anyway.<br /> <br /> <a href="http://static.yorhel.nl/2009/newmail.ogg">Mailu dayo! Bokenasu♥</a><br /> <br /> Unfortunately, the audio quality isn't perfect. ;_;spam@yorhel.nlTue, 24 Nov 2009 23:00:00 CEThttp://yorhel.nl/#nfo_b029A #fluffy storyhttp://yorhel.nl/#nfo_b028It all started on 2008-07-13, when EchoMateria shared his delusions about internet communities with the rest of #vndb-tmp (I temporarily lost control over #vndb, but let's forget about that issue here).<br /> <br /> [12:31] &lt;EchoMateria_Home&gt; I still think its the best to make fun of the channel founder / creator to lighten up the mood<br /> [12:32] &lt;applehq&gt; dw, if he bans you i could undo it...<br /> [12:32] &lt;applehq&gt; unless he bans me! *gasp*<br /> [12:33] &lt;EchoMateria_Home&gt; naah he is trying to make a point that he isn't actually mean, that would prove him otherwise :P<br /> [12:34] &lt;Yorhel&gt; o.0<br /> [12:36] &lt;EchoMateria_Home&gt; translators are the celebrities of the fan translation community, so I make fun of apple at #lbtp but here Yorhel is, so he is the target of al l jokes and stuff<br /> [12:37] * Yorhel wonders in what world Echo is living<br /> [12:37] &lt;applehq&gt; a very fluffy world<br /> [12:37] &lt;EchoMateria_Home&gt; XD<br /> <br /> Later that day, the large amount non-VNDB discussions started annoying me, and I proposed to split #vndb-tmp into two channels, one for VNDB talk and one for everything else:<br /> <br /> [18:40] &lt;Yorhel&gt; I suggest we split this thread into a social one and one for VNDB discussions<br /> [18:40] &lt;Yorhel&gt; err, channel*<br /> [18:40] &lt;Maou&gt; lol<br /> [18:40] &lt;Kotomi-nya&gt; vndb-tmp and vndb-tmp-chat<br /> [18:40] &lt;Yorhel&gt; or #fluffy or something<br /> <br /> And so, #fluffy came into existence...spam@yorhel.nlMon, 5 Oct 2009 22:00:00 CESThttp://yorhel.nl/#nfo_b028Missed the 1000http://yorhel.nl/#nfo_b027<br /> [yorhel@serio ~]$ uptime<br /> 09:34:14 up 1001 days, 7:41, 6 users, load average: 0.07, 0.03, 0.00spam@yorhel.nlSun, 16 Aug 2009 22:00:00 CESThttp://yorhel.nl/#nfo_b027Some more IRC quoteshttp://yorhel.nl/#nfo_b026As I don't really feel like writing about my latest adventures, even though most of them might very well be of interest to my readers, I'll just post some interesting quotes from IRC instead.<br /> <br /> We all love PHP:<br /> [16:45] &lt;Bigblah&gt; i'm such a noob<br /> [16:45] &lt;Bigblah&gt; I tried to manipulate large numbers in PHP<br /> [16:45] &lt;Bigblah&gt; total failure<br /> <br /> Echo in a rather pushy mood:<br /> [21:06] &lt;EchoMateria&gt; Yorhel, can we see those g's on a games page?<br /> [21:07] &lt;Yorhel&gt; who do you think I am, superman?<br /> [21:07] &lt;Yorhel&gt; I can't code that fast! :P<br /> [21:08] &lt;Yorhel&gt; only implemented some basic tag browsing and editing, everything else is still being worked on<br /> [21:09] &lt;EchoMateria&gt; wrong answer, correct one should be "who do you think I am! of course! here:"<br /> <br /> ...<br /> [19:29] &lt;EchoMateria&gt; I am clearly against any tag that has awesome in it<br /> [19:29] * applehq tags echo as "awesome"<br /> <br /> "Praise and run":<br /> [14:42] &lt;Yorhel&gt; yay http://beta.vndb.org/g11?m=2<br /> [14:55] --&gt; dsp2003 joins #vndb<br /> [14:56] &lt;dsp2003&gt; Hey, Yorhel. The beta tag system looks awesome. ^3^<br /> [14:57] &lt;Yorhel&gt; 0.o<br /> [14:57] &lt;Yorhel&gt; where did you just come from? :P<br /> [14:57] &lt;dsp2003&gt; That doesn't matter, really :3<br /> [14:58] &lt;-- dsp2003 quits (Quit: dsp2003)<br /> [15:00] &lt;EchoMateria&gt; praise and run<br /> <br /> <br /> Fun with bots:<br /> [13:53] &lt;Yorhel&gt; !say !say hi<br /> [13:53] &lt;Multi&gt; !say hi<br /> [13:53] &lt;Multi-beta&gt; !say hi<br /> [13:53] &lt;Multi&gt; Multi-beta, You are not my master!<br /> [13:53] &lt;Multi-beta&gt; Multi, You are not my master!spam@yorhel.nlTue, 17 Mar 2009 23:00:00 CEThttp://yorhel.nl/#nfo_b026Trolls on IRChttp://yorhel.nl/#nfo_b025<br /> [17:15] siIent left the room (quit: Connection reset by peer).<br /> [17:18] Bigblah: LoSs sounds like the generic internet troll<br /> [17:18] LoSs: ;_;<br /> [17:18] Bigblah: oh crap I thought you quit<br /> [17:18] Bigblah: I mean LoSs is a totally awesome dude<br /> [17:18] LoSs: ....<br /> [17:19] LoSs is now known as LoSs|GenericInternetTrollspam@yorhel.nlSun, 26 Oct 2008 23:00:00 CEThttp://yorhel.nl/#nfo_b025HTML in Perlhttp://yorhel.nl/#nfo_b024One thing that bothers every web developer (especially those who use something different from PHP) is how the HTML should be generated. Most developers settle for a template system where a simple templating language or sometimes even (parts of) an existing programming language is embedded in the HTML documents. Some developers don't care about code cleanliness and just type all HTML as strings, and others use specialized libraries to generate HTML without actually having to type any HTML for themselves at all.<br /> <br /> While I generally use a template system with embedded Perl for large projects and simply embed the HTML in my Perl code for smaller scripts, I'm still experimenting with code to find better methods. One of these experiments involved mapping Perl functions to HTML tags, pretty similar to <a href="http://search.cpan.org/perldoc?XML::Generator">XML::Generator</a>, but then spreading the generation of tags over multiple calls like <a href="http://search.cpan.org/perldoc?XML::Writer">XML::Writer</a> does. The result is HTML::Writer - a simple and small proof of concept, and an <a href="http://yorhel.nl/htmlwrite/"> example script</a> using it.<br /> <br /> It was fun to write and design, but whether it solves the eternal bother of writing HTML in Perl... I doubt it.spam@yorhel.nlFri, 10 Oct 2008 22:00:00 CESThttp://yorhel.nl/#nfo_b024Programming Awesomenesshttp://yorhel.nl/#nfo_b023There's this site called <a href="http://www.spoj.pl/">Sphere Online Judge</a>, or SPOJ for short. It's apparently been around since 2004 or so, and the first time I've come accross it was around 2006 when the site was mentioned in one of the IRC channels I was lurking in at the time.<br /> <br /> But it wasn't until this week that I actually decided to register myself an account and start solving the problems presented on the site. And honestly, it's awesome! The problems vary from quite easy to extremely difficult. Most problems require you to step back and think a few times about the algoritm before starting to write the actual code, instead of mindlessly implementing someting and experiencing with code like I'm used to do.<br /> <br /> So if you're in for some good brain massage, programming exercises, or just want to test your problem solving ability, please check it out and <a href="http://www.spoj.pl/users/ayo/"> beat me!</a> <i style="font-size: 9px; font-style: normal;">(which shouldn't be too hard...)</i>spam@yorhel.nlMon, 4 Aug 2008 22:00:00 CESThttp://yorhel.nl/#nfo_b023Bloated Data in PDFhttp://yorhel.nl/#nfo_b022No, this post is not about the PDF format, nor about PDF creators or idiots who bloat their PDF files with useless data. No, this post is about an article about <a href="http://dev.yorhel.nl/ncdu/">ncdu</a> in Linux Magazine issue August 2007. I have already received the the magazine with that article myself, but could never let other people read it over the internet. Now, however, I can. <a href="http://linux-magazine.com/"> Linux Magazine</a> has released the article in PDF format on their website. So if you haven't read the article yet, do so <a href="http://static.yorhel.nl/2008/ncdu.pdf">now</a>!spam@yorhel.nlThu, 26 Jun 2008 22:00:00 CESThttp://yorhel.nl/#nfo_b022Digg This Shit, Yo!http://yorhel.nl/#nfo_b021...or don't.<br /> <br /> I just can't stand all these stupid "digg this" icons on web pages, reminding me to "<a href="http://digg.com/">digg</a>" the page I'm viewing. I mean, if the page would be worth "digging", someone would've "dugg" it anyway, even without that stupid icon. And if your page really needs an icon to get "digged", it just means it's not worth being "digged".<br /> <br /> Good thing we have <a href="http://adblockplus.org/en/">Adblock</a> to get rid of these stupid demanding icons pretty easily. Just add the following rule to your exclude filter:<br /></p> <pre>http://digg.com/tools/*</pre><p><br /> Spread the word! <a href="http://digg.com/submit?url=http%3A%2F%2Fyorhel.nl%2F%23nfo_b021&amp;title=Digg%20This%20Shit%21">Digg This!</a>spam@yorhel.nlTue, 24 Jun 2008 22:00:00 CESThttp://yorhel.nl/#nfo_b021