<?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>infinite possibility</title>
	<atom:link href="http://anypossibility.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://anypossibility.com/blog</link>
	<description>Naoko Reeves&#039;s Blog</description>
	<lastBuildDate>Sun, 19 Feb 2012 04:22:13 +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>Another Simple console.log wrapper &#8211; debug log for all browsers</title>
		<link>http://anypossibility.com/blog/2012/02/another-simple-console-log-wrapper-debug-log-for-all-browsers/</link>
		<comments>http://anypossibility.com/blog/2012/02/another-simple-console-log-wrapper-debug-log-for-all-browsers/#comments</comments>
		<pubDate>Sun, 19 Feb 2012 04:22:13 +0000</pubDate>
		<dc:creator>naoko</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://anypossibility.com/blog/?p=401</guid>
		<description><![CDATA[Issues: 1. You can add console.log all day long but at the end of the day you have to remove them. 2. When testing on IE, you got to comment out or remove console.log otherwise it will error out. 3. for IE, you might end up adding Alert(msg). Clicking Alert could become painful. Solution (might [...]]]></description>
			<content:encoded><![CDATA[<p>Issues:</p>
<p>1. You can add console.log all day long but at the end of the day you have to remove them.</p>
<p>2. When testing on IE, you got to comment out or remove console.log otherwise it will error out.</p>
<p>3. for IE, you might end up adding Alert(msg). Clicking Alert could become painful.</p>
<p>Solution (might not be the best but works):</p>
<p>So I wrote Another simple console.log wrapper that meets what I need for now (super super simple)</p>
<p>Out put on IE would look like this:</p>
<p><img class="size-full wp-image-403 alignnone" title="Browser Console Output" src="http://anypossibility.com/blog/wp-content/uploads/2012/02/Screen-shot-2012-02-18-at-9.19.10-PM.png" alt="" width="398" height="158" /></p>
<blockquote><p>&lt;!DOCTYPE html&gt;<br />
&lt;html lang=&#8221;en&#8221;&gt;<br />
&lt;head&gt;<br />
&lt;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text/html; charset=utf-8&#8243;&gt;<br />
&lt;title&gt;Fun with Debugging&lt;/title&gt;<br />
&lt;script src=&#8221;http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js&#8221;&gt;&lt;/script&gt;<br />
&lt;style type=&#8221;text/css&#8221;&gt;<br />
.console{<br />
font-family:monospace;<br />
font-size:12px;<br />
color:white;<br />
background-color:black;<br />
padding: 0 0 0 10px;<br />
}<br />
&lt;/style&gt;<br />
&lt;/head&gt;<br />
&lt;body class=&#8217;body&#8217;&gt;<br />
&lt;h1&gt;Header&lt;/h1&gt;<br />
&lt;p&gt;contents here&lt;/p&gt;<br />
&lt;/body&gt;<br />
&lt;script&gt;<br />
var debug = {<br />
debug: false,<br />
log: function(msg){<br />
if (this.debug){<br />
if(window.console){<br />
console.log(msg)<br />
}else{<br />
$(&#8216;body&#8217;).append(&#8216;&lt;div class=&#8221;console&#8221;&gt;&#8217; + msg + &#8216;&lt;/div&gt;&#8217;);<br />
}<br />
}<br />
},<br />
enable: function(){this.debug = true},<br />
disable: function(){this.debug = false}<br />
}</p>
<p>debug.enable(); // remove or comment out before send to prod or just remove all debug. line with grep or something<br />
debug.log(&#8216;ahoy&#8217;);<br />
debug.log(&#8216;more message&#8217;);<br />
// debug.disabled();<br />
debug.log(&#8216;debug is disabled now&#8217;);<br />
&lt;/script&gt;<br />
&lt;/html&gt;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://anypossibility.com/blog/2012/02/another-simple-console-log-wrapper-debug-log-for-all-browsers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Advnaced Django Tutorial</title>
		<link>http://anypossibility.com/blog/2012/02/advnaced-django-tutorial/</link>
		<comments>http://anypossibility.com/blog/2012/02/advnaced-django-tutorial/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 01:36:20 +0000</pubDate>
		<dc:creator>naoko</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://anypossibility.com/blog/?p=393</guid>
		<description><![CDATA[2 years old but worth watching. Good Stuff. PyCon 2010: Intermediate Tutorial by James Bennett &#8211; Django’s release manager, and also contributes to the documentation and provide the occasional bugfix. Currently, he’s part of the Web development team at Mozilla.]]></description>
			<content:encoded><![CDATA[<p>2 years old but worth watching. Good Stuff.</p>
<p>PyCon 2010: Intermediate Tutorial by James Bennett &#8211; Django’s release manager, and also contributes to the documentation and provide the occasional bugfix.<br />
Currently, he’s part of the Web development team at Mozilla.</p>
<p><iframe src="http://blip.tv/play/g4Vigcv7RQI.html?p=1" width="500" height="363" frameborder="0" allowfullscreen></iframe><embed type="application/x-shockwave-flash" src="http://a.blip.tv/api.swf#g4Vigcv7RQI" style="display:none"></embed></p>
]]></content:encoded>
			<wfw:commentRss>http://anypossibility.com/blog/2012/02/advnaced-django-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PostgreSQL Utility for EnterpriseDB Installation</title>
		<link>http://anypossibility.com/blog/2012/01/postgresql-utility-for-enterprisedb-installation/</link>
		<comments>http://anypossibility.com/blog/2012/01/postgresql-utility-for-enterprisedb-installation/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 05:00:05 +0000</pubDate>
		<dc:creator>naoko</dc:creator>
				<category><![CDATA[mac]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[System Admin]]></category>

		<guid isPermaLink="false">http://anypossibility.com/blog/?p=382</guid>
		<description><![CDATA[PostgreSQL Installer provided by EnterpriseDB is so handy and make your life very easy for OS X Desktop installation. Maybe I just don&#8217;t know the handy utility but I wrote a shell script to control/display various tasks hence I wanted to share this with you. The utility contains: start &#124; stop &#124; restart &#124; stopfast [...]]]></description>
			<content:encoded><![CDATA[<p>PostgreSQL Installer provided by EnterpriseDB is so handy and make your life very easy for OS X Desktop installation.</p>
<p>Maybe I just don&#8217;t know the handy utility but I wrote a shell script to control/display various tasks hence I wanted to share this with you.</p>
<p>The utility contains: start | stop | restart | stopfast | stopnow | status | vac_status | show_connections | version | restore backup</p>
<blockquote>
<pre></pre>
<pre>NODE_NAME=`uname -n`</pre>
<pre>NODE_NAME=${NODE_NAME%%\.*local}</pre>
<pre>NODE_NUMBER=${NODE_NAME##*SQL-}</pre>
<pre>PGBIN=/Library/PostgreSQL/9.1/bin</pre>
<pre>PGDATA=/Library/PostgreSQL/9.1/data</pre>
<pre>pidof(){</pre>
<pre># usage: `pidof`</pre>
<pre>ps -ef | grep postgres | awk '{if ($3==1)print $2}'</pre>
<pre>}</pre>
<pre>start(){</pre>
<pre>pid=`pidof`</pre>
<pre>if [ "$pid" == "" ] ; then</pre>
<pre>echo "Starting postgres..."</pre>
<pre>su - postgres -c "${PGBIN}/pg_ctl -w start -D ${PGDATA} -l ${PGDATA}/pg_log/startup.log"</pre>
<pre>else</pre>
<pre>status</pre>
<pre>fi</pre>
<pre>}</pre>
<pre>stop(){</pre>
<pre>pid=`pidof`</pre>
<pre>if [ "$pid" != "" ] ; then</pre>
<pre>echo "Stopping postgres..."</pre>
<pre>su - postgres -c "${PGBIN}/pg_ctl stop -m smart -w -D ${PGDATA}"</pre>
<pre>else</pre>
<pre>echo "Postgres is not running"</pre>
<pre>fi</pre>
<pre>}</pre>
<pre>stopfast(){</pre>
<pre>pid=`pidof`</pre>
<pre>if [ "$pid" != "" ] ; then</pre>
<pre>echo "Stopping postgres..."</pre>
<pre>su - postgres -c "${PGBIN}/pg_ctl stop -m fast -w -D ${PGDATA}"</pre>
<pre>else</pre>
<pre>echo "Postgres is not running"</pre>
<pre>fi</pre>
<pre>}</pre>
<pre>stopnow(){</pre>
<pre>pid=`pidof`</pre>
<pre>if [ "$pid" != "" ] ; then</pre>
<pre>echo "Stopping postgres..."</pre>
<pre>su - postgres -c "${PGBIN}/pg_ctl stop -m immediate -w -D ${PGDATA}"</pre>
<pre>else</pre>
<pre>echo "Postgres is not running"</pre>
<pre>fi</pre>
<pre>}</pre>
<pre>status(){</pre>
<pre>pid=`pidof`</pre>
<pre>if [ "$pid" != "" ] ; then</pre>
<pre>echo "postgres is running"</pre>
<pre>echo `ps -ef | grep postgres | grep -v grep | awk '{if ($3==1) print "Postgres: " $8 ", Data Directory: " $10}'`</pre>
<pre>else</pre>
<pre>echo "postgres is not running"</pre>
<pre>fi</pre>
<pre>}</pre>
<pre>vac_status(){</pre>
<pre>su - postgres -c "${PGBIN}/psql -c \"select relname, last_autovacuum, last_autoanalyze from pg_stat_user_tables where last_autovacuum IS NOT NULL order by last_autovacuum desc\""</pre>
<pre>}</pre>
<pre>show_connections(){</pre>
<pre>su - postgres -c "${PGBIN}/psql -c \"SELECT datname, usename, procpid, client_addr, waiting, query_start, current_query FROM pg_stat_activity;\""</pre>
<pre>}</pre>
<pre>version(){</pre>
<pre>su - postgres -c "${PGBIN}/psql -c \"SELECT version()\""</pre>
<pre>}</pre>
<pre>restore_bak(){</pre>
<pre>echo "backup file path : "</pre>
<pre>read BACKUPFILEPATH</pre>
<pre>echo "database name : "</pre>
<pre>read DBNMAE</pre>
<pre>chmod -R 777 $BACKUPFILEPATH</pre>
<pre>cat ${BACKUPFILEPATH} | gunzip | ${PGBIN}/psql -U postgres ${DBNMAE}</pre>
<pre>${PGBIN}/psql -d ${DBNMAE} -U postgres &lt; /users.sql</pre>
<pre>}</pre>
<pre>case "$1" in</pre>
<pre>start)</pre>
<pre>start</pre>
<pre>;;</pre>
<pre>stop)</pre>
<pre>stop</pre>
<pre>;;</pre>
<pre>status)</pre>
<pre>status</pre>
<pre>;;</pre>
<pre>restart)</pre>
<pre>stop</pre>
<pre>start</pre>
<pre>;;</pre>
<pre>stopfast)</pre>
<pre>stopfast</pre>
<pre>;;</pre>
<pre>stopnow)</pre>
<pre>stopnow</pre>
<pre>;;</pre>
<pre>vac_status)</pre>
<pre>vac_status</pre>
<pre>;;</pre>
<pre>show_connections)</pre>
<pre>show_connections</pre>
<pre>;;</pre>
<pre>restore_bak)</pre>
<pre>restore_bak</pre>
<pre>;;</pre>
<pre>version)</pre>
<pre>version</pre>
<pre>;;</pre>
<pre>*)</pre>
<pre>echo "Usage: $0 { start | stop | restart | stopfast | stopnow | status | vac_status | show_connections | version | restore_bak }"</pre>
<pre>exit 1</pre>
<pre>esac</pre>
<pre>exit 0</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://anypossibility.com/blog/2012/01/postgresql-utility-for-enterprisedb-installation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PostgreSQL DB Version Control with apgdiff</title>
		<link>http://anypossibility.com/blog/2012/01/postgresql-db-version-control-with-apgdiff/</link>
		<comments>http://anypossibility.com/blog/2012/01/postgresql-db-version-control-with-apgdiff/#comments</comments>
		<pubDate>Mon, 30 Jan 2012 04:05:41 +0000</pubDate>
		<dc:creator>naoko</dc:creator>
				<category><![CDATA[Bash Shell]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[PostgreSQL]]></category>

		<guid isPermaLink="false">http://anypossibility.com/blog/?p=378</guid>
		<description><![CDATA[apgdiff (Another PostgreSQL Diff Tool) is so easy to setup and use. # you need at least Java 1.6 $ java -version java version &#8220;1.6.0_29&#8243; Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-10M3527) Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode) # download binary and that&#8217;s it. $ curl -O http://apgdiff.startnet.biz/download/apgdiff-2.3-bin.zip $ unzip apgdiff-2.3-bin.zip # create [...]]]></description>
			<content:encoded><![CDATA[<p><a title="apgdiff" href="http://apgdiff.startnet.biz/">apgdiff </a>(Another PostgreSQL Diff Tool) is so easy to setup and use.</p>
<p># you need at least Java 1.6</p>
<blockquote><p>$ java -version</p>
<p>java version &#8220;1.6.0_29&#8243;<br />
Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-10M3527)<br />
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)</p></blockquote>
<p># download binary and that&#8217;s it.</p>
<blockquote><p>$ curl -O http://apgdiff.startnet.biz/download/apgdiff-2.3-bin.zip<br />
$ unzip apgdiff-2.3-bin.zip</p></blockquote>
<p># create SQL dump files</p>
<blockquote><p>$ pg_dump &#8211;host HOST_IP &#8211;port 5432 -U DB_USER -s -f new.sql ALPHA_DB<br />
$ pg_dump &#8211;host HOST_IP &#8211;port 5432 -U USER -s -f old.sql PROD_DB</p></blockquote>
<p># generate upgrade statement</p>
<blockquote><p>$ PATH_TO_APGDIFF=/tmp/apgdiff<br />
$ java -jar $PATH_TO_APGDIFF/apgdiff-2.3.jar &#8211;ignore-start-with old.sql new.sql &gt; upgrade.sql</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://anypossibility.com/blog/2012/01/postgresql-db-version-control-with-apgdiff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Know how to use Chrome developer tools I &#8211; Disable Cache</title>
		<link>http://anypossibility.com/blog/2012/01/know-how-to-use-chrome-developer-tools-i-disable-cache/</link>
		<comments>http://anypossibility.com/blog/2012/01/know-how-to-use-chrome-developer-tools-i-disable-cache/#comments</comments>
		<pubDate>Sun, 29 Jan 2012 21:50:37 +0000</pubDate>
		<dc:creator>naoko</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://anypossibility.com/blog/?p=366</guid>
		<description><![CDATA[1. Open Web Developer Tools (Option + Command + i) or (Menu &#62; View &#62; Developer &#62; Developer Tools &#160; &#160; &#160; &#160; 2. Disable Cache 2.1. Go to Settings 2.1.1. Click Gear icon on lower bottom 2.1.2. Check Disable Cache &#160;]]></description>
			<content:encoded><![CDATA[<p>1. Open Web Developer Tools<br />
(Option + Command + i) or (Menu &gt; View &gt; Developer &gt; Developer Tools</p>
<p><a href="http://anypossibility.com/blog/wp-content/uploads/2012/01/Screen-shot-2012-01-29-at-2.26.41-PM.png"><img class="alignleft size-medium wp-image-368" title="Screen shot 2012-01-29 at 2.26.41 PM" src="http://anypossibility.com/blog/wp-content/uploads/2012/01/Screen-shot-2012-01-29-at-2.26.41-PM-300x124.png" alt="" width="300" height="124" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>2. Disable Cache</p>
<p>2.1. Go to Settings</p>
<p>2.1.1. Click Gear icon on lower bottom</p>
<p>2.1.2. Check Disable Cache</p>
<p><a href="http://anypossibility.com/blog/wp-content/uploads/2012/01/Screen-shot-2012-01-29-at-2.27.28-PM1.png"><img class="alignleft size-large wp-image-373" title="Screen shot 2012-01-29 at 2.27.28 PM" src="http://anypossibility.com/blog/wp-content/uploads/2012/01/Screen-shot-2012-01-29-at-2.27.28-PM1-1024x181.png" alt="" width="1024" height="181" /></a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://anypossibility.com/blog/2012/01/know-how-to-use-chrome-developer-tools-i-disable-cache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python &#8211; Calling Python Function From Terminal</title>
		<link>http://anypossibility.com/blog/2012/01/python-calling-python-function-from-terminal/</link>
		<comments>http://anypossibility.com/blog/2012/01/python-calling-python-function-from-terminal/#comments</comments>
		<pubDate>Fri, 27 Jan 2012 02:00:33 +0000</pubDate>
		<dc:creator>naoko</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://anypossibility.com/blog/?p=347</guid>
		<description><![CDATA[#!/usr/local/bin/python # how to call this # $ python /Users/nreeves/Desktop/test.py greeting &#8220;How are you?&#8221; # &#62;&#62; Hello greeting # $ python /Users/nreeves/Desktop/test.py food &#8220;Rice&#8221; &#8220;Potato&#8221; # &#62;&#62;I want to eat food and food # $ python /Users/nreeves/Desktop/test.py foo &#8220;bar&#8221; # &#62;&#62;programmer error! import sys def greeting(arg1):     print&#8216;Hello%s&#8216;% (arg1) def food(arg1, arg2):     print&#8216;I want to [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #808080;">#!/usr/local/bin/python</span><br />
<span style="color: #808080;"># how to call this</span><br />
<span style="color: #808080;"># $ python /Users/nreeves/Desktop/test.py greeting &#8220;How are you?&#8221;</span><br />
<span style="color: #808080;"># &gt;&gt; Hello greeting</span><br />
<span style="color: #808080;"># $ python /Users/nreeves/Desktop/test.py food &#8220;Rice&#8221; &#8220;Potato&#8221;</span><br />
<span style="color: #808080;"># &gt;&gt;I want to eat food and food</span><br />
<span style="color: #808080;"># $ python /Users/nreeves/Desktop/test.py foo &#8220;bar&#8221;</span><br />
<span style="color: #808080;"># &gt;&gt;programmer error!</span></p>
<p><span style="color: #ff6600;">import </span><span style="color: #800000;">sys</span></p>
<p><span style="color: #ff6600;">def </span><span style="color: #800000;">greeting</span>(arg1):<br />
<span style="color: #ff6600;">    print</span><span style="color: #008000;">&#8216;Hello</span><span style="color: #800000;">%s</span><span style="color: #008000;">&#8216;</span><span style="color: #ff6600;">%</span> (arg1)</p>
<p><span style="color: #ff6600;">def </span><span style="color: #800000;">food</span>(arg1, arg2):<br />
<span style="color: #ff6600;">    print</span><span style="color: #008000;">&#8216;I want to eat</span><span style="color: #800000;">%s</span><span style="color: #008000;">and</span><span style="color: #800000;">%s</span><span style="color: #008000;">&#8216;</span><span style="color: #ff6600;">%</span> (arg1, arg2)</p>
<p><span style="color: #ff6600;">def </span><span style="color: #800000;">main</span>():<br />
<span style="color: #ff6600;">    if </span><span style="color: #0000ff;">len</span>(sys.argv) <span style="color: #ff6600;">&gt;</span> 1: function<span style="color: #ff6600;">=</span>sys.argv[<span style="color: #ff6600;">1</span>]<br />
<span style="color: #ff6600;">    if </span><span style="color: #0000ff;">len</span>(sys.argv) <span style="color: #ff6600;">&gt;</span> 2: arg1<span style="color: #ff6600;">=</span>sys.argv[<span style="color: #ff6600;">1</span>]<br />
<span style="color: #ff6600;">    if </span><span style="color: #0000ff;">len</span>(sys.argv) <span style="color: #ff6600;">&gt;</span> 3: arg2<span style="color: #ff6600;">=</span>sys.argv[<span style="color: #ff6600;">1</span>]</p>
<p><span style="color: #ff6600;">    if</span> function <span style="color: #ff6600;">==</span><span style="color: #008000;">&#8220;greeting&#8221;</span>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;greeting(arg1)<br />
<span style="color: #ff6600;">    elif</span> function <span style="color: #ff6600;">==</span><span style="color: #008000;">&#8220;food&#8221;</span>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;food(arg1, arg2)<br />
<span style="color: #ff6600;">    else</span>:<br />
<span style="color: #ff6600;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print</span><span style="color: #008000;">&#8220;programmer error!&#8221;</span></p>
<p><span style="color: #ff6600;">if</span> <span style="color: #0000ff;">__name__</span> <span style="color: #ff6600;">==</span> <span style="color: #008000;">&#8220;__main__&#8221;</span>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;main()</p>
]]></content:encoded>
			<wfw:commentRss>http://anypossibility.com/blog/2012/01/python-calling-python-function-from-terminal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PostgreSQL &#8211; Document PostgreSQL functions</title>
		<link>http://anypossibility.com/blog/2012/01/document-postgresql-functions/</link>
		<comments>http://anypossibility.com/blog/2012/01/document-postgresql-functions/#comments</comments>
		<pubDate>Sun, 22 Jan 2012 19:25:46 +0000</pubDate>
		<dc:creator>naoko</dc:creator>
				<category><![CDATA[PostgreSQL]]></category>

		<guid isPermaLink="false">http://anypossibility.com/blog/?p=338</guid>
		<description><![CDATA[Yep, documentation is critical. Everyone knows that Search-ability of the documentation is critical as documentation. We started to document postgreSQL trigger/functions and created view to list function name, definition and comments etc&#8230; It is pretty handy and would like to share this with you. &#8211; Add Comments COMMENT ON FUNCTION my_function(text) IS &#8216;function description&#8217;; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Yep, documentation is critical. Everyone knows that <img src='http://anypossibility.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Search-ability of the documentation is critical as documentation.</p>
<p>We started to document postgreSQL trigger/functions and created view to list function name, definition and comments etc&#8230; It is pretty handy and would like to share this with you.</p>
<p>&#8211; Add Comments</p>
<blockquote><p>COMMENT ON FUNCTION my_function(text) IS &#8216;function description&#8217;;</p></blockquote>
<p>&nbsp;</p>
<p>&#8211; Search by Comments</p>
<blockquote><p>SELECT * from pg_catalog.pg_description WHERE description = &#8216;function description&#8217;; &#8212; Search for Specific description</p></blockquote>
<p>&nbsp;</p>
<p>&#8211; List All Functions along with Comments</p>
<blockquote><p>SELECT p.proname<br />
,p.proargnames<br />
,obj_description(p.oid)<br />
,pg_get_functiondef(p.oid)<br />
,CASE WHEN p.prorettype=2279 THEN &#8216;Trigger Function&#8217; ELSE &#8216;Function&#8217; END as type<br />
FROM pg_proc p<br />
JOIN pg_namespace nspance ON nspance.oid = p.pronamespace<br />
WHERE<br />
nspname=&#8217;public&#8217; AND proowner &lt;&gt; 10<br />
&#8211; AND proname = &#8216;my_function&#8217; &#8212; Search for Specific function<br />
&#8211; AND p.prorettype=2279 &#8212; Triggere Function Only<br />
ORDER BY 5, 1</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://anypossibility.com/blog/2012/01/document-postgresql-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install Python2.7.2, apache, wsgi on Ubuntu 10.04 LTS</title>
		<link>http://anypossibility.com/blog/2011/09/install-python2-7-2-apache-wsgi-on-ubuntu-10-04-lts/</link>
		<comments>http://anypossibility.com/blog/2011/09/install-python2-7-2-apache-wsgi-on-ubuntu-10-04-lts/#comments</comments>
		<pubDate>Wed, 28 Sep 2011 02:30:30 +0000</pubDate>
		<dc:creator>naoko</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[Bash Shell]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mod_wsgi]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://anypossibility.com/blog/?p=323</guid>
		<description><![CDATA[My initial attept failed miserably as you can see my post from here&#8230; After bunch of help from many intelligent people I successfully setup Python2.7.2, apache, wsgi for Ubunut 10.04 LTS ++++++++++++++++++++++++++++++ + References: + 1. How to install 2.7 comment made by Alen here + 2. How to install wsgi ++++ # ==== Setup [...]]]></description>
			<content:encoded><![CDATA[<p>My initial attept failed miserably as you can see my post from <a href="http://stackoverflow.com/questions/7561221/undefined-symbol-pyobject-nextnotimplemented-error-when-loading-psycopg2-modu">here</a>&#8230;</p>
<p>After bunch of help from many intelligent people I successfully setup Python2.7.2, apache, wsgi for Ubunut 10.04 LTS</p>
<p>++++++++++++++++++++++++++++++<br />
+ References:<br />
+ 1. How to install 2.7 comment made by Alen <a href="http://askubuntu.com/questions/17841/will-python2-7-be-available-for-lucid-in-future ">here</a><br />
+ 2. <a href="http://grok.zope.org/documentation/tutorial/installing-and-setting-up-grok-under-mod-wsgi/installing-and-configuring-mod-wsgi ">How to install wsgi</a><br />
++++</p>
<blockquote><p># ==== Setup Ubuntu 10.04 on VMWare # on server:<br />
# install basic stuff&#8230;<br />
sudo apt-get update<br />
sudo apt-get upgrade<br />
sudo apt-get install openssh-server # only if you want to use ssh<br />
sudo apt-get install vim # only if you like vim&#8230;.<br />
sudo apt-get install libpq-dev<br />
sudo apt-get install curl # only if you like over wget.. I am just so used to curl over wget since os-x (my dev machine) doesn&#8217;t have wget<br />
sudo apt-get install build-essential</p></blockquote>
<p>##### # Install Python 2.7.2 #####</p>
<blockquote><p>sudo vim /etc/apt/sources.list</p></blockquote>
<p># add the following 2 lines at the bottom of the file:</p>
<blockquote><p>deb http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu lucid main<br />
deb-src http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu lucid main</p></blockquote>
<p># issue the following command:</p>
<blockquote><p>sudo apt-key adv &#8211;keyserver keyserver.ubuntu.com &#8211;recv-keys DB82666C<br />
sudo apt-get update<br />
sudo apt-get install python2.7 python2.7-dev</p></blockquote>
<p># verify instllation</p>
<blockquote><p>which python &gt;&gt;/usr/local/bin/python<br />
python -V &gt;&gt; Python 2.7.2</p></blockquote>
<p># verify the linkage</p>
<blockquote><p>ldd /usr/local/bin/python2.7</p></blockquote>
<p>##### # Install Apache #####<br />
# you need to install apache2-dev for wsgi installation</p>
<blockquote><p>sudo apt-get install apache2 apache2-dev</p></blockquote>
<p># then add domain.</p>
<blockquote><p>sudo vim /etc/apache2/conf.d/fqdn<br />
# add: &#8220;ServerName localhost&#8221; without quotes</p></blockquote>
<p>################################<br />
# install wsgi<br />
################################<br />
# if wsgi is installed via apt-get then purge it:</p>
<blockquote><p>sudo apt-get purge libapache2-mod-wsgi</p>
<p>mkdir tmp # or wherever you want to compile<br />
cd tmp<br />
curl -O http://modwsgi.googlecode.com/files/mod_wsgi-3.3.tar.gz tar xzf mod_wsgi-3.3.tar.gz<br />
rm mod_wsgi-3.3.tar.gz<br />
cd mod_wsgi-3.3 ./configure &#8211;with-python=/usr/local/bin/python make sudo make install<br />
# the load declaration for the module needs to go wsgi.load<br />
sudo vim /etc/apache2/mods-available/wsgi.load<br />
# then add the following line: &#8220;LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so&#8221; without quotes<br />
# Then you have to activate the wsgi module with:<br />
sudo a2enmod wsgi</p></blockquote>
<p># That&#8217;s it!</p>
]]></content:encoded>
			<wfw:commentRss>http://anypossibility.com/blog/2011/09/install-python2-7-2-apache-wsgi-on-ubuntu-10-04-lts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open SSH (Port 22) on Fedora 15</title>
		<link>http://anypossibility.com/blog/2011/08/open-ssh-port-22-on-fedora-15/</link>
		<comments>http://anypossibility.com/blog/2011/08/open-ssh-port-22-on-fedora-15/#comments</comments>
		<pubDate>Thu, 01 Sep 2011 01:13:14 +0000</pubDate>
		<dc:creator>naoko</dc:creator>
				<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[System Admin]]></category>

		<guid isPermaLink="false">http://anypossibility.com/blog/?p=313</guid>
		<description><![CDATA[So Fedora 15 with GNOME 3 is very beautiful. I really like it. Mac&#8217;s spotlight like search is +1. I had a bit hard time accessing my macbook to Fedora 15 via SSH so I thought I should share this with you. 1. Modify sshd_conf file (/etc/ssh/sshd_config): Find Line &#8220;Port 22&#8243; and uncomment the line [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #000080;">So Fedora 15 with GNOME 3 is very beautiful. I really like it. Mac&#8217;s spotlight like search is +1.</span></p>
<p><span style="color: #000080;">I had a bit hard time accessing my macbook to Fedora 15 via SSH so I thought I should share this with you.</span></p>
<p><span style="color: #000080;">1. Modify sshd_conf file (/etc/ssh/sshd_config): Find Line &#8220;Port 22&#8243; and uncomment the line</span></p>
<p><span style="color: #000080;">2. Restart sshd service by issuing </span></p>
<blockquote><p><span style="color: #000080;">$ service sshd stop$ service sshd restart</span></p></blockquote>
<p><span style="color: #000080;">3. Let&#8217;s check to see if sshd is running</span></p>
<blockquote><p><span style="color: #000080;">$ service sshd status# or you could$ ps aux|grep sshd</span></p></blockquote>
<p><span style="color: #000080;">3. Okay, let&#8217;s test it. Go to client (my case is my macbook) and issued $ ssh username@ip_address Connect then I got <em>&#8220;Connection Refused&#8221;</em> Error. So looks like I need to mess with firewall (iptables).</span></p>
<p><span style="color: #000080;">3.1 Edit file /etc/sysconfig/iptables and add the following line. Note that this should go above the first instance of -A INPUT otherwise other rule might block you as rule will will be read from top down and stops as soon as it meets the rule.</span></p>
<blockquote>
<div><span style="color: #000080;"># to open ssh</span><br />
<span style="color: #000080;"> -A INPUT -m state &#8211;state NEW -m tcp -p tcp &#8211;dport 22 -j ACCEPT</span></div>
</blockquote>
<div><span style="color: #000080;">3.2. Save and close the file and restart iptables as follows:</span></div>
<blockquote>
<div><span style="color: #000080;">$ service iptables restart</span></div>
</blockquote>
<div><span style="color: #000080;">4. Then try this again: $ ssh username@ip_address Hopefully you are connected&#8230;.</span></div>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://anypossibility.com/blog/2011/08/open-ssh-port-22-on-fedora-15/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PostgreSQL &#8211; Document Table and Column Description (Comments on Table and Column)</title>
		<link>http://anypossibility.com/blog/2011/08/postgresql-document-table-and-column-description-comments-on-table-and-column/</link>
		<comments>http://anypossibility.com/blog/2011/08/postgresql-document-table-and-column-description-comments-on-table-and-column/#comments</comments>
		<pubDate>Thu, 04 Aug 2011 04:08:27 +0000</pubDate>
		<dc:creator>naoko</dc:creator>
				<category><![CDATA[PostgreSQL]]></category>

		<guid isPermaLink="false">http://anypossibility.com/blog/?p=303</guid>
		<description><![CDATA[&#8211; Add comment to table COMMENT ON TABLE fnl is &#8216;Customer Information&#8217; &#8211; Add comment to column COMMENT ON COLUMN customer.id is &#8216;customer primary key&#8217; &#160; &#8211; Retrieve Info Individually SELECT col_description((select c.oid from pg_catalog.pg_class c where c.relname = &#8216;customer&#8217;), 1) SELECT obj_description((select c.oid from pg_catalog.pg_class c where c.relname = &#8216;customer&#8217;)) &#160; &#8211; Retrieve Info [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>&#8211; Add comment to table</p>
<p>COMMENT ON TABLE fnl is &#8216;Customer Information&#8217;</p>
<p>&#8211; Add comment to column</p>
<p>COMMENT ON COLUMN customer.id is &#8216;customer primary key&#8217;</p>
<p>&nbsp;</p>
<p>&#8211; Retrieve Info Individually</p>
<p>SELECT col_description((select c.oid from pg_catalog.pg_class c where c.relname = &#8216;customer&#8217;), 1)</p>
<p>SELECT obj_description((select c.oid from pg_catalog.pg_class c where c.relname = &#8216;customer&#8217;))</p>
<p>&nbsp;</p>
<p>&#8211; Retrieve Info for one table</p>
<p>SELECT</p>
<p>cols.column_name</p>
<p>,(select pg_catalog.obj_description(oid) from pg_catalog.pg_class c where c.relname=cols.table_name) as table_comment</p>
<p>,(select pg_catalog.col_description(oid,cols.ordinal_position::int) from pg_catalog.pg_class c where c.relname=cols.table_name) as column_comment</p>
<p>FROM information_schema.columns cols</p>
<p>WHERE cols.table_catalog=&#8217;database_name&#8217; and cols.table_name=&#8217;customer&#8217;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://anypossibility.com/blog/2011/08/postgresql-document-table-and-column-description-comments-on-table-and-column/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

