<?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>Re-Cycled Air</title>
	<atom:link href="http://www.re-cycledair.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.re-cycledair.com</link>
	<description>Jack Slingerland&#039;s Programming Adventures</description>
	<lastBuildDate>Fri, 11 May 2012 18:40:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Deploying Django 1.4 to Heroku</title>
		<link>http://www.re-cycledair.com/deploying-django-1-4-to-heroku</link>
		<comments>http://www.re-cycledair.com/deploying-django-1-4-to-heroku#comments</comments>
		<pubDate>Sat, 28 Apr 2012 12:45:50 +0000</pubDate>
		<dc:creator>Jack Slingerland</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[heroku]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.re-cycledair.com/?p=1367</guid>
		<description><![CDATA[Note: It is assumed that your are keeping track of your changes using Git. If you aren&#8217;t, you&#8217;ll need to be to deploy to Heroku. If there is one thing that scares beginners away from Django, its the idea of &#8230; <a href="http://www.re-cycledair.com/deploying-django-1-4-to-heroku">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><em>Note: It is assumed that your are keeping track of your changes using Git.  If you aren&#8217;t, you&#8217;ll need to be to deploy to Heroku.</em></p>
<p>If there is one thing that scares beginners away from Django, its the idea of deployment.  For a PHP programmer, deployment can be as simple as FTP&#8217;ing some files to a server, and boom, deployed.  This isn&#8217;t to say that PHP deployment is simple.  If you have to do it from scratch (get apache running, get your db installed, get PHP installed and configured, etc, etc) it can still be very complex, but many hosting companies take care of this for you.  It&#8217;s almost like you never even have to think about it, which isn&#8217;t always the case for Django.  That doesn&#8217;t mean its a bad thing, just&#8230;<em>different</em>.</p>
<p>So where do we start?  Heroku is as good a place as any.</p>
<h2>Heroku</h2>
<p><a href="http://www.re-cycledair.com/wp-content/uploads/2012/04/heroku-Logo-1.jpg" rel="lightbox[1367]"><img src="http://www.re-cycledair.com/wp-content/uploads/2012/04/heroku-Logo-1-300x93.jpg" alt="" title="Heroku Logo" width="300" height="93" class="aligncenter size-medium wp-image-1368" /></a><br />
<a href='http://www.heroku.com'>Heroku</a> is a cloud service for easy deployment of web applications.  Initially it was Ruby only, but has been working hard to become a deployment service for many languages including Java, Python, and Node.js.  Deploying to Heroku assumes a few things:</p>
<ol>
<li>You are familiar with Git and use it to track your code changes.</li>
<li>You are at least passingly familiar with PostgreSQL, because that&#8217;s what you will being using. (You can use other storage devices, but PostgreSQL is the default and easiest to setup.</li>
<li>You use PIP to manage your project&#8217;s requirements.  If you aren&#8217;t doing this, you need to be. (seriously, it&#8217;s worth the effort)</li>
</ol>
<p>Now that we have that out of the way, let&#8217;s get started.  Before we can proceed further, you&#8217;ll need to get a Heroku account set up.  For our testing purposes, a free account should be plenty.</p>
<ol>
<li>Go to <a href='http://www.heroku.com'>Heroku.com</a> and set up an account.</li>
<li>Go to <a href='https://toolbelt.herokuapp.com'>https://toolbelt.herokuapp.com</a> and download the Herok toolbelt.  Follow the directions on this page up to the &#8220;login&#8221; section.</li>
</ol>
<p>That&#8217;s all for setting up Heroku for now.  Next, we&#8217;re going to move on to configure Django so it can be deployed.</p>
<h2>Django</h2>
<p>Django gives you the flexibility to use almost any database under the sun.  I generally develop using MySQL, but Heroku uses Postgres.  As long as you haven&#8217;t been hand-tailoring queries, this shouldn&#8217;t provide any problem whatsoever.  To make your project compatible with Heroku, you need to install the <strong>psycopg2</strong> library.</p>
<pre>
pip install psycopg2
</pre>
<p>Now that you have the Postgres library installed, when your app is pushed to Heroku, Heroku will append some code to the end of your <em>settings.py</em> file that will point your install to the correct database.</p>
<p>Speaking of <em>settings.py</em>, you&#8217;ll also need to get your template and media paths set up correctly.  To do that, add the following to the top of your <em>settings.py</em> and then set your paths to look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>
root = <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">dirname</span><span style="color: black;">&#40;</span>__file__<span style="color: black;">&#41;</span>.<span style="color: black;">replace</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\\</span>'</span>,<span style="color: #483d8b;">'/'</span><span style="color: black;">&#41;</span>
&nbsp;
MEDIA_ROOT = root + <span style="color: #483d8b;">'/../media/'</span>
STATIC_ROOT = root + <span style="color: #483d8b;">'/../static/'</span>
TEMPLATE_DIRS = <span style="color: black;">&#40;</span>
    root +<span style="color: #483d8b;">'/../templates'</span>,
<span style="color: black;">&#41;</span></pre></div></div>

<p>We use this calculate root variable because it&#8217;s kind of a pain to know the path of your install on Heroku.  This way it doesn&#8217;t matter where you deploy your app to, it should just work.  Another thing to consider is static files.  Heroku can be made to serve them, but having the same domain that is serving your site serve your static files is bad practice.</p>
<h2>Wrapping it up</h2>
<p>Now that Django is configured for Heroku deployment, all that&#8217;s left is to deploy it!  The first thing we need to do is create a requirements file so that Heroku knows what packages to install.  At the top level of your project, run the following:</p>
<pre>
pip freeze > requirements.txt
</pre>
<p>Great, now if you look at the generated file you can see what software Heroku is going to install for you.  Next up, we&#8217;re going to create an app on Heroku (assuming you set up the Heroku tool belt correctly).  In the top level directory of your project, run the following.</p>
<pre>
heroku create --stack cedar
</pre>
<p>This added your new Heroku app as a remote on your local Git repository.  All you do to deploy is:</p>
<pre>
git push heroku master
</pre>
<p>Which should give you some output that looks like:</p>
<pre>
Counting objects: 10, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (8/8), done.
Writing objects: 100% (10/10), 3.59 KiB, done.
Total 10 (delta 0), reused 0 (delta 0)

-----> Heroku receiving push
-----> Python/Django app detected
-----> Preparing Python interpreter (2.7.2)
-----> Creating Virtualenv version 1.7
       New python executable in .heroku/venv/bin/python2.7
       Also creating executable in .heroku/venv/bin/python
       Installing distribute........done.
       Installing pip...............done.
       Running virtualenv with interpreter /usr/local/bin/python2.7
-----> Activating virtualenv
-----> Installing dependencies using Pip version 1.0.2
       Downloading/unpacking Django==1.4 (from -r requirements.txt (line 1))
       ...
       Successfully installed Django psycopg2
       Cleaning up...
-----> Injecting Django settings...
       Injecting code into ./hellodjango/settings.py to read from DATABASE_URL
-----> Discovering process types
       Procfile declares types         -> (none)
       Default types for Python/Django -> web
-----> Compiled slug size is 9.3MB
-----> Launching... done, v4
       http://simple-spring-9999.herokuapp.com deployed to Heroku

To git@heroku.com:afternoon-sword-29.git
* [new branch]      master -> master
</pre>
<p>On the line immediately after &#8220;&#8212;&#8211;> Launching&#8230; done,&#8230;&#8221;, the url of your project is displayed.  Before you go to it though, you need to run syncdb on Heroku.  The Heroku toolbelt makes this pretty easy:</p>
<pre>
heroku run python manage.py syncdb
</pre>
<h2>Conclusion</h2>
<p>That&#8217;s all there is to it.  If you get stuck, feel free to leave a comment.  Heroku also has a great guide for getting up and running and explains some more features of the Heroku tool belt.  That can be found <a href='https://devcenter.heroku.com/articles/django'>here</a>.</p>
 <img src="http://www.re-cycledair.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1367" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.re-cycledair.com/deploying-django-1-4-to-heroku/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Up and Running with Django 1.4</title>
		<link>http://www.re-cycledair.com/up-and-running-with-django-1-4</link>
		<comments>http://www.re-cycledair.com/up-and-running-with-django-1-4#comments</comments>
		<pubDate>Wed, 18 Apr 2012 00:50:01 +0000</pubDate>
		<dc:creator>Jack Slingerland</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[virtualenv]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.re-cycledair.com/?p=1326</guid>
		<description><![CDATA[As with any new web framework, getting started can seem daunting. Even though Django has some of best documentation of any framework, it can still be a pain to figure out how things work. The goal of this post is &#8230; <a href="http://www.re-cycledair.com/up-and-running-with-django-1-4">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>As with any new web framework, getting started can seem daunting.  Even though Django has some of best documentation of any framework, it can still be a pain to figure out how things work.  The goal of this post is to help you, the Django newcomer, get up an running with a simple blog.</p>
<h2>Step 1: Your Environment</h2>
<p>One thing that isn&#8217;t clearly stated in most tutorials is that how you set up your environment can either  make or break your Django experience.  To make your Django experience as easy as possible, you&#8217;ll need to make sure that you have two packages installed: <a href='http://pypi.python.org/pypi/virtualenv'>virtualenv</a> and <a href='http://www.doughellmann.com/projects/virtualenvwrapper/'>virtualenvwrapper</a><br />
Virtualenv can be installed using <a href='http://pypi.python.org/pypi/pip'>pip</a>, and virtualenvwrapper can be installed by following the instructions on it&#8217;s site.  Once you have both of these installed, you&#8217;re going to create something called a virtual environment.  A virtual environment allows you to install any packages you need for your Django development without having it interfere with the rest of your system.  It also allows you to create a requirements file, which allows other people to replicate your environment.  To get started, we use the <em>mkvirtualenv</em> command.</p>
<pre>
mkvirtualenv myblog
</pre>
<p>If you at some point close your terminal window and want to load your virtual environment again you can use the <em>workon</em> command.</p>
<pre>
workon myblog
</pre>
<p>If by chance you don&#8217;t want to work on this environment any more, you use the <em>deactivate</em> command.</p>
<pre>
deactivate
</pre>
<p>So bringing it all together, we&#8217;re going to create an environment, create a directory to play around in, and then install django.</p>
<pre>
cd ~/Desktop
mkvirtualenv myblog
mkdir blog
pip install django
</pre>
<p><a href="http://www.re-cycledair.com/wp-content/uploads/2012/04/setup_env.png" rel="lightbox[1326]"><img src="http://www.re-cycledair.com/wp-content/uploads/2012/04/setup_env.png" alt="" title="Setup Django Environment" width="769" height="589" class="aligncenter size-full wp-image-1332" /></a></p>
<h2>Step 2: Create a Django Project</h2>
<p>Now that we have our environment set up we need to create our first project.  We&#8217;re going to call it &#8220;blog&#8221;.</p>
<pre>
cd blog
django-admin.py startproject blog .
</pre>
<p>If you look in the blog directory now, you&#8217;ll see two things: a folder named <em>blog</em> and a file named <em>manage.py</em>.  The <em>manage.py</em> file is used to administer your project.  Using it you&#8217;ll sync model changes, run the server, and collect static assets.  So why don&#8217;t we try running the server?</p>
<pre>
chmod +x manage.py
./manage.py runserver
</pre>
<p>The first line allows the file to be executed, and the second line starts the server.  Once the second line is executed you should see the following:</p>
<pre>
(myblog)jack@jack-HP-HDX-16-Notebook-PC:~/Desktop/blog$ chmod +x manage.py
(myblog)jack@jack-HP-HDX-16-Notebook-PC:~/Desktop/blog$ ./manage.py runserver
Validating models...

0 errors found
Django version 1.4, using settings 'blog.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
</pre>
<p>Once your development server is running, any changes you make to your files will be noticed and served automatically.  If you check out the address that the server is running at, you should see this:<br />
<a href="http://www.re-cycledair.com/wp-content/uploads/2012/04/django-start.png" rel="lightbox[1326]"><img src="http://www.re-cycledair.com/wp-content/uploads/2012/04/django-start.png" alt="" title="Django Start Screen" width="712" height="349" class="aligncenter size-full wp-image-1339" /></a></p>
<h2>Step 3: Configuring a database</h2>
<p>If we&#8217;re going to create a blog, we need to be able to store information.  To do that, and database is required. In the newly create <em>blog</em> folder, there is a file called <em>settings.py</em>.  That file is where we configure our server and add any apps we create.  First things first though, we need a database.  The Django ORM does a great job of abstracting out the database layer for us, so we can plug in basically any database that we want.  For the sake of simplicity, we&#8217;re going to use SQLite.  To create a SQLite database, make sure that you have the <a href='http://www.sqlite.org/'>SQLite3</a> package installed on your operating system.  Make sure you are in the same folder as the <em>settings.py</em> file, and then execute the following commands:</p>
<pre>
sqlite3 blog.db
sqlite> .tables #Look ma, no tables in here!
sqlite> .q #quit
</pre>
<p>Now that you have a database configured, you can crack open the <em>settings.py</em> file and change this bit of code:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">DATABASES = <span style="color: black;">&#123;</span>
    <span style="color: #483d8b;">'default'</span>: <span style="color: black;">&#123;</span>
        <span style="color: #483d8b;">'ENGINE'</span>: <span style="color: #483d8b;">'django.db.backends.'</span>,
        <span style="color: #483d8b;">'NAME'</span>: <span style="color: #483d8b;">''</span>,
        <span style="color: #483d8b;">'USER'</span>: <span style="color: #483d8b;">''</span>,
        <span style="color: #483d8b;">'PASSWORD'</span>: <span style="color: #483d8b;">''</span>,
        <span style="color: #483d8b;">'HOST'</span>: <span style="color: #483d8b;">''</span>,
        <span style="color: #483d8b;">'PORT'</span>: <span style="color: #483d8b;">''</span>,
    <span style="color: black;">&#125;</span>
<span style="color: black;">&#125;</span></pre></div></div>

<p>to this:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">DATABASES = <span style="color: black;">&#123;</span>
    <span style="color: #483d8b;">'default'</span>: <span style="color: black;">&#123;</span>
        <span style="color: #483d8b;">'ENGINE'</span>: <span style="color: #483d8b;">'django.db.backends.sqlite3'</span>,
        <span style="color: #483d8b;">'NAME'</span>: <span style="color: #483d8b;">'blog.db'</span>,
        <span style="color: #483d8b;">'USER'</span>: <span style="color: #483d8b;">''</span>,
        <span style="color: #483d8b;">'PASSWORD'</span>: <span style="color: #483d8b;">''</span>,
        <span style="color: #483d8b;">'HOST'</span>: <span style="color: #483d8b;">''</span>,
        <span style="color: #483d8b;">'PORT'</span>: <span style="color: #483d8b;">''</span>,
    <span style="color: black;">&#125;</span>
<span style="color: black;">&#125;</span></pre></div></div>

<p>Now that your Django project knows about your database, you need to have it create some tables for you.  Go back to the directory with <em>manage.py</em> in it and run:</p>
<pre>
./manage.py syncdb
</pre>
<p>Once you run syncdb, you&#8217;ll get some output that looks like this:</p>
<pre>
./manage.py syncdb
Creating tables ...
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_user_permissions
Creating table auth_user_groups
Creating table auth_user
Creating table django_content_type
Creating table django_session
Creating table django_site

You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): yes
Username (leave blank to use 'jack'):
E-mail address: jack.slingerland@gmail.com
Password:
Password (again):
Superuser created successfully.
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)
</pre>
<h2>Step 4: The Posts App</h2>
<p>A Django powered website consists of many smaller &#8220;apps&#8221;.  For instance, a blog may have a posts app and a photo app.  The idea is that things that aren&#8217;t concerned with each other (photos,posts) should be separate entities.  For our blog projects we&#8217;re going to only use one app, and we&#8217;ll call it <em>posts</em>.<br />
Creating an app is easy.  As usual, Django does most of the work for you so you don&#8217;t get bogged down writing a bunch of tedious boilerplate code.  Navigate back to the top of your Django project (the directory with <em>manage.py</em> in it) and do the following:</p>
<pre>
./manage.py startapp posts
</pre>
<p>If you check out your project now, you&#8217;ll see a new directory called <em>posts</em>.  If you descend into that directory, you&#8217;ll see 4 files.</p>
<ul>
<li><strong>__init__.py</strong>: Let&#8217;s Python know that this directory is a package.  This has more uses, but it&#8217;s beyond the scope of this post.</li>
<li><strong>models.py</strong>: We define how our models (tables) should look and act.</li>
<li><strong>views.py</strong>: This is where we grab data from out model, massage it to our needs, and then render it to a template.</li>
<li><strong>tests.py</strong>: Unit tests go here.</li>
</ul>
<p>Just because the app is created, doesn&#8217;t mean that Django recognizes it.  You actually have to add the app to the <em>INSTALLED_APPS</em> section of the <em>settings.py</em> file.  To do that, add a line to the end of the <em>INSTALLED_APPS</em> list.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #483d8b;">'posts'</span>, <span style="color: #808080; font-style: italic;"># Don't forget the trailing comma!</span></pre></div></div>

<h2>Step 5: The Post Model</h2>
<p>We&#8217;re finally to the part where we get to write code!  But before we dive in, we need to think about what a blog post actually is.  It will generally contain content, a title, and posted on date.  With that in mind, open posts/models.py in your editor and add the following:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">class</span> Post<span style="color: black;">&#40;</span>models.<span style="color: black;">Model</span><span style="color: black;">&#41;</span>:
	title = models.<span style="color: black;">CharField</span><span style="color: black;">&#40;</span>max_length=<span style="color: #ff4500;">100</span><span style="color: black;">&#41;</span>
	content = models.<span style="color: black;">TextField</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
	post_date = models.<span style="color: black;">DateTimeField</span><span style="color: black;">&#40;</span>auto_now=<span style="color: #008000;">True</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Once you&#8217;ve added those, save the file and then go back to <em>manage.py</em> and run syncdb.  You should get some output that looks like:</p>
<pre>
./manage.py syncdb
Creating tables ...
Creating table posts_post
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)
</pre>
<p>If we hadn&#8217;t added the posts app to our settings.py file, the syncdb command wouldn&#8217;t have generated our table for us.</p>
<h2>Step 5: The Admin</h2>
<p>One of the best parts about Django is it&#8217;s free admin interface that you get.  The admin isn&#8217;t enabled by, but it&#8217;s pretty easy to set up.  First off, we need to open <em>settings.py</em> and uncomment two lines.</p>
<pre>
INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    # Uncomment the next line to enable the admin:
    'django.contrib.admin',
    # Uncomment the next line to enable admin documentation:
    'django.contrib.admindocs',
    'posts',
)
</pre>
<p>As the comments say, uncomment the lines that say &#8220;django.contrib.admin&#8221; and &#8220;django.contrib.admindocs&#8221;.  The admindocs line isn&#8217;t necessary, but it&#8217;s nice for completeness.  The second step is to set up the url configuration for the admin.  Go to your <em>urls.py</em> file and make it look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">conf</span>.<span style="color: black;">urls</span> <span style="color: #ff7700;font-weight:bold;">import</span> patterns, include, url
&nbsp;
<span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">contrib</span> <span style="color: #ff7700;font-weight:bold;">import</span> admin
admin.<span style="color: black;">autodiscover</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
urlpatterns = patterns<span style="color: black;">&#40;</span><span style="color: #483d8b;">''</span>,
&nbsp;
    url<span style="color: black;">&#40;</span>r<span style="color: #483d8b;">'^admin/doc/'</span>, include<span style="color: black;">&#40;</span><span style="color: #483d8b;">'django.contrib.admindocs.urls'</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
    url<span style="color: black;">&#40;</span>r<span style="color: #483d8b;">'^admin/'</span>, include<span style="color: black;">&#40;</span>admin.<span style="color: #dc143c;">site</span>.<span style="color: black;">urls</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
