<?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</title>
	<atom:link href="http://threadbarecanvas.com/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>How Many King James Bibles Can You Store In SQL Server 2008</title>
		<link>http://threadbarecanvas.com/java-web/how-many-king-james-bibles-can-you-store-in-sql-server-2008/</link>
		<comments>http://threadbarecanvas.com/java-web/how-many-king-james-bibles-can-you-store-in-sql-server-2008/#comments</comments>
		<pubDate>Fri, 23 Dec 2011 10:44:20 +0000</pubDate>
		<dc:creator>Siriquelle</dc:creator>
				<category><![CDATA[Java Web]]></category>

		<guid isPermaLink="false">http://threadbarecanvas.com/?p=235</guid>
		<description><![CDATA[1GB = 1073741824 http://uk.answers.yahoo.com/question/index?qid=20060702023304AATvs3U Bible in Characters: 3228076 http://wiki.answers.com/Q/How_many_letters_in_the_King_James_Bible Hard Disk Size 500G: 536870912000 SQL Server Hard Disk Space 3.6G: 3865470565 http://msdn.microsoft.com/en-us/library/ms143506.aspx Sophos Anti Virus 500 MB: 536870912 Sophos Firewall 100 MB: 107374182 http://www.sophos.com/en-us/products/endpoint/endpoint-protection/components/anti-virus-protection/windows/system-requirements.aspx Windows XP 1.5GB: 1610612736 http://support.microsoft.com/kb/314865 Windows XP Service Pack 3 1230 MB: 1320702443 http://support.microsoft.com/kb/947311 Bytes Remaining: 529429881162 Bible Count: 164007]]></description>
			<content:encoded><![CDATA[<p>1GB = 1073741824<br />
<a title="http://uk.answers.yahoo.com/question/index?qid=20060702023304AATvs3U" href="http://uk.answers.yahoo.com/question/index?qid=20060702023304AATvs3U" target="_blank">http://uk.answers.yahoo.com/question/index?qid=20060702023304AATvs3U</a></p>
<p>Bible in Characters: 3228076<br />
<a title="http://wiki.answers.com/Q/How_many_letters_in_the_King_James_Bible" href="http://wiki.answers.com/Q/How_many_letters_in_the_King_James_Bible" target="_blank">http://wiki.answers.com/Q/How_many_letters_in_the_King_James_Bible</a></p>
<p>Hard Disk Size 500G: 536870912000</p>
<p>SQL Server Hard Disk Space 3.6G: 3865470565<br />
<a title="http://msdn.microsoft.com/en-us/library/ms143506.aspx" href="http://msdn.microsoft.com/en-us/library/ms143506.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/ms143506.aspx</a></p>
<p>Sophos Anti Virus 500 MB: 536870912<br />
Sophos Firewall 100 MB: 107374182<br />
<a title="http://www.sophos.com/en-us/products/endpoint/endpoint-protection/components/anti-virus-protection/windows/system-requirements.aspx" href="http://www.sophos.com/en-us/products/endpoint/endpoint-protection/components/anti-virus-protection/windows/system-requirements.aspx" target="_blank">http://www.sophos.com/en-us/products/endpoint/endpoint-protection/components/anti-virus-protection/windows/system-requirements.aspx</a><br />
Windows XP 1.5GB: 1610612736<br />
<a title="http://support.microsoft.com/kb/314865" href="http://support.microsoft.com/kb/314865" target="_blank">http://support.microsoft.com/kb/314865</a></p>
<p>Windows XP Service Pack 3 1230 MB: 1320702443<br />
<a title="http://support.microsoft.com/kb/947311" href="http://support.microsoft.com/kb/947311" target="_blank">http://support.microsoft.com/kb/947311</a></p>
<p>Bytes Remaining: 529429881162</p>
<p>Bible Count: 164007</p>
<p><map name='google_ad_map_235_d0b0fa17a4b5b092'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/235?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_235_d0b0fa17a4b5b092' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=235&amp;url= http%3A%2F%2Fthreadbarecanvas.com%2Fjava-web%2Fhow-many-king-james-bibles-can-you-store-in-sql-server-2008%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://threadbarecanvas.com/java-web/how-many-king-james-bibles-can-you-store-in-sql-server-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twitter4j Twitter OAuth Example</title>
		<link>http://threadbarecanvas.com/java/twitter4j-twitter-oauth-example/</link>
		<comments>http://threadbarecanvas.com/java/twitter4j-twitter-oauth-example/#comments</comments>
		<pubDate>Mon, 08 Aug 2011 22:16:15 +0000</pubDate>
		<dc:creator>Siriquelle</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[OAuth]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://threadbarecanvas.com/?p=222</guid>
		<description><![CDATA[Today I&#8217;m going to show you some sample code regarding how to send a tweet to twitter using twitter4j and OAuth. The following code example is a command line twitter client that authenticates a user with oAuth and allows them to post a tweet. All you need to to create a project in your favourite [...]]]></description>
			<content:encoded><![CDATA[<p>Today I&#8217;m going to show you some sample code regarding how to send a tweet to twitter using twitter4j and OAuth. The following code example is a command line twitter client that authenticates a user with oAuth and allows them to post a tweet.</p>
<p>All you need to to create a project in your favourite IDE.. for ease of use. Add the twitter4j library to your build path. Compile and run. If you run into any problems shoot them into the comments and I&#8217;ll lend a hand. Happy hacking.</p>
<p><span class="Apple-style-span" style="font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px; white-space: pre;">package com.auth;</span></p>
<pre class="brush:java">import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.logging.Level;
import java.util.logging.Logger;
import twitter4j.Status;
import twitter4j.Twitter;
import twitter4j.TwitterException;
import twitter4j.TwitterFactory;
import twitter4j.User;
import twitter4j.http.AccessToken;
import twitter4j.http.RequestToken;

public class Main {

    public static void main(String args[])
    {
        try
        {
            // The factory instance is re-useable and thread safe.
            Twitter twitter = new TwitterFactory().getInstance();
            twitter.setOAuthConsumer("pESR4xRk4glcGKMCryvdMQ", "ddu3r7IRp0I1luSFOW2iLwKP5pYTY03AZrAjJAVaj8");

            RequestToken requestToken = twitter.getOAuthRequestToken();
            AccessToken accessToken = null;
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            while (null == accessToken)
            {
                System.out.println("Open the following URL and grant access to your account:");
                System.out.println(requestToken.getAuthorizationURL());
                System.out.print("Enter the PIN(if aviailable) or just hit enter.[PIN]:");
                String pin = null;
                try
                {
                    pin = br.readLine();
                } catch (IOException ex)
                {
                    Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
                }
                try
                {
                    if (pin.length() &gt; 0)
                    {
                        accessToken = twitter.getOAuthAccessToken(requestToken, pin);
                    } else
                    {
                        accessToken = twitter.getOAuthAccessToken();
                    }
                } catch (TwitterException te)
                {
                    if (401 == te.getStatusCode())
                    {
                        System.out.println("Unable to get the access token.");
                    } else
                    {
                        te.printStackTrace();
                    }
                }
            }
            //persist to the accessToken for future reference.
            storeAccessToken(twitter.verifyCredentials(), accessToken);
            Status status = twitter.updateStatus(args[0]);
            System.out.println("Successfully updated the status to [" + status.getText() + "].");
            System.exit(0);
        } catch (TwitterException ex)
        {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private static void storeAccessToken(User user, AccessToken accessToken)
    {
        System.out.println(user.getScreenName());
    }
}</pre>
<p><map name='google_ad_map_222_d0b0fa17a4b5b092'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/222?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_222_d0b0fa17a4b5b092' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=222&amp;url= http%3A%2F%2Fthreadbarecanvas.com%2Fjava%2Ftwitter4j-twitter-oauth-example%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://threadbarecanvas.com/java/twitter4j-twitter-oauth-example/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Convert One Generic List to Another Generic List c#</title>
		<link>http://threadbarecanvas.com/c/convert-one-generic-list-to-another-generic-list-c/</link>
		<comments>http://threadbarecanvas.com/c/convert-one-generic-list-to-another-generic-list-c/#comments</comments>
		<pubDate>Tue, 12 Jul 2011 22:33:49 +0000</pubDate>
		<dc:creator>Siriquelle</dc:creator>
				<category><![CDATA[c#]]></category>
		<category><![CDATA[csharp]]></category>

		<guid isPermaLink="false">http://threadbarecanvas.com/?p=194</guid>
		<description><![CDATA[So I came across a need to create a base class that accepted two generics one would be a concrete class and the other would be the interface to that class. The reason for the need to include both as generics is that I was delegating my concrete implementation to Windows Azure. So, Azure will [...]]]></description>
			<content:encoded><![CDATA[<p>So I came across a need to create a base class that accepted two generics one would be a concrete class and the other would be the interface to that class. The reason for the need to include both as generics is that I was delegating my concrete implementation to Windows Azure.</p>
<p>So, Azure will use my concrete class to store my data and I will retrieve it and pop it into my interface. A problem came up where I could not convert a list of one generic type (concrete) to another (interface).</p>
<p>However I have just discovered a way to convert between two generic lists. What this means is that I can tell azure about my concrete class and it will go ahead and persist my data to the cloud. At the same time I can also expose only the Interface of my concrete implementation to the rest of the system. This means that I can keep all of my instantiation safe and sound in factories where they belong, and also in Azure. :)<br />
 Anyway, If you want to Convert One Generic List to Another Generic List using c# then I hope the following code will give you somewhere to begin.</p>
<pre class="brush:csharp">using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GenericListCastingTest
{
    class GenericBoxClass&lt;T, I&gt; where T:I
    {
        private List&lt;T&gt; listT;</pre>
<pre class="brush:csharp">        public IList&lt;I&gt; getSome() {
            IList&lt;I&gt; list = listT.ConvertAll(x =&gt; (I)x);
            return list;
        }

        public void setSome(List&lt;T&gt; value) {
            this.listT = value;
        }
    }
}</pre>
<p>If you want to play around with the source code for my tests on this code please check out http://compilr.com/IDE/32145</p>
<p><map name='google_ad_map_194_d0b0fa17a4b5b092'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/194?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_194_d0b0fa17a4b5b092' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=194&amp;url= http%3A%2F%2Fthreadbarecanvas.com%2Fc%2Fconvert-one-generic-list-to-another-generic-list-c%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://threadbarecanvas.com/c/convert-one-generic-list-to-another-generic-list-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Introduction to HTML5 Local Storage API</title>
		<link>http://threadbarecanvas.com/java-web/simple-introduction-to-html5-local-storage-api/</link>
		<comments>http://threadbarecanvas.com/java-web/simple-introduction-to-html5-local-storage-api/#comments</comments>
		<pubDate>Thu, 21 Oct 2010 10:36:49 +0000</pubDate>
		<dc:creator>Siriquelle</dc:creator>
				<category><![CDATA[Java Web]]></category>

		<guid isPermaLink="false">http://threadbarecanvas.com/?p=184</guid>
		<description><![CDATA[Okay, so if you not looking into HTML5 your letting the biggest movement in web application development since the introduction of CSS pass you by. In this simple example you can see how an object can be stored into your HTML5 compatible browsers localStorage. Try this, copy and paste the following code to a simple [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, so if you not looking into HTML5 your letting the biggest movement in web application development since the introduction of CSS pass you by. In this simple example you can see how an object can be stored into your HTML5 compatible browsers localStorage.</p>
<p>Try this, copy and paste the following code to a simple HTML file and save it onto you desktop. Open it in Chrome or Firefox 4 or Opera. Then, edit the Hello World text. The HTML5 contentEditable=&#8221;true&#8221; allows the containing element to be editable. This is a really nice attribute that makes textarea redundant in an AJAX app, in my opinion.</p>
<p>After you&#8217;ve edited the content close the browser and open the file  again. Boom! the change has been stored in the browsers localStorage and  is accessible even after a browser shutdown. Pretty sweet right?</p>
<pre class="brush:html">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"&gt;&lt;/script&gt;
&lt;meta charset=utf-8 /&gt;
&lt;title&gt;JS Bin&lt;/title&gt;
&lt;!--[if IE]&gt;
 &lt;script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"&gt;&lt;/script&gt;
&lt;![endif]--&gt;
&lt;script&gt;
$(function(){
 var edit = document.getElementById('hello');

 $(edit).blur(function(){
 localStorage.setItem('save', this.innerHTML);
 });

 if(localStorage.getItem('save')){
 edit.innerHTML = localStorage.getItem('save');
 }

});
&lt;/script&gt;
&lt;style&gt;
 article, aside, figure, footer, header, hgroup,
 menu, nav, section { display: block; }
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
 &lt;p id="hello" contentEditable="true"&gt;Hello World&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;
 
</pre>
<p><map name='google_ad_map_184_d0b0fa17a4b5b092'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/184?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_184_d0b0fa17a4b5b092' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=184&amp;url= http%3A%2F%2Fthreadbarecanvas.com%2Fjava-web%2Fsimple-introduction-to-html5-local-storage-api%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://threadbarecanvas.com/java-web/simple-introduction-to-html5-local-storage-api/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>English Stop Words &#8211; Semantic Text Search</title>
		<link>http://threadbarecanvas.com/java-web/english-stop-words-semantic-text-search/</link>
		<comments>http://threadbarecanvas.com/java-web/english-stop-words-semantic-text-search/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 19:32:43 +0000</pubDate>
		<dc:creator>Siriquelle</dc:creator>
				<category><![CDATA[Java Web]]></category>

		<guid isPermaLink="false">http://threadbarecanvas.com/?p=176</guid>
		<description><![CDATA[Weather your analyzing your blog comments or looking at a single sentence one of the best way to discover the meaning of a peice of text is to perform text stemming and stop word removal to be left with the bones of the text. This post is a list of those words in an array [...]]]></description>
			<content:encoded><![CDATA[<p>Weather your analyzing your blog comments or looking at a single sentence one of the best way to discover the meaning of a peice of text is to perform text stemming and stop word removal to be left with the bones of the text. This post is a list of those words in an array string format. yay.</p>
<p>["a","able","about","above","abst","accordance","according","accordingly","across","act","actually", "added","adj","adopted","affected","affecting","affects","after","afterwards","again","against","ah","all", "almost","alone","along","already","also","although","always","am","among","amongst","an","and","announce", "another","any","anybody","anyhow","anymore","anyone","anything","anyway","anyways","anywhere", "apparently","approximately","are","aren","arent","arise","around","as","aside","ask","asking","at","auth", "available","away","awfully","b","back","be","became","because","become","becomes","becoming","been", "before","beforehand","begin","beginning","beginnings","begins","behind","being","believe","below","beside", "besides","between","beyond","biol","both","brief","briefly","but","by","c","ca","came","can","cannot","can't", "cause","causes","certain","certainly","co","com","come","comes","contain","containing","contains","could", "couldnt","d","date","did","didn't","different","do","does","doesn't","doing","done","don't","down","downwards", "due","during","e","each","ed","edu","effect","eg","eight","eighty","either","else","elsewhere","end","ending", "enough","especially","et","et-al","etc","even","ever","every","everybody","everyone","everything","everywhere","ex","except","f", "far","few","ff","fifth","first","five","fix","followed","following","follows","for","former","formerly","forth","found", "four","from","further","furthermore","g","gave","get","gets","getting","give","given","gives","giving","go","goes", "gone","got","gotten","h","had","happens","hardly","has","hasn't","have","haven't","having","he","hed","hence", "her","here","hereafter","hereby","herein","heres","hereupon","hers","herself","hes","hi","hid","him","himself","his", "hither","home","how","howbeit","however","hundred","i","id","ie","if","i'll","im","immediate","immediately", "importance","important","in","inc","indeed","index","information","instead","into","invention","inward","is","isn't", "it","itd","it'll","its","itself","i've","j","just","k","keep","        keeps","kept","keys","kg","km","know","known","knows","l","largely","last","lately","later","latter","latterly", "least","less","lest","let","lets","like","liked","likely","line","little","'ll","look","looking","looks","ltd","m","made", "mainly","make","makes","many","may","maybe","me","mean","means","meantime","meanwhile","merely","mg", "might","million","miss","ml","more","moreover","most","mostly","mr","mrs","much","mug","must","my","myself","n", "na","name","namely","nay","nd","near","nearly","necessarily","necessary","need","needs","neither","never", "nevertheless","new","next","nine","ninety","no","nobody","non","none","nonetheless","noone","nor","normally", "nos","not","noted","nothing","now","nowhere","o","obtain","obtained","obviously","of","off","often","oh","ok", "okay","old","omitted","on","once","one","ones","only","onto","or","ord","other","others","otherwise","ought", "our","ours","ourselves","out","outside","over","overall","owing","own","p","page","pages","part","particular", "particularly","past","per","perhaps","placed","please","plus","poorly","possible","possibly","potentially","pp", "predominantly","present","previously","primarily","probably","promptly","proud","provides","put","q","que", "quickly","quite","qv","r","ran","rather","rd","re","readily","really","recent","recently","ref","refs","regarding", "regardless","regards","related","relatively","research","respectively","resulted","resulting","results","right","run", "s","said","same","saw","say","saying","says","sec","section","see","seeing","seem","seemed","seeming","seems", "seen","self","selves","sent","seven","several","shall","she","shed","she'll","shes","should","shouldn't","show", "showed","shown","showns","shows","significant","significantly","similar","similarly","since","six","slightly","so", "some","somebody","somehow","someone","somethan","something","sometime","sometimes","somewhat", "somewhere","soon","sorry","specifically","specified","specify","specifying","state","states","still","stop", "strongly","sub","substantially","successfully","such","sufficiently","suggest","sup","sure","        t","take","taken","taking","tell","tends","th","than","thank","thanks","thanx","that","that'll","thats","that've", "the","their","theirs","them","themselves","then","thence","there","thereafter","thereby","thered","therefore", "therein","there'll","thereof","therere","theres","thereto","thereupon","there've","these","they","theyd","they'll", "theyre","they've","think","this","those","thou","though","thoughh","thousand","throug","through","throughout", "thru","thus","til","tip","to","together","too","took","toward","towards","tried","tries","truly","try","trying","ts", "twice","two","u","un","under","unfortunately","unless","unlike","unlikely","until","unto","up","upon","ups","us", "use","used","useful","usefully","usefulness","uses","using","usually","v","value","various","'ve","very","via","viz", "vol","vols","vs","w","want","wants","was","wasn't","way","we","wed","welcome","we'll","went","were","weren't", "we've","what","whatever","what'll","whats","when","whence","whenever","where","whereafter","whereas", "whereby","wherein","wheres","whereupon","wherever","whether","which","while","whim","whither","who", "whod","whoever","whole","who'll","whom","whomever","whos","whose","why","widely","willing","wish","with", "within","without","won't","words","world","would","wouldn't","www","x","y","yes","yet","you","youd","you'll", "your","youre","yours","yourself","yourselves","you've","z","zero"]</p>
<p>The following is the simpe program that i used to convert a text file of these Stop words into the array string above.</p>
<pre class="brush:java">/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package arrayify;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 *
 * @author Siriquelle
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args)
    {
        try
        {
            BufferedReader in = new BufferedReader(new InputStreamReader(Main.class.getResourceAsStream("StopWords.txt")));
            String str = "";
            StringBuilder sb = new StringBuilder();
            while ((str = in.readLine()) != null)
            {
                sb.append("\"").append(str).append("\"");
            }
            str = sb.toString().replaceAll("\"\"", "\",\"");
            System.out.print(str);
            in.close();
        } catch (IOException e)
        {
            System.out.print(e.toString());
        }
    }
}</pre>
<p>Hope this saves you some time. Many thanks to &lt;a href=&#8221;http://www.ranks.nl/resources/stopwords.html&#8221; &gt;http://www.ranks.nl/resources/stopwords.html &lt;/a&gt; for the list of words.</p>
<p><map name='google_ad_map_176_d0b0fa17a4b5b092'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/176?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_176_d0b0fa17a4b5b092' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=176&amp;url= http%3A%2F%2Fthreadbarecanvas.com%2Fjava-web%2Fenglish-stop-words-semantic-text-search%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://threadbarecanvas.com/java-web/english-stop-words-semantic-text-search/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>
		<item>
		<title>Write a Bouncing Accordian with JQuery</title>
		<link>http://threadbarecanvas.com/jquery/write-a-bouncing-accordian-with-jquery/</link>
		<comments>http://threadbarecanvas.com/jquery/write-a-bouncing-accordian-with-jquery/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 19:40:05 +0000</pubDate>
		<dc:creator>Siriquelle</dc:creator>
				<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://threadbarecanvas.com/?p=142</guid>
		<description><![CDATA[The following example is of a bouncing accordian. The idea behind a bouncing accordian is to use ajax to pull content for a number of pages and populate a central div with that data. The content area on the main page will fade out resize to 0px and then rsize again back to a new [...]]]></description>
			<content:encoded><![CDATA[<p>The following example is of a bouncing accordian. The idea behind a bouncing accordian is to use ajax to pull content for a number of pages and populate a central div with that data. The content area on the main page will fade out resize to 0px and then rsize again back to a new height with the new content displayed. The following is the result of the labour.</p>
<p><a href="http://threadbarecanvas.com/wp-content/uploads/2009/11/bouncing.png"><img class="aligncenter size-full wp-image-143" title="_bouncing" src="http://threadbarecanvas.com/wp-content/uploads/2009/11/bouncing.png" alt="_bouncing" width="480" height="261" /></a></p>
<p style="text-align: center; font-size: 24px;"><strong><a title="Write a Bouncing Accordian with JQuery" href="http://threadbarecanvas.com/wp-content/uploads/2009/11/15.zip" target="_blank">Source</a> <a title="Write a Bouncing Accordian with JQuery" href="http://threadbarecanvas.com/wp-content/uploads/2009/11/15/index.html" target="_blank">Demo</a></strong></p>
<p>So, now that you&#8217;ve had a peek at it working you can look over the code. The first thing is folder structure. I like base folder &gt; assets &gt; and then folders for each asset like &gt; ajax for the pages of content and css for css and so on. The following is the HTML and JQUERY all on one page as its fairly simple to put together.</p>
<pre class="brush:html">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" &gt;

	&lt;head&gt;
		&lt;title&gt;
			Bouncing Accordian
		&lt;/title&gt;
		&lt;link rel="shortcut icon" type="image/x-icon" href="assets/img/favicon.ico" /&gt;
		&lt;link rel="stylesheet" type="text/css" media="screen" href="assets/css/style.css" /&gt;
		&lt;script type="text/javascript" src="assets/js/jquery.js"&gt;&lt;/script&gt;
		&lt;script type="text/javascript" charset="utf-8"&gt;</pre>
<pre class="brush:javascript">		 $(document).ready(function() {

			$('#nav_list li').live('click', function(e) {
				loadContent(e.target.id);
			});

			function loadContent(pgNum){

					$('#ajax').animate({'height' : '0px', opacity : 0}, 1000, function(){
						//console.log($('#'+this.id).height());
						$('#'+this.id).load('assets/ajax/' + pgNum + '.html', function(){
						$('#'+this.id).animate({'height' : '420px' , opacity : 1}, 1000);
						});
					});
			}

			});</pre>
<pre class="brush:html">		&lt;/script&gt;
	&lt;/head&gt;
	&lt;body&gt;
		&lt;div id="main"&gt;

			&lt;div id="container" class="aligncenter"&gt;

				&lt;div id="nav"&gt;
					&lt;ul id="nav_list" class="aligncenter"&gt;
						&lt;li id="page1" &gt;Home&lt;/li&gt;
						&lt;li id="page2"&gt;About&lt;/li&gt;
						&lt;li id="page3"&gt;Contact&lt;/li&gt;
					&lt;/ul&gt;
				&lt;/div&gt;

				&lt;div id="content"&gt;
					&lt;div id="ajax"&gt;
						&lt;img src="http://bulk.destructoid.com/ul/122540-hands-on-yakuza-3-japanese-demo/wow-468x.jpg" width="460px"/&gt;
					&lt;/div&gt;
				&lt;/div&gt;

				&lt;div id="footer"&gt;
				&lt;div&gt;© Threadbare Canvas Productions &amp; James Hogan&lt;/div&gt;
				&lt;/div&gt;

			&lt;/div&gt;

		&lt;/div&gt;

	&lt;/body&gt;
&lt;/html&gt;</pre>
<p>That was easy, a couple of lines of jquery and youve got a neat effect. Add some CSS for Style.</p>
<pre class="brush: css">
body{margin:0; padding:0px; background-color: #bdbdbd;}
a{text-decoration:inherit; color: inherit;}
.aligncenter{margin-left:auto;margin-right:auto;}

#main{
background-color:#dedede;
font-family:arial;
}

#container{
width:480px;
background-color:#dedede;
}

#nav{
border:5px #efefef solid;
-moz-border-radius:15px;
}
#nav #nav_list{
width:355px;
}

#nav #nav_list li{
display:inline;
margin-left:30px;
padding:5px;
border:1px #ccc outset;
background-color:#cdcdcd;
color:#fefefe;
-moz-border-radius:10px;
font-weight:bold;
cursor:pointer;
}

#content{
-moz-border-radius:15px;
min-height:0px;
padding:5px;
border-left: 5px #efefef solid;
border-right: 5px #efefef solid;
}
#content h1{
font-size:18px;
}
#content p{
font-size:14px;
}

#footer{
-moz-border-radius:15px;
border: 5px #efefef solid;
padding:5px;
text-align:center;
font-size:12px;
}
</pre>
<p>Also there are three other pages those are the ajax pages that will be dragged in to fill the content area.. So I created three files page1, page2, page3 .html and put them in an ajax folder then I gave an id of page1, page2, page3 to each of the buttons that i wanted to activate the ajax request for the content. The following is the sample content I had in those files.</p>
<pre class="brush:html">
&lt;h1&gt;Home&lt;/h1&gt;

&lt;p&gt;Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis &lt;/p&gt;

&lt;p&gt;et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci &lt;/p&gt;

&lt;p&gt;velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea&lt;/p&gt;

&lt;p&gt; commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate&lt;/p&gt;

&lt;p&gt; velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?&lt;/p&gt;
</pre>
<p>And there you have it a few simple files and a few lines of jquery can create a really nice effect for a website. Even if it looks fuggley :). PEACE!!</p>
<p><map name='google_ad_map_142_d0b0fa17a4b5b092'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/142?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_142_d0b0fa17a4b5b092' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=142&amp;url= http%3A%2F%2Fthreadbarecanvas.com%2Fjquery%2Fwrite-a-bouncing-accordian-with-jquery%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://threadbarecanvas.com/jquery/write-a-bouncing-accordian-with-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Putting Together a Javascript Hangman Game</title>
		<link>http://threadbarecanvas.com/javascript/putting-together-a-javascript-hangman-game/</link>
		<comments>http://threadbarecanvas.com/javascript/putting-together-a-javascript-hangman-game/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 12:07:42 +0000</pubDate>
		<dc:creator>Siriquelle</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://threadbarecanvas.com/?p=133</guid>
		<description><![CDATA[Learning how to manipulate stings is an important component of being able to build usable web applications. The develoepr must be able to take in some input, process it and return to the ser some form of meaningful output. In this example you will get four files. This is what your game will look like [...]]]></description>
			<content:encoded><![CDATA[<p>Learning how to manipulate stings is an important component of being able to build usable web applications. The develoepr must be able to take in some input, process it and return to the ser some form of meaningful output.</p>
<p>In this example you will get four files. This is what your game will look like when it&#8217;s finished:</p>
<p><a href="http://threadbarecanvas.com/wp-content/uploads/2009/10/hangman.png"><img class="aligncenter size-full wp-image-134" title="hangman" src="http://threadbarecanvas.com/wp-content/uploads/2009/10/hangman.png" alt="hangman" width="199" height="557" /></a></p>
<p style="text-align: center; font-size: 24px;"><strong><a title="Putting Together a Javascript Hangman Game" href="http://threadbarecanvas.com/wp-content/uploads/2009/10/io1.zip" target="_blank">Source</a> <a title="Putting Together a Javascript Hangman Game" href="http://threadbarecanvas.com/wp-content/uploads/2009/10/hangman/hangman.htm" target="_blank">Demo</a></strong></p>
<p>So there you have it, a lovley hangman game to develop further and impress your friends with. The following is the code to the other files contained within the source folder.</p>
<p>First off let me show you hangman.htm</p>
<pre class="brush:html">&lt;!DOCTYPE html&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;title&gt;Hangman&lt;/title&gt;
        &lt;link type="text/css" rel="stylesheet" media="screen" href="assets/css/style.css" /&gt;
        &lt;script type="text/JavaScript" src="assets/js/script.js" &gt;&lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;div id="container"&gt;
            &lt;div id="head"&gt;&lt;a name="_top"&gt;Get ready to play&lt;/a&gt;&lt;/div&gt;
            &lt;div id="body"&gt;
                &lt;div id="body_head"&gt;Hangman&lt;/div&gt;

                &lt;div id="body_image"&gt;
                    &lt;script&gt;
                        if (window.innerWidth == null) {
                            intWidth = document.body.clientWidth;
                            intHeight = document.body.clientHeight;
                        }
                        else {
                            intWidth = window.innerWidth;
                            intHeight = window.innerHeight;
                        }
                        if (intWidth &gt;= intHeight) {
                            intHeight = Math.round(intHeight * 0.4);
                            intWidth = Math.round(180 * intHeight / 240);
                        }
                        else {
                            intWidth = Math.round(intWidth * 0.4);
                            intHeight = Math.round(240 * intWidth / 180);
                        }
                        doc.write('&lt;img name="PicHang" src="assets/images/Hangman_11.jpg" width="' + intWidth + '" height="' + intHeight + '" id="PicHang" alt="PicHang"/&gt;');
                    &lt;/script&gt;
                    &lt;noscript&gt;You do not appear to have JavaScript capabilities. This game is written in JavaScript.&lt;/noscript&gt;

                &lt;/div&gt;

                &lt;div id="body_footer"&gt;Don't Get Dead!!&lt;/div&gt;
            &lt;/div&gt;
            &lt;div id="response"&gt;
                &lt;form name="Game" action="./hangman.htm" method="post"&gt;
                    &lt;input type="text" name="TWord" id="TWord" /&gt;
                    &lt;label for="TGuess"&gt;What's your guess?&lt;/label&gt;
                    &lt;input type="text" name="TGuess" id="TGuess" maxlength="1" /&gt;
                    &lt;input type="text" name="TAnswer" id="TAnswer" /&gt;

                    &lt;input type="button" class="action_buttons" name="check" id="check" onclick="CheckGuess();" value="Check" &gt;
                    &lt;input type="button" class="action_buttons" name="start" id="start" onclick="StartOver();" value="Start" &gt;

                    &lt;input type="text" name="TMessage" id="TMessage" /&gt;
                    &lt;label for="TGuess"&gt;You have used the following letters:&lt;/label&gt;
                    &lt;input type="text" name="TPrevious" id="TPrevious" /&gt;
                &lt;/form&gt;
            &lt;/div&gt;
            &lt;div id="guess"&gt;

            &lt;/div&gt;
            &lt;div id="footer"&gt;
                &lt;script&gt;document.write('&lt;a href="#_top" onClick="javascript:ShowHelp()" &gt;HELP&lt;/a&gt;');&lt;/script&gt;
                &lt;noscript&gt;&lt;hr /&gt;
                    You do not appear to have JavaScript capabilities. This game is written in JavaScript.
                &lt;/noscript&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/body&gt;
&lt;/html&gt;</pre>
<p>Next up, is the help file that we will be using javascript to open in a new window, help_popup.htm</p>
<pre class="brush:html">&lt;!DOCTYPE html&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;title&gt;Hangman&lt;/title&gt;
        &lt;link type="text/css" rel="stylesheet" media="screen" href="assets/css/style.css" /&gt;
		&lt;script type="text/JavaScript"&gt;
			function closeWindow(){
				window.close();
			}
		&lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;div id="container"&gt;
            &lt;div id="head"&gt;help&lt;/div&gt;
			&lt;p&gt;boy am i glad that hangman is over... still some things bothering me, i'll get back to them,&lt;/p&gt;
            &lt;p&gt;&lt;a target="_parent" href="#head" onClick="javascript:closeWindow();" &gt;close&lt;/a&gt;&lt;/p&gt;
    &lt;/body&gt;
&lt;/html&gt;</pre>
<p>This is the interesting file, script.js</p>
<pre class="brush:javascript">window.onload = init();
var doc = document;
var p;
var preLoad;
var curWord;
var word;
var curPic = -1;
var count = 0;
var gcount = 0;

function init(){
    var Pic = new Array();	  //Declare the new array
    Pic[0] = 'assets/images/Hangman_1.jpg'; //Assign values to each element of
    Pic[1] = 'assets/images/Hangman_2.jpg'; //the array
    Pic[2] = 'assets/images/Hangman_3.jpg';
    Pic[3] = 'assets/images/Hangman_4.jpg';
    Pic[4] = 'assets/images/Hangman_5.jpg';
    Pic[5] = 'assets/images/Hangman_6.jpg';
    Pic[6] = 'assets/images/Hangman_7.jpg';
    Pic[7] = 'assets/images/Hangman_8.jpg';
    Pic[8] = 'assets/images/Hangman_9.jpg';
    Pic[9] = 'assets/images/Hangman_10.jpg';
    Pic[10] = 'assets/images/Hangman_11.jpg';

    p = Pic.length;
    preLoad = new Array();
    for(var i = 0; i &lt; p; i++){
        preLoad[i] = new Image();
        preLoad[i].src = Pic[i];
    }

//add new words as you see fit the application will adapt to the new words.
    word = new Array();
    word[0] = 'JOKER';
    word[1] = 'TYPICAL';
    word[2] = 'GOOGLE';

    curWord = Math.floor(Math.random() * word.length)+1;
    StartOver;
}

function CheckGuess(){
    var curGuess = doc.Game.TGuess.value;

    if(count &lt; 10){         if (curGuess != '' &amp;&amp; curGuess != ' '){             var curPos = word[curWord].indexOf(curGuess.toUpperCase());             var nomPos = doc.Game.TWord.value.indexOf(curGuess);             if (curPos &gt;= 0){

                //doc.Game.TMessage.value = doc.Game.TWord.value + ' ' + curGuess + ' ' + gcount + ' ';

                if(nomPos &gt;= 0){

                    do{
                        gcount = gcount-1;
                        nomPos = doc.Game.TWord.value.indexOf(curGuess, (nomPos+1));
                    }while(nomPos &gt; 0);
                //doc.Game.TMessage.value += ' ' + gcount + ' ' + doc.Game.TWord.value.indexOf(curGuess);
                }

                do{
                    gcount++;
                    doc.Game.TWord.value = DeBlankMachine(curWord, curPos, curGuess, doc.Game.TWord.value);
                    curPos = word[curWord].indexOf(curGuess.toUpperCase(), (curPos+1));
                } while(curPos &gt; 0);
            }else{
                count++;
                if(doc.Game.TPrevious.value.indexOf(curGuess) &gt;= 0){
                    count = count-1;
                }else{
                    doc.PicHang.src = preLoad[++curPic].src;
                    doc.Game.TPrevious.value += curGuess + ' ';
                }
            }
        }
    }else{
        doc.Game.TAnswer.value= word[curWord];
        doc.Game.TMessage.value = 'You Died, Press Start';
    }

    if(gcount == word[curWord].length){
        doc.Game.TAnswer.value= word[curWord];
        doc.Game.TMessage.value = 'You Win, Press Start';
        curPic = 11;
    }
    doc.Game.TGuess.value = '';

}

function StartOver(){
    curPic = 0;
    count = 0;
    gcount=0;
    doc.PicHang.src = preLoad[0].src;
    doc.Game.TGuess.value = '';
    doc.Game.TAnswer.value = '';
    doc.Game.TMessage.value = '';
    doc.Game.TPrevious.value = '';
    curWord = Math.floor(Math.random() * word.length);
    doc.Game.TWord.value = FillNewWord(curWord);
}

function FillNewWord(curWord, wpos, letter){
    var blankSpace = '';
    for(var j = 0; j &lt; word[curWord].length; j++){
        blankSpace += "_ ";
    }
    return blankSpace;
}

function DeBlankMachine(curWord, wpos, letter, old){
    var oldArray = ExplodeStringToArray(old);

    for(var i = 0; i &lt; word[curWord].length; i++){
        if(wpos == i){
            oldArray[2*i] = letter;
        }
    }

    return ImplodeArrayToString(oldArray)

}

function ExplodeStringToArray(string){
    var stringLength = string.length;
    var charArray = new Array(stringLength);

    for(var i = 0; i &lt; stringLength; i++){
        charArray[i] = string.charAt(i);
    }

    return charArray;

}

function ImplodeArrayToString(array){
    var newString = '';

    for(var i = 0; i &lt; array.length; i++){
        newString += array[i];
    }

    return newString;
}

function ShowHelp(){
    NewWindow = window.open('help_popup.htm','newWin','width=450,height=350, scrollbars=yes');
}</pre>
<p>And finally weve got to style the thing, style.css</p>
<pre class="brush:css">#container{width:180px; margin-left:auto;margin-right:auto; font-family:tahoma, arial, sans-serif; color:#333;}
#head {font-size:1.2em;}
#head, #body_head, #body_footer {font-weight:bold;}

#head, #body_head, #body_footer {text-align:center;}

#head{}

#body{}
#body_head{}
#body_image{}
#PicHang{border:1px solid #000;}
#body_footer{margin-bottom:5px;}

#response{}
#response{}

#response input#TWord, #response input#TGuess, #response input#TAnswer, #response input#TMessage,#response input#TPrevious {text-align:center; text-transform:uppercase; margin-top:5px; margin-bottom:5px;}
#response input#TWord, #response input#TAnswer, #response input#TMessage,#response input#TPrevious {border:0; border-bottom:1px solid #ccc; font-weight:bold; font-size:12px; color:#000080; width:180px;}
#response input#TGuess {width:15px;}
#response input#TAnswer {font-weight:bold; font-size:14px; color:#800000; width:180px;}
#response label{font-weight:bold;}
#response .action_buttons{width:80px; margin-left:5px; margin-top:5px; cursor:pointer;}
#guess{}
#footer{}</pre>
<p>And thats it, a genuine, working hangman game, with proper string manipulation functions. Give it a go :)</p>
<p><map name='google_ad_map_133_d0b0fa17a4b5b092'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/133?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_133_d0b0fa17a4b5b092' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=133&amp;url= http%3A%2F%2Fthreadbarecanvas.com%2Fjavascript%2Fputting-together-a-javascript-hangman-game%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://threadbarecanvas.com/javascript/putting-together-a-javascript-hangman-game/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Write a simple Bingo Card with Javascript and Jquery</title>
		<link>http://threadbarecanvas.com/jquery/bingo-card-javascript-and-jquery/</link>
		<comments>http://threadbarecanvas.com/jquery/bingo-card-javascript-and-jquery/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 20:07:59 +0000</pubDate>
		<dc:creator>Siriquelle</dc:creator>
				<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://threadbarecanvas.com/?p=122</guid>
		<description><![CDATA[Writing a bingo card couldn&#8217;t be easier with tools such as JQuery and a brain. There are some simple techniques that you need to put into place to get it all up and running. There are three files included in this tutorial. index.html, style.css and script.js Now, you should end up with something like this: [...]]]></description>
			<content:encoded><![CDATA[<p>Writing a bingo card couldn&#8217;t be easier with tools such as JQuery and a brain. There are some simple techniques that you need to put into place to get it all up and running. There are three files included in this tutorial. index.html, style.css and script.js</p>
<p>Now, you should end up with something like this:</p>
<p style="text-align: center;"><img class="aligncenter" style="align-center" src="http://threadbarecanvas.com/wp-content/uploads/2009/10/bingo.png" alt="" width="350px" height="329px" /></p>
<p style="text-align: center; font-size: 24px;"><strong><a title="JQuery Content Slider Source" href="/wp-content/uploads/2009/10/io.zip" target="_blank">Source</a> <a title="Simple Bingo Card" href="/wp-content/uploads/2009/10/index.html" target="_blank">Demo</a></strong></p>
<p>If you want to glance through the source code you can do so here: index.html</p>
<pre class="brush:html">
&lt;!DOCTYPE html&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;meta charset=utf-8 /&gt;
        &lt;title&gt;Bingo - Card&lt;/title&gt;
        &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt;&lt;/script&gt;
        &lt;!--[if IE]&gt;
        &lt;script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"&gt;&lt;/script&gt;
    &lt;![endif]--&gt;

        &lt;script type="text/javascript" src="assets/js/script.js"&gt;&lt;/script&gt;
        &lt;link rel="stylesheet" type="text/css" media="screen" href="assets/css/style.css" /&gt;
    &lt;/head&gt;
    &lt;body&gt;

        &lt;div id="page"&gt;
            &lt;h1&gt;Free Bingo Card&lt;/h1&gt;
            &lt;table&gt;
                &lt;tr&gt;
                    &lt;td id="cell0"&gt;&nbsp;nbsp;&lt;/td&gt;
                    &lt;td id="cell5"&gt;&nbsp;nbsp;&lt;/td&gt;
                    &lt;td id="cell10"&gt;&nbsp;nbsp;&lt;/td&gt;
                    &lt;td id="cell14"&gt;&nbsp;nbsp;&lt;/td&gt;
                    &lt;td id="cell19"&gt;&nbsp;nbsp;&lt;/td&gt;
                &lt;/tr&gt;
                &lt;tr&gt;
                    &lt;td id="cell1"&gt;&nbsp;nbsp;&lt;/td&gt;
                    &lt;td id="cell6"&gt;&nbsp;nbsp;&lt;/td&gt;
                    &lt;td id="cell11"&gt;&nbsp;nbsp;&lt;/td&gt;
                    &lt;td id="cell15"&gt;&nbsp;nbsp;&lt;/td&gt;
                    &lt;td id="cell20"&gt;&nbsp;nbsp;&lt;/td&gt;
                &lt;/tr&gt;
                &lt;tr&gt;
                    &lt;td id="cell2"&gt;&nbsp;nbsp;&lt;/td&gt;
                    &lt;td id="cell7"&gt;&nbsp;nbsp;&lt;/td&gt;
                    &lt;td id="free"&gt;Free&lt;/td&gt;
                    &lt;td id="cell16"&gt;&nbsp;nbsp;&lt;/td&gt;
                    &lt;td id="cell21"&gt;&nbsp;nbsp;&lt;/td&gt;
                &lt;/tr&gt;
                &lt;tr&gt;
                    &lt;td id="cell3"&gt;&nbsp;nbsp;&lt;/td&gt;
                    &lt;td id="cell8"&gt;&nbsp;nbsp;&lt;/td&gt;
                    &lt;td id="cell12"&gt;&nbsp;nbsp;&lt;/td&gt;
                    &lt;td id="cell17"&gt;&nbsp;nbsp;&lt;/td&gt;
                    &lt;td id="cell22"&gt;&nbsp;nbsp;&lt;/td&gt;
                &lt;/tr&gt;
                &lt;tr&gt;
                    &lt;td id="cell4"&gt;&nbsp;nbsp;&lt;/td&gt;
                    &lt;td id="cell9"&gt;&nbsp;nbsp;&lt;/td&gt;
                    &lt;td id="cell13"&gt;&nbsp;nbsp;&lt;/td&gt;
                    &lt;td id="cell18"&gt;&nbsp;nbsp;&lt;/td&gt;
                    &lt;td id="cell23"&gt;&nbsp;nbsp;&lt;/td&gt;
                &lt;/tr&gt;
            &lt;/table&gt;
            &lt;h3&gt;&lt;a href="#" id="newCard" &gt;Click me for a new card&lt;/a&gt;&lt;/h3&gt;
        &lt;/div&gt;

    &lt;/body&gt;
&lt;/html&gt;
</pre>
<p>The following is the source of the CSS: style.css</p>
<pre class="brush:css">
#page{
    width:455px;
    margin:0 auto;
}

td{
    font-family:arial;
    color:#333;
    padding:10px;
    width:50px;
    height:50px;
    text-align:center;
    border:10px solid #ddc;
    background-color:#eee;
}

.bingohead{
    border:10px solid #c2324c;
}

h1, h3, h3 a{
    font-family:arial;
    text-align:center;
    padding:3px;
    color:#211111;
    background-color:#EEEEEE;
    border:2px solid #DDDDCC;
}

td{
    cursor:pointer;
}

#free{
    background-color:#fff;
    color:#eee;
    cursor:default;
}
</pre>
<p>And finally all of that JavaScript goodness: script.js</p>
<pre class="brush:js">
$(document).ready(function(){

    var usedArray = new Array(76);
    var baseArray = new Array(0,0,0,0,0,1,1,1,1,1,2,2,2,2,3,3,3,3,3,4,4,4,4,4);
    var number = 0;
    var base = 0;

    init();

    function init(){
        for(var i = 0; i<24; i++){
            fillCard(i);
        }
    }

    function fillCard(i){
        base = baseArray[i] * 15;
        number = base + Math.floor(Math.random()*15)+1;

        if(usedArray[number] != true){
            $('#cell'+i).html(number);
            usedArray[number] = true;
        }else{
            fillCard(i);
        }
    }

    function resetUsedNumbersArray(){
        for(var j = 0; j < usedArray.length; j++){
            usedArray[j] = false;
        }
    }

    $('#newCard').click(function(){
        resetUsedNumbersArray();
        init();
    });

    $('td').click(function(){

        var toggle = this.style;
        toggle.backgroundColor = toggle.backgroundColor? "":"#333";
        toggle.color = toggle.color? "":"#fff";
    });

});
</pre>
<p>Something to read while eating your sandwich and drinking your tea, yummie! Extreme programming!!</p>
<p><map name='google_ad_map_122_d0b0fa17a4b5b092'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/122?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_122_d0b0fa17a4b5b092' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=122&amp;url= http%3A%2F%2Fthreadbarecanvas.com%2Fjquery%2Fbingo-card-javascript-and-jquery%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://threadbarecanvas.com/jquery/bingo-card-javascript-and-jquery/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 1.028 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-05-20 06:08:23 -->

