<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Blog2</title>
	
	<link>http://blog.digvan.com</link>
	<description>[ Life is either a daring adventure or nothing! Helen Keller]</description>
	<lastBuildDate>Wed, 21 Apr 2010 23:44:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/digvan/ieUL" /><feedburner:info uri="digvan/ieul" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Add facebook’s like button to your WP</title>
		<link>http://feedproxy.google.com/~r/digvan/ieUL/~3/7bhYmRUndgE/</link>
		<comments>http://blog.digvan.com/?p=25#comments</comments>
		<pubDate>Wed, 21 Apr 2010 23:44:35 +0000</pubDate>
		<dc:creator>digvan</dc:creator>
				<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://blog.digvan.com/?p=25</guid>
		<description><![CDATA[
			
				
			
		
This is very easy to integrate facebook&#8217;s like button to your posts. Ok here is step-by-step procedere.
1-Login to your Wordpress admin
2-Go to the appearance &#8211;&#62; editor section
3-From right panel click on Main index Template
4-On the line before 
&#60;p class=&#34;postmetadata&#34;&#62;&#60;/p&#62;

5-Paste the below code
&#60;div class=&#34;postmetadata&#34; id=&#34;facebooklikebtn&#34;&#62;
              [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.digvan.com%2F%3Fp%3D25"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.digvan.com%2F%3Fp%3D25&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>This is very easy to integrate facebook&#8217;s like button to your posts. Ok here is step-by-step procedere.</p>
<p>1-Login to your Wordpress admin</p>
<p>2-Go to the appearance &#8211;&gt; editor section</p>
<p>3-From right panel click on Main index Template</p>
<p>4-On the line before </p>
<div><!--</p>
<p>Code highlighting produced by Actipro CodeHighlighter (freeware)</p>
<p>http://www.CodeHighlighter.com/</p>
<p>--><span style="color: #0000FF;">&lt;</span><span style="color: #800000;">p </span><span style="color: #FF0000;">class</span><span style="color: #0000FF;">=&quot;postmetadata&quot;</span><span style="color: #0000FF;">&gt;&lt;/</span><span style="color: #800000;">p</span><span style="color: #0000FF;">&gt;</span><span style="color: #000000;"><br />
</span></div>
<p>5-Paste the below code</p>
<div><!--</p>
<p>Code highlighting produced by Actipro CodeHighlighter (freeware)</p>
<p>http://www.CodeHighlighter.com/</p>
<p>--><span style="color: #0000FF;">&lt;</span><span style="color: #800000;">div </span><span style="color: #FF0000;">class</span><span style="color: #0000FF;">=&quot;postmetadata&quot;</span><span style="color: #FF0000;"> id</span><span style="color: #0000FF;">=&quot;facebooklikebtn&quot;</span><span style="color: #0000FF;">&gt;</span><span style="color: #000000;"><br />
                </span><span style="color: #0000FF;">&lt;</span><span style="color: #800000;">iframe </span><span style="color: #FF0000;">src</span><span style="color: #0000FF;">=&quot;http://www.facebook.com/plugins/like.php?href=&lt;?php the_permalink() ?&gt;&amp;amp;layout=standard&amp;amp;show-faces=false&amp;amp;width=450&amp;amp;action=like&amp;amp;font=verdana&amp;amp;colorscheme=light&quot;</span><span style="color: #FF0000;"> scrolling</span><span style="color: #0000FF;">=&quot;no&quot;</span><span style="color: #FF0000;"> frameborder</span><span style="color: #0000FF;">=&quot;0&quot;</span><span style="color: #FF0000;"> allowTransparency</span><span style="color: #0000FF;">=&quot;true&quot;</span><span style="color: #FF0000;"> style</span><span style="color: #0000FF;">=&quot;border:none; overflow:hidden; width:450px; height:20px&quot;</span><span style="color: #0000FF;">&gt;&lt;/</span><span style="color: #800000;">iframe</span><span style="color: #0000FF;">&gt;</span><span style="color: #000000;"><br />
                </span><span style="color: #0000FF;">&lt;/</span><span style="color: #800000;">div</span><span style="color: #0000FF;">&gt;</span></div>
<p>6-Do the above for the Page Template and Single Post<br />
7-You Done!</p>
<p>If you have any question find me <a href="http://twitter.com.com/digvan">@digvan</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.digvan.com/?feed=rss2&amp;p=25</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.digvan.com/?p=25</feedburner:origLink></item>
		<item>
		<title>Introduction to Redis</title>
		<link>http://feedproxy.google.com/~r/digvan/ieUL/~3/D6sw-wXDaHk/</link>
		<comments>http://blog.digvan.com/?p=14#comments</comments>
		<pubDate>Sat, 10 Apr 2010 19:43:45 +0000</pubDate>
		<dc:creator>digvan</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[Python Redis]]></category>

		<guid isPermaLink="false">http://blog.digvan.com/?p=14</guid>
		<description><![CDATA[
			
				
			
		
Introduction to Redis
Redis is a key-value database that has very nice features which every computer scientist love it.
Why I love Redis?

Redis give the data structure like all computer scientist learn in the school such as Set, sorted set, List, and Hash. So you don&#8217;t need to think in SQL anymore.
Redis is very fast it can gives [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.digvan.com%2F%3Fp%3D14"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.digvan.com%2F%3Fp%3D14&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Introduction to Redis</p>
<p><a id="ev8a" title="Redis" href="http://code.google.com/p/redis/">Redis</a> is a key-value database that has very nice features which every computer scientist love it.</p>
<p><strong>Why I love Redis?</strong></p>
<ul>
<li>Redis give the data structure like all computer scientist learn in the school such as Set, sorted set, List, and Hash. So you don&#8217;t need to think in SQL anymore.</li>
<li>Redis is <a id="e9we" title="very fast" href="http://code.google.com/p/redis/wiki/Benchmarks">very fast</a> it can gives you the performance about 50,000 to 100,000 operation per second in basic basic computers (2GHz CPU with 2GB RAM).</li>
<li>you can install Redis in 2 minutes. (<a id="bk9s" title="linux" href="http://code.google.com/p/redis/wiki/UnstableSource?tm=4">Linux</a> and <a id="xasf" title="windows" href="http://code.google.com/p/servicestack/downloads/list">Windows</a>)</li>
<li>It&#8217;s written in ANSI-C so you can easily pick the source code (Yes, it&#8217;s open source!) and modify the code if you want.</li>
<li>There are native clients for almost every language (include <a id="u8gs" title="Python" href="http://github.com/andymccurdy/redis-py/">Python</a> , <a id="vdjg" title="Ruby" href="http://github.com/ezmobius/redis-rb">Ruby</a> and <a id="d9lj" title="PHP" href="http://github.com/antirez/redisdotphp">PHP</a>) and Yes, you don&#8217;t need Thrift.</li>
<li>You can setup master-slave <a id="qqm1" title="replication" href="http://code.google.com/p/redis/wiki/ReplicationHowto">replication</a> of Redis in 2 minutes.</li>
<li>Redis has great community lead by <a id="el:v" title="Salvatore Sanfilip" href="http://twitter.com/antirez">Salvatore Sanfilippo</a>. (also check <a id="yf41" title="Redis Google group" href="http://groups.google.com/group/redis-db">Redis Google group</a>)</li>
<li>Redis is great for large scale web programming without need of MySQL. (Check <a id="i5ml" title="Retwis" href="http://code.google.com/p/redis/downloads/list">Retwis</a> )</li>
<li>Redis is <a id="zb0h" title="very easy" href="http://code.google.com/p/redis/wiki/QuickStart">very easy</a> to learn.</li>
</ul>
<p><strong>Where should I start the basic?</strong></p>
<ul>
<li>First download the source code from <a id="jjp1" title="Github" href="http://github.com/antirez/redis">Github</a> or <a id="f:yl" title="Google code" href="http://code.google.com/p/redis/downloads/list">Google code</a>.</li>
<li>Second compile the source code (basically just type ./make)</li>
<li>Download and install your language client if you prefer to work with Redis from your language <a id="zwrf" title="here" href="http://code.google.com/p/redis/wiki/SupportedLanguages">here</a> is list all language.</li>
<li>Run Redis server &#8212; $ ./redis-server &#8212; (Redis use port # 6379 by default)</li>
<li>Run Redis client  &#8211; $ ./redis-cli &#8211; and enter follow commands to see &#8220;Hello World!&#8221;</li>
</ul>
<p style="padding-left: 30px;"><span style="white-space:pre"><span style="white-space:pre"> </span> </span>1- &gt; set foo bar<br />
<span style="white-space:pre"><span style="white-space:pre"> </span> </span>2- &gt; get foo<br />
<span style="white-space:pre"><span style="white-space:pre"> </span> </span>3- &gt; lpush myList world!<br />
<span style="white-space:pre"><span style="white-space:pre"> </span> </span>4- &gt; lpush myList Hello<br />
<span style="white-space:pre"><span style="white-space:pre"> </span> </span>5- &gt; lpop myList<br />
<span style="white-space:pre"><span style="white-space:pre"> </span> </span>6- &gt; lpop myList</p>
<p style="padding-left: 30px; "><span style="white-space:pre"> </span>In line 1, we set the key name &#8220;foo&#8221; to the value &#8220;bar&#8221;</p>
<p style="padding-left: 30px; "><span style="white-space:pre"> </span>In line 2, we get the value for the key name &#8220;foo&#8221; so the return value is &#8220;bar&#8221;</p>
<p style="padding-left: 30px; "><span style="white-space:pre"> </span>In line 3, we (left) push the value &#8220;world!&#8221; to the list &#8220;myList&#8221;</p>
<p style="padding-left: 30px; "><span style="white-space:pre"> </span>In line 4, we (left) push the value &#8220;Hello&#8221; to the list &#8220;myList&#8221;</p>
<p style="padding-left: 30px; "><span style="white-space:pre"> </span>In line 5, we (left) pop the value from &#8220;myList&#8221; and the return value is &#8220;Hello&#8221;</p>
<p style="padding-left: 30px; "><span style="white-space:pre"> </span>In line 6, we (left) pop the value from &#8220;myList&#8221; and the return value is &#8220;world!&#8221;<br />
<span style="white-space:pre"> <span style="white-space:pre"> </span></span></p>
<p style="padding-left: 30px; ">Now, you get the idea how Redis works, so lets do one real project in Python and Redis.</p>
<p><strong>Can I see Redis in real project?</strong></p>
<p style="padding-left: 30px;"><span style="white-space: pre;"> </span>Yes, In this project I want to design a program that get the RSS from source, then parse the RSS and send the title of each news to Twitter.</p>
<p style="padding-left: 30px;"><span style="white-space: pre;"> </span>What you need to do before start to code?</p>
<p style="padding-left: 30px;"><span style="white-space:pre"> </span>0- <a id="a3ct" title="Python 2.5 or higher" href="http://python.org/download/">Python 2.5 or higher</a></p>
<p style="padding-left: 30px;"><span style="white-space:pre"> </span>1- <a id="z1kt" title="Redis" href="http://github.com/antirez/redis">Redis</a> and <a id="wkdj" title="py-redis" href="http://github.com/andymccurdy/redis-py">py-redis</a></p>
<p style="padding-left: 30px;"><span style="white-space:pre"> </span>2- <a id="g_vr" title="Twitter python library" href="http://code.google.com/p/python-twitter/">Twitter python library</a> (included in package)</p>
<p style="padding-left: 30px;"><span style="white-space:pre"> </span>3- <a id="oq8c" title="Yahoo social python" href="http://github.com/yahoo/yos-social-python">Yahoo social python</a></p>
<p style="padding-left: 30px;"><span style="white-space:pre"> </span>Next:    Enter the following code in your favorite text editor and save the file.</p>
<p style="padding-left: 30px;">
<pre>import redis,twitter
import yahoo.yql

def getandset():
	''' Get the weather condition for WOID=12778445 and save in the database'''

	q = yahoo.yql.YQLQuery().execute('select * from rss where url="http://weather.yahooapis.com/forecastrss?w=12778445"')
	temp = q["query"]["results"]["item"]["condition"]["temp"]
	text = q["query"]["results"]["item"]["condition"]["text"]
	date = q["query"]["results"]["item"]["condition"]["date"]
	#forecast
	high = q["query"]["results"]["item"]["forecast"][0]['high']
	low  = q["query"]["results"]["item"]["forecast"][0]['low']

	r = redis.Redis('localhost')
	r.set('weather:current:temp', temp)
	r.set('weather:current:cond', text.lower())
	r.set('weather:tomorrow:high', high)
	r.set('weather:tomorrow:low', low)

def post():
	API = twitter.Api(username = "YOUR TWITTER USERNAME", password = 'YOUR TWITTER PASSWORD')
	r = redis.Redis('localhost')
	temp = r.get('weather:current:temp')
	cond = r.get('weather:current:cond')
	tom_high = r.get('weather:tomorrow:high')
	tom_low = r.get('weather:tomorrow:low')
	if (temp or cond or tom_high or tom_low):
	tweet = 'Currently %s F and %s at %s. Tomorrow: high %s F, low: %s F'
	name = 'West Lafayette'
	tweet = tweet % (temp, cond, name, tom_high, tom_low)
	print tweet
	print "Posting...."
	API.PostUpdate(tweet)
	print "Done!"

if __name__ == '__main__':
getandset()
post()</pre>
<p style="padding-left: 30px;">
<div><strong>Summery of code:</strong></div>
<div>In this code we first use YQL (the service form Yahoo!) to get the RSS (in this example we get the weather condition for West Lafayette, IN)</div>
<div>Then we parse the RSS to get our desired field which is basically temperatures and forecast. After that we save these values to our database using &#8216;SET&#8217; function. Please make attention to the key name style I use &#8220;&#8216;weather:current:temp&#8217;&#8221; which is basically tell you in this key we want to have the today&#8217;s temperature. In the post function, I basically retrieve the value we inserted to database and post it to your Twitter account.</div>
<div>You can download the source code for this tutorial from <a id="wm7j" title="here" href="http://bit.ly/9Xk55f">here</a>.</div>
<div>Now that you should learnt the SET data structure, next time I will explain LIST which is one of the most important structure in Redis.</div>
<div><strong>Further Reading:</strong></div>
<div id="k9a5" class="line">
<ul>
<li><a id="b7_3" title="Redis Wiki" href="http://code.google.com/p/redis/wiki/index?tm=6">Redis Wiki</a></li>
<li>How to build an <a id="yau3" title="URL shortener" href="http://sunilarora.org/url-shortener-service-using-redis">URL shortener</a> (Sunil Arora)</li>
<li>Getting started with Redis (<a id="os1e" title="DeGizmo" href="http://degizmo.com/2010/03/22/getting-started-redis-and-python/">DeGizmo</a>)</li>
<li>Redis weekly updates (<a id="en8g" title="Antirez" href="http://antirez.com/">Antirez</a>)</li>
<li>Why I like Redis (<a id="ck-s" title="Simon Willison" href="http://simonwillison.net/2009/Oct/22/redis/">Simon Willison</a>)</li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.digvan.com/?feed=rss2&amp;p=14</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.digvan.com/?p=14</feedburner:origLink></item>
		<item>
		<title>Extract Abstracts from PubMed</title>
		<link>http://feedproxy.google.com/~r/digvan/ieUL/~3/4rdjnCTSYzs/</link>
		<comments>http://blog.digvan.com/?p=13#comments</comments>
		<pubDate>Sun, 01 Mar 2009 02:01:14 +0000</pubDate>
		<dc:creator>digvan</dc:creator>
				<category><![CDATA[Data mining]]></category>
		<category><![CDATA[parser]]></category>
		<category><![CDATA[PubMed]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://blog.digvan.com/?p=13</guid>
		<description><![CDATA[
			
				
			
		
I&#8217;m in the research group that we want to extract protein-protein interaction by using partial matching. After a while we found we need some article&#8217;s abstracts from  National Center for Biotechnology Information by using PUBMED ID. Here is my program to get articles from NCBI, extract abstract section and save abstract part into new file [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.digvan.com%2F%3Fp%3D13"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.digvan.com%2F%3Fp%3D13&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I&#8217;m in the research group that we want to extract protein-protein interaction by using partial matching. After a while we found we need some article&#8217;s abstracts from <a href="http://http://www.ncbi.nlm.nih.gov/"> National Center for Biotechnology Information</a> by using PUBMED ID. Here is my program to get articles from NCBI, extract abstract section and save abstract part into new file name by PUBMED ID.</p>
<p></p>
<pre><font face="Lucida,Courier New"><font color="#C00000">import</font> <font color="#000000">urllib2</font>
<font color="#C00000">import</font> <font color="#000000">re</font>
<font color="#C00000">import</font> <font color="#000000">os</font>
<font color="#C00000">from</font> <font color="#000000">BeautifulSoup</font> <font color="#C00000">import</font> <font color="#000000">BeautifulSoup</font>

<font color="#000000">DIRECTORY</font> <font color="#0000C0">=</font> <font color="#004080">"abstractFiles"</font>
<font color="#C00000">try</font><font color="#0000C0">:</font>
        <font color="#000000">os</font><font color="#0000C0">.</font><font color="#000000">mkdir</font><font color="#0000C0">(</font><font color="#000000">DIRECTORY</font><font color="#0000C0">)</font>

<font color="#C00000">except</font> <font color="#000000">OSError</font><font color="#0000C0">:</font>
        <font color="#C00000">print</font> <font color="#004080">"the directory %s is already exist"</font> <font color="#0000C0">%</font><font color="#000000">DIRECTORY</font>

<font color="#000000">f</font><font color="#0000C0">=</font><font color="#000000">open</font><font color="#0000C0">(</font><font color="#004080">'output-1.txt'</font><font color="#0000C0">,</font> <font color="#004080">'r'</font><font color="#0000C0">)</font>

<font color="#000000">tickers</font> <font color="#0000C0">=</font> <font color="#0000C0">[</font><font color="#0000C0">]</font>
<font color="#C00000">for</font> <font color="#000000">line</font> <font color="#C00000">in</font> <font color="#000000">f</font><font color="#0000C0">:</font>
        <font color="#000000">tickers</font><font color="#0000C0">.</font><font color="#000000">append</font><font color="#0000C0">(</font><font color="#000000">line</font><font color="#0000C0">[</font><font color="#0080C0">13</font><font color="#0000C0">:</font><font color="#0080C0">21</font><font color="#0000C0">]</font><font color="#0000C0">)</font>

<font color="#000000">os</font><font color="#0000C0">.</font><font color="#000000">chdir</font><font color="#0000C0">(</font><font color="#000000">DIRECTORY</font><font color="#0000C0">)</font>
<font color="#C00000">for</font> <font color="#000000">t</font> <font color="#C00000">in</font> <font color="#000000">tickers</font><font color="#0000C0">:</font>
        <font color="#C00000">try</font><font color="#0000C0">:</font>

                <font color="#000000">rows</font><font color="#0000C0">=</font><font color="#000000">urllib2</font><font color="#0000C0">.</font><font color="#000000">urlopen</font><font color="#0000C0">(</font> \
                <font color="#004080">'http://www.ncbi.nlm.nih.gov/sites/entrez?db=pubmed&amp;cmd=search&amp;term=%s'</font> \
                <font color="#0000C0">%</font><font color="#000000">t</font><font color="#0000C0">)</font><font color="#0000C0">.</font><font color="#000000">read</font><font color="#0000C0">(</font><font color="#0000C0">)</font>

                <font color="#000000">soup</font> <font color="#0000C0">=</font> <font color="#000000">BeautifulSoup</font><font color="#0000C0">(</font><font color="#000000">rows</font><font color="#0000C0">)</font>
                <font color="#000000">abs</font> <font color="#0000C0">=</font> <font color="#000000">soup</font><font color="#0000C0">.</font><font color="#000000">findAll</font><font color="#0000C0">(</font><font color="#004080">'p'</font><font color="#0000C0">,</font><font color="#000000">attrs</font><font color="#0000C0">=</font><font color="#0000C0">{</font><font color="#004080">'class'</font> <font color="#0000C0">:</font> <font color="#000000">re</font><font color="#0000C0">.</font><font color="#000000">compile</font><font color="#0000C0">(</font><font color="#004080">"abstract"</font><font color="#0000C0">)</font><font color="#0000C0">}</font><font color="#0000C0">)</font>

                <font color="#000000">ab</font> <font color="#0000C0">=</font> <font color="#000000">str</font><font color="#0000C0">(</font><font color="#000000">abs</font><font color="#0000C0">[</font><font color="#0080C0">0</font><font color="#0000C0">]</font><font color="#0000C0">)</font>
                <font color="#000000">ab</font> <font color="#0000C0">=</font> <font color="#000000">ab</font><font color="#0000C0">[</font><font color="#0080C0">20</font><font color="#0000C0">:</font><font color="#0000C0">]</font>

                <font color="#000000">ab</font> <font color="#0000C0">=</font> <font color="#000000">ab</font><font color="#0000C0">.</font><font color="#000000">replace</font><font color="#0000C0">(</font><font color="#004080">'&lt;/p&gt;'</font><font color="#0000C0">,</font><font color="#004080">''</font><font color="#0000C0">)</font>
                <font color="#000000">t</font> <font color="#0000C0">=</font> <font color="#000000">open</font><font color="#0000C0">(</font><font color="#000000">t</font><font color="#0000C0">+</font><font color="#004080">'.txt'</font><font color="#0000C0">,</font><font color="#004080">'w'</font><font color="#0000C0">)</font>

                <font color="#000000">t</font><font color="#0000C0">.</font><font color="#000000">write</font><font color="#0000C0">(</font><font color="#000000">ab</font><font color="#0000C0">)</font>
                <font color="#000000">t</font><font color="#0000C0">.</font><font color="#000000">close</font><font color="#0000C0">(</font><font color="#0000C0">)</font>

        <font color="#C00000">except</font> <font color="#000000">IOError</font><font color="#0000C0">:</font>

                <font color="#000000">errors</font> <font color="#0000C0">=</font> <font color="#0000C0">[</font><font color="#000000">t</font><font color="#0000C0">]</font>
                <font color="#000000">errf</font> <font color="#0000C0">=</font> <font color="#000000">open</font><font color="#0000C0">(</font><font color="#004080">'bad_trickers.txt'</font><font color="#0000C0">,</font><font color="#004080">'w+'</font><font color="#0000C0">)</font>

                <font color="#000000">errf</font><font color="#0000C0">.</font><font color="#000000">write</font><font color="#0000C0">(</font><font color="#000000">str</font><font color="#0000C0">(</font><font color="#000000">errors</font><font color="#0000C0">)</font><font color="#0000C0">)</font>
                <font color="#000000">errf</font><font color="#0000C0">.</font><font color="#000000">close</font><font color="#0000C0">(</font><font color="#0000C0">)</font>

                <font color="#C00000">print</font> <font color="#000000">errors</font>
<font color="#000000">f</font><font color="#0000C0">.</font><font color="#000000">close</font><font color="#0000C0">(</font><font color="#0000C0">)</font><font color="#000000"></font></font></pre>
<p>Note: This program is written in Python. To run this program you will need an external library named <a href="http://www.crummy.com/software/BeautifulSoup/" >BeautifulSoup</a>.<br />
<br />
Click <a href="http://digvan.com/download/abstractParser.zip">here</a> to download the source code.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.digvan.com/?feed=rss2&amp;p=13</wfw:commentRss>
		<slash:comments>11</slash:comments>
		<feedburner:origLink>http://blog.digvan.com/?p=13</feedburner:origLink></item>
		<item>
		<title>Artificial Intelligence</title>
		<link>http://feedproxy.google.com/~r/digvan/ieUL/~3/PsCAPSHOxgo/</link>
		<comments>http://blog.digvan.com/?p=12#comments</comments>
		<pubDate>Sat, 28 Feb 2009 01:27:45 +0000</pubDate>
		<dc:creator>digvan</dc:creator>
				<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[AI]]></category>
		<category><![CDATA[ML]]></category>

		<guid isPermaLink="false">http://blog.digvan.com/?p=12</guid>
		<description><![CDATA[
			
				
			
		
Finally this semester I got AI. I always like to be involve much and much in AI world, and now I feel AI and ML are my final goal. I would spend all my spare time to study more and more AI. I found some useful links for everyone interested too.

Gmaetheory.net is my first link. [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.digvan.com%2F%3Fp%3D12"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.digvan.com%2F%3Fp%3D12&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Finally this semester I got AI. I always like to be involve much and much in AI world, and now I feel AI and ML are my final goal. I would spend all my spare time to study more and more AI. I found some useful links for everyone interested too.</p>
<ul>
<li><a href="http://www.gametheory.net/">Gmaetheory.net</a> is my first link. I highly recomand it.</li>
<li><a href="http://aima.cs.berkeley.edu/ai.html">AI on the web</a> is list of different sites on the web.</li>
<li><a href="http://www.cs.cornell.edu/People/tj/svm_light/">SVM</a> from Cornell university.</li>
<li><a href="http://www.cs.utah.edu/~hal/courses/2009S_AI/index.html">AI course</a> in Utah University.</li>
<li><a href="Machine Learning and Perception">Microsoft research</a> in ML.</li>
<li><a href="http://www.cs.utexas.edu/users/ml/">UTCS Machine Learning</a> Research Group.</li>
<li>J<a href="http://jmlr.csail.mit.edu/">ournal of Machine Learning</a> Research Homepage from MIT.</li>
<li>AI undergraduate <a href="http://www.stanford.edu/class/cs229/materials.html">course</a> in Stanford.</li>
<li>The Machine Learning <a href="http://www.cse.unsw.edu.au/~billw/mldict.html#bkuperrest">Dictionary.</a><a href="http://www.kernel-machines.org/"></a></li>
<li><a href="http://www.kernel-machines.org/">Kernel-Machines.Org</a>.</li>
<li><a href="http://www-2.cs.cmu.edu/~guestrin/Class/10701/schedule.html">ML course</a> from CMU.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.digvan.com/?feed=rss2&amp;p=12</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.digvan.com/?p=12</feedburner:origLink></item>
		<item>
		<title>Digvan.Com!</title>
		<link>http://feedproxy.google.com/~r/digvan/ieUL/~3/qRaANgkuiGc/</link>
		<comments>http://blog.digvan.com/?p=11#comments</comments>
		<pubDate>Mon, 06 Oct 2008 04:54:49 +0000</pubDate>
		<dc:creator>digvan</dc:creator>
				<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[digvan.com]]></category>
		<category><![CDATA[homepage]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[khashayar's homepage]]></category>

		<guid isPermaLink="false">http://blog.digvan.com/?p=11</guid>
		<description><![CDATA[
			
				
			
		
Finally, after several month I updated my personal homepage. In this version I use jQuery as my AJAX framework. About jQuery, I should say it&#8217;s amazing easy to learn and work with. In my homepage I will keep my resume and portfolio up to date. Also I will add my pictures in photo section. Another [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.digvan.com%2F%3Fp%3D11"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.digvan.com%2F%3Fp%3D11&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Finally, after several month I updated <a href="http://www.digvan.com" target="_self">my personal homepage</a>. In this version I use<a href="http://jquery.com/"> jQuery</a> as my AJAX framework. About jQuery, I should say it&#8217;s amazing easy to learn and work with. In my homepage I will keep my resume and portfolio up to date. Also I will add my pictures in photo section. Another intersting feature I added last night is &#8220;Latest Status&#8221; in footer. Now, I can update my latest status from my <a href="http://www.apple.com/iphone/">iPhone</a> anytime, anywhere. It would be cool to review my status after 20 years!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.digvan.com/?feed=rss2&amp;p=11</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.digvan.com/?p=11</feedburner:origLink></item>
		<item>
		<title>Life Data Visualization</title>
		<link>http://feedproxy.google.com/~r/digvan/ieUL/~3/sWWiJ0SL1rk/</link>
		<comments>http://blog.digvan.com/?p=10#comments</comments>
		<pubDate>Thu, 02 Oct 2008 06:27:23 +0000</pubDate>
		<dc:creator>digvan</dc:creator>
				<category><![CDATA[Data mining]]></category>
		<category><![CDATA[Data visualization]]></category>
		<category><![CDATA[Meaning of life]]></category>

		<guid isPermaLink="false">http://blog.digvan.com/?p=10</guid>
		<description><![CDATA[
			
				
			
		

There is a guy who made this video with help of data mining and data visualization. He try to define the meaning of life and he is successful! Enjoy it!
&#160;

]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.digvan.com%2F%3Fp%3D10"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.digvan.com%2F%3Fp%3D10&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
</p>
<p><a href="http://www.clemenskogler.net/grandcontent">There is a guy</a> who made this video with help of data mining and data visualization. He try to define the meaning of life and he is successful! Enjoy it!</p>
<p>&#160;</p>
<p><center><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/lWWKBY7gx_0&#038;color1=0xb1b1b1&#038;color2=0xcfcfcf&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/lWWKBY7gx_0&#038;color1=0xb1b1b1&#038;color2=0xcfcfcf&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object></center></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.digvan.com/?feed=rss2&amp;p=10</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.digvan.com/?p=10</feedburner:origLink></item>
		<item>
		<title>Python usful libraries</title>
		<link>http://feedproxy.google.com/~r/digvan/ieUL/~3/vBWTxtTB68A/</link>
		<comments>http://blog.digvan.com/?p=7#comments</comments>
		<pubDate>Sat, 27 Sep 2008 05:51:47 +0000</pubDate>
		<dc:creator>digvan</dc:creator>
				<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[Library]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://blog.digvan.com/?p=7</guid>
		<description><![CDATA[
			
				
			
		
In this post I want to make a list for all useful Python libraries that I use until now.
The good news is I will update this every once I use new library.
So now Let&#8217;s chill with Python Libraties.

Django (Python web framework)
cElementTree (Python XML parser)
feedParser (Python feed parser)
html5lib (Python HTML parser)
Imaging (Image processing)
pygame (Game modules)
PyScripter (Python [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.digvan.com%2F%3Fp%3D7"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.digvan.com%2F%3Fp%3D7&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>In this post I want to make a list for all useful Python libraries that I use until now.</p>
<p>The good news is I will update this every once I use new library.</p>
<p>So now Let&#8217;s chill with Python Libraties.</p>
<ul>
<li><a title="django" href="http://www.djangoproject.com/" target="_blank">Django </a>(Python web framework)</li>
<li><a href="http://effbot.org/zone/celementtree.htm" target="_blank">cElementTree</a> (Python XML parser)</li>
<li><a href="http://www.feedparser.org/" target="_blank">feedParser </a>(Python feed parser)</li>
<li><a href="http://code.google.com/p/html5lib/" target="_blank">html5lib</a> (Python HTML parser)</li>
<li><a href="http://www.pythonware.com/products/pil/" target="_blank">Imaging</a> (Image processing)</li>
<li><a href="http://www.pygame.org/news.html" target="_blank">pygame</a> (Game modules)</li>
<li><a href="http://mmm-experts.com/Products.aspx?ProductId=4" target="_blank">PyScripter</a> (Python great IDE)</li>
<li><a href="http://www.sqlalchemy.org/" target="_blank">SQLAlchemy</a> (Python Database mapper)</li>
<li><a href="http://www.dlitz.net/software/pycrypto/" target="_blank">pycrypto</a> (Python Cryptography toolkit)</li>
<li><a href="http://peak.telecommunity.com/DevCenter/EasyInstall">easy install</a> (automatically download, build, install, and manage Python packages)</li>
<li><a href="http://www.undefined.org/python/" target="_blank">simplejson</a> (<a name="simplejson">simple, fast, extensible JSON encoder/decoder</a>)</li>
</ul>
<p>You are more than welcome to share your favorite Python library in comment section.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.digvan.com/?feed=rss2&amp;p=7</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.digvan.com/?p=7</feedburner:origLink></item>
		<item>
		<title>Stock Historical Data</title>
		<link>http://feedproxy.google.com/~r/digvan/ieUL/~3/ldOqGGk4Zk0/</link>
		<comments>http://blog.digvan.com/?p=6#comments</comments>
		<pubDate>Wed, 10 Sep 2008 05:15:09 +0000</pubDate>
		<dc:creator>digvan</dc:creator>
				<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[DB]]></category>
		<category><![CDATA[Open source]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Stock]]></category>

		<guid isPermaLink="false">http://blog.digvan.com/?p=6</guid>
		<description><![CDATA[
			
				
			
		
In my DB project I want to design a site for stock mining. First thing I did is writing a bot for downloading all stock historical data  in Python. I really like Python it makes my life a lot easier and more effective. Unless I don&#8217;t feel I&#8217;m really live effectively!
Here is code:
import urllib2
f=open(&#8216;cusip.txt&#8217;, &#8216;r&#8217;)
tickers [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.digvan.com%2F%3Fp%3D6"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.digvan.com%2F%3Fp%3D6&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>In my DB project I want to design a site for stock mining. First thing I did is writing a bot for downloading all stock historical data  in Python. I really like Python it makes my life a lot easier and more effective. Unless I don&#8217;t feel I&#8217;m really live effectively!</p>
<p>Here is code:</p>
<blockquote><p>import urllib2</p>
<p>f=open(&#8216;cusip.txt&#8217;, &#8216;r&#8217;)</p>
<p>tickers = []<br />
for line in f:<br />
tickers.append(line.split(&#8216;,&#8217;)[0])<br />
for t in tickers:<br />
# Open the URL<br />
try:<br />
rows=urllib2.urlopen(&#8216;http://ichart.finance.yahoo.com/table.csv?&#8217;+\<br />
&#8217;s=%s&amp;d=09&amp;e=05&amp;f=2008&amp;g=d&amp;a=3&amp;b=12&amp;c=1997&#8242;%t +\<br />
&#8216;&amp;ignore=.csv&#8217;).read()<br />
t = open(t+&#8217;.csv&#8217;,'w&#8217;)<br />
t.write(rows)<br />
t.close()</p>
<p>except IOError:<br />
errors = [t]<br />
errf = open(&#8216;bad_trickers.txt&#8217;,'w&#8217;)<br />
errf.write(str(errors))<br />
errf.close()<br />
f.close()<br />
print errors</p>
<p>Click <a href="http://www.digvan.com/download/stock_downloader.zip">here</a> to download!</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.digvan.com/?feed=rss2&amp;p=6</wfw:commentRss>
		<slash:comments>23</slash:comments>
		<feedburner:origLink>http://blog.digvan.com/?p=6</feedburner:origLink></item>
		<item>
		<title>lesson from Mark Cuban</title>
		<link>http://feedproxy.google.com/~r/digvan/ieUL/~3/LRIriwNCWTQ/</link>
		<comments>http://blog.digvan.com/?p=5#comments</comments>
		<pubDate>Wed, 10 Sep 2008 04:02:29 +0000</pubDate>
		<dc:creator>digvan</dc:creator>
				<category><![CDATA[Entrepreneur Lessons]]></category>

		<guid isPermaLink="false">http://blog.digvan.com/?p=5</guid>
		<description><![CDATA[
			
				
			
		
Whats the best piece of advice you can give a young entrepreneur?
Ill tell you what I learned from Bobby Knight: everybody’s got the will to win but when it comes time to doing something, it’s always about someone else. Not many people have the will to prepare. You got to be willing to know your [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.digvan.com%2F%3Fp%3D5"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.digvan.com%2F%3Fp%3D5&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Whats the best piece of advice you can give a young entrepreneur?</p>
<p>Ill tell you what I learned from Bobby Knight: everybody’s got the will to win but when it comes time to doing something, it’s always about someone else. Not many people have the will to prepare. You got to be willing to know your product and environment better than anybody. No matter what you do there is someone out there trying to kick your ass. You got to be the smartest guy in the room about your product. Then you need to have a revenue source. You need a company with a revenue to make money. Concept, competition, and where the money is — plus something you love doing. I’ve never had a day of work. When I die I want to come back as me.</p>
<p>Who’s the entrepreneur you respect most? Current or past?</p>
<p>I guess Bill Gates. Larry Ellison I respect. You know, old school entrepreneurs, it was just diffferent. There was a different crede. I used to want to be profitable every month, before going IPO. But then later I accepted running at a loss. From the Netscape moving on, that’s what has happened since — the whole idea now is to get pageviews and then figure out a revenue model. I think entrepreneurs these days have been cheated because for them, its not about understanding how to make money. But when the money goes dry, you’re shit out of luck. When the bubble burst, 9 out of 10 businesses went away. With weblogs, our mantra was sales cures all. We used to talk about bottom line, not top line. It always came down to what you’re putting into your pocket. I want a cash-in-pocket strategy not an exit strategy.When you walk down these halls, you dont have people making money yet.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.digvan.com/?feed=rss2&amp;p=5</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://blog.digvan.com/?p=5</feedburner:origLink></item>
		<item>
		<title>Building a Successful Enterprise Software Company in the Microsoft Age</title>
		<link>http://feedproxy.google.com/~r/digvan/ieUL/~3/FiQBBHBUPrQ/</link>
		<comments>http://blog.digvan.com/?p=4#comments</comments>
		<pubDate>Mon, 01 Sep 2008 09:32:10 +0000</pubDate>
		<dc:creator>digvan</dc:creator>
				<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://blog.digvan.com/?p=4</guid>
		<description><![CDATA[
			
				
			
		

The bad news: It would be nice to collect money from thousands of customers in exchange for shrink-wrapped closed-source software, packaged by prison labor.  Sadly this niche is occupied by Microsoft. Don&#8217;t be fooled by survivorship bias into thinking that your company has a chance of ascending to this privileged position.
The big question:  [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.digvan.com%2F%3Fp%3D4"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.digvan.com%2F%3Fp%3D4&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<ul>
<li>The bad news: It would be nice to collect money from thousands of customers in exchange for shrink-wrapped closed-source software, packaged by prison labor.  Sadly this niche is occupied by Microsoft. Don&#8217;t be fooled by survivorship bias into thinking that your company has a chance of ascending to this privileged position.</li>
<li>The big question:  &#8220;Why would a customer want to adopt software from any supplier other than Microsoft?&#8221;</li>
<li>You can&#8217;t be richer than Microsoft or smarter than its thousands of brilliant employees; you can attack a problem that Microsoft is not attacking (and the first company to deliver a solution to a customer is the first company that can learn from watching users)</li>
<li>If the problem area is new, and it probably is if Microsoft hasn&#8217;t been there already, requirements will be evolving rapidly; open-source is the best way of ensuring that requirements are met (note that &#8220;open source&#8221; need not mean &#8220;free&#8221;)</li>
<li>Achieving critical mass before Microsoft kills you, Part I: educational marketing via high-level papers and books, one-day high-level courses, and multi-day bootcamps</li>
<li>Achieving critical mass before Microsoft kills you, Part II: freely downloadable software, easy-to-understand software architecture, clear (not voluminous) documentation</li>
<li>Key to supra-normal return on investment in a free open-source world: you control what gets added to the next version of the software, i.e., you control which customers are running a standard version of the software and can upgrade painlessly and which customers are forced into ownership of customizations.</li>
<li>Consider releasing the product from a running system with real users (instead of the usual loop of users talk to marketing, marketing talks to product management, product management talks to programmers, new version gets released after 2 years and the cycle starts anew)</li>
</ul>
<p>Resource:</p>
<p>1- http://philip.greenspun.com/teaching/short-talks</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.digvan.com/?feed=rss2&amp;p=4</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.digvan.com/?p=4</feedburner:origLink></item>
	</channel>
</rss>