<span style="color: black;">&#41;</span></pre></div></div>

<p>Now that the admin is enabled, we need to add our model to it.  In the blog app folder (same folder as <em>models.py</em>), create a file called <em>admin.py</em> and put the following in it:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> posts.<span style="color: black;">models</span> <span style="color: #ff7700;font-weight:bold;">import</span> Post
<span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">contrib</span> <span style="color: #ff7700;font-weight:bold;">import</span> admin
&nbsp;
admin.<span style="color: #dc143c;">site</span>.<span style="color: black;">register</span><span style="color: black;">&#40;</span>Post<span style="color: black;">&#41;</span></pre></div></div>

<p>All this does is let the admin know that it can manage your model for you.  Since you technically added a new app (the admin app), you&#8217;ll need to run syncdb again.</p>
<pre>
./manage.py syncdb
Creating tables ...
Creating table django_admin_log
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)
</pre>
<p>Go ahead an start the server again, and go to the admin.  It should be located at http://127.0.0.1:8000/admin/.  You&#8217;ll be presented with a login screen, with which you&#8217;ll use the credentials you entered in the initial setup.  Once you&#8217;re logged in, you&#8217;ll see this:<br />
<a href="http://www.re-cycledair.com/wp-content/uploads/2012/04/admin_all.png" rel="lightbox[1326]"><img src="http://www.re-cycledair.com/wp-content/uploads/2012/04/admin_all-300x101.png" alt="" title="Django Admin - All" width="300" height="101" class="aligncenter size-medium wp-image-1350" /></a><br />
Now that you can see the <em>Posts</em> model in the admin, click the &#8220;add&#8221; button next to it.  When you do, you&#8217;ll see a form like this.<br />
<a href="http://www.re-cycledair.com/wp-content/uploads/2012/04/add_post.png" rel="lightbox[1326]"><img src="http://www.re-cycledair.com/wp-content/uploads/2012/04/add_post-300x116.png" alt="" title="Django - Model Aa" width="300" height="116" class="aligncenter size-medium wp-image-1351" /></a><br />
Enter a title and some content, and then click &#8220;Save and Add Another&#8221;.  Enter another title a and some content, and then click &#8220;Save&#8221;.  You&#8217;ll be presented with a screen with two entries on it, that both say &#8220;Post object&#8221;.<br />
<a href="http://www.re-cycledair.com/wp-content/uploads/2012/04/posts_list.png" rel="lightbox[1326]"><img src="http://www.re-cycledair.com/wp-content/uploads/2012/04/posts_list-300x117.png" alt="" title="Django admin list" width="300" height="117" class="aligncenter size-medium wp-image-1352" /></a><br />
Now, &#8220;Post object&#8221; doesn&#8217;t do a very good job of describing your post.  What if you want to edit it?  You won&#8217;t know what is in each post until you click into it.  To fix that, go to <em>models.py</em> and modify your Post model to look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">class</span> Post<span style="color: black;">&#40;</span>models.<span style="color: black;">Model</span><span style="color: black;">&#41;</span>:
	title = models.<span style="color: black;">CharField</span><span style="color: black;">&#40;</span>max_length=<span style="color: #ff4500;">100</span><span style="color: black;">&#41;</span>
	content = models.<span style="color: black;">TextField</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
	post_date = models.<span style="color: black;">DateTimeField</span><span style="color: black;">&#40;</span>auto_now=<span style="color: #008000;">True</span><span style="color: black;">&#41;</span>
