<?xml version="1.0" encoding="utf-8"?>
<!-- generator="wordpress/2.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>klog</title>
	<link>http://verens.com</link>
	<description>php, linux, ajax, javascript, kae verens</description>
	<pubDate>Wed, 07 May 2008 20:13:34 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3</generator>
	<language>en</language>
			<item>
		<title>NIN, The_Slip</title>
		<link>http://verens.com/archives/2008/05/07/nin-the_slip/</link>
		<comments>http://verens.com/archives/2008/05/07/nin-the_slip/#comments</comments>
		<pubDate>Wed, 07 May 2008 19:55:14 +0000</pubDate>
		<dc:creator>Kae Verens</dc:creator>
		
		<category><![CDATA[music]]></category>

		<guid isPermaLink="false">http://verens.com/archives/2008/05/07/nin-the_slip/</guid>
		<description><![CDATA[
Fresh from the success of their recent release, Ghosts, which Bronwyn has been playing non-stop since our CD arrived (and for weeks before using the MP3s downloaded from the Interweb), Nine Inch Nails has released a new album and gone even further.
Yes, this album is totally free for you to download. All they ask is [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://verens.com/wp-content/uploads/2008/05/nin-the_slip.jpg' alt='NIN - The Slip' />
<p>Fresh from the success of their recent release, <a href="http://ghosts.nin.com/">Ghosts</a>, which <a href="http://bronwyn.verens.com/">Bronwyn</a> has been playing non-stop since our CD arrived (and for weeks before using the MP3s downloaded from the Interweb), Nine Inch Nails has released a new album and gone even further.</p>
<p>Yes, this album is totally free for you to download. All they ask is that you <a href="http://theslip.nin.com/">sign up for it via their site</a>. However, as the album is licensed via Creative Commons Non-Commercial, it is also legal for you to <a href="http://www.mininova.org/search/nine+inch+nails+the+slip/seeds">download via bittorrent</a> if you prefer.</p>
<p>The album is available in MP3, M4A, FLAC and even 24/96 WAV (for freaks that want a 1.2GB album taking up space).</p>
<p>NIN are recommending that people take the album and produce <a href="http://remix.nin.com/">remixes</a> from it. (<i>That site doesn&#8217;t work well in Firefox in Linux btw - fix it, please - remember I bought a ticket for your concert in the RDS way back in &#8216;96? Go on Trent, be a pal!</i>)</p>
<p>As for the sound, I think it&#8217;s more accessible than <a href="http://yearzero.nin.com/">Year Zero</a> (although I think over time, I will prefer Year Zero) on a first listen. There is the usual layered approach to the music, where textured &#8220;landscapes&#8221; are drawn up. Interestingly, in some tracks, the layers appear to be deliberately off-time from each other (Echoplex, for example).</p>
]]></content:encoded>
			<wfw:commentRss>http://verens.com/archives/2008/05/07/nin-the_slip/feed/</wfw:commentRss>
		</item>
		<item>
		<title>nvidia in Fedora 9</title>
		<link>http://verens.com/archives/2008/05/04/nvidia-in-fedora-9/</link>
		<comments>http://verens.com/archives/2008/05/04/nvidia-in-fedora-9/#comments</comments>
		<pubDate>Sun, 04 May 2008 18:49:54 +0000</pubDate>
		<dc:creator>Kae Verens</dc:creator>
		
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://verens.com/archives/2008/05/04/nvidia-in-fedora-9/</guid>
		<description><![CDATA[&#8230;doesn&#8217;t work properly (at least on my laptop, using a GeForce 7000M). the reason for this is that Fedora 9 uses the latest version of xorg and NVidia&#8217;s driver does not yet work with it (3D is not fully working).
To get stuff at least minimally working, you need to downgrade your xorg RPMs to the [...]]]></description>
			<content:encoded><![CDATA[<p>&#8230;doesn&#8217;t work properly (at least on my laptop, using a GeForce 7000M). the reason for this is that <a href="http://fedoraproject.org/">Fedora 9</a> uses the latest version of <a href="http://x.org/">xorg</a> and <a href="http://nvidia.com/">NVidia</a>&#8217;s <a href="http://www.nvnews.net/vbulletin/showthread.php?t=111460">driver</a> does not yet work with it (3D is not fully working).</p>
<p>To get stuff at least minimally working, you need to downgrade your xorg RPMs to the Fedora 8 versions.</p>
<p>Unfortunately, <a href="http://kde.org/">KDE4</a> appears to require fully working GLX in order to display the kicker (or whatever the hell they&#8217;re calling it now), so my KDE is slightly crippled at the moment. A pity, really, as KDE4 is <em>beautiful</em> and almost as usable as 3.5 was.</p>
]]></content:encoded>
			<wfw:commentRss>http://verens.com/archives/2008/05/04/nvidia-in-fedora-9/feed/</wfw:commentRss>
		</item>
		<item>
		<title>KFM 1.3 released</title>
		<link>http://verens.com/archives/2008/04/28/kfm-13-released/</link>
		<comments>http://verens.com/archives/2008/04/28/kfm-13-released/#comments</comments>
		<pubDate>Mon, 28 Apr 2008 09:11:09 +0000</pubDate>
		<dc:creator>Kae Verens</dc:creator>
		
		<category><![CDATA[ajax]]></category>

		<category><![CDATA[kfm]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://verens.com/archives/2008/04/28/kfm-13-released/</guid>
		<description><![CDATA[For those that don&#8217;t know, KFM (Kae&#8217;s File Manager) is an application which allows a user to edit/move/delete files online. With some plugins, you can even view videos, listen to your music files, etc.
There are a number of interesting improvements in 1.3.
The configuration methods have been improved. To set up your new KFM, simply copy [...]]]></description>
			<content:encoded><![CDATA[<p>For those that don&#8217;t know, <a href="http://kfm.verens.com/">KFM</a> (Kae&#8217;s File Manager) is an application which allows a user to edit/move/delete files online. With some plugins, you can even view videos, listen to your music files, etc.</p>
<p>There are a number of interesting improvements in 1.3.</p>
<p>The configuration methods have been improved. To set up your new KFM, simply copy configuration.dist.php to configuration.php, remove the bits you won&#8217;t be changing, and edit what&#8217;s left. As an example, here is my entire configuration.php:</p>
<pre class="php">
&lt;?php
$kfm_db_type = 'sqlitepdo';
$kfm_userfiles_address = '/home/kae/websites/kfm/1.3/files';
$kfm_userfiles_output = '/get.php';
</pre>
<p>Plugins!</p>
<p>The point of plugins is to enable actions for various file types. We have plugins for the default actions such as image resize, editing text with codepress, etc. You can download new plugins from <a href="http://kfm.verens.com/f/plugins/">here</a> to supplement the default ones (I recommend jwplayer and malsup_media_player) - just unzip them in your /plugins/ directory and refresh your KFM.</p>
<p>The most important part about plugins is that they are easy to write. You don&#8217;t need to understand all of KFM to write your own plugin. Just copy an existing plugin that&#8217;s similar to what you want to do, and then edit it until it&#8217;s like what you wanted.</p>
<p>Another important part is that it helps to keep the size of KFM&#8217;s core down. We are aware that KFM is &#8220;bloating&#8221;, and are trying to keep an eye on that while still increasing its capabilities.</p>
<p>The list-view has been improved, along with a vast number of other things.</p>
<p>We have more new languages - Swedish (thanks to Aram Mäkivierikko), Persian (thanks to Ghassem Tofighi) and Hungarian (thanks to Ujj-Mészáros István).</p>
<p>There is a new strings translator on the way in 1.4, along with a new method of submitting translations. I&#8217;ve learned a lot in the last few months and feel I can do this better so I&#8217;m rewriting the translation methods. I&#8217;ll announce more as it becomes more complete.</p>
<p>A lot of work went into allowing KFM to be templated. This is not quite mature yet, so I won&#8217;t say too much about it, but it is now possible to design KFM the way you want it. If you have a design you&#8217;d like KFM to fit into, please contact me so I can help out. Documentation will come soon.</p>
<p>To download KFM 1.3, get the <a href="http://kfm.verens.com/f/kfm-1.3.tbz2">tar bzip (840k)</a> or the <a href="http://kfm.verens.com/f/kfm-1.3.zip">zip (1M)</a>.</p>
<p>Please report any bugs to the <a href="http://mantis.verens.com/">usual place</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://verens.com/archives/2008/04/28/kfm-13-released/feed/</wfw:commentRss>
		</item>
		<item>
		<title>review: Mastering phpMyAdmin 2.11 for Effective MySQL Management</title>
		<link>http://verens.com/archives/2008/04/26/review-mastering-phpmyadmin-211-for-effective-mysql-management/</link>
		<comments>http://verens.com/archives/2008/04/26/review-mastering-phpmyadmin-211-for-effective-mysql-management/#comments</comments>
		<pubDate>Sat, 26 Apr 2008 07:55:24 +0000</pubDate>
		<dc:creator>Kae Verens</dc:creator>
		
		<category><![CDATA[databases]]></category>

		<category><![CDATA[mysql]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[reviews]]></category>

		<guid isPermaLink="false">http://verens.com/archives/2008/04/26/review-mastering-phpmyadmin-211-for-effective-mysql-management/</guid>
		<description><![CDATA[Packt publishing emailed me a week ago and asked me if I was interested in writing a review of a book on phpMyAdmin.
In short, my review is this: overall, the book detailed everything I can think of (and more) about phpMyAdmin - I learned about some features in phpMyAdmin that I was not already aware [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.packtpub.com/">Packt publishing</a> emailed me a week ago and asked me if I was interested in writing a review of a <a href="http://www.amazon.co.uk/gp/product/1847194184?ie=UTF8&#038;tag=klog-21&#038;linkCode=as2&#038;camp=1634&#038;creative=6738&#038;creativeASIN=1847194184">book on phpMyAdmin</a><img src="http://www.assoc-amazon.co.uk/e/ir?t=klog-21&#038;l=as2&#038;o=2&#038;a=1847194184" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />.</p>
<p>In short, my review is this: overall, the book detailed everything I can think of (and more) about <a href="http://phpmyadmin.net/">phpMyAdmin</a> - I learned about some features in phpMyAdmin that I was not already aware of. I would ask for less screenshots, more how-tos and less &#8220;we/our&#8221; speech for the next revision, but if there are any questions I have about phpMyAdmin, the answers are in this book.</p>
<p>I use phpMyAdmin only occasionally, when I can&#8217;t get direct access to the database in question (I&#8217;m a console jockey - there&#8217;s nothing like the thrill of tappity-tapping away, knowing that you&#8217;re doing Important Stuff and &#8230;well, yeah - geek).</p>
<p>I&#8217;ve used phpMyAdmin since forever, so was familiar with its common uses - importing/exporting databases, running simple queries, etc. I was interested to see if there was anything that I might have missed. And who better to show me than one of the developers, <a href="http://wiki.cihar.com/pma/Marc_Delisle">Marc Delisle</a>.</p>
<p>The table of contents was large, spread over 12 pages. I feel it would have been easier to read if there was one page detailing just h1 listings, followed by 2-3 pages of h2 listings. The h3 and h4 listings could have been shown at the beginning of the concerned chapters.</p>
<p>Disregarding that, scanning the contents showed some features that I was not aware of. Did you know that phpMyAdmin has a built-in relations manager? Even if the engine used is MyISAM, which does not manage referential integrity, phpMyAdmin will protect you and manage it for you if queries are run through it.</p>
<p>Screenshots are provided for everything. This makes some things much easier to understand. Sometimes it made interesting features stand out even more. Did you know that phpMyAdmin can generate PDFs of the relational schema of a database? Some screenshots in chapter 15 show examples of this feature.</p>
<p>Marc obviously knows his stuff. As a major contributor to phpMyAdmin since the early days, he is an ideal person to talk us through configuration details and the various tools that phpMyAdmin offers.</p>
<p>There are, however, a number of things which detract from the readability of the book.</p>
<p>This is the first edition for this title, so the following are probably &#8220;teething&#8221; problems for the author. However, I think they should be taken care of for the second edition, to make the book easier to read. Although, the second edition would most likely have a different title (why is the version number in the title?)</p>
<p>The book is written from a 1st-person-plural point of view - now we do this, now we do that, our table, our server. This distracted and annoyed me while reading the book.</p>
<p>It is too detailed in places, at the expense of readability. For example, chapter one goes through a blow-by-blow account of how phpMyAdmin came to be, with version numbers and even dates! I feel this should have been left to an appendix. The first chapter of any book should introduce a reader gently to the subject; not pummel the reader with historical facts.</p>
<p>The author sometimes forgets that the reader does not know the subject and its community&#8217;s habits. As an example, on page 28 the configuration value &#8220;PmaAbsoluteUri&#8221; is described, but afterwards, I was not sure a) what &#8220;Pma&#8221; is, or b) what the variable was supposed to do (the book described how it should be configured, but not what it was supposed to do). It isn&#8217;t until page 33 that the book pointed out that &#8220;pma&#8221; is an acronym for &#8220;phpMyAdmin&#8221; used by the community. I don&#8217;t feel stupid for not getting this immediately, as there is an awkward mixture of letter-cases going on there. By rights, &#8220;Pma&#8221; should stand for &#8220;Phpmyadmin&#8221;, not &#8220;phpMyAdmin&#8221;.</p>
<p>The sheer number of screenshots was a bit confusing. I feel that screenshots should only be used where the subject is not clear from the text. Two images on every page (almost) has the effect of breaking your concentration when you&#8217;re trying to read.</p>
<p>The book exclusively deals with how to use phpMyAdmin, but I think there should have been more about how to deal with MySQL itself, using phpMyAdmin. For example, chapter 17 details phpMyAdmin&#8217;s coverage of character sets and collations. As a person who knows the pain of upgrading a database from <a href="http://www.mysql.com/">MySQL</a> 4 to MySQL 5 while switching character sets, I was looking forward to seeing how this case is handled (which I am sure is pretty common in one form or another). However, the chapter describes the problems with character sets and does not offer any solutions to those problems.</p>
<p>Overall, the book was detailed, and I learned a lot of new stuff from it. I&#8217;d recommend it for administrators that are not comfortable with CLI MySQL and want a reference for the best web-based MySQL administration tool out there.</p>
]]></content:encoded>
			<wfw:commentRss>http://verens.com/archives/2008/04/26/review-mastering-phpmyadmin-211-for-effective-mysql-management/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to get your own way</title>
		<link>http://verens.com/archives/2008/04/21/how-to-get-your-own-way/</link>
		<comments>http://verens.com/archives/2008/04/21/how-to-get-your-own-way/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 06:16:08 +0000</pubDate>
		<dc:creator>Kae Verens</dc:creator>
		
		<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://verens.com/archives/2008/04/21/how-to-get-your-own-way/</guid>
		<description><![CDATA[&#8230; if you are the chairman of a committee.
This is incredible - it&#8217;s a first-hand account of how Norway&#8217;s OOXML vote was changed from No to Yes in the space of one meeting (No meaning &#8220;there are problems with the proposal, we should not support it&#8221;, and Yes meaning &#8220;there are no problems with the [...]]]></description>
			<content:encoded><![CDATA[<p>&#8230; if you are the chairman of a committee.</p>
<p><a href="http://topicmaps.wordpress.com/2008/04/18/the-norway-vote-what-really-happened/">This is incredible</a> - it&#8217;s a first-hand account of how Norway&#8217;s OOXML vote was changed from No to Yes in the space of one meeting (No meaning &#8220;there are problems with the proposal, we should not support it&#8221;, and Yes meaning &#8220;there are no problems with the proposal, and it should be supported&#8221;).</p>
<p>The meeting started with the chairman, who is not a technical man and has little understanding of the problems of OOXML, stating that this meeting would not adjourn until there was consensus on either Yes or No.</p>
<p>What followed was a real life &#8220;Monty Hall&#8221; whittle - The meeting started with 30 people voting, most of whom <em>did not vote yes</em>. There was no consensus, so most of the voters were asked to leave the room. Then the vote was taken again. People still had different opinions, so more people were asked again. This repeated until there was only one vote left - the chairman&#8217;s. And so Norway&#8217;s vote was decided.</p>
<p>So what&#8217;s wrong with that?</p>
<p>Let&#8217;s say the vote was about slavery. The question was - should slavery be allowed. Let&#8217;s say that the chairman didn&#8217;t understand the need to treat all humans as sovereign, and was the only person voting &#8220;Yes&#8221;.</p>
<p>In the first round, the chairman would vote &#8220;Yes&#8221;, and <em>everyone else</em> votes No. No consensus, so most of the voters are asked to leave. Again, the vote is taken, and again, the tally has one Yes, and many Nos - no consensus. So more people are asked to leave. this process continues until all voters are in agreement. You guessed it - the chairman wins.</p>
<p>This voting process is hilarious because it has actually happened! I&#8217;m frankly astounded that there is less outcry.</p>
<p>This is an example of dictatorship - a question was asked, and everyone that gave an answer different to the chairman&#8217;s was removed from the room. Eventually, he was the only person left, and so the &#8220;vote&#8221; was tallied as 100% Yes.</p>
]]></content:encoded>
			<wfw:commentRss>http://verens.com/archives/2008/04/21/how-to-get-your-own-way/feed/</wfw:commentRss>
		</item>
		<item>
		<title>NIN and Tripping The Rift</title>
		<link>http://verens.com/archives/2008/04/19/nin-and-tripping-the-rift/</link>
		<comments>http://verens.com/archives/2008/04/19/nin-and-tripping-the-rift/#comments</comments>
		<pubDate>Sat, 19 Apr 2008 07:04:54 +0000</pubDate>
		<dc:creator>Kae Verens</dc:creator>
		
		<category><![CDATA[film]]></category>

		<category><![CDATA[music]]></category>

		<guid isPermaLink="false">http://verens.com/archives/2008/04/19/nin-and-tripping-the-rift/</guid>
		<description><![CDATA[
I was watching the Tripping the Rift film and noticed the title of the newspaper that Gus was reading.
&#8220;N Eye N&#8221; - get it?
I have no idea what Tripping The Rift has to do with Nine Inch Nails, and haven&#8217;t found anything obvious online.
Which reminds me - my CDs copy of Ghosts is on the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.amazon.co.uk/gp/product/B0012IX34Y?ie=UTF8&#038;tag=klog-21&#038;linkCode=as2&#038;camp=1634&#038;creative=6738&#038;creativeASIN=B0012IX34Y"><img src='http://verens.com/wp-content/uploads/2008/04/ttr-nin.png' alt='tripping the rift' style="float:left" /></a><img src="http://www.assoc-amazon.co.uk/e/ir?t=klog-21&#038;l=as2&#038;o=2&#038;a=B0012IX34Y" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
<p>I was watching the Tripping the Rift film and noticed the title of the newspaper that Gus was reading.</p>
<p>&#8220;N Eye N&#8221; - get it?</p>
<p>I have no idea what Tripping The Rift has to do with Nine Inch Nails, and haven&#8217;t found anything obvious online.</p>
<p>Which reminds me - my CDs copy of <a href="http://ghosts.nin.com/main/order_options">Ghosts</a> is on the way.</p>
]]></content:encoded>
			<wfw:commentRss>http://verens.com/archives/2008/04/19/nin-and-tripping-the-rift/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Planet PHP (.ie)</title>
		<link>http://verens.com/archives/2008/04/15/planet-php-ie/</link>
		<comments>http://verens.com/archives/2008/04/15/planet-php-ie/#comments</comments>
		<pubDate>Tue, 15 Apr 2008 20:05:26 +0000</pubDate>
		<dc:creator>Kae Verens</dc:creator>
		
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://verens.com/archives/2008/04/15/planet-php-ie/</guid>
		<description><![CDATA[Just waiting for the DNS to resolve, but the Irish PHP User Group now has its own planet.
planet.php.ie is an aggregation of PHP blogs in Ireland. At the moment, there are only a few. If you feel you should be in this group, please get in contact with either Ken Guest or myself.
]]></description>
			<content:encoded><![CDATA[<p>Just waiting for the DNS to resolve, but the Irish PHP User Group now has its own planet.</p>
<p><a href="http://planet.php.ie/">planet.php.ie</a> is an aggregation of PHP blogs in Ireland. At the moment, there are only a few. If you feel you should be in this group, please get in contact with either <a href="http://blogs.linux.ie/kenguest">Ken Guest</a> or myself.</p>
]]></content:encoded>
			<wfw:commentRss>http://verens.com/archives/2008/04/15/planet-php-ie/feed/</wfw:commentRss>
		</item>
		<item>
		<title>HP G6000 in Linux</title>
		<link>http://verens.com/archives/2008/04/12/hp-g6000-in-linux/</link>
		<comments>http://verens.com/archives/2008/04/12/hp-g6000-in-linux/#comments</comments>
		<pubDate>Sat, 12 Apr 2008 22:42:58 +0000</pubDate>
		<dc:creator>Kae Verens</dc:creator>
		
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://verens.com/archives/2008/04/12/hp-g6000-in-linux/</guid>
		<description><![CDATA[My old laptop, an Acer Travelmate 2420 (good machine) started developing vertical lines on its TFT over the last few weeks, so I thought it was time to upgrade, and eventually fix the old lappie up for my son.
I bought an HP G6000. Ken Guest recommended a Lenovo x300 (or something like that) - I [...]]]></description>
			<content:encoded><![CDATA[<p>My old laptop, an Acer Travelmate 2420 (good machine) started developing vertical lines on its TFT over the last few weeks, so I thought it was time to upgrade, and eventually fix the old lappie up for my son.</p>
<p>I bought an HP G6000. Ken Guest recommended a Lenovo x300 (or something like that) - I was in a bit of a rush, though - I can&#8217;t stand being without a functional machine, so I headed into Gillanders in Monaghan and bought the HP.</p>
<p>I spent a few hours on Friday dual-booting Linux onto the machine. FC7 initially, as that&#8217;s all I had with me, then upgraded to FC8 as soon as possible.</p>
<p>It wasn&#8217;t until I got home until I realised that the WIFI was broken (my office network is mostly wire-networked).</p>
<p>A few hours of study showed there was no simple solution to this. <code>lspci</code> claimed that the card is an <code>AR5006EG</code> from Atheros. the card is actually an <code>AR5007EG</code>. Either way, there is no &#8220;official&#8221; Linux support for this, and the unoffical support is not perfect either.</p>
<p>After reviewing the available information, I thought the easiest solution was to replace the WIFI car.d. I had an old Sony Vaio upstairs, so I pulled out the WIFI card from that, an Intel 3945abg, and placed that in the machine (if you unscrew the RAM plate at the back, you will see the WIFI card in its Mini-PCI-Express slot - lever the aerials off it and replace the card - simple, innit). unfortunately, that was far from perfect - the Intel 3945abg is not even seen by <code>lspci</code> - some hints I found online suggested that the 3945 doesn&#8217;t adhere to the standards.</p>
<p>Long story (asked Trevor in Gillanders for permission to dig through their laptop graveyard for a WIFI replacement - found nothing. tried some machines I had in the office - nothing found) - eventually, I figured out the solution.</p>
<p>Here&#8217;s the trick. You will not get the AR5007EG working in 64-bit Linux. Instead, you need to compile <a href="http://kernel.org">a custom kernel</a> using the 386 mode, and download the <a href="http://madwifi.org/ticket/1679">patched version of MadWifi</a> to compile the kernel module.</p>
<p>After that, everything&#8217;s simple. To fix the xorg - download the official <a href="http://nvidia.com/">NVidia</a> driver module installer and let it compile a kernel module for you. That&#8217;s it - done.</p>
<p>Sorry for the length of this - I tried to throw in all the keywords that I searched for while trying to solve this.</p>
]]></content:encoded>
			<wfw:commentRss>http://verens.com/archives/2008/04/12/hp-g6000-in-linux/feed/</wfw:commentRss>
		</item>
		<item>
		<title>javascript cache problem, solved</title>
		<link>http://verens.com/archives/2008/04/09/javascript-cache-problem-solved/</link>
		<comments>http://verens.com/archives/2008/04/09/javascript-cache-problem-solved/#comments</comments>
		<pubDate>Wed, 09 Apr 2008 11:22:57 +0000</pubDate>
		<dc:creator>Kae Verens</dc:creator>
		
		<category><![CDATA[javascript]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[web development]]></category>

		<category><![CDATA[webworks]]></category>

		<guid isPermaLink="false">http://verens.com/archives/2008/04/09/javascript-cache-problem-solved/</guid>
		<description><![CDATA[Almost every time someone says to me that something I was working on is broken, the answer is &#8220;clear your cache&#8221;, and that automagically fixes everything. However, that&#8217;s not an ideal solution - ideally, the problem would never happen in the first place.
So, why does the problem happen?
Let&#8217;s say that there is a HTML file [...]]]></description>
			<content:encoded><![CDATA[<p>Almost every time someone says to me that something I was working on is broken, the answer is &#8220;clear your cache&#8221;, and that automagically fixes everything. However, that&#8217;s not an ideal solution - ideally, the problem would never happen in the first place.</p>
<p>So, why does the problem happen?</p>
<p>Let&#8217;s say that there is a HTML file which calls a JS function like this: <code>showImage();</code> - the JS function is included from the external file <code>/j/images.js</code>.</p>
<p>Browsers are usually set to cache .js files, and that&#8217;s the correct behaviour for the most part. Unfortunately, when a file needs to be fixed, it can cause problems.</p>
<p>For example, let&#8217;s say that I&#8217;ve corrected the function name to match my usual naming scheme - <code>images_show();</code>. I change the reference in both places. The browser reads the new HTML file from the net, but loads the JavaScript from the cache - suddenly there&#8217;s a mismatch which causes a problem.</p>
<p>So, how to get around this?</p>
<p>The solution I&#8217;m using at the moment involves a little bit of <code>mod_rewrite</code> and PHP.</p>
<p>Sticking with the contrived example, let&#8217;s rewrite <code>/j/images.js</code> so it is accessible from <code>/j/images</code> (using <code>/.htaccess</code>):</p>
<pre class="htaccess">
ExpiresActive On
ExpiresDefault A259200
RewriteEngine on
RewriteRule ^j/images$ /j/images.js [L]
</pre>
<p>Now, we add a little magic. We want to change the URL if the file has changed. The only way to know this is to look at the modified date of the file.</p>
<p>In your PHP, you could do it like this:</p>
<pre class="php">
&lt;script type="text/javascript" src="/j/images/&lt;php? echo md5(`ls -l j/images.js`); ?&gt;"&gt;&lt;/script&gt;
</pre>
<p>and then change the <code>.htaccess</code> file to allow that:</p>
<pre class="htaccess">
ExpiresActive On
ExpiresDefault A259200
RewriteEngine on
RewriteRule ^j/images/(.*)$ /j/images.js [L]
</pre>
<p>Now, if no file changes happen, then the MD5 hash (and therefore the URL) will be cacheable, and if the file changes, then the URL will automatically change as well.</p>
<p>&#8230;and that&#8217;s not all!</p>
<p>I like to aggregate my JavaScript files to reduce the network pain felt by the browser. In my CMS, it&#8217;s done with a <code>/j/js.php</code> file. Here&#8217;s a short excerpt:</p>
<pre class="php">
&lt;?php
$js=file_get_contents('jquery-1.2.3.min.js');
$js.=file_get_contents('js.js');
$js.=file_get_contents('tabs.js');
$js.=file_get_contents('addrow.js');
$js.=file_get_contents('formhide.js');
/* more files */

header('Cache-Control: max-age=2592000');
header('Expires-Active: On');
header('Expires: Fri, 1 Jan 2500 01:01:01 GMT');
header('Pragma:');
header('Content-type: text/javascript; charset=utf-8');

echo $js;
</pre>
<p>That&#8217;s then pointed to with this line in my .htaccess:</p>
<pre class="htaccess">
RewriteRule ^js/(.*)$ /j/js.php [L]
</pre>
<p>And it&#8217;s referenced in the browser like this:</p>
<pre class="php">
echo '&lt;script type="text/javascript" src="/js/'.md5(`ls -l j`).'"&gt;&lt;/script&gt;';
</pre>
<p>Simple, innit! That simple trick now keeps track of a number of files, and the browser knows immediately if there are any changes.</p>
<p>BTW: The same trick can be used with images, css, and any number of other &#8220;static&#8221; objects.</p>
]]></content:encoded>
			<wfw:commentRss>http://verens.com/archives/2008/04/09/javascript-cache-problem-solved/feed/</wfw:commentRss>
		</item>
		<item>
		<title>points in an area in mysql</title>
		<link>http://verens.com/archives/2008/04/04/points-in-an-area-in-mysql/</link>
		<comments>http://verens.com/archives/2008/04/04/points-in-an-area-in-mysql/#comments</comments>
		<pubDate>Fri, 04 Apr 2008 04:17:43 +0000</pubDate>
		<dc:creator>Kae Verens</dc:creator>
		
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://verens.com/archives/2008/04/04/points-in-an-area-in-mysql/</guid>
		<description><![CDATA[3am, daughter wide awake, not allowed to sleep - what&#8217;s a guy to do? Let&#8217;s do an experiment.
Let&#8217;s say we want to efficiently select all points in an area from a database. This has real-world applications - I&#8217;ll be using it in a geographical project very soon.
First, create a simple table in MySQL. I&#8217;ve created [...]]]></description>
			<content:encoded><![CDATA[<p>3am, daughter wide awake, not allowed to sleep - what&#8217;s a guy to do? Let&#8217;s do an experiment.</p>
<p>Let&#8217;s say we want to efficiently select all points in an area from a database. This has real-world applications - I&#8217;ll be using it in a geographical project very soon.</p>
<p>First, create a simple table in MySQL. I&#8217;ve created mine in a database called &#8216;geodb&#8217;.</p>
<pre class="mysql">
CREATE TABLE points(x INT, y INT, INDEX(x), INDEX(y));
</pre>
<p>Note that x and y are both indexed.</p>
<p>Then, seed that table using some PHP (I had to up the max_execution_time on my laptop to 300 for this).</p>
<pre class="php">
&lt;?php
mysql_connect('localhost','username','password');
mysql_select_db('geodb');
for($i=0;$i&lt;10000000;++$i){
  $x=rand(-1000000,1000000);
  $y=rand(-1000000,1000000);
  mysql_query("INSERT INTO points (x,y) VALUES ($x,$y)");
}
</pre>
<p>Ok. For the rest of the experiment, we&#8217;ll be trying various ways to extract the number of points within a radius of 100000 from (0,0). The goal is to have the lowest working time. Each method should return the exact same result.</p>
<p>First, from the console, do a straight <code>select</code> statement.</p>
<pre class="bash">
time echo "SELECT COUNT(x) FROM points WHERE SQRT(x*x+y*y)&lt;100000" | mysql -uusername -ppassword geodb
</pre>
<p>Returned result 7993 in .414 seconds. Wow - pretty quick already&#8230; but, my daughter is still awake, so let&#8217;s continue.</p>
<p>We can improve this by avoiding the math on points that we are certain can not be in the area. For example, in a radius of 100000 from (0,0), and points with x&lt;-100000, x&gt;100000, y&lt;-100000, y&gt;100000 can definitely not be in the circle.</p>
<pre class="bash">
time echo "SELECT COUNT(x) FROM (SELECT x,y FROM points WHERE x&gt;-100000 AND x&lt;100000 AND y&gt;-100000 AND y&lt;100000) AS sub1 WHERE SQRT(x*x+y*y)&lt;100000" | mysql -uusername -ppassword geodb
</pre>
<p>.326 seconds. Better. However, there are two calculations being performed on each value. Let&#8217;s reduce that.</p>
<pre class="bash">
time echo "SELECT COUNT(x) FROM (SELECT x,y FROM points WHERE ABS(x)&lt;=100000 AND ABS(y)&lt;=100000) AS sub1 WHERE SQRT(x*x+y*y)&lt;100000" | mysql -uusername -ppassword geodb
</pre>
<p>.297 - more than 25% fster than the original.</p>
<p>It should be possible to reduce that further. For example, we can be certain that x,y values which are both less than (100000*Cos(Pi/4)) are contained inside the circle, so that&#8217;s another &lt; comparison, reducing the number of maths operations. I&#8217;d test that one as well, but my daughter is finally asleep in my left arm as  type. </p>
]]></content:encoded>
			<wfw:commentRss>http://verens.com/archives/2008/04/04/points-in-an-area-in-mysql/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 1.413 seconds -->
<!-- Cached page served by WP-Cache -->
<!-- Compression = gzip -->