<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Mission Data Blog &#187; carsonm</title>
	<atom:link href="http://www.missiondata.com/blog/author/carsonm/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.missiondata.com/blog</link>
	<description>Louisville-based Web Development &#38; Software Engineering</description>
	<lastBuildDate>Tue, 24 Jan 2012 14:58:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Recent Sitemap Enhancements</title>
		<link>http://www.missiondata.com/blog/seo/78/recent-sitemap-enhancements/</link>
		<comments>http://www.missiondata.com/blog/seo/78/recent-sitemap-enhancements/#comments</comments>
		<pubDate>Thu, 12 Apr 2007 12:56:39 +0000</pubDate>
		<dc:creator>carsonm</dc:creator>
				<category><![CDATA[SEO]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[sitemaps]]></category>

		<guid isPermaLink="false">http://www.missiondata.com/blog/seo/78/recent-sitemap-enhancements/</guid>
		<description><![CDATA[There have been a couple recent enhancements to sitemaps that everyone should start using. The first is that Google now supports embedding kml data into sitemaps. This allows you to provide a hint as to where information is related to geographicaly as well as more detailed information to be used in popups on the map. [...]]]></description>
			<content:encoded><![CDATA[<p>There have been a couple recent enhancements to <a href="http://www.sitemaps.org/">sitemaps</a> that everyone should start using.</p>
<p>The first is that Google now supports <a href="http://googlemapsapi.blogspot.com/2007/01/get-more-traffic-to-your-maps-api-site.html">embedding kml data into sitemaps</a>. This allows you to provide a hint as to where information is related to geographicaly as well as more detailed information to be used in popups on the map. For more information on how to make the integration see the <a href="http://www.google.com/apis/maps/sitemap.html">maps sitemap API</a> page. We already support sitemaps in our <a href="http://www.missiondata.com/site/content-management/">content management</a> solution and we will be integrating this new mapping feature as well.</p>
<p>The second new feature added has to do with getting your sitemap included in search engines. Now all search engines that support sitemaps will <a href="http://searchengineland.com/070411-080716.php">inspect your robots.txt file</a> for a pointer to your sitemap. This should remove the need for everyone to submit their sitemap to every search engine. You may still want to submit your sitemap because there are nice tools from engines like Google that let you investigate more information about your site but now you won&#8217;t have to if all you are looking for is your site to be crawled correctly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.missiondata.com/blog/seo/78/recent-sitemap-enhancements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Computing time with Oracle sysdate</title>
		<link>http://www.missiondata.com/blog/database/77/computing-time-with-oracle-sysdate/</link>
		<comments>http://www.missiondata.com/blog/database/77/computing-time-with-oracle-sysdate/#comments</comments>
		<pubDate>Wed, 11 Apr 2007 15:35:39 +0000</pubDate>
		<dc:creator>carsonm</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[sysdate]]></category>

		<guid isPermaLink="false">http://www.missiondata.com/blog/oracle/77/computing-time-with-oracle-sysdate/</guid>
		<description><![CDATA[If you ever need to work with something other than a day when using sysdate you are in luck. As it turns out you can work on sysdate with fractional days. This is just what a person needs when they want to do something like: SELECT mycol FROM sometable WHERE sometimestamp &#38;lt; "30 seconds ago" [...]]]></description>
			<content:encoded><![CDATA[<p>If you ever need to work with something other than a day when using sysdate you are in luck. As it turns out you can work on sysdate with fractional days. This is just what a person needs when they want to do something like:</p>
<pre><code>SELECT mycol FROM sometable WHERE sometimestamp &amp;lt; "30 seconds ago"</code></pre>
<p>The main trick here is to know that sysdate math is based in days and fractional days work. Here are a few examples:</p>
<p><strong>Remove hours from a date</strong>:</p>
<p>sysdate &#8211; hours/hours in a day</p>
<p><strong>Remove minutes from a date</strong>:</p>
<p>sysdate &#8211; minutes/(hours in a day * minutes in an hour)<br />
or<br />
sysdate &#8211; minutes/minutes in a day</p>
<p><strong>Remove seconds from a date</strong>:</p>
<p>sysdate &#8211; seconds/(hours in a day * minutes in an hour * seconds in a minute)<br />
or<br />
sysdate &#8211; seconds/seconds in a day</p>
<p>The example above would be:</p>
<pre><code>SELECT mycol FROM sometable WHERE sometimestamp &amp;lt; sysdate - 30/(24*60*60)</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.missiondata.com/blog/database/77/computing-time-with-oracle-sysdate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Create and Overlay KML on a Google Map Using Google&#8217;s My Maps</title>
		<link>http://www.missiondata.com/blog/systems-integration/72/how-to-overlay-kml-on-a-google-map/</link>
		<comments>http://www.missiondata.com/blog/systems-integration/72/how-to-overlay-kml-on-a-google-map/#comments</comments>
		<pubDate>Fri, 06 Apr 2007 14:33:48 +0000</pubDate>
		<dc:creator>carsonm</dc:creator>
				<category><![CDATA[Systems Integration]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[embedded maps]]></category>
		<category><![CDATA[gis]]></category>
		<category><![CDATA[Google My Maps]]></category>

		<guid isPermaLink="false">http://www.missiondata.com/blog/gis/72/how-to-overlay-kml-on-a-google-map/</guid>
		<description><![CDATA[A few days ago Google made their &#8220;My Maps&#8221; announcment and since then there has been nothing but buzz buzz buzz about it. So I figured I would take a minute to show how someone can use this new tool from Google to create their own embedded maps for their site. The first step is [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago Google made their <a href="http://googleblog.blogspot.com/2007/04/map-making-so-easy-caveman-could-do-it.html">&#8220;My Maps&#8221; announcment</a> and since then there has been nothing but <a href="http://radar.oreilly.com/archives/2007/04/google_launches_mymaps.html">buzz</a> <a href="http://mashable.com/2007/04/05/google-mymaps/">buzz</a> <a href="http://www.gearthblog.com/blog/archives/2007/04/my_maps_new_google_m.html">buzz</a> about it. So I figured I would take a minute to show how someone can use this new tool from Google to create their own embedded maps for their site.</p>
<p><span id="more-72"></span></p>
<p>The first step is to create your new map. Go to <a href="http://maps.google.com/">Google Maps</a> and click on the new &#8220;My Maps&#8221; tab.</p>
<p><img src="http://www.missiondata.com/blog/wp-content/uploads/2007/04/ss6.jpg" alt="Web Hosting, Web Development, and Software Development in Louisville Ky" /></p>
<p>Now you create your map. You can create polygons, lines or just points and include whatever you want in the descriptions because it will all be included in the KML.</p>
<p>Once you have completed your map you want to go to click on the KML link at the top right to save the KML for this map to disk.</p>
<p><img src="http://www.missiondata.com/blog/wp-content/uploads/2007/04/ss5.jpg" alt="Web Hosting, Web Development, and Software Development in Louisville Ky" /></p>
<p>Just last month Google added <a href="http://googlemapsapi.blogspot.com/2007/03/kml-and-georss-support-added-to-google.html">support for KML overlays</a> to their map API. It isn&#8217;t very well documented on the <a href="http://www.google.com/apis/maps/documentation/reference.html#GGeoXml">GGeoXml documentation</a> page but there is only one real issue you have to know about. The main thing to understand is that the KML file must sit on a public webserver somewhere and when you reference it Google needs to be able to access it. For example if you are testing on your local box and you put something like &#8220;http://localhost/mykml.kml&#8221; in for the URL it will not work. After you get past that the path to using your saved KML file is easy. Here is a full example:</p>
<pre><code>
    &lt;script src="http://maps.google.com/maps?file=api&amp;amp;v=2&amp;amp;key=ABQIAAAAcktFen-Z7CQCe0dxIKmxeRReUzuwBhfUVuhk2aRjVRv1avb-hhQdlkzQnQ1P5PComj1CZx2jeOOyIw" type="text/javascript"&gt;<!--mce:0-->&lt;/script&gt;
    &lt;script type="text/javascript"&gt;<!--mce:1-->&lt;/script&gt;
</code></pre>
<p>Notice that you have to zoom and center to somewhere since that isn&#8217;t controled by the KML file but other than that it makes creating embedded maps very simple.</p>
<p>And here are the results from the example:</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.missiondata.com/blog/systems-integration/72/how-to-overlay-kml-on-a-google-map/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Latest on Rails Performance</title>
		<link>http://www.missiondata.com/blog/web-development/70/latest-on-rails-performance/</link>
		<comments>http://www.missiondata.com/blog/web-development/70/latest-on-rails-performance/#comments</comments>
		<pubDate>Mon, 02 Apr 2007 01:02:53 +0000</pubDate>
		<dc:creator>carsonm</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rails performance test]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.missiondata.com/blog/uncategorized/70/latest-on-rails-performance/</guid>
		<description><![CDATA[Updated Rails 1.2 performance numbers have been released. While these number look pretty good it is hard to get a good idea of exactly what the performance of Rails is. A couple of other benchmarks that include Rails such as performance tests for 6 frameworks and Grails vs Rails benchmarks show a different picture. Both [...]]]></description>
			<content:encoded><![CDATA[<p>Updated <a href="http://railsexpress.de/blog/articles/2007/04/01/rails-1-2-performance">Rails 1.2 performance</a> numbers have been released. While these number look pretty good it is hard to get a good idea of exactly what the performance of Rails is. A couple of other benchmarks that include Rails such as <a href="http://www.alrond.com/en/2007/jan/25/performance-test-of-6-leading-frameworks/">performance tests for 6 frameworks</a> and <a href="http://grails.org/Grails+vs+Rails+Benchmark">Grails vs Rails benchmarks</a> show a different picture. Both of these come up with much worse performance than the first. Maybe the issue is that the second two benchmarks are using <a href="http://httpd.apache.org/docs/2.0/programs/ab.html">Apache ab</a> but the first uses a <a href="http://railsexpress.de/blog/articles/2007/04/01/new-railsbench-release-0-9-2">new version</a> of <a href="http://railsbench.rubyforge.org/">rails bench</a>. Of course most people probably aren&#8217;t that worried about the benchmarks that much because you can find ways to make anything fast as shown with <a href="http://joyeur.com/2007/02/04/a-brief-update-with-some-numbers-for-hardware-load-balanced-mongrels">Rails doing 4000 requests a second</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.missiondata.com/blog/web-development/70/latest-on-rails-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Online Vs Offline Applications: Everything old is new again</title>
		<link>http://www.missiondata.com/blog/software-development/51/online-vs-offline-applications-everything-old-is-new-again/</link>
		<comments>http://www.missiondata.com/blog/software-development/51/online-vs-offline-applications-everything-old-is-new-again/#comments</comments>
		<pubDate>Wed, 28 Mar 2007 13:09:30 +0000</pubDate>
		<dc:creator>carsonm</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[online apps]]></category>

		<guid isPermaLink="false">http://www.missiondata.com/blog/software/51/online-vs-offline-applications-everything-old-is-new-again/</guid>
		<description><![CDATA[Everyone has probably noticed this already but the old is new again cycle for &#8220;online&#8221; desktop apps has been shortening at a rapid pace. Everywhere you turn you see people talking about offline and online apps and what should be online vs offline. If you take your time machine back you would see something like [...]]]></description>
			<content:encoded><![CDATA[<p>Everyone has probably noticed this already but the old is new again cycle for &#8220;online&#8221; desktop apps has been shortening at a rapid pace. Everywhere you turn you see people talking about offline and online apps and <a href="http://www.readwriteweb.com/archives/offline_webapps_online_desktop_counterpoint.php">what should be online vs offline</a>. If you take your time machine back you would see something like the following timeline:</p>
<ul>
<li>1970s 3270</li>
<li>1980s X terminal</li>
<li>1990s Java applets</li>
<li>2000 Flash</li>
<li>2005 Ajax</li>
</ul>
<p>Up until about 2000 it was taking 10 years to cycle from &#8220;we want everything on our desktop&#8221; to &#8220;we want everything on the server&#8221;. Now the cycle seems to have sped up to every year and then to constant. A couple recent examples of new faces on this old idea are <a href="http://www.readwriteweb.com/archives/adobe_apollo_collision_course_browsers.php">Adobe&#8217;s Apollo</a> and <a href="http://joyeur.com/2007/03/22/joyent-slingshot">Joyent&#8217;s Slingshot</a>.</p>
<p>Fundamentally not much has changed from the 1970s. The goal is to centralize computing resources into one place (in the simple view of things) and make issues like software deployment easier.The main difference now is that the industry has come to the point where there isn&#8217;t any turning back and everyone has bought on to the need and usefulness of online apps. The main sticking point seems to be finding a way to resolve issues that come up from users being disconnected from time to time. I&#8217;ll bet that one won&#8217;t be fully resolved until you have connectivity anywhere and everywhere you go.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.missiondata.com/blog/software-development/51/online-vs-offline-applications-everything-old-is-new-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>S3 Streaming With PHP</title>
		<link>http://www.missiondata.com/blog/systems-integration/49/s3-streaming-with-php/</link>
		<comments>http://www.missiondata.com/blog/systems-integration/49/s3-streaming-with-php/#comments</comments>
		<pubDate>Sat, 25 Nov 2006 18:45:24 +0000</pubDate>
		<dc:creator>carsonm</dc:creator>
				<category><![CDATA[Systems Integration]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[s3]]></category>

		<guid isPermaLink="false">http://blogs.missiondata.com/linux/49/s3-streaming-with-php/</guid>
		<description><![CDATA[Steven pointed out that someone was looking for a way to stream to S3 using PHP and said I should figure out how to get it going. Since he made a patch to let you stream data with Ruby using S3 I figured I should do one for PHP. There may be better ways of [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blogs.missiondata.com/author/steveny/">Steven</a> pointed out that someone was looking for a way to <a href="http://developer.amazonwebservices.com/connect/thread.jspa?threadID=12829&#038;tstart=0">stream to S3 using PHP</a> and said I should figure out how to get it going. Since he made a patch to let you <a href="http://blogs.missiondata.com/ruby/29/streaming-data-to-s3-with-ruby/">stream data with Ruby using S3</a> I figured I should do one for PHP. There may be better ways of doing this but since I&#8217;ve already done it with C using curl I figured that would be the fastest way.<br />
<span id="more-49"></span></p>
<p>First you will want to get the <a href="http://developer.amazonwebservices.com/connect/servlet/JiveServlet/download/24-12470-46948-845/s3.php">S3 PHP library from Amazon</a>. Then you add the following to the file:</p>
<pre>
<code>/**
 * putObjectStream -- Streams data to a bucket.
 *
 * Takes ($bucket, $key, $streamFunction, $contentType, $contentLength [,$acl, $metadataArray, $md5])
 *
 *
 * - [str] $bucket: the bucket into which file will be written
 * - [str] $key: key of written file
 * - [str] $streamFunction: function to call for data to stream
 * - [str] $contentType: file content type
 * - [str] $contentLength: file content length
 * - [str] $acl: access control policy of file (OPTIONAL: defaults to 'private')
 * - [str] $metadataArray: associative array containing user-defined metadata (name=&gt;value) (OPTIONAL)
 * - [bool] $md5: the MD5 hash of the object (OPTIONAL)
*/
function putObjectStream($bucket, $key, $streamFunction, $contentType, $contentLength, $acl, $metadataArray, $md5){
        sort($metadataArray);
        $resource = "$bucket/$key";
        $resource = urlencode($resource);
        $httpDate = gmdate("D, d M Y G:i:s T");

        $curl_inst = curl_init();

        curl_setopt ($curl_inst, CURLOPT_CONNECTTIMEOUT, 30);
        curl_setopt ($curl_inst, CURLOPT_LOW_SPEED_LIMIT, 1);
        curl_setopt ($curl_inst, CURLOPT_LOW_SPEED_TIME, 180);
        curl_setopt ($curl_inst, CURLOPT_NOSIGNAL, 1);
        curl_setopt ($curl_inst, CURLOPT_READFUNCTION, $streamFunction);
        curl_setopt ($curl_inst, CURLOPT_URL, $this-&gt;serviceUrl . $resource);
        curl_setopt ($curl_inst, CURLOPT_UPLOAD, true);
        curl_setopt ($curl_inst, CURLINFO_CONTENT_LENGTH_UPLOAD, $contentLength);

        $header[] = "Date: $httpDate";
        $header[] = "Content-Type: $contentType";
        $header[] = "Content-Length: $contentLength";
        $header[] = "Expect: ";
        $header[] = "Transfer-Encoding: ";
        $header[] = "x-amz-acl: $acl";

        $MD5 = "";
        if($md5){
                $MD5 = $this-&gt;hex2b64(md5_file($filePath));
                $header[] = "Content-MD5: $MD5";
        }

        $stringToSign="PUT\n$MD5\n$contentType\n$httpDate\nx-amz-acl:$acl\n";
        foreach($metadataArray as $current){
                if($current!=""){
                        $stringToSign.="x-amz-meta-$current\n";
                        $header = substr($current,0,strpos($current,':'));
                        $meta = substr($current,strpos($current,':')+1,strlen($current));
                        $header[] = "x-amz-meta-$header: $meta";
                }
        }

        $stringToSign.="/$resource";

        $signature = $this-&gt;constructSig($stringToSign);

        $header[] = "Authorization: AWS $this-&gt;accessKeyId:$signature";

        curl_setopt($curl_inst, CURLOPT_HTTPHEADER, $header);
        curl_setopt($curl_inst, CURLOPT_RETURNTRANSFER, 1);

        $result = curl_exec ($curl_inst);

        $this-&gt;responseString = $result;
        $this-&gt;responseCode = curl_getinfo($curl_inst, CURLINFO_HTTP_CODE);

        curl_close($curl_inst);
}</code>
</pre>
<p>Now you have an updated s3.php you are ready to start streaming. Be aware that the content length value needs to be correct. If it is not the correct size your upload will be either truncated (too short) or it will hang (too long). If it hangs the S3 service will timeout after a small amount of time and give you an error.</p>
<p>Here are two examples of how to use it. First with a file:</p>
<pre>
<code>&lt;?php

include 's3.php';

class MyClass
{
  var $data;

  function stream_function($handle, $fd, $length)
  {
    return fread($this-&gt;data, $length);
  }
}

$my_class_inst = new MyClass();

$fsize = filesize("/tmp/largefile.tar.gz");

$my_class_inst-&gt;data = fopen("/tmp/largefile.tar.gz", "r");

$s3_inst = new s3("access key", "private key");
$s3_inst-&gt;putObjectStream("abucket", "largefile.tar.gz", array($my_class_inst, "stream_function"), "application/x-gzip", $fsize, "public-read", array(), null);

print "Response String: " . $s3_inst-&gt;responseString . "\n";
print "Response Code: " . $s3_inst-&gt;responseCode . "\n";
print "Parsed XML: " . $s3_inst-&gt;parsed_xml . "\n";

fclose($my_class_inst-&gt;data);

?&gt;</code>
</pre>
<p>Another example of streaming some random text:</p>
<pre>
<code>&lt;?php

include 's3.php';

class MyClass
{
  var $data;

  function stream_function($handle, $fd, $length)
  {
    return $this-&gt;data;
  }
}

$my_class_inst = new MyClass();

$my_class_inst-&gt;data = "A test string";
$size = strlen($my_class_inst-&gt;data);

$s3_inst = new s3("access key", "private key");
$s3_inst-&gt;putObjectStream("bucketname", "test.txt", array($my_class_inst, "stream_function"), "text/html", $size, "public-read", array(), null);

print "Response String: " . $s3_inst-&gt;responseString . "\n";
print "Response Code: " . $s3_inst-&gt;responseCode . "\n";
print "Parsed XML: " . $s3_inst-&gt;parsed_xml . "\n";

?&gt;</code>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.missiondata.com/blog/systems-integration/49/s3-streaming-with-php/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Cleaning up stale rails sessions (removing ruby_sess files)</title>
		<link>http://www.missiondata.com/blog/web-development/58/cleaning-up-stale-rails-sessions-removing-ruby_sess-files/</link>
		<comments>http://www.missiondata.com/blog/web-development/58/cleaning-up-stale-rails-sessions-removing-ruby_sess-files/#comments</comments>
		<pubDate>Thu, 08 Jun 2006 11:59:02 +0000</pubDate>
		<dc:creator>carsonm</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[System Administration]]></category>

		<guid isPermaLink="false">http://blogs.missiondata.com/?p=58</guid>
		<description><![CDATA[I&#8217;m not sure if something isn&#8217;t set up correctly of if this is just a fact of life with rails but the sessions it creates never seem to go away. I think before rails 1.1 the sessions where stored in /tmp and now they are stored in the apps directory along with everything else so [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not sure if something isn&#8217;t set up correctly of if this is just a fact of life with rails but the sessions it creates never seem to go away. I think before rails 1.1 the sessions where stored in /tmp and now they are stored in the apps directory along with everything else so they is probably no internal mechanism to delete them. I only noticed because after about a month of an certain app running the disk on the machine started to fill up. After digging a little I found 50K ruby_sess.* files hanging out in the rails session directory.</p>
<p>Anyway it was easy enough to clean up the stale ruby_sess files by going into the rails webapp/session directory and then running the following command:</p>
<pre>
<code>find -type f -name "ruby_sess*" -exec rm -f {} \;</code>
</pre>
<p>I&#8217;m not sure why the app is creating sessions but it isn&#8217;t something that stores state so I didn&#8217;t have to worry about killing active sessions here. If you do need to worry about that you will probably want to toss a time on the find command.</p>
<p>After looking a little more I found a <a href="http://www.realityforge.org/articles/2006/03/01/removing-stale-rails-sessions">post about this</a> that has a ruby way of cleaning up the sessions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.missiondata.com/blog/web-development/58/cleaning-up-stale-rails-sessions-removing-ruby_sess-files/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Creating S3 URLs that expire using PHP</title>
		<link>http://www.missiondata.com/blog/systems-integration/57/creating-s3-urls-that-expire-using-php/</link>
		<comments>http://www.missiondata.com/blog/systems-integration/57/creating-s3-urls-that-expire-using-php/#comments</comments>
		<pubDate>Thu, 01 Jun 2006 11:50:24 +0000</pubDate>
		<dc:creator>carsonm</dc:creator>
				<category><![CDATA[Systems Integration]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[s3]]></category>

		<guid isPermaLink="false">http://blogs.missiondata.com/?p=57</guid>
		<description><![CDATA[After reading this post on the S3 forum I realized that other people are thinking about doing some of the same stuff I have. paolonew was looking for a way to for a way to create URLs to S3 objects that expired. I did this a while back when I was thinking about how to [...]]]></description>
			<content:encoded><![CDATA[<p>After reading <a href="http://developer.amazonwebservices.com/connect/thread.jspa?threadID=10726&#038;tstart=0">this post on the S3 forum</a> I realized that other people are thinking about doing some of the same stuff I have. paolonew was looking for a way to for a way to create URLs to S3 objects that expired. I did this a while back when I was thinking about how to host objects that I wanted to protect with some outside scheme. The confusion on the forum seemed to be about the timestamps used to expire the URL. For PHP it is fairly easy.</p>
<p>To clear up the expiration time issue I think these two steps are needed:</p>
<p>1) Keep in mind that the HTTP header dates <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html">must</a> be in GMT.<br />
2) The PHP function <a href="http://us3.php.net/manual/en/function.time.php">time()</a> returns the seconds since the epoch January 1 1970 00:00:00 GMT). Notice here this is in GMT as well.<br />
3) The HTTP Date header you see in a response from an S3 server is the time on that server. The machine you use to sign your request should be synced with that time. I think a good guess is that all the Amazon servers are synced with the atomic clock.</p>
<p>There isn&#8217;t much to securing a URL after you have that tucked away. Here is an example that will sign a URL so that it is valid for 60 seconds:</p>
<pre>
<code>&lt;?php

require_once('Crypt/HMAC.php');

echo getS3Redirect("/test.jpg") . "\\n";

function getS3Redirect($objectName)
{
  $S3_URL = "http://s3.amazonaws.com";
  $keyId = "your key";
  $secretKey = "your secret";
  $expires = time() + 60;
  $bucketName = "/your bucket";

  $stringToSign = "GET\\n\\n\\n$expires\\n$bucketName$objectName";
  $hasher =&amp; new Crypt_HMAC($secretKey, "sha1");
  $sig = urlencode(hex2b64($hasher-&gt;hash($stringToSign)));

  return "$S3_URL$bucketName$objectName?AWSAccessKeyId=$keyId&amp;Expires=$expires&amp;Signature=$sig";
}

function hex2b64($str)
{
    $raw = '';
    for ($i=0; $i &lt; strlen($str); $i+=2)
    {
        $raw .= chr(hexdec(substr($str, $i, 2)));
    }
    return base64_encode($raw);
}

?&gt;</code>
</pre>
<p>The hex2b64 function was pulled from the amazon S3 PHP example library.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.missiondata.com/blog/systems-integration/57/creating-s3-urls-that-expire-using-php/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Search Engine Marketing and Google&#8217;s new trending tools</title>
		<link>http://www.missiondata.com/blog/seo/52/search-engine-marketing/</link>
		<comments>http://www.missiondata.com/blog/seo/52/search-engine-marketing/#comments</comments>
		<pubDate>Thu, 11 May 2006 13:22:59 +0000</pubDate>
		<dc:creator>carsonm</dc:creator>
				<category><![CDATA[SEO]]></category>
		<category><![CDATA[sem]]></category>

		<guid isPermaLink="false">http://blogs.missiondata.com/?p=52</guid>
		<description><![CDATA[Now that google has anounced their new Google trends site I couldn&#8217;t help but mention it. If you spend any type of money at all on SEM you need to check your keywords against this site. There are a couple of intro articles about the new service at Micro Persuasion and TechCrunch. To get a [...]]]></description>
			<content:encoded><![CDATA[<p>Now that google has anounced their new <a href="http://www.google.com/trends">Google trends</a> site I couldn&#8217;t help but mention it. If you spend any type of money at all on SEM you need to check your keywords against this site. </p>
<p>There are a couple of intro articles about the new service at <a href="http://www.micropersuasion.com/2006/05/google_trends_f.html>Micro Persuasion</a> and <a href="http://www.techcrunch.com/2006/05/10/google-trends-launches/">TechCrunch</a>. </p>
<p>To get a real feel for how important this information will be you should try out a few queries for yourself. Take a simple query like <a href="http://www.google.com/trends?q=motorcyle">&#8220;motorcycle&#8221;</a> and then look at the regions tab. A lot of the queries about motorcycles originated from the Philippines. Now look at <a href="http://www.google.com/trends?q=pizza">&#8220;pizza&#8221;</a>, most of the queries there originated from the US. That should make it much easier to target your audience with your advertisments. The trending is nice as well and should give marketers a better idea of when to boost spending to maximize exposure.</p>
<p>This follows another <a href="https://adwords.google.com/select/KeywordToolExternal">tool Google just release for their AdWords service</a>. You can read more about it <a href="http://adwords.blogspot.com/2006/03/keyword-tool-global-trends-and-other.html">at the adwords blog</a>. That tool gives you a different view of the search trends and is more like what you get from <a href="http://searchmarketing.yahoo.com/arp/srch_pr.php">Yahoo&#8217;s advertising system</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.missiondata.com/blog/seo/52/search-engine-marketing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Search Engine Optimization</title>
		<link>http://www.missiondata.com/blog/seo/50/search-engine-optimization/</link>
		<comments>http://www.missiondata.com/blog/seo/50/search-engine-optimization/#comments</comments>
		<pubDate>Wed, 10 May 2006 20:38:49 +0000</pubDate>
		<dc:creator>carsonm</dc:creator>
				<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://blogs.missiondata.com/?p=50</guid>
		<description><![CDATA[Recently I&#8217;ve been collecting links on interesting SEO topics. I figured I would dump a few of them out with quick reasons why I think they are good to read. A technical read on how search engines work in general. It focuses on google but has a lot of good general information in it. This [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve been collecting links on interesting SEO topics. I figured I would dump a few of them out with quick reasons why I think they are good to read.</p>
<p><a href="http://www-db.stanford.edu/~backrub/google.html">A technical read</a> on how search engines work in general. It focuses on google but has a lot of good general information in it.</p>
<p>This is a recent article on how to optimize your site. I like it because it has an acronym on how to do it <a href="http://www.web-designers.biz/2006/01/search-engine-optimization-for.html">&#8220;camelot&#8221;</a>.</p>
<p>SEO chat has a lot of information in its <a href="http://forums.seochat.com/">forums</a>.</p>
<p><a href="http://www.mattcutts.com/blog/notifying-webmasters-of-penalties/">An article</a> from a guy who works at Google and goes into what the search engines have to deal with to keep people on the up and up. It goes into some of the stuff you don&#8217;t want to be doing to try to get your site at the top of a search. For some reason I found it interesting that this guy is from kentucky.</p>
<p>Another good article on the <a href="http://www.seochat.com/c/a/Website-Promotion-Help/SEO-Code-of-Conduct/">&#8220;SEO Code of Conduct&#8221;</a> AKA what you should not be doing to get your site at the top of a search.</p>
<p>A nice tool to help you find words to go with your website: <a href="http://www.wordtracker.com/">WordTracker</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.missiondata.com/blog/seo/50/search-engine-optimization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

