<?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/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule">

<channel>
	<title>Diego, el gnomo &#187; tips</title>
	<atom:link href="http://blogs.gnome.org/diegoe/tag/tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.gnome.org/diegoe</link>
	<description>Pisco Sour is GNOME's official cocktail</description>
	<lastBuildDate>Wed, 21 Oct 2009 01:15:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.5/pe/</creativeCommons:license>		<item>
		<title>Python common mistakes</title>
		<link>http://blogs.gnome.org/diegoe/2009/05/23/python-common-mistakes/</link>
		<comments>http://blogs.gnome.org/diegoe/2009/05/23/python-common-mistakes/#comments</comments>
		<pubDate>Sat, 23 May 2009 19:09:58 +0000</pubDate>
		<dc:creator>diegoe</dc:creator>
				<category><![CDATA[planetdebian]]></category>
		<category><![CDATA[planetgnome]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[faq]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/diegoe/?p=127</guid>
		<description><![CDATA[When starting with Python or just when you haven&#8217;t read PEP 8 you usually fall into some frequent mistakes. Mostly because you take your experience in other languages to Python and your mind gets confused with the new conventions (or something like that).
Some of these errors and their explanation:

if a == None:
Really common. None is [...]]]></description>
			<content:encoded><![CDATA[<p>When starting with Python or just when you haven&#8217;t read <a href="http://www.python.org/dev/peps/pep-0008/">PEP 8</a> you usually fall into some frequent mistakes. Mostly because you take your experience in other languages to Python and your mind gets confused with the new conventions (or something like that).</p>
<p>Some of these errors and their explanation:</p>
<ul>
<li><strong>if a == None:</strong><br />
Really common. None is a singleton, so you can (well, actually, have) to compare to it like &#8216;<strong>if a is None</strong>&#8216; or &#8216;<strong>if a is not None</strong>&#8216;.</li>
<li><strong>if (condition):</strong><br />
This is not really pythonic, if doesn&#8217;t take () around the condition in python, () purpose is grouping, you can use them in an if but only to clarify a really complex condition or similar stuff. Please don&#8217;t clutter code with unneeded characters.</li>
<li><strong>if len(list):<br />
</strong>This is a misunderstanding of Python way of things, any empty sequence (string, list, tuple) is False. So if you want to make sure a list is empty, just check if it&#8217;s False. Same for tuples, and in some ocassions for strings.</li>
<li><strong>if type(obj) is type(1):<br />
</strong>This is killing kittens, there&#8217;s a builtin function for this purpose, it&#8217;s called -surprise- isinstance(object, type). For example <strong>isinstance(123, int)</strong></li>
</ul>
<p>Read more about this and other conventions in <a href="http://www.python.org/dev/peps/pep-0008/">PEP 8</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/diegoe/2009/05/23/python-common-mistakes/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>How to know the return value of a command</title>
		<link>http://blogs.gnome.org/diegoe/2008/05/18/how-to-know-the-return-value-of-a-command/</link>
		<comments>http://blogs.gnome.org/diegoe/2008/05/18/how-to-know-the-return-value-of-a-command/#comments</comments>
		<pubDate>Sun, 18 May 2008 22:48:27 +0000</pubDate>
		<dc:creator>diegoe</dc:creator>
				<category><![CDATA[tips]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[commands]]></category>
		<category><![CDATA[return value]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/diegoe/2008/05/18/how-to-know-the-return-value-of-a-command/</guid>
		<description><![CDATA[Just do:
$ echo $?
and that&#8217;s it.
]]></description>
			<content:encoded><![CDATA[<p>Just do:</p>
<p>$ echo $?</p>
<p>and that&#8217;s it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/diegoe/2008/05/18/how-to-know-the-return-value-of-a-command/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thinkpad R50e suspend and resume</title>
		<link>http://blogs.gnome.org/diegoe/2008/05/15/thinkpad-r50e-suspend-and-resume/</link>
		<comments>http://blogs.gnome.org/diegoe/2008/05/15/thinkpad-r50e-suspend-and-resume/#comments</comments>
		<pubDate>Thu, 15 May 2008 08:09:54 +0000</pubDate>
		<dc:creator>diegoe</dc:creator>
				<category><![CDATA[tips]]></category>
		<category><![CDATA[resume]]></category>
		<category><![CDATA[suspend]]></category>
		<category><![CDATA[thinkpad]]></category>
		<category><![CDATA[vbe]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/diegoe/2008/05/15/thinkpad-r50e-suspend-and-resume/</guid>
		<description><![CDATA[So I have a loyal R50e, thing is that resuming from suspend breaks graphics, I had that working back in the days but recent upgrades of drivers and stuff broke it for some months, I didn&#8217;t care to fix it since I didn&#8217;t have battery anyway.
But now I fixed it again, trick is to edit [...]]]></description>
			<content:encoded><![CDATA[<p>So I have a loyal R50e, thing is that resuming from suspend breaks graphics, I had that working back in the days but recent upgrades of drivers and stuff broke it for some months, I didn&#8217;t care to fix it since I didn&#8217;t have battery anyway.</p>
<p>But now I fixed it again, trick is to edit <code>/usr/share/acpi-support/IBM.config</code>:<br />
<code><br />
# R50e<br />
1834*|1842*|2670*)<br />
ACPI_SLEEP=true;<br />
SAVE_VIDEO_PCI_STATE=true;<br />
# toggled false -&gt;; true<br />
SAVE_VBE_STATE=true;<br />
POST_VIDEO=true;<br />
;;<br />
</code></p>
<p>There! You must make those two vars be <strong>true</strong>. Maybe some tweaking to <code>/etc/defaults/acpi-support</code> would be needed. Most of time this should be all you need to do.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/diegoe/2008/05/15/thinkpad-r50e-suspend-and-resume/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
