<?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>Threadbare Canvas Productions &#187; example</title>
	<atom:link href="http://threadbarecanvas.com/category/example/feed/" rel="self" type="application/rss+xml" />
	<link>http://threadbarecanvas.com</link>
	<description>Online Journal of James Hogan the Web Developer</description>
	<lastBuildDate>Fri, 06 Jan 2012 09:59:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Start Uploading Folders in Chrome and Firefox Today</title>
		<link>http://threadbarecanvas.com/example/start-uploading-folders-in-chrome-and-firefox-today/</link>
		<comments>http://threadbarecanvas.com/example/start-uploading-folders-in-chrome-and-firefox-today/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 09:52:39 +0000</pubDate>
		<dc:creator>Siriquelle</dc:creator>
				<category><![CDATA[example]]></category>
		<category><![CDATA[HTML5]]></category>

		<guid isPermaLink="false">http://threadbarecanvas.com/?p=243</guid>
		<description><![CDATA[So, you&#8217;ve been looking for a way to upload folders without using Flash or Java. You heard about folder uploading on google docs but your not sure how to go about implementing it in your application. Well it&#8217;s pretty easy actually if you target chrome users with some clever javascript. HTML5 ready browsers allow the [...]]]></description>
			<content:encoded><![CDATA[<p>So, you&#8217;ve been looking for a way to upload folders without using Flash or Java. You heard about <a title="Folder Uploading On Google Docs" href="http://googledocs.blogspot.com/2011/04/simpler-file-upload-in-google-docs.html" target="_blank">folder uploading on google docs</a> but your not sure how to go about implementing it in your application. Well it&#8217;s pretty easy actually if you <a href="http://davidwalsh.name/detecting-google-chrome-javascript" target="_blank">target chrome</a> users with some clever javascript.<br />
 HTML5 ready browsers allow the multiple file input label so that you&#8217;re users can select a bunch of files at once from a folder. Folder uploading allows your users to select a single folder to upload and the browser takes care of the rest. All you do is add webkitdirectory as an attribute to the file input element and you&#8217;re set.</p>
<pre class="brush:html">
<div class="pnl_default_popup_row">
                    <label for="file_bulk_documents_folder" id="lbl_file_bulk_documents_folder" class="pnl_default_form_header button blue"><span class="label">Choose Folder to Upload</span></label>
<input class="pnl_default_popup_input" type="file" name="file_bulk_documents_folder[]" id="file_bulk_documents_folder" multiple directory webkitdirectory mozdirectory />
<div id="err_file_bulk_documents_folder" class="hide form_input_error_message"></div>
</div>
</pre>
<p>Don&#8217;t think that your server side script will be handling any type of Folder object, because in this case all that the browser does is open up the selected folder and upload all of the files inside. This operation is recursive so be warned that all of the containing files will be thrown at the server. Anyway, enjoy</p>
<p><map name='google_ad_map_243_d0b0fa17a4b5b092'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/243?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_243_d0b0fa17a4b5b092' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=243&amp;url= http%3A%2F%2Fthreadbarecanvas.com%2Fexample%2Fstart-uploading-folders-in-chrome-and-firefox-today%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://threadbarecanvas.com/example/start-uploading-folders-in-chrome-and-firefox-today/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Python to determine if a number is whole or decimal</title>
		<link>http://threadbarecanvas.com/tutorial/using-python-will-determine-if-a-number-is-whole-or-decimal/</link>
		<comments>http://threadbarecanvas.com/tutorial/using-python-will-determine-if-a-number-is-whole-or-decimal/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 21:55:31 +0000</pubDate>
		<dc:creator>Siriquelle</dc:creator>
				<category><![CDATA[example]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://threadbarecanvas.com/?p=152</guid>
		<description><![CDATA[Introduction In this example you will learn how to create a Python application that will determine if a given number is whole or decimal. Step One: Download Python Python is a cool language. Like Ruby it&#8217;s very simple to use. You can download it from the python site. Choose your version, download, install and move [...]]]></description>
			<content:encoded><![CDATA[<h4>Introduction</h4>
<p>In this example you will learn how to create a Python application that will determine if a given number is whole or decimal.</p>
<h4>Step One: Download Python</h4>
<p>Python is a cool language. Like Ruby it&#8217;s very simple to use. You can download it from <a href="http://www.python.org/download/">the python site</a>. Choose your version, download, install and move onto step two.</p>
<h4>Step Two: Simple Python Function</h4>
<p>Python functions are defined using the def keyword. In this example we define an isWhole function to check weather the number entered by the user is whole or not.</p>
<p><em>Code:</em></p>
<pre class="brush:python">def isWhole(x):
	if(x%1 == 0):
		return True
	else:
		return False
</pre>
<p>You&#8217;ll notice that after the function definition there is a colon and there are no semi colons at the end of lines. This is because indention is used to perform code blocks. Using indented code blocks, it is thought, will make the code easier to read.</p>
<h4>Step Three: Desktop application</h4>
<p>Copy and paste the following code into your favourite text editor. I use <a href="http://sourceforge.net/projects/notepad-plus/files/">Notepad++</a> for, like, everything. It really is a very good text editor. Make sure you save it as a .py file. Then, you should be able to run this file by double clicking it. If something goes wrong you micht want to re-st-ar-t your computer. But that&#8217;s it. You&#8217;ve got a start with python.</p>
<p><strong>NOTE:</strong> The first line you&#8217;ll see is commented out &#8216;#!/usr/bin/python&#8217; this is only used my Unix machines and is used for specifying the location of the python install. You may want to edit this line if you are using a Mac or Linux machine. But if you are, chances are, you knew that already.</p>
<p><em>Code:</em></p>
<pre class="brush:python">#!/usr/bin/python
# Filename: run.py

print '*******************'
print #
print '|   Welcome to Python   |'
print #

def isWhole(x):
	if(x%1 == 0):
		return True
	else:
		return False

#The scope of the following while loop
#is determined by the indentation. Spooky huh.
while(True):
	print '*******************'
	print #
	print 'Enter a number and i\'ll tell\nyou if its whole or not:'
	print #

#The function raw_input('Your number please: ') accepts
#raw input from the user. In this case we cast the raw
#input as a float and pass the input to the isWhole function.
	if(isWhole(float(raw_input('Your number please: ')))):
		print #
		print 'Well, this is clearly a whole number.'
	else:
		print #
		print 'Ick, I dont like decimal numbers'

	print #
	print '*******************'
	print #

#The following conditional statement will break out of the while
#loop we are in now, and terminate the program if the user enters N.
#the upper() funciton converts the users input to
#uppercase so that it compares to the N.
	if(raw_input('Would you like to try another number?(Y/N) ').upper() == 'N'):
		break
	print #
</pre>
<h4>Conclusion</h4>
<p>Now that you have this application up and running you can answer that is this a decimal or whole number question with confidence.</p>
<p><map name='google_ad_map_152_d0b0fa17a4b5b092'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/152?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_152_d0b0fa17a4b5b092' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=152&amp;url= http%3A%2F%2Fthreadbarecanvas.com%2Ftutorial%2Fusing-python-will-determine-if-a-number-is-whole-or-decimal%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://threadbarecanvas.com/tutorial/using-python-will-determine-if-a-number-is-whole-or-decimal/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