&nbsp;
	<span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__unicode__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
		<span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">self</span>.<span style="color: black;">title</span></pre></div></div>

<p>Now when you view your post list, you&#8217;ll see the post titles instead of &#8220;Post object&#8221;.<br />
<a href="http://www.re-cycledair.com/wp-content/uploads/2012/04/post_formatted.png" rel="lightbox[1326]"><img src="http://www.re-cycledair.com/wp-content/uploads/2012/04/post_formatted-300x167.png" alt="" title="Django - Model List Formatted" width="300" height="167" class="aligncenter size-medium wp-image-1354" /></a></p>
<h2>Step 6: URLconfs</h2>
<p>We now have a few posts in the database and can edit them in the Django admin.  The next step is to set up our url structure that will allow users to view the posts on the front end of the site.  Open <em>urls.py</em> and add the lines to it that have the &#8220;#Added&#8221; comment at the end of them.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">conf</span>.<span style="color: black;">urls</span> <span style="color: #ff7700;font-weight:bold;">import</span> patterns, include, url
&nbsp;
<span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">contrib</span> <span style="color: #ff7700;font-weight:bold;">import</span> admin
admin.<span style="color: black;">autodiscover</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">from</span> posts.<span style="color: black;">views</span> <span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #66cc66;">*</span> <span style="color: #808080; font-style: italic;">#added</span>
&nbsp;
urlpatterns = patterns<span style="color: black;">&#40;</span><span style="color: #483d8b;">''</span>,
    <span style="color: black;">&#40;</span><span style="color: #483d8b;">'^$'</span>, home<span style="color: black;">&#41;</span>, <span style="color: #808080; font-style: italic;">#added</span>
    <span style="color: black;">&#40;</span>r<span style="color: #483d8b;">'^post/(?P&lt;post_id&gt;<span style="color: #000099; font-weight: bold;">\d</span>+)/$'</span>,post_specific<span style="color: black;">&#41;</span>, <span style="color: #808080; font-style: italic;">#added</span>
    url<span style="color: black;">&#40;</span>r<span style="color: #483d8b;">'^admin/doc/'</span>, include<span style="color: black;">&#40;</span><span style="color: #483d8b;">'django.contrib.admindocs.urls'</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
    url<span style="color: black;">&#40;</span>r<span style="color: #483d8b;">'^admin/'</span>, include<span style="color: black;">&#40;</span>admin.<span style="color: #dc143c;">site</span>.<span style="color: black;">urls</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
