
<rss version="0.91">
  <channel>
  <copyright>Copyright 1997-2005 eden</copyright>
  <pubDate>Thu, 01 Jan 1970 01:33:30 +0100</pubDate>
  <description>Why bother? I mean, really, why?</description>
  <link>http://teethgrinder.co.uk/</link>
  <title>teethgrinder</title>

  <webMaster>rss&#064;teethgrinder.co.uk</webMaster>
  <managingEditor>rss&#064;teethgrinder.co.uk</managingEditor>
  <language>en-us</language>

<item><title>Tesco VX1 Party Phone review :: life</title><link>http://teethgrinder.co.uk/perm.php?id=361</link><description>&lt;p&gt;OK phone, cheap and cheerful. Just calls and text msgs. Which is fine for me :)&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;color: rgb(0, 0, 128);&quot;&gt;&lt;span style=&quot;font-size: larger;&quot;&gt;&lt;b&gt;When texting PRESS # to turn off predictive text!&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;For more hints and tips see the &lt;a href=&quot;http://www.mediariver.co.uk/bluechip/page.asp?pid=109&quot;&gt;VX-1 MINI  MOBILE PHONE FAQ&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Seven Pillars of Pretty Code :: Programming</title><link>http://teethgrinder.co.uk/perm.php?id=360</link><description>&lt;p&gt;First of all, here is the link: &lt;a href=&quot;http://www.perforce.com/perforce/papers/prettycode.html&quot;&gt;prettycode&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I have to agree with everything they say. Amazing, that must be the first time I&#039;ve read anything on the internet that I totally agree with, especially when it comes to coding style - hehe!&lt;/p&gt;</description></item><item><title>C# silverlight and all that shit :: Programming</title><link>http://teethgrinder.co.uk/perm.php?id=359</link><description>&lt;p&gt;&lt;a href=&quot;http://www.joe-stevens.com/&quot;&gt;Joe Stevens&lt;/a&gt; is my geeky brother in law.&lt;/p&gt;</description></item><item><title>Blair :: life</title><link>http://teethgrinder.co.uk/perm.php?id=358</link><description>&lt;p&gt;Blair Julian - JOIN FACEBOOK - ok thx bye&lt;/p&gt;</description></item><item><title>PHP code style :: Programming</title><link>http://teethgrinder.co.uk/perm.php?id=357</link><description>&lt;p&gt;&lt;a href=&quot;http://universalindent.sourceforge.net/&quot;&gt;http://universalindent.sourceforge.net/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://sourceforge.net/projects/uncrustify/&quot;&gt;http://sourceforge.net/projects/uncrustify/&lt;/a&gt;&lt;/p&gt;</description></item><item><title>NuSphere PHPeD firefox debug toolbar :: Programming</title><link>http://teethgrinder.co.uk/perm.php?id=356</link><description>&lt;p&gt;Tags: NuSphere PHPeD firefox debug toolbar&lt;/p&gt;
&lt;p&gt;There is an open source Firefox toolbar for NuSphere PHP IDE (&lt;a href=&quot;http://forum.nusphere.com/viewtopic.php?t=2439&quot;&gt;NuSphere PHPeD firefox toolbar&lt;/a&gt;). It was written by a kind chap called Ian Flory.&lt;/p&gt;
&lt;p&gt;Firefox 3.5 beta 99 Preview is out and I use it, but the toolbar is locked to Firefox versions &lt;i&gt;&lt;b&gt;3.0.* and lower&lt;/b&gt;&lt;/i&gt;. The toolbar needed an update, so a little hacking later and here is the new version:&lt;/p&gt;
&lt;p style=&quot;margin-left: 40px;&quot;&gt;DBGbar: &lt;a href=&quot;http://www.teethgrinder.co.uk/pictures/phpdebugger.xpi&quot;&gt;phpdebugger.xpi&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Fixed:&lt;/p&gt;
&lt;p style=&quot;margin-left: 40px;&quot;&gt;Changed the min version to &lt;b&gt;3.5.*&lt;/b&gt;&lt;br /&gt;
Changed how the toolbar flexes and fills the space - it is now &lt;b&gt;fixed width&lt;/b&gt;.&lt;br /&gt;
Updated the &#039;options&#039; window text.&lt;/p&gt;
&lt;p&gt;Comments:&lt;/p&gt;
&lt;p style=&quot;margin-left: 40px;&quot;&gt;This Firefox add-on &lt;a href=&quot;http://kb.mozillazine.org/Windows_build_script&quot;&gt;build script&lt;/a&gt; was useful.&lt;br /&gt;
I drag and drop the toolbar up next to the &#039;File, Edit, View...&#039; menus, so when it flexes to fill all the horizontal space it really annoys me. I also drag and drop some bookmarks up here and a few Facebook buttons.&lt;/p&gt;
&lt;p&gt;If you find this useful leave a comment :)&lt;/p&gt;
&lt;p&gt;Open source (LGPL), flash charts (pie, bar, line, scatter, etc): &lt;a href=&quot;http://teethgrinder.co.uk/open-flash-chart-2/&quot;&gt;open flash chart 2&lt;/a&gt;. Tooltips, animation and JSON friendly.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>zend framework jeditable :: Programming</title><link>http://teethgrinder.co.uk/perm.php?id=355</link><description>&lt;p&gt;Tags: zend framework &lt;a href=&quot;http://www.appelsiini.net/projects/jeditable&quot;&gt;jquery.jeditable.js&lt;/a&gt; JSON&lt;/p&gt;
&lt;p&gt;jeditable does not accept JSON in response to the AJAX call. So how can you get this to work with Zend Framework? Like this:&lt;/p&gt;
&lt;p&gt;Your view will need the the .js files:&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-family: Courier New;&quot;&gt;&amp;lt;?php&lt;br /&gt;
$this-&amp;gt;headScript()-&amp;gt;appendFile($this-&amp;gt;baseUrl().&#039;/js/jquery-1.2.1.pack.js&#039;);&lt;br /&gt;
$this-&amp;gt;headScript()-&amp;gt;appendFile($this-&amp;gt;baseUrl().&#039;/js/jquery.jeditable.js&#039;);&lt;br /&gt;
?&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;In your controller you&#039;ll need to add a context swtich to return JSON, not HTML:&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-family: Courier New;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function init()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; parent::init();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; //&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // NOTE you need **format** in the URL, http://url/url/format/json/&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; //&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;_helper-&amp;gt;contextSwitch&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;gt;addActionContext(&#039;my-editable-ajax&#039;, &#039;json&#039;)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;gt;initContext();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;You action will look like this:&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-family: Courier New;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: Courier New;&quot;&gt;function myEditableAjaxAction()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; //&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // This is a serious PITA. The editable expects a single value&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // is response, not a JSON object, so turn off AUTO json&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; //&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;_helper-&amp;gt;contextSwitch()-&amp;gt;setAutoJsonSerialization(false);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $value = $this-&amp;gt;_getParam(&#039;value&#039;, &#039;&#039;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; echo &#039;got-&#039;.$value;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The URL you need to paste into the editable config will need the JSON context switch in it:&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-family: Courier New;&quot;&gt;$(&amp;quot;.edit_area&amp;quot;).editable(&amp;quot;&amp;lt;?= $this-&amp;gt;url(array(&#039;action&#039;=&amp;gt;&#039;&lt;/span&gt;&lt;span style=&quot;font-family: Courier New;&quot;&gt;my-editable-ajax&lt;/span&gt;&lt;span style=&quot;font-family: Courier New;&quot;&gt;&#039;, &#039;format&#039;=&amp;gt;&#039;json&#039;)) ?&amp;gt;&amp;quot;, { &lt;br /&gt;
&amp;nbsp; cancel&amp;nbsp;&amp;nbsp;&amp;nbsp; : &#039;Cancel&#039;,&lt;br /&gt;
&amp;nbsp; submit&amp;nbsp;&amp;nbsp;&amp;nbsp; : &#039;OK&#039;,&lt;br /&gt;
&amp;nbsp; indicator : &amp;quot;Saving...&amp;quot;,&lt;br /&gt;
&amp;nbsp; tooltip&amp;nbsp;&amp;nbsp; : &#039;Click to edit...&#039;,&lt;br /&gt;
&amp;nbsp; placeholder : &#039;&amp;amp;nbsp;&#039;&lt;br /&gt;
})&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Hope that helps.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>zend framework sql error reporting adapter :: Programming</title><link>http://teethgrinder.co.uk/perm.php?id=354</link><description>&lt;p&gt;This post is about &lt;b&gt;Zend Framework&lt;/b&gt;, &lt;span style=&quot;color: rgb(128, 0, 0);&quot;&gt;sql error reporting&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Problem:&lt;/b&gt;&lt;br /&gt;
If your SQL has an error in it, Zend Framework throws a  &lt;span style=&quot;font-family: Courier New; color: rgb(0, 0, 187);&quot;&gt;Zend_Db_Statement_Mysqli_Exception&lt;/span&gt;, the default exception message is pretty pants and does not show the whole SQL query (it only shows the first 10 characters or so!)&lt;/p&gt;
&lt;p&gt;Lets fix it so it shows the whole query.&lt;/p&gt;
&lt;p&gt;I found this &lt;a href=&quot;http://www.zfforums.com/zend-framework-components-13/databases-20/reporting-sql-errors-zend_db-105.html&quot;&gt;neat class&lt;/a&gt; that reports the SQL, it work by extending the &lt;span style=&quot;font-family: Courier New; color: rgb(0, 0, 187);&quot;&gt;Zend_Db_Adapter_Pdo_Mysql&lt;/span&gt; class. I use MySQLi, so I adapted it so it works for me:&lt;/p&gt;
&lt;div style=&quot;font-family: Courier New; padding-left: 10px;&quot;&gt;class MyCompany_Db_Mysqli extends Zend_Db_Adapter_Mysqli&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public function query($sql, $bind = array()) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; try {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return parent::query($sql, $bind);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (Exception $e) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if( $this-&amp;gt;getProfiler()-&amp;gt;getEnabled() )&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/div&gt;
&lt;div style=&quot;font-family: Courier New; padding-left: 10px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; echo &#039;&amp;lt;span style=&amp;quot;color: red; font-size: 20px;&amp;quot;&amp;gt;MyCompany_Db_Mysqli adapter Error&amp;lt;/span&amp;gt;&#039;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; echo &#039;&amp;lt;div style=&amp;quot;font-family: monospace; padding: 10px; margin: 10px; border: 2px solid pink;&amp;quot;&amp;gt;&#039;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; echo nl2br($sql);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; echo &#039;&amp;lt;hr&amp;gt;&#039;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; echo &#039;&amp;lt;pre&amp;gt;&#039;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; echo var_dump($bind);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; echo &#039;&amp;lt;pre&amp;gt;&#039;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; echo &#039;&amp;lt;/div&amp;gt;&#039;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // no profiler&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; throw $e;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;/div&gt;
&lt;p&gt;The whole thing is a little bit quick and dirty. I wanted to see if it worked and post a blog entry about if it did.&lt;/p&gt;
&lt;p&gt;You need to save the file into your library code (replace MyCompany with your library directory name) in the Db directory.&lt;/p&gt;
&lt;p&gt;To use it you want to find where you load your database adapter, I do this in my controller &lt;span style=&quot;color: rgb(0, 0, 255);&quot;&gt;&lt;span style=&quot;font-family: Courier New;&quot;&gt;init()&lt;/span&gt;&lt;/span&gt; function. My &lt;span style=&quot;color: rgb(0, 0, 255);&quot;&gt;&lt;span style=&quot;font-family: Courier New;&quot;&gt;init()&lt;/span&gt;&lt;/span&gt; looks like this:&lt;/p&gt;
&lt;div style=&quot;font-family: Courier New; padding-left: 10px;&quot;&gt;class ProjectsController extends Zend_Controller_Action&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; //&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; // this is called from __construct&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; //&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public function init()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; parent::init();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $config = new Zend_Config_Ini(&#039;/var/www/ZF-apps/config.ini&#039;, &#039;general&#039;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; //$db = Zend_Db::factory($config-&amp;gt;projects-&amp;gt;db);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $db = new Guava_1_Db_Mysqli($config-&amp;gt;projects-&amp;gt;db-&amp;gt;params);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;$db-&amp;gt;getProfiler()-&amp;gt;setEnabled(&lt;b&gt;true&lt;/b&gt;);&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Zend_Db_Table::setDefaultAdapter($db);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; ...&lt;br /&gt;
&amp;nbsp;&amp;nbsp; ...&lt;/div&gt;
&lt;p&gt;&lt;b&gt;Note&lt;/b&gt; how I have commented out how I used to get my adapter. Also see how the params are loaded from an &lt;span style=&quot;font-family: Courier New;&quot;&gt;.ini&lt;/span&gt; file and used slightly differently.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;How to use it:&lt;/b&gt;&lt;br /&gt;
On my staging (development) server I use the SQL profiler (the highlighted blue line), so if the profiler is enabled then I&#039;d like to see the SQL errors. If I am not profiling (on the live server) then I just raise the error like normal.&lt;/p&gt;
&lt;p&gt;You&#039;ll want to add your own logic into the adapter so it emails off the error report (or pasts it into an RSS feed or something)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>XUL Firefox add on sidebar open close events :: Programming</title><link>http://teethgrinder.co.uk/perm.php?id=353</link><description>&lt;p&gt;&lt;b&gt;Tags:&lt;/b&gt; &lt;span style=&quot;color: rgb(128, 0, 0);&quot;&gt;Firefox 3.x&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 0, 255);&quot;&gt;add-on&lt;/span&gt; &lt;span style=&quot;color: rgb(128, 0, 128);&quot;&gt;sidebar&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;What this post is about&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;I am coding a FIrefox add-on. It is fun. I am making a sidebar that you can drag and drop stuff onto. I need to know when the user has opened it or closed it (so I can persist the data) so after a lot of googling I figured it out.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;The code&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;This is how you can watch the open and close events of a sidebar. In your sidebar javascript file put this in:&lt;/p&gt;
&lt;p style=&quot;margin-left: 40px;&quot;&gt;&lt;span style=&quot;font-family: Courier New;&quot;&gt;var skratch = {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; onLoad: function(e) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; alert(&#039;load&#039;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; onUnload: function(e) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; alert(&#039;close&#039;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.addEventListener(&amp;quot;load&amp;quot;, function(e) { skratch.onLoad(e); }, false);&lt;br /&gt;
window.addEventListener(&amp;quot;unload&amp;quot;, function(e) { skratch.onUnload(e); }, false);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Hope that helps someone.&lt;/p&gt;
&lt;p&gt;Use this with &#039;save to file&#039; to persist data in your add-on - happy days. Happy fuckin days, man.&lt;/p&gt;
&lt;p&gt;Here is some save to file goodness (note: the code is GPL):&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://code.flickr.com/trac/browser/trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/file.js?rev=501&quot;&gt;http://code.flickr.com/ ... /uploadr/file.js?rev=501&lt;/a&gt;&lt;/p&gt;</description></item><item><title>MySQL compare sub query null :: Programming</title><link>http://teethgrinder.co.uk/perm.php?id=352</link><description>&lt;p&gt;Hey, this is cool. I had a query like so:&lt;/p&gt;
&lt;p style=&quot;margin-left: 40px;&quot;&gt;&lt;span style=&quot;font-family: Courier New;&quot;&gt;SELECT stuff&lt;br /&gt;
FROM table&lt;br /&gt;
WHERE&lt;br /&gt;
col = ( SELECT col FROM table_2 WHERE id IN (1,2,3) )&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;And the sub query was returning NULL sometimes. So I wanted the rows from table where col is null. But the syntax to do that would be:&lt;/p&gt;
&lt;p style=&quot;margin-left: 40px;&quot;&gt;&lt;span style=&quot;font-family: Courier New;&quot;&gt;SELECT stuff&lt;br /&gt;
FROM table&lt;br /&gt;
WHERE&lt;br /&gt;
col IS ( SELECT col FROM table_2 WHERE id IN (1,2,3) )&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Now this query isn&#039;t going to work when the sub query returns a number. The answer is to use this funky operator thatsolves this problem &lt;a href=&quot;http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html#operator_equal-to&quot;&gt;&lt;code class=&quot;literal&quot;&gt;&amp;lt;=&amp;gt;&lt;/code&gt;&lt;/a&gt;, the null safe equality operator:&lt;/p&gt;
&lt;p style=&quot;margin-left: 40px;&quot;&gt;&lt;span style=&quot;font-family: Courier New;&quot;&gt;SELECT stuff&lt;br /&gt;
FROM table&lt;br /&gt;
WHERE&lt;br /&gt;
col &amp;lt;=&amp;gt; ( SELECT col FROM table_2 WHERE id IN (1,2,3) )&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Smooth :-)&lt;/p&gt;</description></item>
</channel>
</rss>

