<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0" 
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:admin="http://webns.net/mvcb/"
	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
	
	<channel>
		<title>Frakkle</title>
		<link>http://frakkle.com/</link>
		<description>a spot on the internet</description>
		<dc:language>en</dc:language>
		<dc:creator></dc:creator>
		<dc:rights>Copyright 2008</dc:rights>
		<dc:date>2008-09-23T21:17:33-07:00</dc:date>
		<admin:generatorAgent rdf:resource="http://www.pivotlog.net/?ver=Pivot+-+1.40.5%3A+%27Dreadwind%27" />
		<admin:errorReportsTo rdf:resource="mailto:rsserrors@pivotlog.net"/>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
		<sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
		
		
		
		
		<item>
			<title>Hoops to jump through if using Oracle 10g (instead of Postgres 6+)</title>
			<link>http://frakkle.com/entry/108/hoops_to_jump_through_if_using</link>
			<comments>http://frakkle.com/entry/108/hoops_to_jump_through_if_using#comm</comments>
			<description><p>I've been using PostgreSQL for years, and I've often made use of cacheing of functions.</p>
<p>Last year I discovered - working on an Oracle 10g environment, that any sort of caching of functinon results does not exist.&nbsp; (It does for 11, though)&nbsp; This totally blew me away, and lead to the following soluction.&nbsp; PostgreSQL people may enjoy reading what they can happily avoid...&nbsp; </p>
<p>The&nbsp;solution utilises oracle Packages.&nbsp; These are assembles of functions and procedures that stay in memory for a time after first being called.&nbsp; The packages can contain member private variables - and these are what we use to cache the results.</p>
<p>The result of doing this calculation in a cached function was a halving of run-time.</p>

<blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
<p>CREATE OR REPLACE PACKAGE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SCHEMA.etl_utils IS<br  />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FUNCTION cache_clear RETURN INTEGER;<br  />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FUNCTION keyword_text_clean(i_rawtext IN VARCHAR2 ) RETURN VARCHAR2;<br  />END etl_utils;</p>
<p>create or replace PACKAGE BODY&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SCHEMA.etl_utils IS<br  />&nbsp;&nbsp;&nbsp; TYPE assoc_array_str_type IS TABLE OF VARCHAR2(200) INDEX BY VARCHAR2(200);<br  />&nbsp;&nbsp;&nbsp; TYPE array_num_type IS TABLE OF number INDEX BY pls_integer;&nbsp;&nbsp;&nbsp; <br  />&nbsp;&nbsp;&nbsp; TYPE assoc_array_nums_type IS TABLE OF array_num_type INDEX BY VARCHAR2(200);<br  />&nbsp;&nbsp;&nbsp; <br  />&nbsp;&nbsp;&nbsp; assoc_array_str assoc_array_str_type;<br  />&nbsp;&nbsp;&nbsp; <br  />&nbsp;&nbsp;&nbsp; assoc_array_nums assoc_array_nums_type;</p>
<p>&nbsp;&nbsp;&nbsp; FUNCTION cache_clear RETURN INTEGER<br  />&nbsp;&nbsp;&nbsp; AS<br  />&nbsp;&nbsp;&nbsp; BEGIN<br  />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; assoc_array_str.DELETE;<br  />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; assoc_array_nums.DELETE;<br  />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RETURN 1;<br  />&nbsp;&nbsp;&nbsp; END;<br  /></p>
<p>&nbsp;&nbsp;&nbsp; FUNCTION keyword_text_clean(i_rawtext IN VARCHAR2 ) RETURN VARCHAR2<br  />&nbsp;&nbsp;&nbsp; AS<br  />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l_out VARCHAR2(200);<br  />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l_out_upper VARCHAR2(200);<br  />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l_key VARCHAR2(200);<br  />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l_found BOOLEAN := TRUE; -- set to TRUE to enable caching<br  />&nbsp;&nbsp;&nbsp; BEGIN<br  />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l_key := trim(i_rawtext);<br  />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BEGIN<br  />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l_out := assoc_array_str( l_key );<br  />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXCEPTION<br  />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WHEN OTHERS THEN<br  />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l_found := FALSE;<br  />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; END;</p>
<p><font color="darkgreen">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --sometimes short text comes back NULL erroneously<br  />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --this means we can't rely on looking up the keys that should resovle to null<br  />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --pain but makes only a small difference</font><br  />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IF l_out IS NULL THEN<br  />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l_found := FALSE;<br  />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; END IF;</p>
<p><font color="darkgreen">--do calculation for value and store in array-cache.</font><br  />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IF NOT l_found THEN</p>
<p>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l_out := .....</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; assoc_array_str( l_key ) := l_out;<br  />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; END IF;<br  />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RETURN l_out;<br  />&nbsp;&nbsp;&nbsp; END;</p>