<span style="color: black;">&#41;</span></pre></div></div>

<p>The first line added tells Python about your views (we&#8217;ll get to them next).  The 2nd and 3rd lines added specify how certain urls are handled.  The 2nd added line defines your home URLconf, and the 3rd added line defined your route for specific posts.  Next, open yours posts/views.py file and add the following:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">shortcuts</span> <span style="color: #ff7700;font-weight:bold;">import</span> render_to_response
<span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">http</span> <span style="color: #ff7700;font-weight:bold;">import</span> Http404
<span style="color: #ff7700;font-weight:bold;">from</span> posts.<span style="color: black;">models</span> <span style="color: #ff7700;font-weight:bold;">import</span> Post
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> home<span style="color: black;">&#40;</span>request<span style="color: black;">&#41;</span>:
	<span style="color: #ff7700;font-weight:bold;">return</span> render_to_response<span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;home.html&quot;</span>,<span style="color: black;">&#123;</span>
		<span style="color: #483d8b;">&quot;posts&quot;</span> : Post.<span style="color: black;">objects</span>.<span style="color: #008000;">all</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">order_by</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'post_date'</span><span style="color: black;">&#41;</span>
	<span style="color: black;">&#125;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> post_specific<span style="color: black;">&#40;</span>request, post_id<span style="color: black;">&#41;</span>:
	<span style="color: #ff7700;font-weight:bold;">try</span>:
		p = Post.<span style="color: black;">objects</span>.<span style="color: black;">get</span><span style="color: black;">&#40;</span>pk=post_id<span style="color: black;">&#41;</span>
	<span style="color: #ff7700;font-weight:bold;">except</span>:
		<span style="color: #ff7700;font-weight:bold;">raise</span> Http404
&nbsp;
	<span style="color: #ff7700;font-weight:bold;">return</span> render_to_response<span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;post_specific.html&quot;</span>,<span style="color: black;">&#123;</span>
		<span style="color: #483d8b;">&quot;post&quot;</span> : p
	<span style="color: black;">&#125;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>In the first few lines we import some things we&#8217;ll need:</p>
<ul>
<li>The ability to raise a 404 error.</li>
<li>Our Post model</li>
<li>A shortcut for rendering templates</li>
</ul>
<p>The two functions we created are pretty straight forward.  The <em>home</em> function takes all of the posts, and sends them to the &#8220;home.html&#8221; template where they will be rendered.  The <em>post_specific</em> function checks to see if the post id that is passed in exists.  If it does, it grabs that post and sends it on to the template.  If it doesn&#8217;t, it raises a 404 error.  Now, we need to make those templates.</p>
<h2>Step 7: Templates</h2>
<p>Creating templates is honestly the easiest part of the whole process.  In your settings.py file, there is a variable called <em>TEMPLATE_DIRS</em>.  You need to add the path to your templates folder in there.  For instance, I created a folder called &#8220;templates&#8221; at the top level of my Django app, so mine looks like:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">TEMPLATE_DIRS = <span style="color: black;">&#40;</span>
    <span style="color: #483d8b;">'/home/jack/Desktop/blog/templates'</span>,
<span style="color: black;">&#41;</span></pre></div></div>

<p>Now in your templates directory, create <em>home.html</em> and <em>post_specific.html</em>.  In <em>home.html</em> put the following:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;html&gt;
	&lt;head&gt;
		&lt;title&gt;All posts!&lt;/title&gt;
	&lt;/head&gt;
	&lt;body&gt;
		&lt;ol&gt;
			{% for p in posts %}
			&lt;li&gt;&lt;a href='/post/{{ p.id }}'&gt;{{ p.title }}&lt;/a&gt;&lt;/li&gt;
			{% endfor %}
		&lt;/ol&gt;
	&lt;/body&gt;
&lt;/html&gt;</pre></div></div>

<p>and in <em>post_specific.html</em> put:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;html&gt;
	&lt;head&gt;
		&lt;title&gt;{{ post.title }}&lt;/title&gt;
	&lt;/head&gt;
	&lt;body&gt;
		{{ post.content }}
		&lt;p /&gt;
		&lt;a href='/'&gt;Back&lt;/a&gt;
	&lt;/body&gt;
&lt;/html&gt;</pre></div></div>

<p>Once everything is saved, go to http://127.0.0.1:8000 and check out your (simple) blog!</p>
<h2>Next Steps</h2>
<p>This is a <strong>very</strong> simplified tutorial.  The goal is to help someone get started with something easy without getting bogged down in details.  One of the greatest things about Django though is that the more details you learn, the greater it gets.  With that in mind, I highly suggest checking out the following sites for more learning.  Good luck!</p>
<ol>
<li><a href='https://docs.djangoproject.com/en/1.4/'>https://docs.djangoproject.com/en/1.4/</a> &#8211; The official Django documentation.  Django has some of the best documentation out of any open source project, so don&#8217;t be scared of diving in.  Be sure to check out the 4 part tutorial  It covers some of the same things I did, but in much greater detail.</li>
<li><a href='http://www.djangobook.com/en/2.0/'>http://www.djangobook.com/en/2.0/</a> &#8211; A lot of the material in the DjangoBook website is out of date, but it does a great job explaining some key concepts that are still relevant.</li>
<li><a href='http://www.reddit.com/r/django'>http://www.reddit.com/r/django</a> &#8211; The Django sub-Reddit is a great place to keep up with Django news and conversations.</li>
</ol>
 <img src="http://www.re-cycledair.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1326" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.re-cycledair.com/up-and-running-with-django-1-4/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Methods &amp; Properties with Javascript OOP</title>
		<link>http://www.re-cycledair.com/methods-properties-with-javascript-oop</link>
		<comments>http://www.re-cycledair.com/methods-properties-with-javascript-oop#comments</comments>
		<pubDate>Sat, 17 Mar 2012 14:11:47 +0000</pubDate>
		<dc:creator>Jack Slingerland</dc:creator>
				<category><![CDATA[Other Programming]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[OOP]]></category>

		<guid isPermaLink="false">http://www.re-cycledair.com/?p=1304</guid>
		<description><![CDATA[Note: This isn&#8217;t quite OOP. It&#8217;s actually called the &#8220;module pattern&#8221;. If you come from a language such as Python, PHP, or Java, you&#8217;re used to having public and private methods and variables. In Javascript this is possible too, but &#8230; <a href="http://www.re-cycledair.com/methods-properties-with-javascript-oop">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><em><strong>Note:</strong> This isn&#8217;t quite OOP.  It&#8217;s actually called the &#8220;module pattern&#8221;.</em><br />
<br />
If you come from a language such as Python, PHP, or Java, you&#8217;re used to having public and private methods and variables.  In Javascript this is possible too, but it&#8217;s not nearly as straight-forward.  To make this happen, you usually need to wade through Javascript&#8217;s prototype inheritance.  However, there is another way.</p>
<h2>Step 1: Create your class.</h2>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> MyClass<span style="color: #009900;">&#40;</span>somevar<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Now that your class is created, you can instantiate an instance of it by doing the following:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> x <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> MyClass<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">123</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h2>Step 2: Public Methods and Properties</h2>
<p>To expose properties and methods to the public, you need to attach them to an object and return it.  Some people will attach to <em>this</em>, but I prefer to create a new object called <em>self</em> and return that.  It keeps me from getting confused with what <em>this</em> scope I&#8217;m in.  One thing to remember, is that anything inside of your class that isn&#8217;t in a function gets executed as soon as you create a new instance of it.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> MyClass<span style="color: #009900;">&#40;</span>somevar<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> self <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #006600; font-style: italic;">// Check to make sure somevar is defined and then</span>
	<span style="color: #006600; font-style: italic;">// assign it to the my_property public property.</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>somevar <span style="color: #339933;">===</span> undefined<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> somevar <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
	self.<span style="color: #660066;">my_property</span> <span style="color: #339933;">=</span> somevar<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #006600; font-style: italic;">// A public method!</span>
	self.<span style="color: #660066;">alert_loop</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>count<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>count <span style="color: #339933;">===</span> undefined<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> count <span style="color: #339933;">=</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
		<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> count<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>self.<span style="color: #660066;">my_property</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">return</span> self<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>You&#8217;ll see that we have two things exposed here: <em>my_property</em> and <em>alert_loop</em>.  To access them, do this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> x <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> MyClass<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Hi!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>x.<span style="color: #660066;">my_property</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// Alerts &quot;Hi!&quot;</span>
x.<span style="color: #660066;">alert_loop</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// Alerts &quot;Hi!&quot; twice</span></pre></div></div>

<h2>Step 3: Private Methods and Variables</h2>
<p>Creating private methods and variables is very easy using this method Javascript OOP.  All you do is <strong>not</strong> attach the variable or method to the <em>self</em> object.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> MyClass<span style="color: #009900;">&#40;</span>somevar<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> self <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009966; font-style: italic;">/* Private */</span>
	<span style="color: #003366; font-weight: bold;">var</span> loop_max <span style="color: #339933;">=</span> <span style="color: #CC0000;">2</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">function</span> add_numbers<span style="color: #009900;">&#40;</span>x<span style="color: #339933;">,</span>y<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">return</span> x <span style="color: #339933;">+</span> y<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #009966; font-style: italic;">/* Public stuff */</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>somevar <span style="color: #339933;">===</span> undefined<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> somevar <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
	self.<span style="color: #660066;">my_property</span> <span style="color: #339933;">=</span> somevar<span style="color: #339933;">;</span>
&nbsp;
	self.<span style="color: #660066;">alert_loop</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>count<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>count <span style="color: #339933;">===</span> undefined<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> count <span style="color: #339933;">=</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
		<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> count<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>self.<span style="color: #660066;">my_property</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
	self.<span style="color: #660066;">alert_numbers</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> loop_max<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>add_numbers<span style="color: #009900;">&#40;</span>i<span style="color: #339933;">,</span>i<span style="color: #339933;">+</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">return</span> self<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>And to use it:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> x <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> MyClass<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Hi!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
x.<span style="color: #660066;">add_numbers</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1</span><span style="color: #339933;">,</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// Will fail.</span>
<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>x.<span style="color: #660066;">loop_max</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #006600; font-style: italic;">// Will fail.</span>
x.<span style="color: #660066;">alert_numbers</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #006600; font-style: italic;">// works!</span></pre></div></div>

<h2>Conclusion</h2>
<p>That&#8217;s it!  Using this style of OOP in Javascript is easy to learn and easy to understand.  If you have any questions, drop a comment and I&#8217;ll get back to you.</p>
 <img src="http://www.re-cycledair.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1304" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.re-cycledair.com/methods-properties-with-javascript-oop/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Using Git with Subversion(SVN) on a Non-Standard Repository Layout</title>
		<link>http://www.re-cycledair.com/using-git-with-subversion-on-non-standard-repository-layout</link>
		<comments>http://www.re-cycledair.com/using-git-with-subversion-on-non-standard-repository-layout#comments</comments>
		<pubDate>Tue, 17 Jan 2012 01:14:07 +0000</pubDate>
		<dc:creator>Jack Slingerland</dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.re-cycledair.com/?p=1268</guid>
		<description><![CDATA[For the longest time I was a loyal Subversion(SVN) user. I know, it&#8217;s crazy, but I was. When I found out about Git, I was hooked immediately and used it for all of my personal projects. The problem was that &#8230; <a href="http://www.re-cycledair.com/using-git-with-subversion-on-non-standard-repository-layout">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>For the longest time I was a loyal Subversion(SVN) user.  I know, it&#8217;s crazy, but I was.  When I found out about Git, I was hooked immediately and used it for all of my personal projects.  The problem was that at work we use SVN, and getting everyone to migrate to Git just wasn&#8217;t in the cards.  Much to my surprise, Git has the ability to interact with a SVN repository, so I could still use it anyways.</p>
<p>The issue with my work&#8217;s current SVN layout is that it is non-standard.  By that I mean all projects exist in one big happy repository.  Something like:</p>
<blockquote><p>Repository -> Project -> Trunk/Branches/Tags</p></blockquote>
<p>Unfortunately, Git+SVN isn&#8217;t really all that excited about working with non-standard repositories, so I had to do some experimentation and Googling to figure it all out.  Eventually, I came up with the following steps:</p>
<p><strong>Step 1: Clone the Repo</strong><br />
The first step in this process is actually cloning your SVN repository.  By clone, we mean make a full copy of it and all of the revision history.<br />
<code><br />
git svn clone svn://the.svn.server/allEncompassingRepo/project -trunk=trunk/ .<br />
</code><br />
After the initial clone is complete, we move to fixing where git should look for things.</p>
<p><strong>Step 2: Set up fetch, branches, and tags</strong><br />
The initial setup for fetch, branches, and tags gets screwed up at this point if you have a non-standard layout like my employer does, so we need to do some cleanup.  Open .git/config and set the following:<br />
<code><br />
url = svn://the.svn.server/allEncompassingRepo<br />
fetch = project/trunk:refs/remotes/trunk<br />
branches = project/branches/*:refs/remotes/*<br />
tags = project/tags/*:refs/remotes/tags/*<br />
</code><br />
Now that the config file is all set, go ahead and save.</p>
<p><strong>Step 3: Pull down your files</strong><br />
The config file is all set, so you&#8217;re ready to do your first pull.<br />
<code>git svn fetch svn</code><br />
That&#8217;s all there is to it.  If you&#8217;d like to know how to use Git+SVN, I suggest reading the fine article over at <a href='http://www.viget.com/extend/effectively-using-git-with-subversion/'>Viget</a>.</p>
 <img src="http://www.re-cycledair.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1268" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.re-cycledair.com/using-git-with-subversion-on-non-standard-repository-layout/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using JSHint with Sublime Text 2</title>
		<link>http://www.re-cycledair.com/using-jshint-with-sublime-text-2</link>
		<comments>http://www.re-cycledair.com/using-jshint-with-sublime-text-2#comments</comments>
		<pubDate>Tue, 22 Nov 2011 13:28:40 +0000</pubDate>
		<dc:creator>Jack Slingerland</dc:creator>
				<category><![CDATA[Other Programming]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jshint]]></category>
		<category><![CDATA[sublime]]></category>
		<category><![CDATA[sublime text 2]]></category>
		<category><![CDATA[sublime text 2 plugins]]></category>

		<guid isPermaLink="false">http://www.re-cycledair.com/?p=1238</guid>
		<description><![CDATA[Awhile ago I was looking an editor that was cross platform, light weight, and awesome. I&#8217;d dabbled with Netbeans in the past, but found it to be a little heavy for what I needed it for. I ended up settling &#8230; <a href="http://www.re-cycledair.com/using-jshint-with-sublime-text-2">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Awhile ago I was looking an editor that was cross platform, light weight, and awesome.  I&#8217;d dabbled with Netbeans in the past, but found it to be a little heavy for what I needed it for.  I ended up settling on <a href="http://www.sublimetext.com/2" title="Sublime Text 2" target="_blank">Sublime Text 2</a>.  I have a hard time coming up with words for how awesome Sublime Text 2 is, so here&#8217;s a screenshot of my current window.</p>
<p><a href="http://www.re-cycledair.com/wp-content/uploads/2011/11/Screen-Shot-2011-11-22-at-8.18.07-AM.png" rel="lightbox[1238]"><img src="http://www.re-cycledair.com/wp-content/uploads/2011/11/Screen-Shot-2011-11-22-at-8.18.07-AM-1024x642.png" alt="" title="Screen Shot 2011-11-22 at 8.18.07 AM" width="584" height="366" class="aligncenter size-large wp-image-1252" /></a></p>
<h2>JSHint</h2>
<p>One of the languages I find myself writing frequently is Javascript.  As most of you know, Javascript has an assortment of odd conventions that can be pretty hard to remember.  Code quality checkers like JSLint and JSHint exist for this reason.  Prior to Sublime Text 2 I never bothered integrating either of those tools into my editor, but found myself needing to streamline my development process.</p>
<p>Sublime Text 2 provides an easy way to write build systems depending on which language you&#8217;re using.  The <a href="https://github.com/uipoet/sublime-jshint" title="Sublime-JSHint" target="_blank">sublime-jshint</a> plugin takes advantage of this.  All you do to make this work is go to the <a href="https://github.com/uipoet/sublime-jshint" title="Sublime-JSHint" target="_blank">sublime-jshint GitHub page</a>, and follow the instructions.  Once it&#8217;s installed, run CTRL+B (CMD+B on Mac) while inside a Javascript file and you should see output like this.</p>
<p><a href="http://www.re-cycledair.com/wp-content/uploads/2011/11/Screen-Shot-2011-11-22-at-8.24.10-AM.png" rel="lightbox[1238]"><img src="http://www.re-cycledair.com/wp-content/uploads/2011/11/Screen-Shot-2011-11-22-at-8.24.10-AM.png" alt="" title="Screen Shot 2011-11-22 at 8.24.10 AM" width="731" height="189" class="aligncenter size-full wp-image-1253" /></a></p>
 <img src="http://www.re-cycledair.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1238" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.re-cycledair.com/using-jshint-with-sublime-text-2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating jQuery Plugins</title>
		<link>http://www.re-cycledair.com/creating-jquery-plugins</link>
		<comments>http://www.re-cycledair.com/creating-jquery-plugins#comments</comments>
		<pubDate>Sat, 19 Nov 2011 10:51:29 +0000</pubDate>
		<dc:creator>Jack Slingerland</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jquery plugins]]></category>

		<guid isPermaLink="false">http://www.re-cycledair.com/?p=1222</guid>
		<description><![CDATA[Update: I was able to get permission to release the iScroll plugin! Check it out here. Not too long ago I decided to write a jQuery plugin for making the use of iScroll a little less painful. Since I made &#8230; <a href="http://www.re-cycledair.com/creating-jquery-plugins">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><em><strong>Update</strong></em>:  <em>I was able to get permission to release the iScroll plugin!  Check it out <a href='http://plugins.jquery.com/project/jScroll'>here</a>.</em></p>
<p>Not too long ago I decided to write a jQuery plugin for making the use of iScroll a little less painful.  Since I made the plugin at work I&#8217;m not really at liberty to share it.  But what I can share is a step by step tutorial for creating a jQuery plugin of your own. Let&#8217;s get started.</p>
<h2>Step 1: Scope</h2>
<p>If you&#8217;ve been writing Javascript with jQuery for any amount of time, you find out pretty quickly that proper scoping is <strong>very</strong> important.  You also learn that the $ symbol isn&#8217;t reliable.  So what&#8217;s a coder to do?  Make sure that your scope is contained within an anonymous function, and that you pass the jQuery object into that function.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">jquery</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>If you paste this code into your console (assuming jQuery is included), you should receive a print out of what version of jQuery you&#8217;re using.</p>
<h2>Step 2: Functions</h2>
<p>Now that you have the basic wrapper written, we need to write some real code.  Before we start, there are 3 things you need to know.</p>
<ol>
<li>Functions are attached to the $.fn object.</li>
<li>There may be more than one element passed into your function (plugin)</li>
<li>We want to keep the chain alive if possible. (See <a href="http://www.re-cycledair.com/jquery-chaining" title="jQuery Chaining" target="_blank">jQuery Chaining</a> if you have questions)</li>
</ol>
<p>So, let&#8217;s write a function that adds the class &#8220;bob&#8221; to every item in the set.  Yes, we could just use the .addClass() method, but then we wouldn&#8217;t need to write a plugin would we?</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	$.<span style="color: #660066;">fn</span>.<span style="color: #660066;">addBob</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>  <span style="color: #006600; font-style: italic;">//Add the function</span>
		<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//Loop over each element in the set and return them to keep the chain alive.</span>
			<span style="color: #003366; font-weight: bold;">var</span> $this <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			$this.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;bob&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h2>Step 3: Options</h2>
<p>So let&#8217;s say you need to pass some options to your plugin.  You know, like Bob&#8217;s last name, or if we should remove Bob.  To accomplish this, all you do is create a defaultOptions object and load it with defaults.  Then you use the $.extend function to overwrite it&#8217;s values with values passed in as a function parameter.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	$.<span style="color: #660066;">fn</span>.<span style="color: #660066;">addBob</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>customOptions<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>  <span style="color: #006600; font-style: italic;">//Add the function</span>
		<span style="color: #003366; font-weight: bold;">var</span> options <span style="color: #339933;">=</span> $.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> $.<span style="color: #660066;">fn</span>.<span style="color: #660066;">addBob</span>.<span style="color: #660066;">defaultOptions</span><span style="color: #339933;">,</span> customOptions<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//Loop over each element in the set and return them to keep the chain alive.</span>
			<span style="color: #003366; font-weight: bold;">var</span> $this <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #006600; font-style: italic;">//Determine what name to use.</span>
			<span style="color: #003366; font-weight: bold;">var</span> <span style="color: #000066;">name</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>options.<span style="color: #660066;">lastName</span> <span style="color: #339933;">!=</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000066;">name</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;bob-&quot;</span> <span style="color: #339933;">+</span> options.<span style="color: #660066;">lastName</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000066;">name</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;bob&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
&nbsp;
			<span style="color: #006600; font-style: italic;">//Are we removing items?</span>
			<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>options.<span style="color: #660066;">remove</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				$this.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #000066;">name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
				$this.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #000066;">name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
	$.<span style="color: #660066;">fn</span>.<span style="color: #660066;">addBob</span>.<span style="color: #660066;">defaultOptions</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
		lastName <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">,</span>
		remove <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span>	
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h2>Step 4: Running your plugin</h2>
<p>Now that you&#8217;ve written your plugin, you need to run it!<br />
<strong>Before</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;ol id='x'&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;ol id='y'&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
&lt;/ol&gt;</pre></div></div>

<p><strong>JS</strong></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#x li, #y li&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addBob</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>lastName<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;awesome&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>After</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;ol id='x'&gt;
	&lt;li class='bob-awesome'&gt;&lt;/li&gt;
	&lt;li class='bob-awesome'&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;ol id='y'&gt;
	&lt;li class='bob-awesome'&gt;&lt;/li&gt;
	&lt;li class='bob-awesome'&gt;&lt;/li&gt;
&lt;/ol&gt;</pre></div></div>

<p><strong>JS</strong></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#y li&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addBob</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>lastName<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;awesome&quot;</span><span style="color: #339933;">,</span> remove<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>After</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;ol id='x'&gt;
	&lt;li class='bob-awesome'&gt;&lt;/li&gt;
	&lt;li class='bob-awesome'&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;ol id='y'&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
&lt;/ol&gt;</pre></div></div>

<p>That&#8217;s all there is to it.  If you have any questions, leave a comment and I&#8217;ll get back to you as soon as I can.</p>
 <img src="http://www.re-cycledair.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1222" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.re-cycledair.com/creating-jquery-plugins/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>jQuery Chaining</title>
		<link>http://www.re-cycledair.com/jquery-chaining</link>
		<comments>http://www.re-cycledair.com/jquery-chaining#comments</comments>
		<pubDate>Mon, 24 Oct 2011 17:24:15 +0000</pubDate>
		<dc:creator>Jack Slingerland</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[chaining]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.re-cycledair.com/?p=1203</guid>
		<description><![CDATA[jQuery is the jewel in the crown that is web development. Once you discover it, Javascript is no longer a chore to write, hell, it might even be considered fun! Sure being able to select elements by ID, class, or &#8230; <a href="http://www.re-cycledair.com/jquery-chaining">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>jQuery is the jewel in the crown that is web development.  Once you discover it, Javascript is no longer a chore to write, hell, it might even be considered fun!  Sure being able to select elements by ID, class, or type is great, but what about all the other stuff?  What about chaining? I&#8217;ve heard such great stuff about it!  </p>
<h2> Chaining </h2>
<p>The first thing you need to know about chaining is that you chain actions on to collections.  A collection is what is returned when you select something using jQuery.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #006600; font-style: italic;">//Collection of all input elements on the page.</span></pre></div></div>

<p>When most people start using jQuery, they do something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;123&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;awesome&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;data-bind&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;15&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Yes, this code will work, but it&#8217;s inefficient.  Every time you perform a selection, jQuery must traverse the DOM and find all the input elements.  If you use chaining, it will simply use the collection of input elements that it already has.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input&quot;</span><span style="color: #009900;">&#41;</span>
	.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;123&quot;</span><span style="color: #009900;">&#41;</span>
	.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;awesome&quot;</span><span style="color: #009900;">&#41;</span>
	.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;data-bind&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;15&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>So why does this work? Because each method that you call in the chain returns the collection.  So in this case &#8220;val()&#8221;, &#8220;addClass()&#8221;, and &#8220;attr()&#8221; all return &#8220;$(input)&#8221;.  However, not all methods support chaining.  For instance, the &#8220;text()&#8221; method breaks the chain, so if you&#8217;re going to use it, do it at the end.<br />
What if you want to keep the chain alive though?  No problem.  You can simply back-out of the destructive action using the &#8220;end()&#8221; method.</p>
<p />
<strong>Before</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;ol id='mylist'&gt;
	&lt;li&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;/li&gt;
&lt;/ol&gt;</pre></div></div>

<p><strong>Javascript</strong></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#mylist'</span><span style="color: #009900;">&#41;</span>
	.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&gt;li'</span><span style="color: #009900;">&#41;</span>
		.<span style="color: #660066;">filter</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">':last'</span><span style="color: #009900;">&#41;</span>
			.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Meow'</span><span style="color: #009900;">&#41;</span>
		.<span style="color: #660066;">end</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
		.<span style="color: #660066;">filter</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">':first'</span><span style="color: #009900;">&#41;</span>
			.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Mix'</span><span style="color: #009900;">&#41;</span>
		.<span style="color: #660066;">end</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
		.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'catfood'</span><span style="color: #009900;">&#41;</span>
	.<span style="color: #660066;">end</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'thelist'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>After</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;ol id='mylist' class='thelist'&gt;
	&lt;li class='Mix catfood'&gt;
	&lt;/li&gt;
	&lt;li class='catfood'&gt;
	&lt;/li&gt;
	&lt;li class='Meow catfood'&gt;
	&lt;/li&gt;
&lt;/ol&gt;</pre></div></div>

<p>While sometimes confusing, you can see that chaining is often the most efficient way to handle modifying the DOM.</p>
<h2>Writing Chainable Plugins/Functions</h2>
<p>Now that you know all about chaining, you&#8217;ll probably want to write your own chainable plugins/functions.  It&#8217;s very easy to do this, since all you need to do is return the jQuery object at the end of the function.</p>
<p>In this example, we&#8217;ll write a plugin that attaches a second counter to an element.</p>
<p />
<strong> Plugin </strong></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	$.<span style="color: #660066;">fn</span>.<span style="color: #660066;">count</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>  <span style="color: #006600; font-style: italic;">//We do an 'each', because the collection may have more than one item in it.</span>
			<span style="color: #003366; font-weight: bold;">var</span> self <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #006600; font-style: italic;">//</span>
			self.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'0'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #003366; font-weight: bold;">var</span> theInterval <span style="color: #339933;">=</span> window.<span style="color: #660066;">setInterval</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #003366; font-weight: bold;">var</span> c <span style="color: #339933;">=</span> parseFloat<span style="color: #009900;">&#40;</span>self.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				self.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span>c <span style="color: #339933;">+</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>HTML</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div&gt;
	&lt;span id='test'&gt;&lt;/span&gt;
&lt;/div&gt;</pre></div></div>

<p><strong>Execution</strong></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#test&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">count</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'counters'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//Chaining still works :)</span></pre></div></div>

 <img src="http://www.re-cycledair.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1203" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.re-cycledair.com/jquery-chaining/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PHP Dark Arts: References</title>
		<link>http://www.re-cycledair.com/php-dark-arts-references</link>
		<comments>http://www.re-cycledair.com/php-dark-arts-references#comments</comments>
		<pubDate>Wed, 19 Oct 2011 17:25:01 +0000</pubDate>
		<dc:creator>Jack Slingerland</dc:creator>
				<category><![CDATA[PHP Programming]]></category>
		<category><![CDATA[dark arts]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[references]]></category>

		<guid isPermaLink="false">http://www.re-cycledair.com/?p=1187</guid>
		<description><![CDATA[Remember the first time you dabbled in C?  Oh, the glorious typing, functions, and structs!  Now do you remember the first time you ran in to a pointer?  &#8217;*', &#8216;&#38;&#8217;, &#8216;-&#62;&#8217; all made your hurt, but eventually you figured it &#8230; <a href="http://www.re-cycledair.com/php-dark-arts-references">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Remember the first time you dabbled in C?  Oh, the glorious typing, functions, and structs!  Now do you remember the first time you ran in to a pointer?  &#8217;*', &#8216;&amp;&#8217;, &#8216;-&gt;&#8217; all made your hurt, but eventually you figured it out.  It&#8217;s fortunate (depending how you look at it) that we don&#8217;t have need to dabble with pointers or references while web programming these days.  However, PHP does allow us to passing things around by reference.  It&#8217;s not used often, but when used correctly can be very beneficial to the quality of your code.</p>
<h2>What are PHP references?</h2>
<p>The first thing you need to know about PHP references is that they are <span style="text-decoration: underline"><strong>not</strong></span> C references.  You can&#8217;t do pointer arithmetic on them because they aren&#8217;t actually addresses.  In PHP references are actually symbol table aliases.  This means that you can have 2 variable names sharing the same variable content.</p>
<h2>What can you do with references?</h2>
<p>There are 3 things that you can do with PHP references.</p>
<ul>
<li>Assign by reference.</li>
<li>Pass by reference.</li>
<li>Return by reference.</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$x</span> <span style="color: #339933;">=&amp;</span> <span style="color: #000088;">$y</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$x</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">3</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;X: <span style="color: #006699; font-weight: bold;">$x</span>, Y: <span style="color: #006699; font-weight: bold;">$y</span>&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The above code sets $x and $y&#8217;s references to the same content area.  Therefore, when $x is assigned 3, $y has access to the same data.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> add_item<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #000088;">$item</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   	<span style="color: #000088;">$item</span><span style="color: #339933;">++;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000088;">$totalItems</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">&lt;;</span> <span style="color: #cc66cc;">5</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	add_item<span style="color: #009900;">&#40;</span><span style="color: #000088;">$totalItems</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Total items: <span style="color: #006699; font-weight: bold;">$totalItems</span>&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This code allows you to modify a variable&#8217;s value without ever returning anything.  In this example I made a simple counter, but you can set the value of $item to anything and it should work out just fine.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> Test <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$count</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #339933;">&amp;</span>getCount<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">count</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000088;">$t</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Test<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$value</span> <span style="color: #339933;">=</span> <span style="color: #339933;">&amp;</span><span style="color: #000088;">$t</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCount</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$t</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">count</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">25</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #339933;">;</span></pre></div></div>

<p>This code returns a reference to the public $count variable of the Test class.  Generally this isn&#8217;t best practice, as it lowers the readability of the code.</p>
<h2>Unsetting References</h2>
<p>In the event that you want to free a variable from it&#8217;s reference to another, you can simply use the <em>unset</em> function.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$x</span> <span style="color: #339933;">=&amp;</span> <span style="color: #000088;">$y</span><span style="color: #339933;">;</span>
<span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$x</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

 <img src="http://www.re-cycledair.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1187" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.re-cycledair.com/php-dark-arts-references/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fixing DreamHost&#8217;s Django Deployment Script</title>
		<link>http://www.re-cycledair.com/fixing-dreamhosts-django-deployment-script</link>
		<comments>http://www.re-cycledair.com/fixing-dreamhosts-django-deployment-script#comments</comments>
		<pubDate>Wed, 19 Oct 2011 13:10:51 +0000</pubDate>
		<dc:creator>Jack Slingerland</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[django deployment]]></category>
		<category><![CDATA[dreamhost]]></category>
		<category><![CDATA[passenger]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.re-cycledair.com/?p=1181</guid>
		<description><![CDATA[I recently created a trivial site locally with Django that I wanted to deploy on my DreamHost shared server.  DreamHost has made this process pretty painless by creating an easy-to-follow guide that can be found here.  The only problem is &#8230; <a href="http://www.re-cycledair.com/fixing-dreamhosts-django-deployment-script">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I recently created a trivial site locally with Django that I wanted to deploy on my DreamHost shared server.  DreamHost has made this process pretty painless by creating an easy-to-follow guide that can be found <a title="DreamHost Django Deployment" href="http://wiki.dreamhost.com/Django" target="_blank">here</a>.  The only problem is that it doesn&#8217;t work.  After entering in my project name and database info, i got the error message:</p>
<blockquote><p>Creating project framework&#8230;  oops, django-admin failed to run!</p></blockquote>
<p>With nothing to lose (and not wanting to figure out how to get Passenger set up on my own), I dove into their <strong><a title="django-setup.py" href="http://wiki.dreamhost.com/django-setup.py" target="_blank">django-setup.py</a></strong> script.  As it turns out, the problem is on line 126.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #dc143c;">os</span>.<span style="color: black;">spawnl</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">os</span>.<span style="color: black;">P_WAIT</span>, <span style="color: #483d8b;">&quot;/usr/bin/django-admin.py&quot;</span>, <span style="color: #483d8b;">&quot;django-admin.py&quot;</span>, <span style="color: #483d8b;">&quot;startproject&quot;</span>, projname<span style="color: black;">&#41;</span> <span style="color: #66cc66;">!</span>= <span style="color: #ff4500;">0</span>:</pre></div></div>

<p>Apparently on DreamHost, django-admin.py has dropped the extension.  So if you replace line 126 with the following, everything works great.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #dc143c;">os</span>.<span style="color: black;">spawnl</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">os</span>.<span style="color: black;">P_WAIT</span>, <span style="color: #483d8b;">&quot;/usr/bin/django-admin&quot;</span>, <span style="color: #483d8b;">&quot;django-admin&quot;</span>, <span style="color: #483d8b;">&quot;startproject&quot;</span>, projname<span style="color: black;">&#41;</span> <span style="color: #66cc66;">!</span>= <span style="color: #ff4500;">0</span>:</pre></div></div>

 <img src="http://www.re-cycledair.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1181" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.re-cycledair.com/fixing-dreamhosts-django-deployment-script/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Dual-Boot Pumpkin</title>
		<link>http://www.re-cycledair.com/dual-boot-pumpkin</link>
		<comments>http://www.re-cycledair.com/dual-boot-pumpkin#comments</comments>
		<pubDate>Thu, 13 Oct 2011 01:15:05 +0000</pubDate>
		<dc:creator>Jack Slingerland</dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[halloween]]></category>
		<category><![CDATA[pumpkin]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.re-cycledair.com/?p=1162</guid>
		<description><![CDATA[I&#8217;m a nerd.  I regularly use Ubuntu, and just bought a Windows Phone 7 instead of an iPhone.  With Halloween right around the corner, I thought it was time to bump up my nerd credentials. I now present to you&#8230; &#8230; <a href="http://www.re-cycledair.com/dual-boot-pumpkin">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m a nerd.  I regularly use Ubuntu, and just bought a Windows Phone 7 instead of an iPhone.  With Halloween right around the corner, I thought it was time to bump up my nerd credentials.</p>
<p>I now present to you&#8230; the <strong>Dual-Boot Pumpkin!</strong></p>
<div id="attachment_1165" class="wp-caption aligncenter" style="width: 527px"><a href="http://www.re-cycledair.com/wp-content/uploads/2011/10/IMG_4505.jpg" rel="lightbox[1162]"><img class="size-large wp-image-1165" src="http://www.re-cycledair.com/wp-content/uploads/2011/10/IMG_4505-1024x768.jpg" alt="Dual-Boot Pumpkin Front (lights on)" width="517" height="387" /></a><p class="wp-caption-text">Ubuntu (lights on)</p></div>
<div id="attachment_1164" class="wp-caption aligncenter" style="width: 527px"><a href="http://www.re-cycledair.com/wp-content/uploads/2011/10/IMG_4504.jpg" rel="lightbox[1162]"><img class="size-large wp-image-1164" src="http://www.re-cycledair.com/wp-content/uploads/2011/10/IMG_4504-1024x768.jpg" alt="Dual-Boot Pumpkin Rear (lights on)" width="517" height="387" /></a><p class="wp-caption-text">Windows (lights on)</p></div>
<p style="text-align: center">
<div id="attachment_1167" class="wp-caption aligncenter" style="width: 527px"><a href="http://www.re-cycledair.com/wp-content/uploads/2011/10/IMG_4507.jpg" rel="lightbox[1162]"><img class="size-large wp-image-1167" src="http://www.re-cycledair.com/wp-content/uploads/2011/10/IMG_4507-1024x768.jpg" alt="Dual-Boot Pumpkin Rear (lights off)" width="517" height="387" /></a><p class="wp-caption-text">Windows (lights off)</p></div>
<div id="attachment_1166" class="wp-caption aligncenter" style="width: 527px"><a href="http://www.re-cycledair.com/wp-content/uploads/2011/10/IMG_4506.jpg" rel="lightbox[1162]"><img class="size-large wp-image-1166" src="http://www.re-cycledair.com/wp-content/uploads/2011/10/IMG_4506-1024x768.jpg" alt="Dual-Boot Pumpkin Front (lights off)" width="517" height="387" /></a><p class="wp-caption-text">Ubuntu (lights off)</p></div>
 <img src="http://www.re-cycledair.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1162" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.re-cycledair.com/dual-boot-pumpkin/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 1/48 queries in 0.127 seconds using disk: basic
Object Caching 721/854 objects using disk: basic

Served from: www.re-cycledair.com @ 2012-05-18 01:26:41 -->
