<?xml version="1.0" encoding="utf-8"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en">
<title>Fuzzy Buckets</title>
<link rel="alternate" type="text/html" href="http://www.fuzzybuckets.org/fuzzybuckets/" />
<modified>2011-12-20T13:10:24Z</modified>
<tagline>Metadatative musings</tagline>
<id>tag:www.fuzzybuckets.org,2011:/fuzzybuckets//5</id>
<generator url="http://www.movabletype.org/" version="3.17">Movable Type</generator>
<copyright>Copyright (c) 2011, pj</copyright>
<entry>
<title>rEFIt - Booting Linux with Bootcamp</title>
<link rel="alternate" type="text/html" href="http://www.fuzzybuckets.org/fuzzybuckets/archives/2011/12/refit_-_booting.html" />
<modified>2011-12-20T13:10:24Z</modified>
<issued>2011-12-20T13:10:24Z</issued>
<id>tag:www.fuzzybuckets.org,2011:/fuzzybuckets//5.2008</id>
<created>2011-12-20T13:10:24Z</created>
<summary type="text/plain">rEFIt - An EFI Boot Menu and Toolkit...</summary>
<author>
<name>pj</name>
<url>pj</url>
<email>paul.hollands@gmail.com</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.fuzzybuckets.org/fuzzybuckets/">
<![CDATA[<a title="rEFIt - An EFI Boot Menu and Toolkit" href="http://refit.sourceforge.net/">rEFIt - An EFI Boot Menu and Toolkit</a>

]]>

</content>
</entry>
<entry>
<title>Cast the results of a subquery as an array then join as a string</title>
<link rel="alternate" type="text/html" href="http://www.fuzzybuckets.org/fuzzybuckets/archives/2011/12/cast_the_result.html" />
<modified>2011-12-07T12:33:35Z</modified>
<issued>2011-12-07T12:31:07Z</issued>
<id>tag:www.fuzzybuckets.org,2011:/fuzzybuckets//5.2007</id>
<created>2011-12-07T12:31:07Z</created>
<summary type="text/plain"> select p.*, array_to_string(array(select first_name||&apos; &apos;||last_name from publications.authors a where a.publication_id = p.id), &apos;,&apos;) as aus , array_to_string(array(select first_name||&apos; &apos;||last_name from publications.editors e where e.publication_id = p.id), &apos;,&apos;) as eds from publications.publication_as_ris3 p where p.av in (&apos;Forthcoming&apos;,&apos;Published&apos;) and p.id in...</summary>
<author>
<name>pj</name>
<url>pj</url>
<email>paul.hollands@gmail.com</email>
</author>
<dc:subject>PostgreSQL</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.fuzzybuckets.org/fuzzybuckets/">
<![CDATA[<pre>
select p.*, <br/>
<span style="color: red;">array_to_string(array(select first_name||' '||last_name from publications.authors a where a.publication_id = p.id), ',') as aus </span>, 
<br/>
<span style="color: red;">array_to_string(array(select first_name||' '||last_name from publications.editors e where e.publication_id = p.id), ',') as eds</span> 
<br/>
from publications.publication_as_ris3 p<br/> 
where p.av in ('Forthcoming','Published') and p.id in ((select publication_id from publications.authors where first_name = 'Tony' and last_name = 'Kinder')union(select publication_id from publications.editors where first_name = 'Tony' and last_name = 'Kinder')) </pre>]]>

