<?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>appgrinders</title>
	<atom:link href="http://appgrinders.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://appgrinders.com</link>
	<description>A full-service web shop</description>
	<lastBuildDate>Wed, 09 Jan 2013 14:44:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>A webpage&#8217;s &#8220;tough&#8221; title » section &lt; site</title>
		<link>http://appgrinders.com/2013/01/a-webpages-tough-title/</link>
		<comments>http://appgrinders.com/2013/01/a-webpages-tough-title/#comments</comments>
		<pubDate>Wed, 09 Jan 2013 14:44:18 +0000</pubDate>
		<dc:creator>ykessler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://appgrinders.com/?p=179</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://appgrinders.com/2013/01/a-webpages-tough-title/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Something&#8217;s post for &gt; testing</title>
		<link>http://appgrinders.com/2013/01/somethings-post-for-testing/</link>
		<comments>http://appgrinders.com/2013/01/somethings-post-for-testing/#comments</comments>
		<pubDate>Wed, 09 Jan 2013 14:14:21 +0000</pubDate>
		<dc:creator>ykessler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://appgrinders.com/?p=177</guid>
		<description><![CDATA[testing]]></description>
			<content:encoded><![CDATA[<p>testing</p>
]]></content:encoded>
			<wfw:commentRss>http://appgrinders.com/2013/01/somethings-post-for-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git Basics</title>
		<link>http://appgrinders.com/2012/03/git-basics/</link>
		<comments>http://appgrinders.com/2012/03/git-basics/#comments</comments>
		<pubDate>Sat, 10 Mar 2012 01:40:04 +0000</pubDate>
		<dc:creator>ykessler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.appgrinders.com/?p=99</guid>
		<description><![CDATA[A basic cheat sheet of some common git commands I constantly use but can never remember. Committing Changes Once you&#8217;ve changed files in a git repo, you need to first stage and then commit those changes. There are several commands involved in this, and which do what is actually pretty confusing. Here&#8217;s a breakdown: Staging: <a href="http://appgrinders.com/2012/03/git-basics/">[&#8230;]</a>]]></description>
			<content:encoded><![CDATA[<p>A basic cheat sheet of some common git commands I constantly use but can never remember.</p>

<h2>Committing Changes</h2>

<p>Once you&#8217;ve changed files in a git repo, you need to first stage and then commit those changes. There are several commands involved in this, and which do what is actually pretty confusing. Here&#8217;s a breakdown:</p>

<ul>
<li><strong>Staging:</strong>

<ul>
<li><code>git add .</code>  &#8211; Stages modified and new, but not deleted</li>
<li><code>git add -u</code>  &#8211; Stages modified and deleted, but not new</li>
<li><code>git add -A</code>  &#8211; Stages all</li>
</ul></li>
<li><strong>Committing:</strong>

<ul>
<li><code>git commit</code>  &#8211; Commits staged changes</li>
<li><code>git commit -m "comment"</code>  &#8211; Commits staged changes with comment</li>
</ul></li>
<li><strong>Combination:</strong>

<ul>
<li><code>git commit -a</code> = <code>git add -u &amp;&amp; git commit</code> &#8211; (See links below for subtleties)</li>
<li><code>git add -A &amp;&amp; git commit -m "comment"</code> &#8211; Stages new/modified/deleted <em>and</em> commits with comment in a single command</li>
<li><code>git add . &amp;&amp; git commit -am "comment"</code> &#8211; Same as above</li>
</ul></li>
</ul>

<p>To undo a bad commit, just re-stage what you want to and run:<br />
<code>git commit --amend</code></p>

<h2>Branching and Merging</h2>

<p>The major conceptual leap one has to make when coming from a version-control system like Subversion is that in Git multiple branches are handled within a single working directory.</p>

<p>For example, to <strong>create a new branch and switch to it</strong>, you would run the following command in your repo directory:</p>

<p><code>git checkout -b new-branch</code></p>

<p>You would then be working in a new branch without ever having changed locations on your file system.</p>

<h2>Synchronizing Local/Remote Repositories</h2>

<p>To <strong>get the latest version of a repo</strong>, you do:</p>

<p><code>git fetch</code></p>

<p>Then, to <strong>merge it into your current working version</strong>, you do:</p>

<p><code>git merge</code></p>

<p>OR, you can <strong>use the two-in-one command</strong>:</p>

<p><code>git pull</code>, which is the same as <code>git fetch</code> followed by <code>git merge</code>.</p>

<p>To push your <strong>local repo out to the remote repo</strong>, you do:</p>

<p><code>git push</code></p>

<hr />

<p><img src="http://osteele.com/images/2008/git-transport.png" alt="Git commands" /></p>

<p>From <a href="http://gitready.com/beginner/2009/01/21/pushing-and-pulling.html">Git pushing and pulling | Git Ready</a></p>

<hr />

<p><a href="http://stackoverflow.com/questions/572549/difference-of-git-add-a-and-git-add">Difference of “git add -A” and “git add .” &#8211; Stack Overflow</a><br />
<a href="http://stackoverflow.com/questions/3541647/git-add-vs-git-commit-a">git add . vs git commit -a &#8211; Stack Overflow</a><br />
<a href="http://stackoverflow.com/questions/4298960/git-add-a-git-commit-in-one-command">git add -A, git commit in one command? &#8211; Stack Overflow</a><br />
<a href="http://stackoverflow.com/a/927397/165673">Git undo last commit &#8211; Stack Overflow</a></p>

<p>Other:</p>

<p><a href="http://gitref.org/index.html">Git reference</a><br />
<a href="http://hans.fugal.net/blog/2008/11/10/git-push-is-worse-than-worthless/">Git-push is worse than useless</a></p>
]]></content:encoded>
			<wfw:commentRss>http://appgrinders.com/2012/03/git-basics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python Pitfalls: Base Classes</title>
		<link>http://appgrinders.com/2012/02/python-pitfalls-base-classes/</link>
		<comments>http://appgrinders.com/2012/02/python-pitfalls-base-classes/#comments</comments>
		<pubDate>Sat, 25 Feb 2012 20:59:19 +0000</pubDate>
		<dc:creator>ykessler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.appgrinders.com/?p=75</guid>
		<description><![CDATA[Defining a class in Python is done as follows: class MyClass(MyBaseClass): Since Python 2.2, All classes must inherit from a base class. If the class you&#8217;re defining is a base class, it should inherit from object: class MyClass(object): Watch Your Base Class Syntax! When defining base classes in Python 3.x, you&#8217;re allowed to drop the <a href="http://appgrinders.com/2012/02/python-pitfalls-base-classes/">[&#8230;]</a>]]></description>
			<content:encoded><![CDATA[<p>Defining a class in Python is done as follows:</p>

<p><code>class MyClass(MyBaseClass):</code></p>

<p>Since Python 2.2, All classes must inherit from a base class. If the class you&#8217;re defining is a base class, it should inherit from <code>object</code>:</p>

<p><code>class MyClass(object):</code></p>

<h3><span style='color:red;'>Watch Your Base Class Syntax!</span></h3>

<p>When defining base classes in Python 3.x, you&#8217;re allowed to drop the <code>object</code> from the definition. However, this can open the door for a seriously hard to track problem&#8230;</p>

<p>Depending on whether you&#8217;re using Python 2.x or Python 3.x, there&#8217;s 2 different ways to define a base class that will potentially get you <em>3 different results</em>:</p>

<p>1) <strong>In Python 2.x</strong><br />
<code>class MyClass:</code> <span style='color:red;'>Old-style classes. Don&#8217;t ever use.</span></p>

<p>2) <strong>In Python 2.2 &#8211; Python 3.x</strong><br />
<code>class MyClass(object):</code> New-style classes.</p>

<p>3) <strong>In Python 3.x</strong><br />
<code>class MyClass:</code> Optional syntax for new-style classes. Implicitly inherits from <code>object</code>.</p>

<h3>Old-style vs New-style classes</h3>

<p>Python introduced new-style classes back in Python 2.2, and by now old-style classes are really quite old. Discussion of old-style classes is <a href="http://docs.python.org/reference/datamodel.html#new-style-and-classic-classes">buried in the 2.x docs</a>, and non-existant in the 3.x docs.</p>

<p>The problem is, <strong>the syntax for old-style classes in Python 2.x is the same as the alternative syntax for new-style classes in Python 3.x</strong>. Python 2.x is still very widely used (GAE, Web2Py), and any code (or coder) unwittingly bringing 3.x-style class definitions into 2.x code is gonna end up with some seriously outdated base objects. And because old-style classes aren&#8217;t on anyone&#8217;s radar, they likely won&#8217;t know what hit them.</p>

<p>For that reason, keep using the explicit <code>class MyClass(object):</code> style definitions for as long as 2.x code is still around.</p>

<p>More on this:</p>

<ul>
<li><a href="http://stackoverflow.com/questions/54867/old-style-and-new-style-classes-in-python">Old style and new style classes in Python &#8211; Stack Overflow</a></li>
<li><a href="http://www.cafepy.com/article/python_types_and_objects/python_types_and_objects.html">Python Types and Objects</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://appgrinders.com/2012/02/python-pitfalls-base-classes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Basics of URL Encoding</title>
		<link>http://appgrinders.com/2012/01/basics-of-url-encoding/</link>
		<comments>http://appgrinders.com/2012/01/basics-of-url-encoding/#comments</comments>
		<pubDate>Mon, 30 Jan 2012 20:09:28 +0000</pubDate>
		<dc:creator>ykessler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mamp/com_appgrinders_6/?p=4</guid>
		<description><![CDATA[URL Encoding, otherwise known as percent-encoding, refers to the mechanism whereby certain characters within the text of a URL must be encoded in a special way in order to distinguish them from the characters that make up the structure of the URL itself. Reserved Characters In the language of URLs, the following &#8216;reserved&#8217; characters have <a href="http://appgrinders.com/2012/01/basics-of-url-encoding/">[&#8230;]</a>]]></description>
			<content:encoded><![CDATA[<p>URL Encoding, otherwise known as percent-encoding, refers to the mechanism whereby certain characters within the text of a URL must be encoded in a special way in order to distinguish them from the characters that make up the structure of the URL itself.</p>

<h3>Reserved Characters</h3>

<p>In the language of URLs, the following &#8216;reserved&#8217; characters have special meaning:</p>

<p><code>!</code> <code>*</code> <code>'</code> <code>(</code> <code>)</code> <code>;</code> <code>:</code> <code>@</code> <code>&amp;</code> <code>=</code> <code>+</code> <code>$</code> <code>,</code> <code>/</code> <code>?</code> <code>#</code> <code>[</code> <code>]</code></p>

<p>Because these characters are used to define the structure of the URL, any use of them within the URL text, whether as part of the path or part of the query string, necessitates that they be percent encoded.</p>

<h3>Percent Encodings</h3>

<p><caption>Reserved characters:</caption></p>

<table cellpadding="4px" border="1" style="border:1px solid #C0C0C0; border-collapse:collapse; background-color:#FFFFFF; font-size:14px; text-align:center;">

<tbody><tr>
<td>!</td>
<td>#</td>
<td>$</td>
<td>&amp;</td>
<td>&#8216;</td>
<td>(</td>
<td>)</td>
<td>*</td>
<td>+</td>
<td>,</td>
<td>/</td>
<td>:</td>
<td>;</td>
<td>=</td>
<td>?</td>
<td>@</td>
<td>[</td>
<td>]</td>
</tr>
<tr>
<td>%21</td>
<td>%23</td>
<td>%24</td>
<td>%26</td>
<td>%27</td>
<td>%28</td>
<td>%29</td>
<td>%2A</td>
<td>%2B</td>
<td>%2C</td>
<td>%2F</td>
<td>%3A</td>
<td>%3B</td>
<td>%3D</td>
<td>%3F</td>
<td>%40</td>
<td>%5B</td>
<td>%5D</td>
</tr>
</tbody></table>

<p><caption>Other characters:</caption></p>

<table cellpadding="4px" border="1" style="border:1px solid #C0C0C0; border-collapse:collapse; background-color:#FFFFFF; font-size:14px; text-align:center;">

<tbody><tr>
<td>%</td>
<td>space</td>
</tr>
<tr>
<td>%25</td>
<td>%20 or +</td>
</tr>
</tbody></table>

<p><cite><a href="http://en.wikipedia.org/wiki/Percent-encoding">Percent-encoding &#8211; Wikipedia</a></cite></p>

<p>(<strong>NOTE:</strong> I&#8217;ve noticed that the following reserved characters are not consistently encoded by various encoding functions: <code>!</code> <code>*</code> <code>'</code> <code>(</code> <code>)</code>. For example, <a href="http://meyerweb.com/eric/tools/dencoder/">Meyerweb&#8217;s online encoder</a> ignores them. Not sure about various programming languages, and don&#8217;t yet have an explanation.)</p>

<h3>Encoding Spaces</h3>

<p>Space characters are unique in that they can be encoded using either the <code>+</code> sign or as the percent-encoded format <code>%20</code>.</p>

<p>Whether there are hard rules to use one format or the other is not clear to me (The <code>+</code> format is supposedly legacy but is still the standard format for web form GET/POST data&#8230;). Suffice it to say the two formats are both in use today and should both be handled.</p>

<h3>Double encoding and decoding</h3>

<p>One must make sure that a given string is only URL encoded once. Encoding an already encoded string will require decoding the same number of times.</p>

<p>For example:</p>

<ol>
<li>Original sentence: <code>This sentence has spaces.</code></li>
<li>First encoding: <code>This%20sentence%20has%20spaces.</code></li>
<li>Second encoding: <code>This%2520sentence%2520has%2520spaces.</code></li>
</ol>

<p>Double decoding has less obvious consequences but can also cause incorrect results. For example, if a sentence containing a <code>+</code> sign is encoded once, then decoded twice, the plus sign will be treated like a space and disappear.</p>

<hr />

<h2>Further Reading</h2>

<ul>
<li><a href="http://en.wikipedia.org/wiki/Percent-encoding">Percent-encoding &#8211; Wikipedia</a></li>
<li><a href="http://www.w3schools.com/tags/ref_urlencode.asp">HTML URL Encoding Reference</a></li>
<li><a href="http://stackoverflow.com/questions/1634271/url-encoding-the-space-character-or-20">URL encoding the space character: + or %20? &#8211; Stack Overflow</a></li>
<li><a href="http://stackoverflow.com/questions/1211229/in-a-url-should-spaces-be-encoded-using-20-or">In a URL Should spaces be encoded using %20 or +? &#8211; Stack Overflow</a></li>
<li><a href="http://stackoverflow.com/questions/996139/php-urlencode-vs-rawurlencode">urlencode vs rawurlencode? &#8211; Stack Overflow</a></li>
<li><a href="http://unspecified.wordpress.com/2008/05/24/uri-encoding/">URI Encoding Done Right &laquo; Unspecified Behaviour</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://appgrinders.com/2012/01/basics-of-url-encoding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
