<?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>The.Failboat.me &#187; Programming</title>
	<atom:link href="http://failboat.me/category/personal/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://failboat.me</link>
	<description>Everything about Nothing</description>
	<lastBuildDate>Wed, 28 Jul 2010 04:12:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Rocket: A Lua Sqlite3 ORM manager</title>
		<link>http://failboat.me/2010/lua-sqlite3-orm-manager/</link>
		<comments>http://failboat.me/2010/lua-sqlite3-orm-manager/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 04:44:44 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Lua]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[mapper]]></category>
		<category><![CDATA[orm]]></category>
		<category><![CDATA[rocket]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[sqlite]]></category>

		<guid isPermaLink="false">http://failboat.me/?p=3033</guid>
		<description><![CDATA[<p>Relational databases are designed so that they can both store and describe data. Most programming level APIs do wonderful jobs of maintaining the former aspect. I mean, what ORM doesn&#8217;t automatically map the insert method to the so very generic&#8230;</p>]]></description>
		<wfw:commentRss>http://failboat.me/2010/lua-sqlite3-orm-manager/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>See.lua &#8211; Documentation</title>
		<link>http://failboat.me/2010/see-lua-documentation/</link>
		<comments>http://failboat.me/2010/see-lua-documentation/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 04:56:36 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Lua]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[introspection]]></category>
		<category><![CDATA[see]]></category>

		<guid isPermaLink="false">http://failboat.me/?p=2905</guid>
		<description><![CDATA[<p>See.lua &#8211; A Lua introspection library</p>
<pre class="brush: lua">
	&#62; see(string)

	.byte(?)            .char(?)            .dump(?)            .find(?)
	.format(?)          .gfind(?)           .gmatch(?)          .gsub(?)
	.join(self, table, ...)                 .len(?)
	.lower(?)           .match(?)           .rep(?)             .reverse(?)
	.sub(?)             .upper(?)
</pre>
<p>Lua is a wonderful little language that lets you do&#8230;</p>]]></description>
		<wfw:commentRss>http://failboat.me/2010/see-lua-documentation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>see.lua &#8211; Introspecting Lua objects</title>
		<link>http://failboat.me/2010/see-lua-introspecting-lua-objects/</link>
		<comments>http://failboat.me/2010/see-lua-introspecting-lua-objects/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 02:53:01 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Lua]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[introspect]]></category>
		<category><![CDATA[object]]></category>
		<category><![CDATA[parameters]]></category>
		<category><![CDATA[see]]></category>
		<category><![CDATA[table]]></category>

		<guid isPermaLink="false">http://failboat.me/?p=2629</guid>
		<description><![CDATA[<p>As via its python equivalent, see.lua takes in an object and prints out a list of its elements as well as metatable methods in readable text.</p>
<pre class="brush: lua">
&#62; require &#34;see&#34;

&#62; s = see(string)
.byte(?)            .char(?)            .dump(?)            .find(?)</pre><p>&#8230;</p>]]></description>
		<wfw:commentRss>http://failboat.me/2010/see-lua-introspecting-lua-objects/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Pydev: The Best Python IDE</title>
		<link>http://failboat.me/2010/pydev-the-best-python-ide/</link>
		<comments>http://failboat.me/2010/pydev-the-best-python-ide/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 03:09:15 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[ide]]></category>
		<category><![CDATA[pydev]]></category>

		<guid isPermaLink="false">http://failboat.me/?p=2157</guid>
		<description><![CDATA[<p>While I don&#8217;t usually advertise, I love eclipse for all of its feature rich implementations of language specific IDE&#8217;s. Among those is Pydev, a complete first class IDE for Python.<br />
Recently, Pydev just hit version 1.6.0 (Congratulations!) with the&#8230;</p>]]></description>
		<wfw:commentRss>http://failboat.me/2010/pydev-the-best-python-ide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python: Self references in List comprehension</title>
		<link>http://failboat.me/2010/python-self-references-in-list-comprehension/</link>
		<comments>http://failboat.me/2010/python-self-references-in-list-comprehension/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 03:09:23 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[haskell]]></category>
		<category><![CDATA[lambda]]></category>
		<category><![CDATA[list comprehension]]></category>
		<category><![CDATA[self reference]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[ugly]]></category>

		<guid isPermaLink="false">http://failboat.me/?p=1959</guid>
		<description><![CDATA[<p>One of the great abilities in Python that is copied over from Haskell is the ability to construct lists from other lists or iterators inline. This is of course limiting in certain cases where self references are necessary. For example,&#8230;</p>]]></description>
		<wfw:commentRss>http://failboat.me/2010/python-self-references-in-list-comprehension/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>strcpy() implementation in C/C++</title>
		<link>http://failboat.me/2010/strcpy-implementation-in-cc/</link>
		<comments>http://failboat.me/2010/strcpy-implementation-in-cc/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 23:51:09 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[strcpy]]></category>
		<category><![CDATA[string]]></category>

		<guid isPermaLink="false">http://failboat.me/?p=783</guid>
		<description><![CDATA[<p>One of our ubiquitous C functions can be rather easily recreated via C:</p>
<pre class="brush: c">
char* strcpy(char* other, char* self){
    while (*self) *other++=*self++;
    *other = &#039;\0&#039;;
}
</pre>
<p>Note that C strings are null terminating, hence we create a&#8230;</p>]]></description>
		<wfw:commentRss>http://failboat.me/2010/strcpy-implementation-in-cc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python Tip: Copying an object</title>
		<link>http://failboat.me/2010/python-tip-copying-an-object/</link>
		<comments>http://failboat.me/2010/python-tip-copying-an-object/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 02:30:46 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[attributes]]></category>
		<category><![CDATA[containers]]></category>
		<category><![CDATA[copies]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[deep copy]]></category>
		<category><![CDATA[items]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[object]]></category>
		<category><![CDATA[reference]]></category>
		<category><![CDATA[shallow copy]]></category>

		<guid isPermaLink="false">http://failboat.me/?p=751</guid>
		<description><![CDATA[<p>One of the several &#8220;features&#8221; of python that often land beginners head over feet with their faces in the mud is the distinction between references and copies. Say we have the following list <strong>a</strong>:</p>
<pre class="brush: python">
a = [1,3,5,7,9,11]</pre><p>&#8230;</p>]]></description>
		<wfw:commentRss>http://failboat.me/2010/python-tip-copying-an-object/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Brain Teaser: Multiply by 6</title>
		<link>http://failboat.me/2010/brain-teaser-multiply-by-6/</link>
		<comments>http://failboat.me/2010/brain-teaser-multiply-by-6/#comments</comments>
		<pubDate>Sat, 17 Jul 2010 07:22:21 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[bit shift]]></category>
		<category><![CDATA[brain teaser]]></category>
		<category><![CDATA[multiply]]></category>

		<guid isPermaLink="false">http://failboat.me/?p=739</guid>
		<description><![CDATA[<p><em>How do I go about multiplying a real number n by 6 in python without using the * or the + operators?</em></p>
<p><strong>Solution</strong>:</p>
<pre class="brush: python">
x6 = lambda n: (n&#60;&#60;3) - n - n
</pre>
<p>Rationale:</p>
<p>n]]></description>
		<wfw:commentRss>http://failboat.me/2010/brain-teaser-multiply-by-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tips and Tricks for Lua Beginners: Writing an at.exit registry</title>
		<link>http://failboat.me/2010/tips-and-tricks-for-lua-beginners-writing-an-at-exit-registry/</link>
		<comments>http://failboat.me/2010/tips-and-tricks-for-lua-beginners-writing-an-at-exit-registry/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 18:24:36 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Lua]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[at.exit]]></category>
		<category><![CDATA[exit]]></category>
		<category><![CDATA[metamethod]]></category>
		<category><![CDATA[process]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[__gc]]></category>

		<guid isPermaLink="false">http://failboat.me/?p=725</guid>
		<description><![CDATA[<p>It&#8217;s relatively simple to write a function that takes in a function and executes it once Lua terminates. </p>
<pre class="brush: lua">
at = {}
function at.exit(fn)
     getmetatable(newproxy(true)).__gc = fn
end
</pre>
<p><span id="more-725"></span><br />
The caveat for at.exit() is that on&#8230;</p>]]></description>
		<wfw:commentRss>http://failboat.me/2010/tips-and-tricks-for-lua-beginners-writing-an-at-exit-registry/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lua &#8211; Get a table of function arguments</title>
		<link>http://failboat.me/2010/lua-get-a-table-of-function-arguments/</link>
		<comments>http://failboat.me/2010/lua-get-a-table-of-function-arguments/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 18:04:51 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Lua]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[arguments]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[get_args]]></category>
		<category><![CDATA[introspection]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[table]]></category>

		<guid isPermaLink="false">http://failboat.me/?p=722</guid>
		<description><![CDATA[<p>The lua standard libraries do not provide anything that helps you get the table of arguments for a given function. This can be accomplished by directly introspecting the bytecode of the function. The following snippet generates a function get_args that&#8230;</p>]]></description>
		<wfw:commentRss>http://failboat.me/2010/lua-get-a-table-of-function-arguments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lua &#8211; Get number of parameters in a function</title>
		<link>http://failboat.me/2010/lua-get-number-of-parameters-in-a-function/</link>
		<comments>http://failboat.me/2010/lua-get-number-of-parameters-in-a-function/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 16:04:22 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Lua]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[arguments]]></category>
		<category><![CDATA[bytecode]]></category>
		<category><![CDATA[dump]]></category>
		<category><![CDATA[function]]></category>

		<guid isPermaLink="false">http://failboat.me/?p=716</guid>
		<description><![CDATA[<p>The following snippet defines a function num_args(func) that returns the number of parameters within a function as a string:</p>
<pre class="brush: lua">
num_args(function(a,b,c) end) --&#62; 3
</pre>
<p>It also works with functions that have variable arguments:</p>
<pre class="brush: lua">
num_args(function(a,...)</pre><p>&#8230;</p>]]></description>
		<wfw:commentRss>http://failboat.me/2010/lua-get-number-of-parameters-in-a-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Serializing Lua objects into Lua Code</title>
		<link>http://failboat.me/2010/serializing-lua-objects-into-lua-code/</link>
		<comments>http://failboat.me/2010/serializing-lua-objects-into-lua-code/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 04:00:08 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Lua]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[dump]]></category>
		<category><![CDATA[load]]></category>
		<category><![CDATA[objects]]></category>
		<category><![CDATA[pickle]]></category>
		<category><![CDATA[serialize]]></category>

		<guid isPermaLink="false">http://failboat.me/?p=690</guid>
		<description><![CDATA[<p>The following little snippet allows you to &#8216;pickle&#8217; Lua objects directly into Lua code (with the exception of functions, which are serialized as raw bytecode). Metatable support is on the way, but for now, it should be useful enough.</p>
<p><strong>Example</strong>&#8230;</p>]]></description>
		<wfw:commentRss>http://failboat.me/2010/serializing-lua-objects-into-lua-code/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Lua Exception Handling</title>
		<link>http://failboat.me/2010/lua-exception-handling/</link>
		<comments>http://failboat.me/2010/lua-exception-handling/#comments</comments>
		<pubDate>Sat, 10 Apr 2010 02:11:26 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Lua]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[error handling]]></category>
		<category><![CDATA[except]]></category>
		<category><![CDATA[exceptions]]></category>
		<category><![CDATA[try]]></category>

		<guid isPermaLink="false">http://failboat.me/?p=620</guid>
		<description><![CDATA[<p>Wouldn&#8217;t it be awsome if you could do something like</p>
<pre class="brush: lua">
dofile &#34;try&#34;

try{
	function()
		a = a/a
	end
}.except(Exceptions.ValueError){
	function(_, exceptions, detail)
		print(detail)
	end
}
</pre>
<p>And get</p>
<pre class="brush: plain">
lua:5: attempt to perform arithmetic on</pre><p>&#8230;</p>]]></description>
		<wfw:commentRss>http://failboat.me/2010/lua-exception-handling/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Linked Lists via ctypes in Python</title>
		<link>http://failboat.me/2010/linked-lists-via-ctypes-in-python/</link>
		<comments>http://failboat.me/2010/linked-lists-via-ctypes-in-python/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 04:00:22 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[ctypes]]></category>
		<category><![CDATA[linked list]]></category>
		<category><![CDATA[pointers]]></category>
		<category><![CDATA[structure]]></category>

		<guid isPermaLink="false">http://failboat.me/?p=617</guid>
		<description><![CDATA[<pre class="brush: python">
from ctypes import *

class linknode(Structure):
    pass
linknode._fields_ = [
                (&#34;nextNode&#34;, POINTER(linknode)),
                (&#34;intData&#34;, c_int),
                ]
class linked_list():
    head_node = None
    def add(self, int_data):
        node_to_add = linknode(intData = c_int(int_data))
        if (self.head_node == None):
            self.head_node = node_to_add
        else:
            traverse_node</pre><p>&#8230;</p>]]></description>
		<wfw:commentRss>http://failboat.me/2010/linked-lists-via-ctypes-in-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Context aware Lua Macros</title>
		<link>http://failboat.me/2010/context-aware-lua-macros/</link>
		<comments>http://failboat.me/2010/context-aware-lua-macros/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 01:06:43 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Lua]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Snippets]]></category>

		<guid isPermaLink="false">http://failboat.me/?p=614</guid>
		<description><![CDATA[<p>Will automatically detect locals as well as global variables.</p>
<p>Usage: Macro &#8220;text ${Lua Code} more text&#8221;</p>
<pre class="brush: lua">
test = Macro &#34;Hello ${jack} ${&#039;Bauer&#039;}&#34;

function test1()
	local jack = &#34;Jack&#34;
	print(test)
end

test1()

function test2()
	local jack = &#34;No</pre><p>&#8230;</p>]]></description>
		<wfw:commentRss>http://failboat.me/2010/context-aware-lua-macros/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
