<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss version="2.0"><channel><title>Code for Monkeys - Zedwood</title><link>http://zedwood.com</link><description>developer code samples and codeblog</description><language>en-us</language><pubDate>Wed, 31 Dec 1969 18:00:00 -0600</pubDate><lastBuildDate>Wed, 31 Dec 1969 18:00:00 -0600</lastBuildDate><docs>http://blogs.law.harvard.edu/tech/rss</docs><generator>PHP 5</generator><managingEditor>noreply@zedwood.com</managingEditor><webMaster>noreply@zedwood.com</webMaster><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/Zedwood-Code-Articles" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item><title>Javascript Convert Date To String (Past Tense)</title><link>http://zedwood.com/article/152/javascript-convert-date-to-string-past-tense</link><description>Have you ever wanted to convert a date string to be say something like this:
&lt;br&gt;32 seconds ago (or)
&lt;br&gt;12 minutes ago (or)
&lt;br&gt;4 days ago (or)
&lt;br&gt;2 months ago (or)
&lt;br&gt;1 year ago 
&lt;br&gt;
&lt;br&gt;This is the javascript function to do it.
&lt;br&gt;
&lt;br&gt;&lt;div class="</description><pubDate>Wed, 31 Dec 1969 18:00:00 -0600</pubDate><guid>http://zedwood.com/article/152/javascript-convert-date-to-string-past-tense</guid></item><item><title>CSS Two Column Scroller</title><link>http://zedwood.com/article/151/css-two-column-scroller</link><description>css:
&lt;br&gt;&lt;div class="code-css"&gt;&lt;div class="css" style="font-family: monospace;color: #0A246A;  border: 1px dashed #35a; background-color: #f0f0ff; font-size:90%; padding:2px; overflow:auto;"&gt;div.&lt;span style="color:#ff0000;"&gt;twocolscroller&lt;/span&gt; &lt;span sty</description><pubDate>Wed, 31 Dec 1969 18:00:00 -0600</pubDate><guid>http://zedwood.com/article/151/css-two-column-scroller</guid></item><item><title>C++ str_pad</title><link>http://zedwood.com/article/150/cpp-strpad</link><description>&lt;div class="code-cpp"&gt;&lt;div class="cpp" style="font-family: monospace;color: #0A246A;  border: 1px dashed #35a; background-color: #f0f0ff; font-size:90%; padding:2px; overflow:auto;"&gt;&lt;span style="color:#FF8000;"&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span</description><pubDate>Wed, 31 Dec 1969 18:00:00 -0600</pubDate><guid>http://zedwood.com/article/150/cpp-strpad</guid></item><item><title>HTML Table Row Highlight</title><link>http://zedwood.com/article/149/html-table-row-highlight</link><description>Javascript:
&lt;br&gt;&lt;div class="code-js"&gt;&lt;div class="javascript" style="font-family: monospace;color: #0A246A;  border: 1px dashed #35a; background-color: #f0f0ff; font-size:90%; padding:2px; overflow:auto;"&gt;&lt;span style="color:#000080;font-weight:bold;"&gt;var&lt;/</description><pubDate>Wed, 31 Dec 1969 18:00:00 -0600</pubDate><guid>http://zedwood.com/article/149/html-table-row-highlight</guid></item><item><title>BATCH Zip files in place</title><link>http://zedwood.com/article/148/batch-zip-files-in-place</link><description>In this case we are using 7zip command line version to compress files in place.
&lt;br&gt;
&lt;br&gt;&lt;b &gt;WHAT IS INPLACE COMPRESSION?&lt;/b&gt;
&lt;br&gt;
&lt;br&gt;If I have some files
&lt;br&gt;c:\files\file1.txt
&lt;br&gt;c:\files\file2.txt
&lt;br&gt;c:\files\folder1\file1.txt
&lt;br&gt;c:\files\folder2\f</description><pubDate>Wed, 31 Dec 1969 18:00:00 -0600</pubDate><guid>http://zedwood.com/article/148/batch-zip-files-in-place</guid></item><item><title>PHP Send a file via FTP</title><link>http://zedwood.com/article/147/php-send-a-file-via-ftp</link><description>I was having some trouble successfully sending files, until I set FTP PASSIVE to true.
&lt;br&gt;
&lt;br&gt;&lt;div class="code-php"&gt;&lt;div class="php" style="font-family: monospace;color: #0A246A;  border: 1px dashed #35a; background-color: #f0f0ff; font-size:90%; paddin</description><pubDate>Wed, 31 Dec 1969 18:00:00 -0600</pubDate><guid>http://zedwood.com/article/147/php-send-a-file-via-ftp</guid></item><item><title>PHP Create Zip file </title><link>http://zedwood.com/article/146/php-create-zip-file</link><description>We will make zip yyyymmdd_myfilename.txt as yyyymmdd_myfilename.zip below.
&lt;br&gt;
&lt;br&gt;&lt;div class="code-php"&gt;&lt;div class="php" style="font-family: monospace;color: #0A246A;  border: 1px dashed #35a; background-color: #f0f0ff; font-size:90%; padding:2px; overf</description><pubDate>Wed, 31 Dec 1969 18:00:00 -0600</pubDate><guid>http://zedwood.com/article/146/php-create-zip-file</guid></item><item><title>C++ Convert Wikipedia XML Dump To Mysql (UTF-8 safe)</title><link>http://zedwood.com/article/145/cpp-convert-wikipedia-xml-dump-to-mysql-utf8-safe</link><description>Here is a project for parsing the wikipedia xml database dump to mysql for use in mediawiki or whatever.
&lt;br&gt;
&lt;br&gt;Wikipedia, the online encyclopedia, is also made available for download for offline and research use.  To download the english wikipedia data</description><pubDate>Wed, 31 Dec 1969 18:00:00 -0600</pubDate><guid>http://zedwood.com/article/145/cpp-convert-wikipedia-xml-dump-to-mysql-utf8-safe</guid></item><item><title>PHP MySQL GeoIP Lookup</title><link>http://zedwood.com/article/144/php-mysql-geoip-lookup</link><description>
&lt;br&gt;The latest GeoIPCountryWhois.csv is available from &lt;a href="http://www.maxmind.com/app/geolitecountry"&gt;http://www.maxmind.com/app/geolitecountry&lt;/a&gt;
&lt;br&gt;
&lt;br&gt;&lt;b &gt;Parse GeoIP CSV to MySQL&lt;/b&gt;
&lt;br&gt;&lt;div class="code-php"&gt;&lt;div class="php" style="font-fami</description><pubDate>Wed, 31 Dec 1969 18:00:00 -0600</pubDate><guid>http://zedwood.com/article/144/php-mysql-geoip-lookup</guid></item><item><title>URL Rewrite in PHP</title><link>http://zedwood.com/article/143/url-rewrite-in-php</link><description>One technique to writing php websites is to run all the requests through one php page, usually index.php.  This is common particularly because it allows you to add sitewide scripts (analytics etc) in one place, and also allows for nice URLs.  This is by n</description><pubDate>Wed, 31 Dec 1969 18:00:00 -0600</pubDate><guid>http://zedwood.com/article/143/url-rewrite-in-php</guid></item><item><title>Linux SCP Expect Script</title><link>http://zedwood.com/article/142/linux-scp-expect-script</link><description>usage: expect_scp.exp myfile.7z
&lt;br&gt;file: expect_scp.exp
&lt;br&gt;&lt;div class="code-php"&gt;&lt;div class="php" style="font-family: monospace;color: #0A246A;  border: 1px dashed #35a; background-color: #f0f0ff; font-size:90%; padding:2px; overflow:auto;"&gt;&lt;span style=</description><pubDate>Wed, 31 Dec 1969 18:00:00 -0600</pubDate><guid>http://zedwood.com/article/142/linux-scp-expect-script</guid></item><item><title>Windows Batch Date Parser</title><link>http://zedwood.com/article/141/windows-batch-date-parser</link><description>This displays todays date in YYYY-MM-DD format instead of D m/d/Y (2010-12-24 instead of thurs 12/24/2010).
&lt;br&gt;
&lt;br&gt;formatdate1.bat
&lt;br&gt;&lt;div class="code-other"&gt;@echo&amp;nbsp;off
&lt;br&gt;FOR&amp;nbsp;/F&amp;nbsp;"TOKENS=2,3,4*&amp;nbsp;DELIMS=/&amp;nbsp;"&amp;nbsp;%%A&amp;nbsp;IN&amp;nbsp;</description><pubDate>Wed, 31 Dec 1969 18:00:00 -0600</pubDate><guid>http://zedwood.com/article/141/windows-batch-date-parser</guid></item><item><title>BASH Automate FTP</title><link>http://zedwood.com/article/140/bash-automate-ftp</link><description>&lt;div class="code-php"&gt;&lt;div class="php" style="font-family: monospace;color: #0A246A;  border: 1px dashed #35a; background-color: #f0f0ff; font-size:90%; padding:2px; overflow:auto;"&gt;&lt;span style="color: #666666; font-style: italic;"&gt;#! /bin/bash&lt;/span&gt;&lt;br </description><pubDate>Wed, 31 Dec 1969 18:00:00 -0600</pubDate><guid>http://zedwood.com/article/140/bash-automate-ftp</guid></item><item><title>Glass Hover Button</title><link>http://zedwood.com/article/139/glass-hover-button</link><description>&lt;style type="text/css"&gt;
a.hbutton 
{  
    height:32px;
    width:125px; 
    text-decoration:none;
}
a.hbutton span
{
    font-weight:bold; 
    font-size:10pt;
    font-family:Arial;
    color:#fff;
}
a.hbutton span.but_l
{  
    float:l</description><pubDate>Wed, 31 Dec 1969 18:00:00 -0600</pubDate><guid>http://zedwood.com/article/139/glass-hover-button</guid></item><item><title>Calculate Script Duration in PHP and BASH</title><link>http://zedwood.com/article/137/calculate-script-duration-in-php-and-bash</link><description>BASH
&lt;br&gt;&lt;div class="code-php"&gt;&lt;div class="php" style="font-family: monospace;color: #0A246A;  border: 1px dashed #35a; background-color: #f0f0ff; font-size:90%; padding:2px; overflow:auto;"&gt;&lt;span style="color: #666666; font-style: italic;"&gt;#!/bin/bash&lt;/s</description><pubDate>Wed, 31 Dec 1969 18:00:00 -0600</pubDate><guid>http://zedwood.com/article/137/calculate-script-duration-in-php-and-bash</guid></item><item><title>Generate PDFs with PHP</title><link>http://zedwood.com/article/136/generate-pdfs-with-php</link><description>There is a lot of PHP code available to generate PDF but most of it requires downloading and installing php extensions.  In a shared hosting environment you don't always have access to php configuration, which is why &lt;a href="http://www.ros.co.nz/pdf/"&gt;ez</description><pubDate>Wed, 31 Dec 1969 18:00:00 -0600</pubDate><guid>http://zedwood.com/article/136/generate-pdfs-with-php</guid></item><item><title>Linux Crontab Reference</title><link>http://zedwood.com/article/135/linux-crontab-reference</link><description>&lt;b &gt;Crontab basics&lt;/b&gt;
&lt;br&gt;
&lt;br&gt;1. Crontab usage:
&lt;br&gt;&lt;div class="code-other"&gt;[user@linux1&amp;nbsp;~]&amp;nbsp;crontab&amp;nbsp;--help
&lt;br&gt;crontab:
&lt;br&gt;usage:&amp;nbsp;&amp;nbsp;crontab&amp;nbsp;[-u&amp;nbsp;user]&amp;nbsp;file
&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cronta</description><pubDate>Wed, 31 Dec 1969 18:00:00 -0600</pubDate><guid>http://zedwood.com/article/135/linux-crontab-reference</guid></item><item><title>Visual Studio Express 2005 and the Platform SDK</title><link>http://zedwood.com/article/134/visual-studio-express-2005-and-the-platform-sdk</link><description>When Visual C++ Express 2005 was first released, many of its features were stripped out, including the ability to compile any code with &lt;i &gt;#include &lt;windows.h&gt;&lt;/i&gt; in it.  If you don't want to pay for the full version of visual studio, you can download t</description><pubDate>Wed, 31 Dec 1969 18:00:00 -0600</pubDate><guid>http://zedwood.com/article/134/visual-studio-express-2005-and-the-platform-sdk</guid></item><item><title>Generate XLS Spreadsheet files with PHP</title><link>http://zedwood.com/article/133/generate-xls-spreadsheet-files-with-php</link><description>The .xls binary file format is documented at &lt;a href="http://www.microsoft.com/interop/docs/OfficeBinaryFormats.mspx"&gt;Microsoft Office Format Docs&lt;/a&gt;, however it is a 1000+ page doc, and would take a lot of time to implement it from scratch.  .XLS files </description><pubDate>Wed, 31 Dec 1969 18:00:00 -0600</pubDate><guid>http://zedwood.com/article/133/generate-xls-spreadsheet-files-with-php</guid></item><item><title>MySQL Create Table Statements</title><link>http://zedwood.com/article/132/mysql-create-table-statements</link><description>If you have an existing database table to look at, use these mysql commands to view schema details:
&lt;br&gt;&lt;div class="code-sql"&gt;&lt;div class="sql" style="font-family: monospace;color: #0A246A;  border: 1px dashed #35a; background-color: #f0f0ff; font-size:90%</description><pubDate>Wed, 31 Dec 1969 18:00:00 -0600</pubDate><guid>http://zedwood.com/article/132/mysql-create-table-statements</guid></item><item><title>PHP MySQL Basic Connectivity Code</title><link>http://zedwood.com/article/131/php-mysql-basic-connectivity-code</link><description>Here is some basic query code for people starting out in php and mysql.  Obviously this is for an existing mysql database.
&lt;br&gt;
&lt;br&gt;&lt;div class="code-php"&gt;&lt;div class="php" style="font-family: monospace;color: #0A246A;  border: 1px dashed #35a; background-c</description><pubDate>Wed, 31 Dec 1969 18:00:00 -0600</pubDate><guid>http://zedwood.com/article/131/php-mysql-basic-connectivity-code</guid></item><item><title>Generate CSV Spreadsheet with PHP</title><link>http://zedwood.com/article/130/generate-csv-spreadsheet-with-php</link><description>A &lt;a href="http://en.wikipedia.org/wiki/Comma-separated_values"&gt;CSV&lt;/a&gt; is a comma separated value text file, which is pretty much a spreadsheet text file.  There are other popular formats like tab delimited files as well.  It is difficult to generate an </description><pubDate>Wed, 31 Dec 1969 18:00:00 -0600</pubDate><guid>http://zedwood.com/article/130/generate-csv-spreadsheet-with-php</guid></item><item><title>XML Parsing with PHP DOMDocument</title><link>http://zedwood.com/article/129/xml-parsing-with-php-domdocument</link><description>PHP5 has several XML parsers built in, here is some sample code for parsing with &lt;a href="http://us3.php.net/manual/en/book.domxml.php"&gt;DOM XML&lt;/a&gt;.  It is by no means an exhaustive example, but it is some code to get your feet wet.  This example uses the</description><pubDate>Wed, 31 Dec 1969 18:00:00 -0600</pubDate><guid>http://zedwood.com/article/129/xml-parsing-with-php-domdocument</guid></item><item><title>XML Parsing in PHP SimpleXML</title><link>http://zedwood.com/article/128/xml-parsing-in-php-simplexml</link><description>&lt;a href="http://us2.php.net/manual/en/book.simplexml.php"&gt;SimpleXML&lt;/a&gt; was added to PHP5 as an easy way to parse xml.  I have found some limitations (IE: when the tagname has a colon in it).  For those cases, there are other xml parsers to use. 
&lt;br&gt;
&lt;br</description><pubDate>Wed, 31 Dec 1969 18:00:00 -0600</pubDate><guid>http://zedwood.com/article/128/xml-parsing-in-php-simplexml</guid></item><item><title>PHP Calculate Duration of MP3</title><link>http://zedwood.com/article/127/php-calculate-duration-of-mp3</link><description>On a website where you upload an mp3 it is often useful to have a class that can analyze this mp3 on the fly, extract some meta data about bitrate, song length, etc.
&lt;br&gt;
&lt;br&gt;This was written in PHP5, and will not work on php4 web servers.  Using this php</description><pubDate>Wed, 31 Dec 1969 18:00:00 -0600</pubDate><guid>http://zedwood.com/article/127/php-calculate-duration-of-mp3</guid></item></channel></rss>