<p><a href="http://frakkle.com">http://frakkle.com</a></p></blockquote></description>
			<guid isPermaLink="false">108@http://frakkle.com</guid>
			<content:encoded><![CDATA[ <p>I've been using PostgreSQL for years, and I've often made use of cacheing of functions.</p>
<p>Last year I discovered - working on an Oracle 10g environment, that any sort of caching of functinon results does not exist.  (It does for 11, though)  This totally blew me away, and lead to the following soluction.  PostgreSQL people may enjoy reading what they can happily avoid...  </p>
<p>The solution utilises oracle Packages.  These are assembles of functions and procedures that stay in memory for a time after first being called.  The packages can contain member private variables - and these are what we use to cache the results.</p>
<p>The result of doing this calculation in a cached function was a halving of run-time.</p>

<blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
<p>CREATE OR REPLACE PACKAGE         SCHEMA.etl_utils IS<br  />       FUNCTION cache_clear RETURN INTEGER;<br  />       FUNCTION keyword_text_clean(i_rawtext IN VARCHAR2 ) RETURN VARCHAR2;<br  />END etl_utils;</p>
<p>create or replace PACKAGE BODY         SCHEMA.etl_utils IS<br  />    TYPE assoc_array_str_type IS TABLE OF VARCHAR2(200) INDEX BY VARCHAR2(200);<br  />    TYPE array_num_type IS TABLE OF number INDEX BY pls_integer;    <br  />    TYPE assoc_array_nums_type IS TABLE OF array_num_type INDEX BY VARCHAR2(200);<br  />    <br  />    assoc_array_str assoc_array_str_type;<br  />    <br  />    assoc_array_nums assoc_array_nums_type;</p>
<p>    FUNCTION cache_clear RETURN INTEGER<br  />    AS<br  />    BEGIN<br  />         assoc_array_str.DELETE;<br  />         assoc_array_nums.DELETE;<br  />         RETURN 1;<br  />    END;<br  /></p>
<p>    FUNCTION keyword_text_clean(i_rawtext IN VARCHAR2 ) RETURN VARCHAR2<br  />    AS<br  />      l_out VARCHAR2(200);<br  />      l_out_upper VARCHAR2(200);<br  />      l_key VARCHAR2(200);<br  />      l_found BOOLEAN := TRUE; -- set to TRUE to enable caching<br  />    BEGIN<br  />        l_key := trim(i_rawtext);<br  />        BEGIN<br  />              l_out := assoc_array_str( l_key );<br  />        EXCEPTION<br  />                WHEN OTHERS THEN<br  />                     l_found := FALSE;<br  />         END;</p>
<p><font color="darkgreen">         --sometimes short text comes back NULL erroneously<br  />         --this means we can't rely on looking up the keys that should resovle to null<br  />         --pain but makes only a small difference</font><br  />         IF l_out IS NULL THEN<br  />                  l_found := FALSE;<br  />         END IF;</p>
<p><font color="darkgreen">--do calculation for value and store in array-cache.</font><br  />         IF NOT l_found THEN</p>
<p>              l_out := .....</p>
<p>              assoc_array_str( l_key ) := l_out;<br  />         END IF;<br  />         RETURN l_out;<br  />    END;</p>

<p><a href="http://frakkle.com">http://frakkle.com</a></p></blockquote> ]]></content:encoded>
			<dc:subject>postgresql</dc:subject>
			<dc:date>2008-09-23T21:17:00-07:00</dc:date>
		</item>
		
		
		
		<item>
			<title>in response to: Need Help Reducing View Calculations</title>
			<link>http://frakkle.com/entry/106/in_response_to_need_help_reduc</link>
			<comments>http://frakkle.com/entry/106/in_response_to_need_help_reduc#comm</comments>
			<description><p>
I&#39;m posting this via trackback because of a&nbsp;strange posting problem:&nbsp; (layout is strange and missing the email field?&nbsp; Yes I am using a crud browser from here... that could be it)&nbsp; 
</p>
<p>
I have to agree with Hernan. 
</p>
<p>
The simplest saving I can see is an extra column to save on the &quot;run time&quot; calculation.&nbsp; This does not have to be dangerous (ie potentially different to the date column you have already)Just setup a trigger for whenever the existing date column gets updated(/inserted) to update the extra column. 
</p>
<p>
Another alternative is to use a materialised view.&nbsp; On Postgres this is a manual process involving setting up a view and rules, and ig you want it always up to date, triggers again on the source table to update the materialised view whenever the data changes.&nbsp; 
</p>
<p>
This latter idea would be the fastest - faster than your original view by quite a margin, in fact.&nbsp; You may then be able to get rid of some (all?) indexes you have already on the existing table - because they would no longer be needed. 
</p>
<p>
One thing I think would be handy that I have on my list of &quot;when I get time&quot; is to write some reasonably automatic code to do materialised views without the manual coding (ala Oracle).&nbsp; People may use these things more if they were a bit more simple to do. 
</p>
<p>
Link to <em>Need Help Reducing View Calculations</em> page: <a href="http://www.justatheory.com/computers/databases/postgresql/reducing_view_calculations.html">http://www.justatheory.com/computers/databases/postgresql/reducing_view_calculations.html</a></p></description>
			<guid isPermaLink="false">106@http://frakkle.com</guid>
			<content:encoded><![CDATA[ <p>
I&#39;m posting this via trackback because of a strange posting problem:  (layout is strange and missing the email field?  Yes I am using a crud browser from here... that could be it)  
</p>
<p>
I have to agree with Hernan. 
</p>
<p>
The simplest saving I can see is an extra column to save on the &quot;run time&quot; calculation.  This does not have to be dangerous (ie potentially different to the date column you have already)Just setup a trigger for whenever the existing date column gets updated(/inserted) to update the extra column. 
</p>
<p>
Another alternative is to use a materialised view.  On Postgres this is a manual process involving setting up a view and rules, and ig you want it always up to date, triggers again on the source table to update the materialised view whenever the data changes.  
</p>
<p>
This latter idea would be the fastest - faster than your original view by quite a margin, in fact.  You may then be able to get rid of some (all?) indexes you have already on the existing table - because they would no longer be needed. 
</p>
<p>
One thing I think would be handy that I have on my list of &quot;when I get time&quot; is to write some reasonably automatic code to do materialised views without the manual coding (ala Oracle).  People may use these things more if they were a bit more simple to do. 
</p>
<p>
Link to <em>Need Help Reducing View Calculations</em> page: <a href="http://www.justatheory.com/computers/databases/postgresql/reducing_view_calculations.html">http://www.justatheory.com/computers/databases/postgresql/reducing_view_calculations.html</a></p> ]]></content:encoded>
			<dc:subject>postgresql</dc:subject>
			<dc:date>2007-11-07T18:18:00-07:00</dc:date>
		</item>
		
		
		
		<item>
			<title>Data Warehouse / Business Intelligence - PostgreSQL or Oracle</title>
			<link>http://frakkle.com/entry/105/data_warehouse__business_intel</link>
			<comments>http://frakkle.com/entry/105/data_warehouse__business_intel#comm</comments>
			<description><p>
I&#39;ve just started a new contract for a Federal department where an old&nbsp;grants management system is being replaced with a PostgreSQL/Java based version.&nbsp; The sister project (sub project really) is a data warehouse.&nbsp; The choices were Oracle or PostgreSQL (PostgreSQL was what attracted me to the contract actually) 
</p>
<p>
The argument that I have been unable to win in putting together a warehouse on PostgreSQL comes down to tool maturity - ie the risk involved in something &quot;not proven&quot; so it is almost certainly going to be built using Oracle Warehouse Builder and a BI tool tbd. 
</p>
<p>
I have a long history with databases, and experience with PostgreSQL that dates to the beginning of version 7, however I&#39;ve never been involved in formal datawarehousing or ETL - so I can&#39;t speak with the authority I would prefer ;-) 
</p>
<p>
From my research (mostly involving asking Liam at Fujitsu) Bizgres which seems to be still at the &quot;not finished&quot; stage, and Jasper.&nbsp; I have experience in Jasper products from some time back - they looked very good then - so I can&#39;t wait to try out JasperETL. 
</p>
<p>
In any case I am likely to do a parallel run of the work with OWB using Jasper/Postgres to see how they go in my own time.&nbsp; I would welcome any comments on all this - particularly if they can be backed up with real-world datawarehousing projects. 
</p>
<p>
For those wondering about this blog, family illness has kept me from this for some time, unfortunately...&nbsp;something that is now coming to an end in a good way. 
</p>
<p>
Cheers, 
</p>
<p>
Mathew Frank (<a href="http://frakkle.com/">http://frakkle.com</a>)</p></description>
			<guid isPermaLink="false">105@http://frakkle.com</guid>
			<content:encoded><![CDATA[ <p>
I&#39;ve just started a new contract for a Federal department where an old grants management system is being replaced with a PostgreSQL/Java based version.  The sister project (sub project really) is a data warehouse.  The choices were Oracle or PostgreSQL (PostgreSQL was what attracted me to the contract actually) 
</p>
<p>
The argument that I have been unable to win in putting together a warehouse on PostgreSQL comes down to tool maturity - ie the risk involved in something &quot;not proven&quot; so it is almost certainly going to be built using Oracle Warehouse Builder and a BI tool tbd. 
</p>
<p>
I have a long history with databases, and experience with PostgreSQL that dates to the beginning of version 7, however I&#39;ve never been involved in formal datawarehousing or ETL - so I can&#39;t speak with the authority I would prefer ;-) 
</p>
<p>
From my research (mostly involving asking Liam at Fujitsu) Bizgres which seems to be still at the &quot;not finished&quot; stage, and Jasper.  I have experience in Jasper products from some time back - they looked very good then - so I can&#39;t wait to try out JasperETL. 
</p>
<p>
In any case I am likely to do a parallel run of the work with OWB using Jasper/Postgres to see how they go in my own time.  I would welcome any comments on all this - particularly if they can be backed up with real-world datawarehousing projects. 
</p>
<p>
For those wondering about this blog, family illness has kept me from this for some time, unfortunately... something that is now coming to an end in a good way. 
</p>
<p>
Cheers, 
</p>
<p>
Mathew Frank (<a href="http://frakkle.com/">http://frakkle.com</a>)</p> ]]></content:encoded>
			<dc:subject>default, postgresql</dc:subject>
			<dc:date>2007-06-15T01:48:00-07:00</dc:date>
		</item>
		
		
		
		<item>
			<title>Finally a Keyword Competition System as I Would Build It</title>
			<link>http://frakkle.com/entry/104/finally_a_keyword_competition_</link>
			<comments>http://frakkle.com/entry/104/finally_a_keyword_competition_#comm</comments>
			<description>With thanks to Rebecca @ seomoz for finding it - this system looks really good for people wanting more than just classic "keyword research" and really want focused business information on what is happening in the market.<br  /><br  />I highly recommend you check it out - the free vesion is very good.&nbsp; Well done guys!<br  /><br  /><a href="http://www.keycompete.com/">http://www.keycompete.com/</a></p><br  />For a more complete pulling about of the service, look here:&nbsp; <a href="http://feeds.feedburner.com/%7Er/seomoz/%7E3/64378835/blogdetail.php">http://feeds.feedburner.com/~r/seomoz/~3/64378835/blogdetail.php</a><br  /><br  />Cheers,<br  /><a href="http://frakkle.com">Mathew Frank</a></description>
			<guid isPermaLink="false">104@http://frakkle.com</guid>
			<content:encoded><![CDATA[ With thanks to Rebecca @ seomoz for finding it - this system looks really good for people wanting more than just classic "keyword research" and really want focused business information on what is happening in the market.<br  /><br  />I highly recommend you check it out - the free vesion is very good.  Well done guys!<br  /><br  /><a href="http://www.keycompete.com/">http://www.keycompete.com/</a></p><br  />For a more complete pulling about of the service, look here:  <a href="http://feeds.feedburner.com/%7Er/seomoz/%7E3/64378835/blogdetail.php">http://feeds.feedburner.com/~r/seomoz/~3/64378835/blogdetail.php</a><br  /><br  />Cheers,<br  /><a href="http://frakkle.com">Mathew Frank</a> ]]></content:encoded>
			<dc:subject>default</dc:subject>
			<dc:date>2006-12-21T03:38:00-07:00</dc:date>
		</item>
		
		
		
		<item>
			<title>PHP mime_content_type() Alternative avoiding PECL and PHPCompat</title>
			<link>http://frakkle.com/entry/103/php_mime_content_type_alternat</link>
			<comments>http://frakkle.com/entry/103/php_mime_content_type_alternat#comm</comments>
			<description>Okay - its been a long time between posts (that's code for very busy).&nbsp; The following is something I came accross while installing a membership system on somebody elses server.&nbsp; Aside from old PHP4, there were missing libraries...&nbsp; this is the result.<br  /><br  />If mime_content_type is unavailable, and so is the PECL FileInfo library and so is the shell (in which case you are pretty annoyed by now) here is an alternative that falls back on the file extension - instead of 'magic'.<br  /><br  />I took the mime list basically and used that for the extension check.&nbsp; note that unlike 'magic' file detection this will get fooled by a bad extension.&nbsp; So a PDF file called file.zip will be reported as an 'application/zip' file.<br  /><br  />Like the PHP Compat library, this falls back to 'application/octet-stream'<br  /><br  /><pre>&lt;?php<br  />if (!function_exists('mime_content_type')) {<br  />	function mime_content_type($filename) {<br  />		$idx = strtolower(end( explode( '.', $filename )) );<br  />		$mimet = array(	'ai' =&gt;'application/postscript',<br  />			'aif' =&gt;'audio/x-aiff',<br  />			'aifc' =&gt;'audio/x-aiff',<br  />			'aiff' =&gt;'audio/x-aiff',<br  />			'asc' =&gt;'text/plain',<br  />			'atom' =&gt;'application/atom+xml',<br  />			'avi' =&gt;'video/x-msvideo',<br  />			'bcpio' =&gt;'application/x-bcpio',<br  />			'bmp' =&gt;'image/bmp',<br  />			'cdf' =&gt;'application/x-netcdf',<br  />			'cgm' =&gt;'image/cgm',<br  />			'cpio' =&gt;'application/x-cpio',<br  />			'cpt' =&gt;'application/mac-compactpro',<br  />			'crl' =&gt;'application/x-pkcs7-crl',<br  />			'crt' =&gt;'application/x-x509-ca-cert',<br  />			'csh' =&gt;'application/x-csh',<br  />			'css' =&gt;'text/css',<br  />			'dcr' =&gt;'application/x-director',<br  />			'dir' =&gt;'application/x-director',<br  />			'djv' =&gt;'image/vnd.djvu',<br  />			'djvu' =&gt;'image/vnd.djvu',<br  />			'doc' =&gt;'application/msword',<br  />			'dtd' =&gt;'application/xml-dtd',<br  />			'dvi' =&gt;'application/x-dvi',<br  />			'dxr' =&gt;'application/x-director',<br  />			'eps' =&gt;'application/postscript',<br  />			'etx' =&gt;'text/x-setext',<br  />			'ez' =&gt;'application/andrew-inset',<br  />			'gif' =&gt;'image/gif',<br  />			'gram' =&gt;'application/srgs',<br  />			'grxml' =&gt;'application/srgs+xml',<br  />			'gtar' =&gt;'application/x-gtar',<br  />			'hdf' =&gt;'application/x-hdf',<br  />			'hqx' =&gt;'application/mac-binhex40',<br  />			'html' =&gt;'text/html',<br  />			'html' =&gt;'text/html',<br  />			'ice' =&gt;'x-conference/x-cooltalk',<br  />			'ico' =&gt;'image/x-icon',<br  />			'ics' =&gt;'text/calendar',<br  />			'ief' =&gt;'image/ief',<br  />			'ifb' =&gt;'text/calendar',<br  />			'iges' =&gt;'model/iges',<br  />			'igs' =&gt;'model/iges',<br  />			'jpe' =&gt;'image/jpeg',<br  />			'jpeg' =&gt;'image/jpeg',<br  />			'jpg' =&gt;'image/jpeg',<br  />			'js' =&gt;'application/x-javascript',<br  />			'kar' =&gt;'audio/midi',<br  />			'latex' =&gt;'application/x-latex',<br  />			'm3u' =&gt;'audio/x-mpegurl',<br  />			'man' =&gt;'application/x-troff-man',<br  />			'mathml' =&gt;'application/mathml+xml',<br  />			'me' =&gt;'application/x-troff-me',<br  />			'mesh' =&gt;'model/mesh',<br  />			'mid' =&gt;'audio/midi',<br  />			'midi' =&gt;'audio/midi',<br  />			'mif' =&gt;'application/vnd.mif',<br  />			'mov' =&gt;'video/quicktime',<br  />			'movie' =&gt;'video/x-sgi-movie',<br  />			'mp2' =&gt;'audio/mpeg',<br  />			'mp3' =&gt;'audio/mpeg',<br  />			'mpe' =&gt;'video/mpeg',<br  />			'mpeg' =&gt;'video/mpeg',<br  />			'mpg' =&gt;'video/mpeg',<br  />			'mpga' =&gt;'audio/mpeg',<br  />			'ms' =&gt;'application/x-troff-ms',<br  />			'msh' =&gt;'model/mesh',<br  />			'mxu m4u' =&gt;'video/vnd.mpegurl',<br  />			'nc' =&gt;'application/x-netcdf',<br  />			'oda' =&gt;'application/oda',<br  />			'ogg' =&gt;'application/ogg',<br  />			'pbm' =&gt;'image/x-portable-bitmap',<br  />			'pdb' =&gt;'chemical/x-pdb',<br  />			'pdf' =&gt;'application/pdf',<br  />			'pgm' =&gt;'image/x-portable-graymap',<br  />			'pgn' =&gt;'application/x-chess-pgn',<br  />			'php' =&gt;'application/x-httpd-php',<br  />			'php4' =&gt;'application/x-httpd-php',<br  />			'php3' =&gt;'application/x-httpd-php',<br  />			'phtml' =&gt;'application/x-httpd-php',<br  />			'phps' =&gt;'application/x-httpd-php-source',<br  />			'png' =&gt;'image/png',<br  />			'pnm' =&gt;'image/x-portable-anymap',<br  />			'ppm' =&gt;'image/x-portable-pixmap',<br  />			'ppt' =&gt;'application/vnd.ms-powerpoint',<br  />			'ps' =&gt;'application/postscript',<br  />			'qt' =&gt;'video/quicktime',<br  />			'ra' =&gt;'audio/x-pn-realaudio',<br  />			'ram' =&gt;'audio/x-pn-realaudio',<br  />			'ras' =&gt;'image/x-cmu-raster',<br  />			'rdf' =&gt;'application/rdf+xml',<br  />			'rgb' =&gt;'image/x-rgb',<br  />			'rm' =&gt;'application/vnd.rn-realmedia',<br  />			'roff' =&gt;'application/x-troff',<br  />			'rtf' =&gt;'text/rtf',<br  />			'rtx' =&gt;'text/richtext',<br  />			'sgm' =&gt;'text/sgml',<br  />			'sgml' =&gt;'text/sgml',<br  />			'sh' =&gt;'application/x-sh',<br  />			'shar' =&gt;'application/x-shar',<br  />			'shtml' =&gt;'text/html',<br  />			'silo' =&gt;'model/mesh',<br  />			'sit' =&gt;'application/x-stuffit',<br  />			'skd' =&gt;'application/x-koan',<br  />			'skm' =&gt;'application/x-koan',<br  />			'skp' =&gt;'application/x-koan',<br  />			'skt' =&gt;'application/x-koan',<br  />			'smi' =&gt;'application/smil',<br  />			'smil' =&gt;'application/smil',<br  />			'snd' =&gt;'audio/basic',<br  />			'spl' =&gt;'application/x-futuresplash',<br  />			'src' =&gt;'application/x-wais-source',<br  />			'sv4cpio' =&gt;'application/x-sv4cpio',<br  />			'sv4crc' =&gt;'application/x-sv4crc',<br  />			'svg' =&gt;'image/svg+xml',<br  />			'swf' =&gt;'application/x-shockwave-flash',<br  />			't' =&gt;'application/x-troff',<br  />			'tar' =&gt;'application/x-tar',<br  />			'tcl' =&gt;'application/x-tcl',<br  />			'tex' =&gt;'application/x-tex',<br  />			'texi' =&gt;'application/x-texinfo',<br  />			'texinfo' =&gt;'application/x-texinfo',<br  />			'tgz' =&gt;'application/x-tar',<br  />			'tif' =&gt;'image/tiff',<br  />			'tiff' =&gt;'image/tiff',<br  />			'tr' =&gt;'application/x-troff',<br  />			'tsv' =&gt;'text/tab-separated-values',<br  />			'txt' =&gt;'text/plain',<br  />			'ustar' =&gt;'application/x-ustar',<br  />			'vcd' =&gt;'application/x-cdlink',<br  />			'vrml' =&gt;'model/vrml',<br  />			'vxml' =&gt;'application/voicexml+xml',<br  />			'wav' =&gt;'audio/x-wav',<br  />			'wbmp' =&gt;'image/vnd.wap.wbmp',<br  />			'wbxml' =&gt;'application/vnd.wap.wbxml',<br  />			'wml' =&gt;'text/vnd.wap.wml',<br  />			'wmlc' =&gt;'application/vnd.wap.wmlc',<br  />			'wmlc' =&gt;'application/vnd.wap.wmlc',<br  />			'wmls' =&gt;'text/vnd.wap.wmlscript',<br  />			'wmlsc' =&gt;'application/vnd.wap.wmlscriptc',<br  />			'wmlsc' =&gt;'application/vnd.wap.wmlscriptc',<br  />			'wrl' =&gt;'model/vrml',<br  />			'xbm' =&gt;'image/x-xbitmap',<br  />			'xht' =&gt;'application/xhtml+xml',<br  />			'xhtml' =&gt;'application/xhtml+xml',<br  />			'xls' =&gt;'application/vnd.ms-excel',<br  />			'xml xsl' =&gt;'application/xml',<br  />			'xpm' =&gt;'image/x-xpixmap',<br  />			'xslt' =&gt;'application/xslt+xml',<br  />			'xul' =&gt;'application/vnd.mozilla.xul+xml',<br  />			'xwd' =&gt;'image/x-xwindowdump',<br  />			'xyz' =&gt;'chemical/x-xyz',<br  />			'zip' =&gt;'application/zip'<br  />		);<br  /><br  />		if (isset( $mimet[$idx] )) {<br  />			return $mimet[$idx];<br  />		} else {<br  />			return 'application/octet-stream';<br  />		}<br  />	}<br  />}<br  />?&gt;</pre></description>
			<guid isPermaLink="false">103@http://frakkle.com</guid>
			<content:encoded><![CDATA[ Okay - its been a long time between posts (that's code for very busy).  The following is something I came accross while installing a membership system on somebody elses server.  Aside from old PHP4, there were missing libraries...  this is the result.<br  /><br  />If mime_content_type is unavailable, and so is the PECL FileInfo library and so is the shell (in which case you are pretty annoyed by now) here is an alternative that falls back on the file extension - instead of 'magic'.<br  /><br  />I took the mime list basically and used that for the extension check.  note that unlike 'magic' file detection this will get fooled by a bad extension.  So a PDF file called file.zip will be reported as an 'application/zip' file.<br  /><br  />Like the PHP Compat library, this falls back to 'application/octet-stream'<br  /><br  /><pre>&lt;?php<br  />if (!function_exists('mime_content_type')) {<br  />	function mime_content_type($filename) {<br  />		$idx = strtolower(end( explode( '.', $filename )) );<br  />		$mimet = array(	'ai' =&gt;'application/postscript',<br  />			'aif' =&gt;'audio/x-aiff',<br  />			'aifc' =&gt;'audio/x-aiff',<br  />			'aiff' =&gt;'audio/x-aiff',<br  />			'asc' =&gt;'text/plain',<br  />			'atom' =&gt;'application/atom+xml',<br  />			'avi' =&gt;'video/x-msvideo',<br  />			'bcpio' =&gt;'application/x-bcpio',<br  />			'bmp' =&gt;'image/bmp',<br  />			'cdf' =&gt;'application/x-netcdf',<br  />			'cgm' =&gt;'image/cgm',<br  />			'cpio' =&gt;'application/x-cpio',<br  />			'cpt' =&gt;'application/mac-compactpro',<br  />			'crl' =&gt;'application/x-pkcs7-crl',<br  />			'crt' =&gt;'application/x-x509-ca-cert',<br  />			'csh' =&gt;'application/x-csh',<br  />			'css' =&gt;'text/css',<br  />			'dcr' =&gt;'application/x-director',<br  />			'dir' =&gt;'application/x-director',<br  />			'djv' =&gt;'image/vnd.djvu',<br  />			'djvu' =&gt;'image/vnd.djvu',<br  />			'doc' =&gt;'application/msword',<br  />			'dtd' =&gt;'application/xml-dtd',<br  />			'dvi' =&gt;'application/x-dvi',<br  />			'dxr' =&gt;'application/x-director',<br  />			'eps' =&gt;'application/postscript',<br  />			'etx' =&gt;'text/x-setext',<br  />			'ez' =&gt;'application/andrew-inset',<br  />			'gif' =&gt;'image/gif',<br  />			'gram' =&gt;'application/srgs',<br  />			'grxml' =&gt;'application/srgs+xml',<br  />			'gtar' =&gt;'application/x-gtar',<br  />			'hdf' =&gt;'application/x-hdf',<br  />			'hqx' =&gt;'application/mac-binhex40',<br  />			'html' =&gt;'text/html',<br  />			'html' =&gt;'text/html',<br  />			'ice' =&gt;'x-conference/x-cooltalk',<br  />			'ico' =&gt;'image/x-icon',<br  />			'ics' =&gt;'text/calendar',<br  />			'ief' =&gt;'image/ief',<br  />			'ifb' =&gt;'text/calendar',<br  />			'iges' =&gt;'model/iges',<br  />			'igs' =&gt;'model/iges',<br  />			'jpe' =&gt;'image/jpeg',<br  />			'jpeg' =&gt;'image/jpeg',<br  />			'jpg' =&gt;'image/jpeg',<br  />			'js' =&gt;'application/x-javascript',<br  />			'kar' =&gt;'audio/midi',<br  />			'latex' =&gt;'application/x-latex',<br  />			'm3u' =&gt;'audio/x-mpegurl',<br  />			'man' =&gt;'application/x-troff-man',<br  />			'mathml' =&gt;'application/mathml+xml',<br  />			'me' =&gt;'application/x-troff-me',<br  />			'mesh' =&gt;'model/mesh',<br  />			'mid' =&gt;'audio/midi',<br  />			'midi' =&gt;'audio/midi',<br  />			'mif' =&gt;'application/vnd.mif',<br  />			'mov' =&gt;'video/quicktime',<br  />			'movie' =&gt;'video/x-sgi-movie',<br  />			'mp2' =&gt;'audio/mpeg',<br  />			'mp3' =&gt;'audio/mpeg',<br  />			'mpe' =&gt;'video/mpeg',<br  />			'mpeg' =&gt;'video/mpeg',<br  />			'mpg' =&gt;'video/mpeg',<br  />			'mpga' =&gt;'audio/mpeg',<br  />			'ms' =&gt;'application/x-troff-ms',<br  />			'msh' =&gt;'model/mesh',<br  />			'mxu m4u' =&gt;'video/vnd.mpegurl',<br  />			'nc' =&gt;'application/x-netcdf',<br  />			'oda' =&gt;'application/oda',<br  />			'ogg' =&gt;'application/ogg',<br  />			'pbm' =&gt;'image/x-portable-bitmap',<br  />			'pdb' =&gt;'chemical/x-pdb',<br  />			'pdf' =&gt;'application/pdf',<br  />			'pgm' =&gt;'image/x-portable-graymap',<br  />			'pgn' =&gt;'application/x-chess-pgn',<br  />			'php' =&gt;'application/x-httpd-php',<br  />			'php4' =&gt;'application/x-httpd-php',<br  />			'php3' =&gt;'application/x-httpd-php',<br  />			'phtml' =&gt;'application/x-httpd-php',<br  />			'phps' =&gt;'application/x-httpd-php-source',<br  />			'png' =&gt;'image/png',<br  />			'pnm' =&gt;'image/x-portable-anymap',<br  />			'ppm' =&gt;'image/x-portable-pixmap',<br  />			'ppt' =&gt;'application/vnd.ms-powerpoint',<br  />			'ps' =&gt;'application/postscript',<br  />			'qt' =&gt;'video/quicktime',<br  />			'ra' =&gt;'audio/x-pn-realaudio',<br  />			'ram' =&gt;'audio/x-pn-realaudio',<br  />			'ras' =&gt;'image/x-cmu-raster',<br  />			'rdf' =&gt;'application/rdf+xml',<br  />			'rgb' =&gt;'image/x-rgb',<br  />			'rm' =&gt;'application/vnd.rn-realmedia',<br  />			'roff' =&gt;'application/x-troff',<br  />			'rtf' =&gt;'text/rtf',<br  />			'rtx' =&gt;'text/richtext',<br  />			'sgm' =&gt;'text/sgml',<br  />			'sgml' =&gt;'text/sgml',<br  />			'sh' =&gt;'application/x-sh',<br  />			'shar' =&gt;'application/x-shar',<br  />			'shtml' =&gt;'text/html',<br  />			'silo' =&gt;'model/mesh',<br  />			'sit' =&gt;'application/x-stuffit',<br  />			'skd' =&gt;'application/x-koan',<br  />			'skm' =&gt;'application/x-koan',<br  />			'skp' =&gt;'application/x-koan',<br  />			'skt' =&gt;'application/x-koan',<br  />			'smi' =&gt;'application/smil',<br  />			'smil' =&gt;'application/smil',<br  />			'snd' =&gt;'audio/basic',<br  />			'spl' =&gt;'application/x-futuresplash',<br  />			'src' =&gt;'application/x-wais-source',<br  />			'sv4cpio' =&gt;'application/x-sv4cpio',<br  />			'sv4crc' =&gt;'application/x-sv4crc',<br  />			'svg' =&gt;'image/svg+xml',<br  />			'swf' =&gt;'application/x-shockwave-flash',<br  />			't' =&gt;'application/x-troff',<br  />			'tar' =&gt;'application/x-tar',<br  />			'tcl' =&gt;'application/x-tcl',<br  />			'tex' =&gt;'application/x-tex',<br  />			'texi' =&gt;'application/x-texinfo',<br  />			'texinfo' =&gt;'application/x-texinfo',<br  />			'tgz' =&gt;'application/x-tar',<br  />			'tif' =&gt;'image/tiff',<br  />			'tiff' =&gt;'image/tiff',<br  />			'tr' =&gt;'application/x-troff',<br  />			'tsv' =&gt;'text/tab-separated-values',<br  />			'txt' =&gt;'text/plain',<br  />			'ustar' =&gt;'application/x-ustar',<br  />			'vcd' =&gt;'application/x-cdlink',<br  />			'vrml' =&gt;'model/vrml',<br  />			'vxml' =&gt;'application/voicexml+xml',<br  />			'wav' =&gt;'audio/x-wav',<br  />			'wbmp' =&gt;'image/vnd.wap.wbmp',<br  />			'wbxml' =&gt;'application/vnd.wap.wbxml',<br  />			'wml' =&gt;'text/vnd.wap.wml',<br  />			'wmlc' =&gt;'application/vnd.wap.wmlc',<br  />			'wmlc' =&gt;'application/vnd.wap.wmlc',<br  />			'wmls' =&gt;'text/vnd.wap.wmlscript',<br  />			'wmlsc' =&gt;'application/vnd.wap.wmlscriptc',<br  />			'wmlsc' =&gt;'application/vnd.wap.wmlscriptc',<br  />			'wrl' =&gt;'model/vrml',<br  />			'xbm' =&gt;'image/x-xbitmap',<br  />			'xht' =&gt;'application/xhtml+xml',<br  />			'xhtml' =&gt;'application/xhtml+xml',<br  />			'xls' =&gt;'application/vnd.ms-excel',<br  />			'xml xsl' =&gt;'application/xml',<br  />			'xpm' =&gt;'image/x-xpixmap',<br  />			'xslt' =&gt;'application/xslt+xml',<br  />			'xul' =&gt;'application/vnd.mozilla.xul+xml',<br  />			'xwd' =&gt;'image/x-xwindowdump',<br  />			'xyz' =&gt;'chemical/x-xyz',<br  />			'zip' =&gt;'application/zip'<br  />		);<br  /><br  />		if (isset( $mimet[$idx] )) {<br  />			return $mimet[$idx];<br  />		} else {<br  />			return 'application/octet-stream';<br  />		}<br  />	}<br  />}<br  />?&gt;</pre> ]]></content:encoded>
			<dc:subject>default</dc:subject>
			<dc:date>2006-11-15T06:17:00-07:00</dc:date>
		</item>
		
		
		
		<item>
			<title>interesting</title>
			<link>http://frakkle.com/entry/63/interesting</link>
			<comments>http://frakkle.com/entry/63/interesting#comm</comments>
			<description><p><a href="http://www.human-anatomy.net">Human-Anatomy Pictures</a></p></description>
			<guid isPermaLink="false">63@http://frakkle.com</guid>
			<content:encoded><![CDATA[ <p><a href="http://www.human-anatomy.net">Human-Anatomy Pictures</a></p> ]]></content:encoded>
			<dc:subject>linkdump</dc:subject>
			<dc:date>2005-10-13T03:38:00-07:00</dc:date>
		</item>
		
		
		
		<item>
			<title>Links</title>
			<link>http://frakkle.com/entry/53/links</link>
			<comments>http://frakkle.com/entry/53/links#comm</comments>
			<description><a href="http://powersitesystem.com">Powersite Web CMS Design</a></p></description>
			<guid isPermaLink="false">53@http://frakkle.com</guid>
			<content:encoded><![CDATA[ <a href="http://powersitesystem.com">Powersite Web CMS Design</a></p> ]]></content:encoded>
			<dc:subject>linkdump</dc:subject>
			<dc:date>2005-09-18T12:40:00-07:00</dc:date>
		</item>
		
		
		
		<item>
			<title>Linkdump</title>
			<link>http://frakkle.com/entry/3/linkdump</link>
			<comments>http://frakkle.com/entry/3/linkdump#comm</comments>
			<description><a href="http://www.ezinemarketingcenter.com/blog/">Dr Mani</a></description>
			<guid isPermaLink="false">3@http://frakkle.com</guid>
			<content:encoded><![CDATA[ <a href="http://www.ezinemarketingcenter.com/blog/">Dr Mani</a> ]]></content:encoded>
			<dc:subject>linkdump</dc:subject>
			<dc:date>2004-01-30T21:25:00-07:00</dc:date>
		</item>
		
		
		
	</channel>
</rss>