</content>
</entry>
<entry>
<title>Server replication in Postgres 9.1</title>
<link rel="alternate" type="text/html" href="http://www.fuzzybuckets.org/fuzzybuckets/archives/2011/11/server_replicat.html" />
<modified>2011-11-27T01:11:47Z</modified>
<issued>2011-11-26T12:10:02Z</issued>
<id>tag:www.fuzzybuckets.org,2011:/fuzzybuckets//5.2006</id>
<created>2011-11-26T12:10:02Z</created>
<summary type="text/plain">Postgres slave server in five minutes Files: Postgres_9.1_replication_standby_files.tar.gz Binary Replication in 6 Steps This 6-step guide, and all of the examples in this tutorial, assume that you have a master server at 192.168.0.1 and a standby server at 192.168.0.2 and...</summary>
<author>
<name>pj</name>
<url>pj</url>
<email>paul.hollands@gmail.com</email>
</author>
<dc:subject>PostgreSQL</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.fuzzybuckets.org/fuzzybuckets/">
<![CDATA[<a href="http://michael.otacoo.com/postgresql-2/postgres-9-1-setup-a-synchronous-stand-by-server-in-5-minutes/">Postgres slave server in five minutes</a> 
<br/>
<br/>
<a href="/Postgres_9.1_replication_standby_files.tar.gz">Files: Postgres_9.1_replication_standby_files.tar.gz</a>
<br/>
<br/>
<a name="Binary_Replication_in_6_Steps" id="Binary_Replication_in_6_Steps"></a><h2> <span class="mw-headline"> Binary Replication in 6 Steps </span></h2>
<p>This 6-step guide, and all of the examples in this tutorial, assume that you have a master server at 192.168.0.1 and a standby server at 192.168.0.2 and that your database and its configuration files are installed at /var/lib/postgresql/data.  Replace those with whatever your actual server addresses and directories are.
</p><p>1. Edit postgresql.conf on the master to turn on streaming replication. Change these settings:
</p>
<pre> listen_address = '*'
 wal_level = hot_standby
 max_wal_senders = 3
</pre>
<p>2. Edit pg_hba.conf on the master in order to let the standby connect. 
</p>
<pre> host  replication   all   192.168.0.2/32      trust
</pre>
<p>3. Edit recovery.conf and postgresql.conf on the standby to start up replication and hot standby.  First, in postgresql.conf, change this line:
</p>
<pre> hot_standby = on
</pre>
<p>Then create a file in the standby's <b>data directory</b> (which is often the same directory as postgresql.conf and pg_hba.conf, except on some Linux distributions such as Debian and Ubuntu), called recovery.conf, with the following lines:
</p>
<pre> standby_mode = 'on'
 primary_conninfo = 'host=192.168.0.1'
</pre>
<p>4. Shutdown the master and copy the files.  You want to copy most but not all files between the two servers, excluding the configuration files and the pg_xlog directory. 
</p>
<pre>tar cvzhf /Users/paulhollands/Desktop/data.tgz --exclude 'pg_xlog' --exclude 'postgresql.conf' data/
</pre>
<p>5. Start the standby first, so that they can't get out of sync.
</p><p>6. Start the master.
</p>

]]>

</content>
</entry>
<entry>
<title>Jython and Django Trial</title>
<link rel="alternate" type="text/html" href="http://www.fuzzybuckets.org/fuzzybuckets/archives/2011/11/jython_and_djan_1.html" />
<modified>2011-11-25T23:08:48Z</modified>
<issued>2011-11-25T23:02:16Z</issued>
<id>tag:www.fuzzybuckets.org,2011:/fuzzybuckets//5.2005</id>
<created>2011-11-25T23:02:16Z</created>
<summary type="text/plain"> # cd /Users/paulhollands/jython2.5.2/bin # django-admin.py startproject dss # jython manage.py runserver Validating models... 0 errors found Django version 1.3.1, using settings &apos;dss.settings&apos; Development server is running at http://127.0.0.1:8000/ Quit the server with CONTROL-C. [25/Nov/2011 23:00:47] &quot;GET / HTTP/1.1&quot; 200...</summary>
<author>
<name>pj</name>
<url>pj</url>
<email>paul.hollands@gmail.com</email>
</author>
<dc:subject>Jython</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.fuzzybuckets.org/fuzzybuckets/">
<![CDATA[<pre>
# cd /Users/paulhollands/jython2.5.2/bin
# django-admin.py startproject dss
# jython manage.py runserver
<span style="color: red">Validating models...

0 errors found
Django version 1.3.1, using settings 'dss.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
[25/Nov/2011 23:00:47] "GET / HTTP/1.1" 200 2045</span>
</pre>]]>

