<?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>newthink.net &#187; Software</title>
	<atom:link href="http://www.newthink.net/tag/software/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.newthink.net</link>
	<description>Less Talk. More Do.</description>
	<lastBuildDate>Tue, 26 Jan 2010 18:28:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PostRank Python API</title>
		<link>http://www.newthink.net/2008/07/14/postrank-python-api/</link>
		<comments>http://www.newthink.net/2008/07/14/postrank-python-api/#comments</comments>
		<pubDate>Mon, 14 Jul 2008 15:22:00 +0000</pubDate>
		<dc:creator>Ash Christopher</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[AideRSS]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[PostRank]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://newthink.net/blog/2008/07/14/postrank-python-api/</guid>
		<description><![CDATA[What is PostRank?
PostRank is a scoring system developed by AideRSS to rank any kind of online content, such as RSS feed items, blog posts, articles, or news stories. PostRank is based on social engagement, which refers to how interesting or relevant people have found an item or category to be.
Public-facing RESTful API&#8217;s are becoming more [...]]]></description>
			<content:encoded><![CDATA[<h3>What is PostRank?</h3>
<blockquote><p>PostRank is a scoring system developed by AideRSS to rank any kind of online content, such as RSS feed items, blog posts, articles, or news stories. PostRank is based on social engagement, which refers to how interesting or relevant people have found an item or category to be.</p></blockquote>
<p>Public-facing <a href="http://en.wikipedia.org/wiki/RESTful">RESTful</a> API&#8217;s are becoming more popular as a way to allow access to services by third-parties. <a href="http://www.aiderss.com">AideRSS</a> recently decoupled their PostRank service and offered it as a stand-alone service allowing any developer to use <a href="http://www.postrank.com">PostRank</a> within their application. I am in the process of updating this website/blog and I am planning to make use of the PostRank service not only as a tool to measure my engagement with the public, but increase the usefulness of my posts.</p>
<h3>What is PostRank Python API and what does it do?</h3>
<p>This is an api accessor for python that allows a developer to quickly access all of the services offered by PostRank. It is loosely modeled after <a href="http://mike.verdone.ca/twitter/">Mike Verdone&#8217;s Python Twitter Tools</a> in that it is simple to use, and it uses the same arguments as those documented on the <a href="http://postrank.com/developers.html">PostRank API</a> page.</p>
<h3>What are the requirements?</h3>
<ul>
<li>Python 2.5 <em>(haven&#8217;t tested with &lt;2.4)</em></li>
<li>simplejson python library <em>(if using json output)</em></li>
</ul>
<h3>How do I use it?</h3>
<p>Using the PostRank Python API is very easy. The first step should be to look at the API documentation provided by the PostRank website.</p>
<p><img src="http://newthink.net/wp-content/uploads/2008/07/feed_id_api_doc1.png" alt="feed_id API Doc" /></p>
<p>We can see what options the api needs in order to satisfy the request. We just need to specify the resource that we want to use, then we can add all the arguments we want passed along to PostRank.</p>
<p><img src="http://newthink.net/wp-content/uploads/2008/07/feed_id_usage_example.png" alt="feed_id usage example." /></p>
<p>If you have selected JSON as your format, the api will return to you a simplejson object which can be accessed just like a multi-dimensional array. When using JSON, it is extremely simple to get at the information provided by PostRank.</p>
<p><img src="http://newthink.net/wp-content/uploads/2008/07/using_json_object.png" alt="Using the json object." /></p>
<p>There is a bit of a trick when using the &#8216;<a href="http://postrank.com/api/postrank.html">postrank</a>&#8216; resource but it certainly isn&#8217;t difficult to use.  It works the exact same way &#8211; the PostRank API says it wants an array of urls (url[]) so we will pass in an array of urls as an argument (same thing for the feed_id[]).</p>
<p><img src="http://newthink.net/wp-content/uploads/2008/07/post_rank_api_doc.png" alt="post_rank API Doc" /></p>
<p>Following the same pattern as before, we just pass in the resource we want to use and the API arguments.</p>
<p><img src="http://newthink.net/wp-content/uploads/2008/07/postrank_usage_example.png" alt="postrank usage example." /></p>
<p>There really isn&#8217;t much more to it.  For now, you can find the python library here: <a href="http://newthink.net/~ash/software/postrankapi/">http://newthink.net/~ash/software/postrankapi/</a> When my new website is done, I plan to find a more permanent place for this (and future software).  Next step, creating an egg and integrating with ez_install.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.newthink.net/2008/07/14/postrank-python-api/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>A Few Weeks With Rails</title>
		<link>http://www.newthink.net/2007/11/05/a-few-weeks-with-rails/</link>
		<comments>http://www.newthink.net/2007/11/05/a-few-weeks-with-rails/#comments</comments>
		<pubDate>Mon, 05 Nov 2007 16:30:00 +0000</pubDate>
		<dc:creator>Ash Christopher</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://newthink.net/blog/2007/11/05/a-few-weeks-with-rails/</guid>
		<description><![CDATA[ It&#8217;s been a few weeks since I started using Ruby on Rails, and so far it has been pretty good. That isn&#8217;t to say I havent run into a few hickups.
I am quite familiar with PHP, so I set out to try to do the same things in rails as I would in PHP. [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://newthink.net/wp-content/uploads/2007/11/rails.png' alt='Ruby on Rails' align='left' style='margin-right: 10px' /> It&#8217;s been a few weeks since I started using Ruby on Rails, and so far it has been pretty good. That isn&#8217;t to say I havent run into a few hickups.</p>
<p>I am quite familiar with PHP, so I set out to try to do the same things in rails as I would in PHP. Everything seemed to transfer over without effort&#8230; except file upload inputs. These kept me busy for quite some time, and had me wanting to pull out my hair.</p>
<p>I tried to make use of the community; exploring the wiki, reading through the rails cookbook, seeking out blogs that addressed the issue, visiting <strong>#rubyonrails</strong> on <strong>irc.freenode.net</strong> on a regular basis. Infact, the IRC community was referring me to the wiki article (<a href="http://wiki.rubyonrails.org/rails/pages/HowtoUploadFiles">HowtoUploadFiles</a>). No matter how I tried, the upload just wouldnt work. I had narrowed the problem down to the <em>multipart => &#8220;true&#8221;</em> definition, but that was about as far as I could get without help. Luckily, I know a few rails nunjas (gurus) who helped me figure out what to do.</p>
<p>As it turns out, the rails wiki was incorrect. Since the project is opensource, it was easy enough for me to fix the documentation (perhaps the documentation was for a previous version of rails, and hadn&#8217;t been updated), but it was still a frustrating week (I was actually only working on it maybe and hour a night, but still) especially since it was such a simple task I was trying to complete.</p>
<p>Hopefully there are no more hiccups like this as I go forward. I am already thinking about a cool new idea which I am excited to work on once I complete this test application.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.newthink.net/2007/11/05/a-few-weeks-with-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What Is This Rails Thing?</title>
		<link>http://www.newthink.net/2007/10/01/what-is-this-rails-thing/</link>
		<comments>http://www.newthink.net/2007/10/01/what-is-this-rails-thing/#comments</comments>
		<pubDate>Mon, 01 Oct 2007 15:18:20 +0000</pubDate>
		<dc:creator>Ash Christopher</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://newthink.net/blog/2007/10/01/what-is-this-rails-thing/</guid>
		<description><![CDATA[A few weeks ago, I downloaded an eBook on Ruby on Rails and gave the first few chapters a read. It was decently interesting, and it sounded like something I would like to get into. I am not a fan of eBooks, so I decided I would spring for a physical copy.

The book covers Rails [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, I downloaded an eBook on Ruby on Rails and gave the first few chapters a read. It was decently interesting, and it sounded like something I would like to get into. I am not a fan of eBooks, so I decided I would spring for a physical copy.</p>
<p><a href="http://www.amazon.ca/Agile-Development-Rails-Dave-Thomas/dp/0977616630/ref=sr_1_1/702-0097744-5236026?ie=UTF8&#038;s=books&#038;qid=1191254859&#038;sr=8-1"><img src='http://newthink.net/blog/wp-content/uploads/2007/10/51yzkk7c2wl__ss500_.jpg' alt='Agile Web Development with Rails' /></a></p>
<p>The book covers Rails development from the beginners level to the fairly advanced. It offers an easy tutorial which one can follow along, and gives a decent amount of information about most of the features they have available.</p>
<p>One of the biggest features that the Rails framework offers is migration. Although it is a fairly small part of Rails, it is a technology which I know is useful to many companies. At Pason, we created our own technology that basically does the same task as migration. It would have been nice to just use the Rails&#8217; migration instead of developing our own.</p>
<p>The biggest issue I am having now, is getting back into the Python-style of coding. Ruby and Python are fairly similar&#8230; and very much different from Java and C++ which I am more familiar with. There are also a few speedbumps I am noticing when working on my first Rails project, but I hope to overcome them soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.newthink.net/2007/10/01/what-is-this-rails-thing/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Solving The HTTP Double-Post Dilema</title>
		<link>http://www.newthink.net/2007/03/06/solving-the-double-post-dilema/</link>
		<comments>http://www.newthink.net/2007/03/06/solving-the-double-post-dilema/#comments</comments>
		<pubDate>Wed, 07 Mar 2007 03:20:03 +0000</pubDate>
		<dc:creator>Ash Christopher</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://newthink.net/blog/2007/03/06/solving-the-double-post-dilema/</guid>
		<description><![CDATA[Everyone who has done any sort of web development, and made use of the HTTP POST has run into this problem. If you haven&#8217;t, are you sure you are doing proper QA?
Basically, the problem comes from having the POST information still resident after an HTTP POST. If the user were to refresh their browser, that [...]]]></description>
			<content:encoded><![CDATA[<p>Everyone who has done any sort of web development, and made use of the <strong>HTTP POST</strong> has run into this problem. If you haven&#8217;t, are you sure you are doing proper QA?</p>
<p>Basically, the problem comes from having the POST information still resident after an <strong>HTTP POST</strong>. If the user were to refresh their browser, that POST information will be resent, resulting in a double post. There are many ways to solve this problem, but the one I will outline (in PHP) seemed like the best for my situation.</p>
<p>Let us assume we have a text input and a button and that our form.php file will process our form as well as present it to the user (yes, I know this isn&#8217;t a good idea, but it is just an example).<br />
<span id="more-14"></span></p>
<blockquote><p>
&lt;form method=&#8221;post&#8221; action=&#8221;form.php&#8221;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;input name=&#8221;mytext&#8221; /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;input name=&#8221;submitBtn&#8221; type=&#8221;submit&#8221; /&gt;<br />
&lt;/form&gt;
</p></blockquote>
<p>When we load the page, we are going to check whether the <strong>$_POST</strong> variable is set. If it is, then we are going to do something with it.</p>
<blockquote><p>
session_start();</p>
<p>if(isset($_POST['mytext']))<br />
{<br />
&nbsp;&nbsp;&nbsp;&nbsp;saveToDatabase($_POST['mytext']);<br />
}
</p></blockquote>
<p>Now that we are doing something with this <strong>$_POST['mytext']</strong> variable, we can see the double-post problem materialize. Since the <strong>HTTP POST</strong> is still populated, when the user presses refresh on their browser, the <strong>$_POST['mytext']</strong> will be saved to the database twice.</p>
<p>What we need to do is get rid of the <strong>$_POST</strong> variable after we are done using it.</p>
<p>At the beginning of the form.php file I am going to create a server-side session to store any post information we get. Then I have a check to see whether the $_POST array has been populated.</p>
<p>If the <strong>$_POST</strong> has been populated, we are going to store the post information in the server-side session we have started and we send a blank header back out (which removes the <strong>HTTP POST</strong>).</p>
<blockquote><p>
if (isset($_POST['myText']))<br />
{<br />
&nbsp;&nbsp;&nbsp;&nbsp;$_SESSION['myText'] = $_POST['myText'];<br />
&nbsp;&nbsp;&nbsp;&nbsp;header(&#8220;Location: form.php&#8221;);<br />
}</p></blockquote>
<p>Now, we have gotten rid of the POST which removes the double-post problem, and have stored the information from the <strong>$_POST</strong> for use. We can then access the POST information stored in the session. Once we have copied the POST information from the session, we will unset the session so that the information doesn&#8217;t stay resident.</p>
<blockquote><p>
if (isset($_SESSION['myText']))<br />
{<br />
&nbsp;&nbsp;&nbsp;&nbsp;$myEnteredText = $_SESSION['myText'];<br />
&nbsp;&nbsp;&nbsp;&nbsp;unset($_SESSION['myText']);<br />
}
</p></blockquote>
<p>Now you can use the POST information without running the risk of a double post.</p>
<p>If you would like to see this tutorial in action, create a form.php file on your webserver, and paste the following:</p>
<blockquote><p>
&lt;?<br />
&nbsp;&nbsp;&nbsp;&nbsp;session_start();</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;if (isset($_SESSION['myText']))<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$myEnteredText = $_SESSION['myText'];<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset($_SESSION['myText']);<br />
&nbsp;&nbsp;&nbsp;&nbsp;}</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;if (isset($_POST['myText']))<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$_SESSION['myText'] = $_POST['myText'];<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;header(&#8220;Location: form.php&#8221;);<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
?&gt;</p>
<p>&lt;html&gt;<br />
&lt;head&gt;</p>
<p>&lt;/head&gt;<br />
&lt;body&gt;</p>
<p>&lt;form action=&#8221;form.php&#8221; method=&#8221;POST&#8221;&gt;</p>
<p>&lt;?<br />
&nbsp;&nbsp;&nbsp;&nbsp;if (isset($myEnteredText))<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &#8220;&lt;p&gt;The message you entered was \&#8221;".$myEnteredText.&#8221;\&#8221;&lt;/p&gt;&#8221;;<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
?&gt;</p>
<p>&lt;input name=&#8221;myText&#8221; type=&#8221;text&#8221; /&gt;<br />
&lt;input name=&#8221;submitBtn&#8221; type=&#8221;submit&#8221; value=&#8221;ok&#8221; /&gt;</p>
<p>&lt;/form&gt;<br />
&lt;/body&gt;</p>
<p>&lt;/html&gt;
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.newthink.net/2007/03/06/solving-the-double-post-dilema/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Converting TV Shows To Play On Your iPod In Linux</title>
		<link>http://www.newthink.net/2007/03/02/converting-tv-shows-to-play-on-your-ipod-in-linux/</link>
		<comments>http://www.newthink.net/2007/03/02/converting-tv-shows-to-play-on-your-ipod-in-linux/#comments</comments>
		<pubDate>Fri, 02 Mar 2007 20:30:40 +0000</pubDate>
		<dc:creator>Ash Christopher</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[iPod]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://newthink.net/blog/2007/03/02/converting-tv-shows-to-play-on-your-ipod-in-linux/</guid>
		<description><![CDATA[There are numerous Windows programs out there to convert video for use in your mobile devices. The problem however, is that unless you have a new dual-core machine your PC is more or less unusable until the conversion is complete.
Now, I know not everyone has a Linux machine just lying around, but I do, and [...]]]></description>
			<content:encoded><![CDATA[<p>There are numerous Windows programs out there to convert video for use in your mobile devices. The problem however, is that unless you have a new dual-core machine your PC is more or less unusable until the conversion is complete.</p>
<p>Now, I know not everyone has a Linux machine just lying around, but I do, and maybe in the future it might be enough to convince you to build your own file-server for your home (for media perhaps?).</p>
<p>Before starting, you need to make sure you have the <strong>ffmpeg</strong> binary installed on your Linux box. As of this posting, I have ffmpeg-0.4.9-0.3.20051207.2.el4.rf installed on my CentOS4 machine. I will leave it as an exercise to you to figure out how to install it if you don&#8217;t have it.</p>
<blockquote><p>ash@galactica:[/tmp]> ffmpeg -vcodec xvid -b 500 -qmin 1 -qmax 7 -bufsize 4096 -g 300 -acodec aac -ab 96 -i doctor.who.102.the.end.of.the.world.avi -s 320&#215;240 -aspect 16:9 doctor.who.102.the.end.of.the.world.mp4</p></blockquote>
<p>Here is a run down of what the switches mean and how they affect your converted video:</p>
<blockquote><p><em>-vcodec</em> &#8212; this is the video codec you want the converted video to use. For iPod use, I suggest xvid. It is basically the same codec as mpeg4 (except open source) and you don&#8217;t run into buffer-underflow problems as often.</p>
<p><em>-b</em> &#8212; this is the video bitrate in kbit/s (higher bitrate means higher quality).</p>
<p><em>-qmin &#038; -qmax</em> &#8212; this controls the quality when dealing with VBR (variable bit rate). Basically a range to keep the quality between.</p>
<p><em>-acodec</em> &#8212; the audio codec to use. When converting to iPod video, this must be aac since that is the only format the iPod supports.</p>
<p><em>-ab</em> &#8212; this is the audio bitrate in kbit/s. 96 kbit/s offers decent audio quality for iPod use.</p>
<p><em>-i</em> &#8212; input file (obviously?).</p>
<p><em>-s</em> &#8212; size of the output video. The iPod supports 320&#215;240, 480&#215;480 and with the newest firmware, now supports 640&#215;480. If you want to retain the source aspect ratio, make sure you calculate the new size to follow the sources aspect ratio.</p>
<p><em>-aspect</em> &#8212; aspect ratio for the converted video. This is especially important if your input video is 16:9 and you want to keep the ratio and replace the extra space with black bars. The aspect ratio is usually 4:3 or 16:9.</p></blockquote>
<p>Now,after you have run this command, your video should begin to be converted. The time it takes to convert depends greatly on the hardware being used. I often offload this task to a P-III 800 machine, and it seems to be able to encode a video in the same time it would take to watch it. Again, the nice thing about offloading this task is that you can now use your main system for other fun tasks.</p>
<p>Might I suggest maybe using your main machine to whip up a quick script to encode a list of videos, perhaps at night when spare cpu cycles are pleniful? The nice thing about batching up video conversions like this, is that it is also compatible with mac&#8217;s running OSX. Sure, you could use the mac-GUI program to do it, but that is going to require a whole lot more human interaction to convert 10 shows.</p>
<p>For mor information of supported codecs, see the <a href="http://ffmpeg.mplayerhq.hu/ffmpeg-doc.html#SEC24">FFMPEG Documentation</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.newthink.net/2007/03/02/converting-tv-shows-to-play-on-your-ipod-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
