<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: cgi code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Wed, 21 May 2008 18:55:34 GMT</pubDate>
    <description>DZone Snippets: cgi code</description>
    <item>
      <title>Redirect a URL with Ruby CGI</title>
      <link>http://snippets.dzone.com/posts/show/5415</link>
      <description>&lt;code&gt;&lt;br /&gt;#!/usr/bin/ruby&lt;br /&gt;&lt;br /&gt;require 'cgi'&lt;br /&gt;&lt;br /&gt;cgi = CGI.new&lt;br /&gt;print cgi.header({'Status' =&gt; '302 Moved', 'location' =&gt;  'http://www.wired.com'})&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;or&lt;br /&gt;&lt;code&gt;&lt;br /&gt;url = 'http://www.wired.com/'&lt;br /&gt;print cgi.header({'status'=&gt;'REDIRECT', 'Location'=&gt;url})&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;References:&lt;br /&gt;&lt;a href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/48889"&gt;RE: cgi redirect&lt;/a&gt; [nagaokaut.ac.jp]&lt;br /&gt;&lt;a href="http://www.mokehehe.com/assari/index.php?Ruby%2FCGI"&gt;Ruby/CGI - assari&lt;/a&gt; [mokehehe.com]&lt;br /&gt;&lt;a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"&gt;HTTP/1.1: Status Code Definitions&lt;/a&gt; [w3.org]</description>
      <pubDate>Mon, 21 Apr 2008 12:25:30 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5415</guid>
      <author>jrobertson (James Robertson)</author>
    </item>
    <item>
      <title>Instruct a shared whiteboard to save and refresh</title>
      <link>http://snippets.dzone.com/posts/show/5284</link>
      <description>The following code used with the ProjectX API informs the client web browser that the whiteboard will be refreshed in 5 seconds. It then archives the current whiteboard information, formats it, and sends a message to each web browser to refresh their view.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;project name="whiteboardqueue"&gt;&lt;br /&gt;  &lt;methods&gt;&lt;br /&gt;    &lt;method name="create"&gt;&lt;br /&gt;      &lt;params&gt;&lt;br /&gt;        &lt;param var="type"&gt;ecmascript&lt;/param&gt;&lt;br /&gt;        &lt;param var="body"&gt;startRefresh(5)&lt;/param&gt;&lt;br /&gt;        &lt;param var="sender"&gt;system&lt;/param&gt;&lt;br /&gt;      &lt;/params&gt;&lt;br /&gt;    &lt;/method&gt;&lt;br /&gt;    &lt;method name="timer"&gt;&lt;br /&gt;      &lt;params&gt;&lt;br /&gt;        &lt;param var="timer"&gt;5&lt;/param&gt;&lt;br /&gt;      &lt;/params&gt;&lt;br /&gt;    &lt;/method&gt;&lt;br /&gt;    &lt;method name="archive_and_format"&gt;&lt;br /&gt;      &lt;params/&gt;&lt;br /&gt;    &lt;/method&gt;&lt;br /&gt;    &lt;method name="create"&gt;&lt;br /&gt;      &lt;params&gt;&lt;br /&gt;        &lt;param var="type"&gt;ecmascript&lt;/param&gt;&lt;br /&gt;        &lt;param var="body"&gt;reloadDocument()&lt;/param&gt;&lt;br /&gt;        &lt;param var="sender"&gt;system&lt;/param&gt;&lt;br /&gt;      &lt;/params&gt;&lt;br /&gt;    &lt;/method&gt;&lt;br /&gt;  &lt;/methods&gt;&lt;br /&gt;&lt;/project&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;*update 1:14am*&lt;br /&gt;The &lt;a href="http://rorbuilder.info/r/whiteboardqueue/index2.svg"&gt;whiteboard demo&lt;/a&gt; [rorbuilder.info] allows the user to draw using the mouse within the web browser which renders SVG. Tested on Flock and Firefox.&lt;br /&gt;&lt;br /&gt;*update 4:42pm 28 Mar 08*&lt;br /&gt;You can also view the &lt;a href="http://rorbuilder.info/whiteboardqueue/whiteboardqueue_data.xml?passthru=1"&gt;whiteboard message queue&lt;/a&gt; [rorbuilder.info].&lt;br /&gt;&lt;br /&gt;*update 6:29pm Mar 08*&lt;br /&gt;I've created a short url (http://rubyurl.com/vxHD) (to demonstrate the cleaning of the whiteboard) which redirects to this http://rorbuilder.info/api/projectx.cgi?xml_project=&lt;project name="whiteboardqueue"&gt;&lt;methods&gt;&lt;method name="create"&gt;&lt;params&gt;&lt;param var="type"&gt;ecmascript&lt;/param&gt;&lt;param var="body"&gt;startRefresh(5)&lt;/param&gt;&lt;param var="sender"&gt;system&lt;/param&gt;&lt;/params&gt;&lt;/method&gt;&lt;method name="timer"&gt;&lt;params&gt;&lt;param var="timer"&gt;5&lt;/param&gt;&lt;/params&gt;&lt;/method&gt;&lt;method name="archive_and_format"&gt;&lt;params/&gt;&lt;/method&gt;&lt;method name="create"&gt;&lt;params&gt;&lt;param var="type"&gt;ecmascript&lt;/param&gt;&lt;param var="body"&gt;reloadDocument()&lt;/param&gt;&lt;param var="sender"&gt;system&lt;/param&gt;&lt;/params&gt;&lt;/method&gt;&lt;/methods&gt;&lt;/project&gt;&lt;br /&gt;&lt;br /&gt;I've </description>
      <pubDate>Thu, 27 Mar 2008 19:14:07 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5284</guid>
      <author>jrobertson (James Robertson)</author>
    </item>
    <item>
      <title>Upload a file using Ruby</title>
      <link>http://snippets.dzone.com/posts/show/5165</link>
      <description>The following code was used to upload an image file to the web server. Source code origin: &lt;a href="http://www.zytrax.com/tech/lang/ruby/#upload"&gt;Ruby Language Stuff | mod_ruby File upload scripts&lt;/a&gt; [zytrax.com]&lt;br /&gt;&lt;br /&gt;file: file_upload.cgi&lt;br /&gt;&lt;code&gt;&lt;br /&gt;#!/usr/bin/ruby&lt;br /&gt;&lt;br /&gt;# ruby script fragment&lt;br /&gt;require 'cgi'&lt;br /&gt;require 'stringio'&lt;br /&gt;&lt;br /&gt;cgi = CGI.new()  # New CGI object&lt;br /&gt;puts "Content-Type: text/plain"&lt;br /&gt;puts&lt;br /&gt;print '&lt;result&gt;'&lt;br /&gt;&lt;br /&gt;# get uri of tx'd file (in tmp normally)&lt;br /&gt;tmpfile = cgi.params['myfile'].first.path&lt;br /&gt;&lt;br /&gt;# OR (functionally the same)&lt;br /&gt;tmpfile = cgi.params['myfile'][0].path&lt;br /&gt;&lt;br /&gt;# create a Tempfile reference&lt;br /&gt;fromfile = cgi.params['myfile'].first&lt;br /&gt;&lt;br /&gt;#displays the original file name as supplied in the form&lt;br /&gt;puts fromfile.original_filename&lt;br /&gt;&lt;br /&gt;# displays the content (mime) type e.g. text/html&lt;br /&gt;puts fromfile.content_type&lt;br /&gt;&lt;br /&gt;# create output file reference as original filename in our chosen directory&lt;br /&gt;tofile = '/var/www/yourdomain.com/htdocs/r/'+fromfile.original_filename&lt;br /&gt;&lt;br /&gt;# copy the file&lt;br /&gt;# note the untaint prevents a security error&lt;br /&gt;# cgi sets up an StringIO object if file &lt; 10240&lt;br /&gt;# or a Tempfile object following works for both&lt;br /&gt;File.open(tofile.untaint, 'w') { |file| file &lt;&lt; fromfile.read}&lt;br /&gt;# when the page finishes the Tempfile/StringIO!) thing is deleted automatically&lt;br /&gt;&lt;br /&gt;print '&lt;/result&gt;'&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;file: file_upload.html&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"&lt;br /&gt;  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;&lt;br /&gt;&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt;&lt;br /&gt;  &lt;head&gt;&lt;br /&gt;    &lt;title&gt;File upload&lt;/title&gt;&lt;br /&gt;    &lt;meta http-equiv="Content-Type" content="text/html;charset=utf-8"/&gt;&lt;br /&gt;  &lt;/head&gt;&lt;br /&gt;  &lt;body&gt;&lt;br /&gt;    &lt;form name='fileupload' enctype="multipart/form-data" &lt;br /&gt;    action='/p/file_upload.cgi' method='post'&gt;&lt;br /&gt;    &lt;input type='file' name='myfile' size="40" /&gt;&lt;br /&gt;    &lt;input type='submit' value"Send it"/&gt;&lt;br /&gt;    &lt;/form&gt;&lt;br /&gt;  &lt;/body&gt;&lt;br /&gt;&lt;/html&gt;&lt;br /&gt;  &lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sat, 23 Feb 2008 13:26:00 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5165</guid>
      <author>jrobertson (James Robertson)</author>
    </item>
    <item>
      <title>Unify the handling of XML records</title>
      <link>http://snippets.dzone.com/posts/show/4833</link>
      <description>This Ruby code creates, updates or deletes an XML record, using a hash, record handling objects, and XML to invoke the correct method.  &lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;#file: recordx_handler.rb&lt;br /&gt;require 'recordx'&lt;br /&gt;&lt;br /&gt;class RecordX_Update &lt; RecordX&lt;br /&gt;  def call(params)&lt;br /&gt;    #todo: write the code to read the xml parameter string&lt;br /&gt;    update_record(h)&lt;br /&gt;    save_file &lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;class RecordX_Create &lt; RecordX&lt;br /&gt;  def call(params)&lt;br /&gt;    #todo: write the code to read the xml parameter string  &lt;br /&gt;    create_record(h)&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;class RecordX_Delete &lt; RecordX&lt;br /&gt;  def call(params)&lt;br /&gt;    doc = Document.new(params)&lt;br /&gt;    node = doc.root.elements["param[@var='id']"]&lt;br /&gt;    puts node&lt;br /&gt;    id = node.attributes.get_attribute('val').to_s&lt;br /&gt;    delete_record(id)&lt;br /&gt;    puts 'deleted record ' + id&lt;br /&gt;    save_file&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;class RecordX_handler&lt;br /&gt;  def invoke(method, params)&lt;br /&gt;    h = Hash.new&lt;br /&gt;    h["create"] = RecordX_Create.new&lt;br /&gt;    h["update"] = RecordX_Update.new&lt;br /&gt;    h["delete"] = RecordX_Delete.new&lt;br /&gt;    h[method].call(params)&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;if __FILE__ == $0&lt;br /&gt;  xml_method = "&lt;method name='delete'&gt;&lt;params&gt;&lt;param var='id' val='17648' /&gt;&lt;/params&gt;&lt;/method&gt;"&lt;br /&gt;  doc = Document.new(xml_method)&lt;br /&gt;  method = doc.root.attributes.get_attribute('name').to_s&lt;br /&gt;  params = doc.root.elements['params'].to_s&lt;br /&gt;&lt;br /&gt;  rh = RecordX_handler.new&lt;br /&gt;  rh.invoke(method, params)&lt;br /&gt;end&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;This code is intended to be called by a Ruby CGI script which can simply relay the cgi post argument to the recordx_handler object.&lt;br /&gt;</description>
      <pubDate>Sun, 02 Dec 2007 13:50:18 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4833</guid>
      <author>jrobertson (James Robertson)</author>
    </item>
    <item>
      <title>A simple test case using Ruby and XML - Part III</title>
      <link>http://snippets.dzone.com/posts/show/4625</link>
      <description>This Ruby CGI script tests a class, by reading the testdata from an XML file, then outputs the result to the web browser. Refer to parts 1 http://urltea.com/1p7h [dzone.com], and II http://urltea.com/1p7m [dzone.com]&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;#file: test-feed.cgi&lt;br /&gt;&lt;br /&gt;require 'test_feed'&lt;br /&gt;&lt;br /&gt;puts "Content-Type: text/xml"&lt;br /&gt;puts&lt;br /&gt;&lt;br /&gt;puts "&lt;test_report&gt;"&lt;br /&gt;tf = Test_feed.new()&lt;br /&gt;puts tf.plan&lt;br /&gt;puts "&lt;actual&gt;"&lt;br /&gt;tf.print('create_file', tf.tested)&lt;br /&gt;puts "&lt;/actual&gt;"&lt;br /&gt;puts "&lt;/test_report&gt;"&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Tue, 09 Oct 2007 10:07:41 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4625</guid>
      <author>jrobertson (James Robertson)</author>
    </item>
    <item>
      <title>CGI script for collecting username and password and storing them in a database table</title>
      <link>http://snippets.dzone.com/posts/show/4092</link>
      <description>// CGI script for collecting username and password and storing them in a database table&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;#!/usr/bin/perl&lt;br /&gt;&lt;br /&gt;# $Id$&lt;br /&gt;&lt;br /&gt;# CGI script for collecting username and password and storing them in a database&lt;br /&gt;# table. The password is encrypted with Crypt::PasswdMD5 ready for passing to&lt;br /&gt;# useradd.&lt;br /&gt;&lt;br /&gt;use strict;&lt;br /&gt;use warnings;&lt;br /&gt;&lt;br /&gt;## no critic (ValuesAndExpressions::RequireInterpolationOfMetachars)&lt;br /&gt;our ($VERSION) = '$Revision$' =~ m{ \$Revision: \s+ (\S+) }xms;&lt;br /&gt;## use critic&lt;br /&gt;&lt;br /&gt;use CGI::Pretty qw(:standard -nosticky);&lt;br /&gt;use DBI;&lt;br /&gt;use Crypt::PasswdMD5;&lt;br /&gt;&lt;br /&gt;# Schema for database table to store account details:&lt;br /&gt;# &lt;br /&gt;# CREATE TABLE account (&lt;br /&gt;#     username varchar(50) NOT NULL,&lt;br /&gt;#     password varchar(50) NOT NULL,&lt;br /&gt;#     date_created datetime NOT NULL&lt;br /&gt;# );&lt;br /&gt;&lt;br /&gt;my $DBNAME = 'database';&lt;br /&gt;my $DBHOST = 'localhost';&lt;br /&gt;my $DBPORT = 3306;&lt;br /&gt;my $DBUSER = 'username';&lt;br /&gt;my $DBPASS = 'password';&lt;br /&gt;&lt;br /&gt;# Header&lt;br /&gt;my $q = new CGI;&lt;br /&gt;print $q-&gt;header(),&lt;br /&gt;      $q-&gt;start_html(&lt;br /&gt;          -title =&gt; 'New Account',&lt;br /&gt;          -lang  =&gt; 'en',&lt;br /&gt;      ),&lt;br /&gt;      $q-&gt;h1('New Account');&lt;br /&gt;&lt;br /&gt;my $submit    = $q-&gt;param('submit')    || q{};&lt;br /&gt;my $username  = $q-&gt;param('username')  || q{};&lt;br /&gt;my $password1 = $q-&gt;param('password1') || q{};&lt;br /&gt;my $password2 = $q-&gt;param('password2') || q{};&lt;br /&gt;&lt;br /&gt;my %ERROR = (&lt;br /&gt;    no_username         =&gt; 'You must specify a username.',&lt;br /&gt;    no_password         =&gt; 'You must specify a password.',&lt;br /&gt;    password_not_twice  =&gt; 'You must specify your password twice.',&lt;br /&gt;    passwords_not_match =&gt; 'Both passwords must match.',&lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;my $error = (!$submit)                   ? undef                       :&lt;br /&gt;            (!$username)                 ? $ERROR{no_username}         :&lt;br /&gt;            (!$password1 &amp;&amp; !$password2) ? $ERROR{no_password}         :&lt;br /&gt;            (!$password1 || !$password2) ? $ERROR{password_not_twice}  :&lt;br /&gt;            ( $password1 ne  $password2) ? $ERROR{passwords_not_match} :&lt;br /&gt;                                           undef&lt;br /&gt;            ;&lt;br /&gt;&lt;br /&gt;if (!$submit) {&lt;br /&gt;    # Form not submitted, so display empty form&lt;br /&gt;    form($q);&lt;br /&gt;}&lt;br /&gt;elsif ($error) {&lt;br /&gt;    # Show error and redisplay form&lt;br /&gt;    print $q-&gt;p($error);&lt;br /&gt;    form($q, $username);&lt;br /&gt;}&lt;br /&gt;else {&lt;br /&gt;    # Enter account details into database&lt;br /&gt;    my $dsn = "DBI:mysql:database=$DBNAME;host=$DBHOST;port=$DBPORT";&lt;br /&gt;    my $dbh = DBI-&gt;connect($dsn, $DBUSER, $DBPASS);&lt;br /&gt;    &lt;br /&gt;    my $username_quoted = $dbh-&gt;quote(param('username'));&lt;br /&gt;    my $password_quoted = $dbh-&gt;quote(unix_md5_crypt(param('password1')));&lt;br /&gt;    &lt;br /&gt;    $dbh-&gt;do("&lt;br /&gt;        INSERT INTO account&lt;br /&gt;        (username, password, date_created)&lt;br /&gt;        VALUES ($username_quoted, $password_quoted, NOW())&lt;br /&gt;    ");&lt;br /&gt;    &lt;br /&gt;    print $q-&gt;p('Your username and password have been recorded.');&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;# Footer&lt;br /&gt;print $q-&gt;end_html();&lt;br /&gt;&lt;br /&gt;sub form {&lt;br /&gt;    my $q = shift;&lt;br /&gt;    my $username = shift || q{};&lt;br /&gt;    &lt;br /&gt;    print start_form(),&lt;br /&gt;          p('Username:', br(), textfield(&lt;br /&gt;              -name  =&gt; 'username',&lt;br /&gt;              -value =&gt; $username,&lt;br /&gt;          )),&lt;br /&gt;          p('Password:', br(), password_field(&lt;br /&gt;              -name =&gt; 'password1',&lt;br /&gt;          )),&lt;br /&gt;          p('Password (again):', br(), password_field(&lt;br /&gt;              -name =&gt; 'password2',&lt;br /&gt;          )),&lt;br /&gt;          p(submit(&lt;br /&gt;              -name  =&gt; 'submit',&lt;br /&gt;              -value =&gt; 'Submit',&lt;br /&gt;          )),&lt;br /&gt;          end_form();&lt;br /&gt;    &lt;br /&gt;    return;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sat, 02 Jun 2007 07:35:36 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4092</guid>
      <author>iansealy (Ian Sealy)</author>
    </item>
    <item>
      <title>Python - Simple Example CGI</title>
      <link>http://snippets.dzone.com/posts/show/3122</link>
      <description>// http://localhost/cgi-bin/example.py?variable=example&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;import cgi&lt;br /&gt;&lt;br /&gt;print 'Content-type: text/html\r\n'&lt;br /&gt;&lt;br /&gt;inputValue = cgi.FieldStorage()&lt;br /&gt;&lt;br /&gt;if(inputValue.has_key('variable')):&lt;br /&gt;  print inputValue['variable'].value&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sun, 10 Dec 2006 16:48:24 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3122</guid>
      <author>whitetiger ()</author>
    </item>
    <item>
      <title>Python - Exception CGI Redirect</title>
      <link>http://snippets.dzone.com/posts/show/3121</link>
      <description>// Reindirizza gli errori di uno script CGI in un file random nella cartella /tmp&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;import cgitb; cgitb.enable(display=0, logdir='/tmp')&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sun, 10 Dec 2006 16:45:08 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3121</guid>
      <author>whitetiger ()</author>
    </item>
    <item>
      <title>Python CGI script to display client's IP address</title>
      <link>http://snippets.dzone.com/posts/show/1840</link>
      <description>When run as a cgi script, this will print the client's IP address.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;import cgi&lt;br /&gt;import os&lt;br /&gt;&lt;br /&gt;print "Content-type: text/html"&lt;br /&gt;print ""&lt;br /&gt;&lt;br /&gt;print cgi.escape(os.environ["REMOTE_ADDR"])&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Tue, 04 Apr 2006 19:54:21 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/1840</guid>
      <author>madphilosopher (Darren Paul Griffith)</author>
    </item>
    <item>
      <title>Decode an encoded query string in C</title>
      <link>http://snippets.dzone.com/posts/show/527</link>
      <description>Here's a little function to decode part of a query string that has been encoded as per the HTML specification with %xx notation, where xx is the hexidecimal representation of a character.&lt;br /&gt;&lt;br /&gt;Be warned that this function modifies the contents of the string you pass as the argument!&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;#include &lt;stdlib.h&gt;&lt;br /&gt;&lt;br /&gt;char* decode_query (char* str)&lt;br /&gt;{&lt;br /&gt;        char*           in = str;&lt;br /&gt;        char*           out = str;&lt;br /&gt;&lt;br /&gt;        char            c = 0;&lt;br /&gt;        char            decode_buffer[5] = { '0', 'x', 0, 0, 0 };&lt;br /&gt;&lt;br /&gt;        while ((c = *in++)) {&lt;br /&gt;                if (c == '%' &amp;&amp; *in &amp;&amp; *(in + 1)) {&lt;br /&gt;                        decode_buffer[2] = *in++;&lt;br /&gt;                        decode_buffer[3] = *in++;&lt;br /&gt;&lt;br /&gt;                        c = char(strtod(decode_buffer, (char**) NULL));&lt;br /&gt;                } else if (c == '+')&lt;br /&gt;                        c = ' ';&lt;br /&gt;&lt;br /&gt;                *out++ = c;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        *out = 0;&lt;br /&gt;&lt;br /&gt;        return str;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sat, 30 Jul 2005 06:03:20 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/527</guid>
      <author>AGWA (Andrew Ayer)</author>
    </item>
  </channel>
</rss>