</content>
</entry>
<entry>
<title>Is Solaris running in 64bit mode?</title>
<link rel="alternate" type="text/html" href="http://www.fuzzybuckets.org/fuzzybuckets/archives/2011/11/is_solaris_runn.html" />
<modified>2011-11-23T14:21:09Z</modified>
<issued>2011-11-23T14:20:50Z</issued>
<id>tag:www.fuzzybuckets.org,2011:/fuzzybuckets//5.2004</id>
<created>2011-11-23T14:20:50Z</created>
<summary type="text/plain"> isainfo -v...</summary>
<author>
<name>pj</name>
<url>pj</url>
<email>paul.hollands@gmail.com</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.fuzzybuckets.org/fuzzybuckets/">
<![CDATA[<pre>
isainfo -v
</pre>]]>

</content>
</entry>
<entry>
<title>Spine JS Framework</title>
<link rel="alternate" type="text/html" href="http://www.fuzzybuckets.org/fuzzybuckets/archives/2011/11/spine_js_framew.html" />
<modified>2011-11-05T17:40:44Z</modified>
<issued>2011-11-05T17:40:44Z</issued>
<id>tag:www.fuzzybuckets.org,2011:/fuzzybuckets//5.2003</id>
<created>2011-11-05T17:40:44Z</created>
<summary type="text/plain">Spine...</summary>
<author>
<name>pj</name>
<url>pj</url>
<email>paul.hollands@gmail.com</email>
</author>
<dc:subject>JavaScript</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.fuzzybuckets.org/fuzzybuckets/">
<![CDATA[<p><a title="Spine" href="http://spinejs.com/docs/started">Spine</a></p>]]>

</content>
</entry>
<entry>
<title>Cast a date to Unix timestamp in Postgres</title>
<link rel="alternate" type="text/html" href="http://www.fuzzybuckets.org/fuzzybuckets/archives/2011/11/cast_a_date_to.html" />
<modified>2011-11-05T17:49:28Z</modified>
<issued>2011-11-01T11:31:08Z</issued>
<id>tag:www.fuzzybuckets.org,2011:/fuzzybuckets//5.2002</id>
<created>2011-11-01T11:31:08Z</created>
<summary type="text/plain"> &apos;2012-04-01&apos;::timestamp::abstime::int4...</summary>
<author>
<name>pj</name>
<url>pj</url>
<email>paul.hollands@gmail.com</email>
</author>
<dc:subject>PostgreSQL</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.fuzzybuckets.org/fuzzybuckets/">
<![CDATA[<pre>
'2012-04-01'<span style="color: red;">::timestamp::abstime::int4
</span>
</pre>]]>

