<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: Offspinner's Code Snippets</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Thu, 24 Jul 2008 21:09:35 GMT</pubDate>
    <description>DZone Snippets: Offspinner's Code Snippets</description>
    <item>
      <title>.htaccess redirect</title>
      <link>http://snippets.dzone.com/posts/show/2964</link>
      <description>// description of your code here&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;// insert code here..&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Fri, 03 Nov 2006 21:12:20 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/2964</guid>
      <author>offspinner ()</author>
    </item>
    <item>
      <title>.htaccess error404.php</title>
      <link>http://snippets.dzone.com/posts/show/2891</link>
      <description>// This goes in .htaccess in the web root.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;# error docs&lt;br /&gt;ErrorDocument 404 /error404.php&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;// Use existing site template to start 404 page then add this code in your main content div.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;h1&gt;Page not found&lt;/h1&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;/* Error 404 code for ***** website */&lt;br /&gt;&lt;br /&gt;$webmaster = "webmaster@camrider.com";&lt;br /&gt;$host     = getenv("REMOTE_HOST");&lt;br /&gt;$referrer = getenv("HTTP_REFERER"); &lt;br /&gt;$path     = getenv("REQUEST_URI"); &lt;br /&gt;&lt;br /&gt;// time in this format: 13/Nov/2000:10:50:38&lt;br /&gt;$time = strftime("%d/%b/%Y:%T");&lt;br /&gt;&lt;br /&gt;if ($referrer == "") {&lt;br /&gt;  $referrer = "";&lt;br /&gt;} else {&lt;br /&gt;  $referrer = "&lt;p&gt;You came to this page from $referrer, this could be a broken link so please &lt;a href=\"mailto:$webmaster?subject=Error 404 on $path from $referrer\"&gt;email the webmaster&lt;/a&gt; to inform us of this.&lt;/p&gt;";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;?&gt;&lt;br /&gt;&lt;h2&gt;Sorry, we couldn't find the page &lt;?php echo $path ?&gt; on this website&lt;/h2&gt;&lt;br /&gt;&lt;?php echo $referrer; ?&gt;&lt;br /&gt;&lt;p&gt;Please use the navigation links to help locate what you're looking for.&lt;/p&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Wed, 25 Oct 2006 19:14:17 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/2891</guid>
      <author>offspinner ()</author>
    </item>
    <item>
      <title>Mencoder settings</title>
      <link>http://snippets.dzone.com/posts/show/2056</link>
      <description>From Real Media to QuickTime compatible&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;br /&gt;mencoder ~/Desktop/wpa90_220k.rm -o ~/Desktop/wpa90_23.avi -ovc lavc -oac lavc -ss 00:41:10 -endpos 00:01:20&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;mencoder ~/Desktop/wpa90_23.avi -o ~/Desktop/wpa90_232.avi -ovc xvid -xvidencopts bitrate=400 -oac lavc -lavcopts acodec=mp3&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Wed, 17 May 2006 03:20:53 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/2056</guid>
      <author>offspinner ()</author>
    </item>
    <item>
      <title>Applescript Export QT Streaming Movie</title>
      <link>http://snippets.dzone.com/posts/show/1998</link>
      <description>// description of your code here&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt; export movie 1 to save_location as hinted movie using default settings&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Mon, 08 May 2006 20:39:40 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/1998</guid>
      <author>offspinner ()</author>
    </item>
    <item>
      <title>UNIX tar Commands</title>
      <link>http://snippets.dzone.com/posts/show/1976</link>
      <description>// how the heck do you do the stuff you do with zip but with tar&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;create tar file&lt;br /&gt;tar cvf filename.tar monkey.txt monkey2.txt&lt;br /&gt;&lt;br /&gt;add a file&lt;br /&gt;tar uvf filename.tar monkey.txt&lt;br /&gt;&lt;br /&gt;extract tar file&lt;br /&gt;tar xvf filename.tar&lt;br /&gt;&lt;br /&gt;list contents&lt;br /&gt;tar tf monkey.tar&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Wed, 03 May 2006 20:37:24 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/1976</guid>
      <author>offspinner ()</author>
    </item>
    <item>
      <title>Handling Accented Characters with Python Regular Expressions</title>
      <link>http://snippets.dzone.com/posts/show/1588</link>
      <description>[A-z] just isn't good enough!&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;import re&lt;br /&gt;string = 'rich&#233;'&lt;br /&gt;print string&lt;br /&gt;rich&#233;&lt;br /&gt;&lt;br /&gt;richre = re.compile('([A-z]+)')&lt;br /&gt;match = richre.match(string)&lt;br /&gt;print match.groups()&lt;br /&gt;('rich',)&lt;br /&gt;&lt;br /&gt;richre = re.compile('(\w+)',re.LOCALE)&lt;br /&gt;match = richre.match(string)&lt;br /&gt;print match.groups()&lt;br /&gt;('rich',)&lt;br /&gt;&lt;br /&gt;richre = re.compile('([&#233;\w]+)')&lt;br /&gt;match = richre.match(string)&lt;br /&gt;print match.groups()&lt;br /&gt;('rich\xe9',)&lt;br /&gt;&lt;br /&gt;richre = re.compile('([\xe9\w]+)')&lt;br /&gt;match = richre.match(string)&lt;br /&gt;print match.groups()&lt;br /&gt;('rich\xe9',)&lt;br /&gt;&lt;br /&gt;richre = re.compile('([\xe9-\xf8\w]+)')&lt;br /&gt;match = richre.match(string)&lt;br /&gt;print match.groups()&lt;br /&gt;('rich\xe9',)&lt;br /&gt;&lt;br /&gt;string = 'rich&#233;&#241;'&lt;br /&gt;match = richre.match(string)&lt;br /&gt;print match.groups()&lt;br /&gt;('rich\xe9\xf1',)&lt;br /&gt;&lt;br /&gt;richre = re.compile('([\u00E9-\u00F8\w]+)')&lt;br /&gt;print match.groups()&lt;br /&gt;('rich\xe9\xf1',)&lt;br /&gt;&lt;br /&gt;matched = match.group(1)&lt;br /&gt;print matched&lt;br /&gt;rich&#233;&#241;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Mon, 27 Feb 2006 21:20:20 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/1588</guid>
      <author>offspinner ()</author>
    </item>
    <item>
      <title>DVD Authoring Workflow</title>
      <link>http://snippets.dzone.com/posts/show/1498</link>
      <description>MPEG Streamclip edit -&gt;&lt;br /&gt;DeMux to mpv + aif/m1a -&gt; &lt;br /&gt;optional Audacity edit aif -&gt;&lt;br /&gt;rename m1a&gt;mp2 -&gt;&lt;br /&gt;Sizzle Authoring&lt;br /&gt;&lt;br /&gt;MPEG Streamclip edit -&gt;&lt;br /&gt;Convert to mpeg -&gt;&lt;br /&gt;ffmpegx crop and convert to MPEG4 (2 pass mencoder ac3 audio) (HQ) -&gt;&lt;br /&gt;Meta Hoot Chapters -&gt;&lt;br /&gt;iDVD Authoring&lt;br /&gt;</description>
      <pubDate>Thu, 16 Feb 2006 16:04:11 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/1498</guid>
      <author>offspinner ()</author>
    </item>
    <item>
      <title>Analyse a MySQL Table for Inefficiencies</title>
      <link>http://snippets.dzone.com/posts/show/1447</link>
      <description>// description of your code here&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;SELECT * FROM tags PROCEDURE ANALYSE()&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Thu, 09 Feb 2006 22:56:32 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/1447</guid>
      <author>offspinner ()</author>
    </item>
    <item>
      <title>Analyse a MySQL Query for inefficiencies</title>
      <link>http://snippets.dzone.com/posts/show/1446</link>
      <description>// description of your code here&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;EXPLAIN SELECT t2.dbid, t2.tag, COUNT(t2.dbid) * 20 AS match_count&lt;br /&gt;FROM tags AS t1, tags AS t2&lt;br /&gt;WHERE t1.dbid = '105318'&lt;br /&gt;AND t2.tag = t1.tag&lt;br /&gt;AND t1.dbid != t2.dbid&lt;br /&gt;GROUP BY t2.dbid&lt;br /&gt;ORDER BY match_count;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Thu, 09 Feb 2006 22:40:35 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/1446</guid>
      <author>offspinner ()</author>
    </item>
    <item>
      <title>Return ordered list of near match items based on tag matches</title>
      <link>http://snippets.dzone.com/posts/show/1445</link>
      <description>// description of your code here&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;select t2.dbid, t2.tag, count(t2.dbid) as match_count from tags as t1, tags as t2 where t1.dbid = '105319' and t2.tag = t1.tag and t1.dbid != t2.dbid GROUP BY t2.dbid 1 ORDER BY match_count;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Thu, 09 Feb 2006 21:41:00 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/1445</guid>
      <author>offspinner ()</author>
    </item>
  </channel>
</rss>