</content>
</entry>
<entry>
<title>Detect an iPad and provide a non-Flash alternative</title>
<link rel="alternate" type="text/html" href="http://www.fuzzybuckets.org/fuzzybuckets/archives/2011/10/detect_an_ipad.html" />
<modified>2011-10-30T21:15:53Z</modified>
<issued>2011-10-30T20:40:46Z</issued>
<id>tag:www.fuzzybuckets.org,2011:/fuzzybuckets//5.2001</id>
<created>2011-10-30T20:40:46Z</created>
<summary type="text/plain"> try{ [&quot;iPad&quot;,&quot;iPod&quot;,&quot;iPhone&quot;].each( function(i){ if(navigator.userAgent.indexOf(i) &gt; -1){ //Do iPad stuff here } }); } catch(e){ var meh = &apos;meh&apos;; }...</summary>
<author>
<name>pj</name>
<url>pj</url>
<email>paul.hollands@gmail.com</email>
</author>
<dc:subject>jQuery</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.fuzzybuckets.org/fuzzybuckets/">
<![CDATA[<pre>
try{ ["iPad","iPod","iPhone"].each(

  function(i){

    if(navigator.userAgent.indexOf(i) > -1){

      //Do iPad stuff here

      }

   }); } catch(e){ var meh = 'meh'; }

</pre>]]>

</content>
</entry>
<entry>
<title>Jython and Django</title>
<link rel="alternate" type="text/html" href="http://www.fuzzybuckets.org/fuzzybuckets/archives/2011/10/jython_and_djan.html" />
<modified>2011-10-28T22:00:48Z</modified>
<issued>2011-10-28T22:00:48Z</issued>
<id>tag:www.fuzzybuckets.org,2011:/fuzzybuckets//5.2000</id>
<created>2011-10-28T22:00:48Z</created>
<summary type="text/plain">Chapter 14: Web Applications With Django — Jython Book v1.0 documentation...</summary>
<author>
<name>pj</name>
<url>pj</url>
<email>paul.hollands@gmail.com</email>
</author>
<dc:subject>Jython</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.fuzzybuckets.org/fuzzybuckets/">
<![CDATA[<p><a title="Chapter 14: Web Applications With Django — Jython Book v1.0 documentation" href="http://www.jython.org/jythonbook/en/1.0/JythonDjango.html#deploying-your-first-application">Chapter 14: Web Applications With Django — Jython Book v1.0 documentation</a></p>]]>

</content>
</entry>
<entry>
<title>Groooooooooovy</title>
<link rel="alternate" type="text/html" href="http://www.fuzzybuckets.org/fuzzybuckets/archives/2011/10/groooooooooovy.html" />
<modified>2011-10-28T21:41:43Z</modified>
<issued>2011-10-28T21:41:43Z</issued>
<id>tag:www.fuzzybuckets.org,2011:/fuzzybuckets//5.1999</id>
<created>2011-10-28T21:41:43Z</created>
<summary type="text/plain">Groovy - Home...</summary>
<author>
<name>pj</name>
<url>pj</url>
<email>paul.hollands@gmail.com</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.fuzzybuckets.org/fuzzybuckets/">
<![CDATA[<p><a title="Groovy - Home" href="http://groovy.codehaus.org/">Groovy - Home</a></p>]]>

</content>
</entry>
<entry>
<title>Matrix Asset Map for iOS</title>
<link rel="alternate" type="text/html" href="http://www.fuzzybuckets.org/fuzzybuckets/archives/2011/10/matrix_asset_ma.html" />
<modified>2011-10-26T21:55:19Z</modified>
<issued>2011-10-26T21:55:19Z</issued>
<id>tag:www.fuzzybuckets.org,2011:/fuzzybuckets//5.1998</id>
<created>2011-10-26T21:55:19Z</created>
<summary type="text/plain">Zed Said Studio - Squiz Matrix Asset Map for iOS...</summary>
<author>
<name>pj</name>
<url>pj</url>
<email>paul.hollands@gmail.com</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.fuzzybuckets.org/fuzzybuckets/">
<![CDATA[<p><a title="Zed Said Studio - Squiz Matrix Asset Map for iOS" href="http://www.zedsaid.com/blog/squiz-matrix-asset-map-for-ios">Zed Said Studio - Squiz Matrix Asset Map for iOS</a></p>]]>

</content>
</entry>
<entry>
<title>Textastic for iPad</title>
<link rel="alternate" type="text/html" href="http://www.fuzzybuckets.org/fuzzybuckets/archives/2011/10/textastic_for_i.html" />
<modified>2011-10-21T22:40:41Z</modified>
<issued>2011-10-21T22:40:41Z</issued>
<id>tag:www.fuzzybuckets.org,2011:/fuzzybuckets//5.1997</id>
<created>2011-10-21T22:40:41Z</created>
<summary type="text/plain">Textastic Code Editor for iPad on the iTunes App Store...</summary>
<author>
<name>pj</name>
<url>pj</url>
<email>paul.hollands@gmail.com</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.fuzzybuckets.org/fuzzybuckets/">
<![CDATA[<p><a title="Textastic Code Editor for iPad on the iTunes App Store" href="http://itunes.apple.com/us/app/textastic-code-editor/id383577124?mt=8">Textastic Code Editor for iPad on the iTunes App Store</a></p>]]>

</content>
</entry>
<entry>
<title>Alternately colour the rows in a table with jQuery</title>
<link rel="alternate" type="text/html" href="http://www.fuzzybuckets.org/fuzzybuckets/archives/2011/10/alternately_col.html" />
<modified>2011-10-19T18:44:31Z</modified>
<issued>2011-10-19T18:42:43Z</issued>
<id>tag:www.fuzzybuckets.org,2011:/fuzzybuckets//5.1996</id>
<created>2011-10-19T18:42:43Z</created>
<summary type="text/plain"> var color = &apos;#efefef&apos;; var counter = 0; function switch_bg(counter){ if(eval(counter/2) == eval(counter/2).toFixed(0)){ return color; } else { return &apos;white&apos;; } } jQuery(&apos;tbody tr&apos;).each( function(){ counter++; jQuery(this).find(&apos;td&apos;).each( function(){ jQuery(this).css({ &apos;background-color&apos; : switch_bg(counter) }); } ); } );...</summary>
<author>
<name>pj</name>
<url>pj</url>
<email>paul.hollands@gmail.com</email>
</author>
<dc:subject>jQuery</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.fuzzybuckets.org/fuzzybuckets/">
<![CDATA[<pre>
var color = '#efefef';

var counter = 0;

function switch_bg(counter){ 

    if(eval(counter/2) == eval(counter/2).toFixed(0)){ return color; } 

    else { return 'white'; } 

    }

jQuery('tbody tr').each(

	function(){ 
	
		counter++;  
		
		jQuery(this).find('td').each(
		
			function(){ 
			
				jQuery(this).css({ 'background-color' : switch_bg(counter) }); 
				
				}
			
			);
			
		}
			 
	);
</pre>]]>

</content>
</entry>
<entry>
<title>Student class needs to be adjusted</title>
<link rel="alternate" type="text/html" href="http://www.fuzzybuckets.org/fuzzybuckets/archives/2011/10/student_class_n.html" />
<modified>2011-10-11T19:12:29Z</modified>
<issued>2011-10-11T18:42:14Z</issued>
<id>tag:www.fuzzybuckets.org,2011:/fuzzybuckets//5.1995</id>
<created>2011-10-11T18:42:14Z</created>
<summary type="text/plain"> function get_hash_by_uun($uun){ return $this-&gt;get_hash_by_id($this-&gt;get_id_by_uun($uun)); } function get_id_by_uun($uun){ $m = (int) str_replace(&apos;s&apos;, &apos;&apos;, $uun); $reply = just::sql(sprintf(&quot;select student_id from student_full where matriculation_number = %d&quot;, $m)); return $reply[&apos;first_row&apos;][&apos;student_id&apos;]; } function get_uun_by_id($id){ $reply = just::sql( sprintf(&quot;select case when char_length(matriculation_number::varchar) = 5 then...</summary>
<author>
<name>pj</name>
<url>pj</url>
<email>paul.hollands@gmail.com</email>
</author>
<dc:subject>PHP</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.fuzzybuckets.org/fuzzybuckets/">
<![CDATA[<pre>
	function get_hash_by_uun($uun){
		
		return $this->get_hash_by_id($this->get_id_by_uun($uun)); 
		
		}

	function get_id_by_uun($uun){

		$m = (int) str_replace('s', '', $uun);
		
		$reply = just::sql(sprintf("select student_id from student_full where matriculation_number = %d", $m));
		
		return $reply['first_row']['student_id'];		

		}
		
	function get_uun_by_id($id){
	
		$reply = just::sql(
			sprintf("select case
			when char_length(matriculation_number::varchar) = 5 then 's00'||matriculation_number
			when char_length(matriculation_number::varchar) = 6 then 's0'||matriculation_number
			else 's'||matriculation_number end as uun from student_full where student_id = %d", (int) $id)
			);
	
		return $reply['first_row']['uun'];
	
		}
</pre>]]>

</content>
</entry>
<entry>
<title>Kill runaway Postgres threads</title>
<link rel="alternate" type="text/html" href="http://www.fuzzybuckets.org/fuzzybuckets/archives/2011/10/kill_runaway_po.html" />
<modified>2011-10-10T17:05:44Z</modified>
<issued>2011-10-10T17:05:44Z</issued>
<id>tag:www.fuzzybuckets.org,2011:/fuzzybuckets//5.1994</id>
<created>2011-10-10T17:05:44Z</created>
<summary type="text/plain"> kill `ps -ef | grep [p]ostgres | awk &apos;{print $2}&apos;`...</summary>
<author>
<name>pj</name>
<url>pj</url>
<email>paul.hollands@gmail.com</email>
</author>
<dc:subject>PostgreSQL</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.fuzzybuckets.org/fuzzybuckets/">
<![CDATA[<pre>
kill `ps -ef | grep [p]ostgres | awk '{print $2}'`
</pre>
]]>

</content>
</entry>

</feed>
