<?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>[todo austin]</title>
	<atom:link href="http://blog.austintodo.tw/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.austintodo.tw</link>
	<description>Nothing Impossible</description>
	<lastBuildDate>Mon, 20 Jun 2011 09:38:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>[Paper] Clustering Query Refinements by User Intent</title>
		<link>http://blog.austintodo.tw/2011/06/18/paper-clustering-query-refinements-by-user-intent/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=paper-clustering-query-refinements-by-user-intent</link>
		<comments>http://blog.austintodo.tw/2011/06/18/paper-clustering-query-refinements-by-user-intent/#comments</comments>
		<pubDate>Sat, 18 Jun 2011 00:13:49 +0000</pubDate>
		<dc:creator>austintodo</dc:creator>
				<category><![CDATA[paper]]></category>
		<category><![CDATA[Time-Sensitive]]></category>

		<guid isPermaLink="false">http://blog.austintodo.tw/?p=420</guid>
		<description><![CDATA[這篇主要專注在cluster 某個query的 query refinements， 提出了一個Markov Model， 可以同時將Document Clicks 和 Use Session 放進演算法中去cluster refinements。 例如query: Mars 通常Mars有兩種可能的走向：羅馬神話（戰神）、太陽系（火星） 這篇的重點在於將Query Suggestion cluster起來 讓Query Suggestion可以有足夠的Diversity讓user選擇   ﻿這篇的Motivation有三個： 1. 提供一個夠廣(diversity)的query refinements給user選擇 2. 提昇query suggestion顯示的方式 3. 能夠橫跨sessions去推薦query 4. 提供一個所有可能的diversity的summary給user選擇 針對第一點，目前的query refinements通常是clicks frequency導向 若某個面相的query refinements的frequency被兩個以上的query分掉了 那麼這個面相就很可能不會出現在query refinements中 第二點則是希望能夠透過column和row的方式顯示不同面相的query refinement cluster 讓每個column是不同的方向 幫助使用者了解目前的選擇 第三點則是透過第一次、第二次的query refinement去了解user目前的search intent 讓Search Engine可以更準確的推薦該方向的query refinement   現今有兩種方式做到query refinement clustering [...]]]></description>
			<content:encoded><![CDATA[<p>這篇主要專注在cluster 某個query的 query refinements，</p>
<p>提出了一個Markov Model，</p>
<p>可以同時將Document Clicks 和 Use Session 放進演算法中去cluster refinements。</p>
<p>例如query: Mars</p>
<p>通常Mars有兩種可能的走向：羅馬神話（戰神）、太陽系（火星）</p>
<p>這篇的重點在於將Query Suggestion cluster起來</p>
<p>讓Query Suggestion可以有足夠的Diversity讓user選擇</p>
<p> </p>
<p><span id="more-420"></span>
<p>﻿這篇的Motivation有三個：</p>
<ul>
<li>1. 提供一個夠廣(diversity)的query refinements給user選擇</li>
<li>2. 提昇query suggestion顯示的方式</li>
<li>3. 能夠橫跨sessions去推薦query</li>
<li>4. 提供一個所有可能的diversity的summary給user選擇</li>
</ul>
<p>針對第一點，目前的query refinements通常是clicks frequency導向</p>
<p>若某個面相的query refinements的frequency被兩個以上的query分掉了</p>
<p>那麼這個面相就很可能不會出現在query refinements中</p>
<p>第二點則是希望能夠透過column和row的方式顯示不同面相的query refinement cluster</p>
<p>讓每個column是不同的方向</p>
<p>幫助使用者了解目前的選擇</p>
<p>第三點則是透過第一次、第二次的query refinement去了解user目前的search intent</p>
<p>讓Search Engine可以更準確的推薦該方向的query refinement</p>
<p> </p>
<p>現今有兩種方式做到query refinement clustering</p>
<p>一種是based on similarity in the vocabulary of the clicked documents</p>
<p>問題在於若兩種同一面相但長得完全不一樣的字就很難記算出similarity</p>
<p>(例如query Mars，若refinements是venus和jupiter，很難透過similarity將venus和jupiter cluster到星球這個cluster內）</p>
<p>一種是based on their occurrences within user search sessions.</p>
<p>然而user session常常會過於sparse或甚至有intention drift的現象</p>
<p> </p>
<p>因此這篇paper提出一個combine document similarity和user session的Markov Model</p>
<p>並透過random walk去算出不同cluster</p></p>
<div class="al2fb_like_button"><script src="http://connect.facebook.net/zh_TW/all.js#xfbml=1"></script><fb:like ref="AL2FB" layout="standard" show_faces="true" width="450" action="like" font="arial" colorscheme="light" href="http://blog.austintodo.tw/2011/06/18/paper-clustering-query-refinements-by-user-intent/"></fb:like></div>]]></content:encoded>
			<wfw:commentRss>http://blog.austintodo.tw/2011/06/18/paper-clustering-query-refinements-by-user-intent/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Paper] Understanding Temporal Query Dynamics</title>
		<link>http://blog.austintodo.tw/2011/06/17/paper-understanding-temporal-query-dynamics/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=paper-understanding-temporal-query-dynamics</link>
		<comments>http://blog.austintodo.tw/2011/06/17/paper-understanding-temporal-query-dynamics/#comments</comments>
		<pubDate>Fri, 17 Jun 2011 00:24:11 +0000</pubDate>
		<dc:creator>austintodo</dc:creator>
				<category><![CDATA[paper]]></category>
		<category><![CDATA[Time-Sensitive]]></category>

		<guid isPermaLink="false">http://blog.austintodo.tw/?p=416</guid>
		<description><![CDATA[這篇主要的概念在於：網路搜尋與時間的關係。 query會有時間性，會有spike(突然崛起) 這時候這些query跟document的關係可能就會改變 例如：query 地震 平常時候地震的相關document大都指到wikipedia 但是當地震發生的當下（有spike時），卻是指到New York Times（新聞媒體） 例如：March madness與NCAA的關係 平常NACC包含所有運動種類 但在三月時March madness會與NACC的basketball關係變得很強烈 因此這篇paper著重於觀察query spike的種類（馬上起來緩緩下降 or 緩緩上升急速下降&#8230;etc） 與document改變的量（query在不同時間下出現在document內的次數） 並透過這兩個特性去model user search intent]]></description>
			<content:encoded><![CDATA[<p>這篇主要的概念在於：網路搜尋與時間的關係。</p>
<p>query會有時間性，會有spike(突然崛起)</p>
<p>這時候這些query跟document的關係可能就會改變</p>
<p>例如：query 地震</p>
<p>平常時候地震的相關document大都指到wikipedia</p>
<p>但是當地震發生的當下（有spike時），卻是指到New York Times（新聞媒體）</p>
<p>例如：March madness與NCAA的關係</p>
<p>平常NACC包含所有運動種類</p>
<p>但在三月時March madness會與NACC的basketball關係變得很強烈</p>
<p>因此這篇paper著重於觀察query spike的種類（馬上起來緩緩下降 or 緩緩上升急速下降&#8230;etc）</p>
<p>與document改變的量（query在不同時間下出現在document內的次數）</p>
<p>並透過這兩個特性去model user search intent</p>
<div class="al2fb_like_button"><script src="http://connect.facebook.net/zh_TW/all.js#xfbml=1"></script><fb:like ref="AL2FB" layout="standard" show_faces="true" width="450" action="like" font="arial" colorscheme="light" href="http://blog.austintodo.tw/2011/06/17/paper-understanding-temporal-query-dynamics/"></fb:like></div>]]></content:encoded>
			<wfw:commentRss>http://blog.austintodo.tw/2011/06/17/paper-understanding-temporal-query-dynamics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>build a template for python (*.py) from vim</title>
		<link>http://blog.austintodo.tw/2011/06/16/build-a-template-for-python-py-from-vim/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=build-a-template-for-python-py-from-vim</link>
		<comments>http://blog.austintodo.tw/2011/06/16/build-a-template-for-python-py-from-vim/#comments</comments>
		<pubDate>Thu, 16 Jun 2011 12:41:38 +0000</pubDate>
		<dc:creator>austintodo</dc:creator>
				<category><![CDATA[coding note]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.austintodo.tw/?p=412</guid>
		<description><![CDATA[Every time when I create a new python file, I have to write lots of same things like: Fortunately I found a way from stackoverflow to use vim autocmd to create a python template automatically when I use vim to start a new python file. Step 1: Add autocmd to your ~/.vimrc file to be [...]]]></description>
			<content:encoded><![CDATA[<p>Every time when I create a new python file, I have to write lots of same things like:</p>
<p>Fortunately I found a way from stackoverflow to use vim autocmd to create a python template automatically when I use vim to start a new python file.</p>
<p><strong>Step 1</strong>: Add autocmd to your ~/.vimrc file to be triggered when you create a *.py file:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">autocmd bufnewfile <span style="color: #000000; font-weight: bold;">*</span>.py :0r ~<span style="color: #000000; font-weight: bold;">/</span>.vim<span style="color: #000000; font-weight: bold;">/</span>template<span style="color: #000000; font-weight: bold;">/</span>pythontmp.txt
<span style="color: #000000; font-weight: bold;">if</span> exists<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'*strftime'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
    au BufNewFile <span style="color: #000000; font-weight: bold;">*</span>.py :call append<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">2</span>, <span style="color: #ff0000;">'# Created: '</span>.strftime<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'%a, %d %b %Y %T %z'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
endif</pre></div></div>

<p><strong>Step 2</strong>: Build your own python template in ~/.vim/template/pythontmp.txt</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/env python</span>
<span style="color: #808080; font-style: italic;"># -*-*- encoding: utf-8 -*-*-</span>
&nbsp;
<span style="color: #483d8b;">&quot;&quot;&quot;
Document here.
&quot;&quot;&quot;</span>
&nbsp;
__author__ = u<span style="color: #483d8b;">'username@xxx.xxx (ur_name)'</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
<span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">optparse</span> <span style="color: #ff7700;font-weight:bold;">import</span> OptionParser
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> main<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
    MSG_USAGE = <span style="color: #483d8b;">&quot;%prog [options] arg1&quot;</span>
    opt_parser = OptionParser<span style="color: black;">&#40;</span>MSG_USAGE<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#40;</span><span style="color: #008000;">len</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#41;</span> <span style="color: #66cc66;">!</span>= <span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[ERROR] unsupported arguments&quot;</span>
        opt_parser.<span style="color: black;">print_usage</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #ff4500;">2</span>
&nbsp;
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #ff4500;">0</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">if</span> __name__==<span style="color: #483d8b;">&quot;__main__&quot;</span>:
    <span style="color: #dc143c;">sys</span>.<span style="color: black;">exit</span><span style="color: black;">&#40;</span>main<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></div></div>

<p><strong>Step 3</strong>: Enjoy it.</p>
<p> </p>
<p>Ref: <a href="http://stackoverflow.com/questions/6366686/add-creation-modified-time-to-python-template-in-vim-script">http://stackoverflow.com/questions/6366686/add-creation-modified-time-to-python-template-in-vim-script</a></p>
<div class="al2fb_like_button"><script src="http://connect.facebook.net/zh_TW/all.js#xfbml=1"></script><fb:like ref="AL2FB" layout="standard" show_faces="true" width="450" action="like" font="arial" colorscheme="light" href="http://blog.austintodo.tw/2011/06/16/build-a-template-for-python-py-from-vim/"></fb:like></div>]]></content:encoded>
			<wfw:commentRss>http://blog.austintodo.tw/2011/06/16/build-a-template-for-python-py-from-vim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sort two python dictionary</title>
		<link>http://blog.austintodo.tw/2011/06/16/sort-two-python-dictionary/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sort-two-python-dictionary</link>
		<comments>http://blog.austintodo.tw/2011/06/16/sort-two-python-dictionary/#comments</comments>
		<pubDate>Thu, 16 Jun 2011 08:05:20 +0000</pubDate>
		<dc:creator>austintodo</dc:creator>
				<category><![CDATA[coding note]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.austintodo.tw/?p=406</guid>
		<description><![CDATA[We use sort everywhere. The way to sort a dictionary by value is as following: import operator x = &#123;'a':1, 'b':3, 'c':2&#125; sorted_x = sorted&#40;x.iteritems&#40;&#41;, key=operator.itemgetter&#40;1&#41;&#41; print sorted_x and the results is &#62;&#62;&#62; import operator &#62;&#62;&#62; x = &#123;'a':1, 'b':3, 'c':2&#125; &#62;&#62;&#62; sorted_x = sorted&#40;x.iteritems&#40;&#41;, key=operator.itemgetter&#40;1&#41;&#41; &#62;&#62;&#62; print sorted_x &#91;&#40;'a', 1&#41;, &#40;'c', 2&#41;, &#40;'b', 3&#41;&#93; [...]]]></description>
			<content:encoded><![CDATA[<p>We use sort everywhere.</p>
<p>The way to sort a dictionary by value is as following:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">operator</span>
x = <span style="color: black;">&#123;</span><span style="color: #483d8b;">'a'</span>:<span style="color: #ff4500;">1</span>, <span style="color: #483d8b;">'b'</span>:<span style="color: #ff4500;">3</span>, <span style="color: #483d8b;">'c'</span>:<span style="color: #ff4500;">2</span><span style="color: black;">&#125;</span>
sorted_x = <span style="color: #008000;">sorted</span><span style="color: black;">&#40;</span>x.<span style="color: black;">iteritems</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>, key=<span style="color: #dc143c;">operator</span>.<span style="color: black;">itemgetter</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> sorted_x</pre></div></div>

<p>and the results is</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&gt;&gt;&gt;</span> import operator
<span style="color: #000000; font-weight: bold;">&gt;&gt;&gt;</span> x = <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #ff0000;">'a'</span>:<span style="color: #000000;">1</span>, <span style="color: #ff0000;">'b'</span>:<span style="color: #000000;">3</span>, <span style="color: #ff0000;">'c'</span>:<span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #000000; font-weight: bold;">&gt;&gt;&gt;</span> sorted_x = sorted<span style="color: #7a0874; font-weight: bold;">&#40;</span>x.iteritems<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>, <span style="color: #007800;">key</span>=operator.itemgetter<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">&gt;&gt;&gt;</span> print sorted_x
<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'a'</span>, <span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>, <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'c'</span>, <span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>, <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'b'</span>, <span style="color: #000000;">3</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">&gt;&gt;&gt;</span> sorted_x = sorted<span style="color: #7a0874; font-weight: bold;">&#40;</span>x.iteritems<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>, <span style="color: #007800;">key</span>=operator.itemgetter<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>, <span style="color: #007800;">reverse</span>=True<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">&gt;&gt;&gt;</span> print sorted_x
<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'b'</span>, <span style="color: #000000;">3</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>, <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'c'</span>, <span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>, <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'a'</span>, <span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p>Ref: ﻿<a href="http://stackoverflow.com/questions/613183/python-sort-a-dictionary-by-value">http://stackoverflow.com/questions/613183/python-sort-a-dictionary-by-value</a></p>
<div class="al2fb_like_button"><script src="http://connect.facebook.net/zh_TW/all.js#xfbml=1"></script><fb:like ref="AL2FB" layout="standard" show_faces="true" width="450" action="like" font="arial" colorscheme="light" href="http://blog.austintodo.tw/2011/06/16/sort-two-python-dictionary/"></fb:like></div>]]></content:encoded>
			<wfw:commentRss>http://blog.austintodo.tw/2011/06/16/sort-two-python-dictionary/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>python multi-dimensional dictionary</title>
		<link>http://blog.austintodo.tw/2011/06/16/python-multi-dimensional-dictionary/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=python-multi-dimensional-dictionary</link>
		<comments>http://blog.austintodo.tw/2011/06/16/python-multi-dimensional-dictionary/#comments</comments>
		<pubDate>Thu, 16 Jun 2011 04:35:17 +0000</pubDate>
		<dc:creator>austintodo</dc:creator>
				<category><![CDATA[coding note]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.austintodo.tw/?p=402</guid>
		<description><![CDATA[Since defaultdict could set the default value in the dict, we can set the default value of a dict to another dict to make a multiple dimensional dict. from collections import defaultdict &#160; one_dimensional = defaultdict&#40;&#41; two_dimensional = defaultdict&#40;defaultdict&#41; three_dimensional = defaultdict&#40;lambda: defaultdict&#40;defaultdict&#41; three_dimensional_with_default_int = defaultdict&#40;lambda: defaultdict&#40;lambda: defaultdict&#40;int&#41;&#41;&#41; Ref: http://slacy.com/blog/2010/05/python-multi-dimensional-dicts-using-defaultdict/    ]]></description>
			<content:encoded><![CDATA[<p>Since defaultdict could set the default value in the dict, we can set the default value of a dict to another dict to make a multiple dimensional dict.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">collections</span> <span style="color: #ff7700;font-weight:bold;">import</span> defaultdict
&nbsp;
one_dimensional = defaultdict<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
two_dimensional = defaultdict<span style="color: black;">&#40;</span>defaultdict<span style="color: black;">&#41;</span>
three_dimensional = defaultdict<span style="color: black;">&#40;</span><span style="color: #ff7700;font-weight:bold;">lambda</span>: defaultdict<span style="color: black;">&#40;</span>defaultdict<span style="color: black;">&#41;</span>
three_dimensional_with_default_int = defaultdict<span style="color: black;">&#40;</span><span style="color: #ff7700;font-weight:bold;">lambda</span>: defaultdict<span style="color: black;">&#40;</span><span style="color: #ff7700;font-weight:bold;">lambda</span>: defaultdict<span style="color: black;">&#40;</span><span style="color: #008000;">int</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Ref: <a href="http://slacy.com/blog/2010/05/python-multi-dimensional-dicts-using-defaultdict/">http://slacy.com/blog/2010/05/python-multi-dimensional-dicts-using-defaultdict/</a></p>
<p> </p>
<p> </p>
<div class="al2fb_like_button"><script src="http://connect.facebook.net/zh_TW/all.js#xfbml=1"></script><fb:like ref="AL2FB" layout="standard" show_faces="true" width="450" action="like" font="arial" colorscheme="light" href="http://blog.austintodo.tw/2011/06/16/python-multi-dimensional-dictionary/"></fb:like></div>]]></content:encoded>
			<wfw:commentRss>http://blog.austintodo.tw/2011/06/16/python-multi-dimensional-dictionary/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to mysqldump without locking the tables</title>
		<link>http://blog.austintodo.tw/2011/06/06/how-to-mysqldump-without-locking-the-tables/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-mysqldump-without-locking-the-tables</link>
		<comments>http://blog.austintodo.tw/2011/06/06/how-to-mysqldump-without-locking-the-tables/#comments</comments>
		<pubDate>Mon, 06 Jun 2011 02:17:09 +0000</pubDate>
		<dc:creator>austintodo</dc:creator>
				<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://blog.austintodo.tw/?p=396</guid>
		<description><![CDATA[  Sometimes when I tried to backup mysql I will encounter this problem: mysqldump: Got error: 1016: Can't open file: './db_name/xxx_table.frm' (errno: 24) when using LOCK TABLES This message will pop out if the table is too large to dump The solution is simply add a --lock-tables=false to the mysqldump options. Therefore the most used [...]]]></description>
			<content:encoded><![CDATA[<p> </p>
<p>Sometimes when I tried to backup mysql I will encounter this problem:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mysqldump: Got error: <span style="color: #000000;">1016</span>: Can<span style="color: #ff0000;">'t open file: '</span>.<span style="color: #000000; font-weight: bold;">/</span>db_name<span style="color: #000000; font-weight: bold;">/</span>xxx_table.frm<span style="color: #ff0000;">' (errno: 24) when using LOCK TABLES</span></pre></div></div>

<p>This message will pop out if the table is too large to dump</p>
<p>The solution is simply add a</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #660033;">--lock-tables</span>=<span style="color: #c20cb9; font-weight: bold;">false</span></pre></div></div>

<p>to the mysqldump options.</p>
<p>Therefore the most used mysql backup command is as following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mysqldump <span style="color: #660033;">-u</span> username <span style="color: #660033;">-p</span> db_name <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">gzip</span> <span style="color: #660033;">-c</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">&gt;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>Y-<span style="color: #000000; font-weight: bold;">%</span>m-<span style="color: #000000; font-weight: bold;">%</span>d-<span style="color: #000000; font-weight: bold;">%</span>H.<span style="color: #000000; font-weight: bold;">%</span>M.<span style="color: #000000; font-weight: bold;">%</span>S<span style="color: #7a0874; font-weight: bold;">&#41;</span>.sql.gz</pre></div></div>

<div class="al2fb_like_button"><script src="http://connect.facebook.net/zh_TW/all.js#xfbml=1"></script><fb:like ref="AL2FB" layout="standard" show_faces="true" width="450" action="like" font="arial" colorscheme="light" href="http://blog.austintodo.tw/2011/06/06/how-to-mysqldump-without-locking-the-tables/"></fb:like></div>]]></content:encoded>
			<wfw:commentRss>http://blog.austintodo.tw/2011/06/06/how-to-mysqldump-without-locking-the-tables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>use ctrl + arrow to switch between screens in ubuntu</title>
		<link>http://blog.austintodo.tw/2011/06/01/use-ctrl-arrow-to-switch-between-screens-in-ubuntu/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=use-ctrl-arrow-to-switch-between-screens-in-ubuntu</link>
		<comments>http://blog.austintodo.tw/2011/06/01/use-ctrl-arrow-to-switch-between-screens-in-ubuntu/#comments</comments>
		<pubDate>Wed, 01 Jun 2011 05:39:45 +0000</pubDate>
		<dc:creator>austintodo</dc:creator>
				<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://blog.austintodo.tw/?p=394</guid>
		<description><![CDATA[It&#8217;s kind of disturbing to use ctrl-a + w to switch between screens. So I found a .screenrc file to enable ctrl + arrow to switch them. Here goes: vbell off &#160; term $TERM termcapinfo $TERM &#34;Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm&#34; &#160; # saved as ~/.screenrc caption always &#34;%{= bK} %{= bG} [%n]%t @ %H %{-} %= %{= bR} [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s kind of disturbing to use ctrl-a + w to switch between screens.</p>
<p>So I found a .screenrc file to enable ctrl + arrow to switch them.</p>
<p>Here goes:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">vbell off
&nbsp;
term <span style="color: #007800;">$TERM</span>
termcapinfo <span style="color: #007800;">$TERM</span> <span style="color: #ff0000;">&quot;Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># saved as ~/.screenrc</span>
caption always <span style="color: #ff0000;">&quot;%{= bK} %{= bG} [%n]%t @ %H %{-} %= %{= bR} %l %{-} | %{= bG} %Y-%m-%d %{-}&quot;</span>
hardstatus alwayslastline <span style="color: #ff0000;">&quot; %-Lw%{= BW}%n%f %t%{-}%+Lw %=| %0c:%s &quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Ctrl + left : last page</span>
<span style="color: #666666; font-style: italic;"># Ctrl + right : next page</span>
bindkey <span style="color: #ff0000;">&quot;^[[1;5C&quot;</span> next
bindkey <span style="color: #ff0000;">&quot;^[O5C&quot;</span> next
bindkey <span style="color: #ff0000;">&quot;^[[C&quot;</span> next
bindkey <span style="color: #ff0000;">&quot;^[[1;5D&quot;</span> prev
bindkey <span style="color: #ff0000;">&quot;^[O5D&quot;</span> prev
bindkey <span style="color: #ff0000;">&quot;^[[D&quot;</span> prev
&nbsp;
bindkey <span style="color: #ff0000;">&quot;^[O3D&quot;</span> prev
bindkey <span style="color: #ff0000;">&quot;^[O3C&quot;</span> next
&nbsp;
<span style="color: #666666; font-style: italic;"># C-a b --(switch to)--&gt; view big5 data</span>
<span style="color: #7a0874; font-weight: bold;">bind</span> b encoding big5 utf8
<span style="color: #666666; font-style: italic;"># C-a u --(switch to)--&gt; view utf8 data</span>
<span style="color: #7a0874; font-weight: bold;">bind</span> u encoding utf8 utf8</pre></div></div>

<div class="al2fb_like_button"><script src="http://connect.facebook.net/zh_TW/all.js#xfbml=1"></script><fb:like ref="AL2FB" layout="standard" show_faces="true" width="450" action="like" font="arial" colorscheme="light" href="http://blog.austintodo.tw/2011/06/01/use-ctrl-arrow-to-switch-between-screens-in-ubuntu/"></fb:like></div>]]></content:encoded>
			<wfw:commentRss>http://blog.austintodo.tw/2011/06/01/use-ctrl-arrow-to-switch-between-screens-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>how to write a simple shell script to run program parallelly in ubuntu</title>
		<link>http://blog.austintodo.tw/2011/06/01/how-to-write-a-simple-shell-script-to-run-program-parallelly-in-ubuntu/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-write-a-simple-shell-script-to-run-program-parallelly-in-ubuntu</link>
		<comments>http://blog.austintodo.tw/2011/06/01/how-to-write-a-simple-shell-script-to-run-program-parallelly-in-ubuntu/#comments</comments>
		<pubDate>Wed, 01 Jun 2011 05:31:30 +0000</pubDate>
		<dc:creator>austintodo</dc:creator>
				<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://blog.austintodo.tw/?p=387</guid>
		<description><![CDATA[I have a program to run with 3 parameters. To save the time I write a very very simple shell script to run it ﻿parallelly. To prevent overloading for server, I sleep 300 seconds after execute 5 process parallelly. #!/bin/bash for dataset in `seq 1 10`;do for prob_type in 'us' 'merge';do for smooth in '0.0' [...]]]></description>
			<content:encoded><![CDATA[<p>I have a program to run with 3 parameters.</p>
<p>To save the time I write a very very simple shell script to run it ﻿parallelly.</p>
<p>To prevent overloading for server,  I sleep 300 seconds after execute 5 process parallelly.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #000000; font-weight: bold;">for</span> dataset <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">seq</span> <span style="color: #000000;">1</span> <span style="color: #000000;">10</span><span style="color: #000000; font-weight: bold;">`</span>;<span style="color: #000000; font-weight: bold;">do</span>
    <span style="color: #000000; font-weight: bold;">for</span> prob_type <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #ff0000;">'us'</span> <span style="color: #ff0000;">'merge'</span>;<span style="color: #000000; font-weight: bold;">do</span>
        <span style="color: #000000; font-weight: bold;">for</span> smooth <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #ff0000;">'0.0'</span> <span style="color: #ff0000;">'0.5'</span> <span style="color: #ff0000;">'1.0'</span> <span style="color: #ff0000;">'1.5'</span> <span style="color: #ff0000;">'2.0'</span>;<span style="color: #000000; font-weight: bold;">do</span>
            .<span style="color: #000000; font-weight: bold;">/</span>my_prog.py <span style="color: #007800;">$dataset</span> <span style="color: #007800;">$smooth</span> <span style="color: #007800;">$prob_type</span> <span style="color: #000000; font-weight: bold;">&amp;</span>
        <span style="color: #000000; font-weight: bold;">done</span>
        <span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">300</span>
    <span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #000000; font-weight: bold;">done</span></pre></div></div>

<div class="al2fb_like_button"><script src="http://connect.facebook.net/zh_TW/all.js#xfbml=1"></script><fb:like ref="AL2FB" layout="standard" show_faces="true" width="450" action="like" font="arial" colorscheme="light" href="http://blog.austintodo.tw/2011/06/01/how-to-write-a-simple-shell-script-to-run-program-parallelly-in-ubuntu/"></fb:like></div>]]></content:encoded>
			<wfw:commentRss>http://blog.austintodo.tw/2011/06/01/how-to-write-a-simple-shell-script-to-run-program-parallelly-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ubuntu terminal tango-style color theme for iterm on Mac</title>
		<link>http://blog.austintodo.tw/2011/06/01/ubuntu-terminal-tango-style-color-theme-for-iterm-on-mac/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ubuntu-terminal-tango-style-color-theme-for-iterm-on-mac</link>
		<comments>http://blog.austintodo.tw/2011/06/01/ubuntu-terminal-tango-style-color-theme-for-iterm-on-mac/#comments</comments>
		<pubDate>Wed, 01 Jun 2011 05:24:59 +0000</pubDate>
		<dc:creator>austintodo</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://blog.austintodo.tw/?p=385</guid>
		<description><![CDATA[  I always like the color theme in ubuntu. Yesterday I knew the color theme is called tango so I change the iTerm color theme to be looked like tango style     Ref: ﻿Tango color theme: http://tango.freedesktop.org/Tango_Icon_Theme_Guidelines Just open Bookmarks -&#62; Add new Display Profiles and called it "tango" Then change the color in [...]]]></description>
			<content:encoded><![CDATA[<p><img style="display: block; margin-left: auto; margin-right: auto;" title="iterm_tango.png" src="http://blog.austintodo.tw/wp-content/uploads/2011/06/iterm_tango2.png" border="0" alt="iterm_tango" width="600" height="267" /></p>
<p> </p>
<p>I always like the color theme in ubuntu.</p>
<p>Yesterday I knew the color theme is called tango</p>
<p>so I change the iTerm color theme to be looked like tango style</p>
<p> </p>
<p><span id="more-385"></span>
<p> </p>
<p>Ref: ﻿Tango color theme:</p>
<p><a href="http://tango.freedesktop.org/Tango_Icon_Theme_Guidelines">http://tango.freedesktop.org/Tango_Icon_Theme_Guidelines</a></p>
<p>Just open Bookmarks -&gt; Add new Display Profiles and called it "tango"</p>
<p>Then change the color in the right side to tango color theme</p>
<p>Then you can get the tango style theme in iTerm!</p>
<p> </p>
<p> </p>
<div class="al2fb_like_button"><script src="http://connect.facebook.net/zh_TW/all.js#xfbml=1"></script><fb:like ref="AL2FB" layout="standard" show_faces="true" width="450" action="like" font="arial" colorscheme="light" href="http://blog.austintodo.tw/2011/06/01/ubuntu-terminal-tango-style-color-theme-for-iterm-on-mac/"></fb:like></div>]]></content:encoded>
			<wfw:commentRss>http://blog.austintodo.tw/2011/06/01/ubuntu-terminal-tango-style-color-theme-for-iterm-on-mac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>how to put a process into background in ubuntu</title>
		<link>http://blog.austintodo.tw/2011/06/01/how-to-put-a-process-into-background-in-ubuntu/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-put-a-process-into-background-in-ubuntu</link>
		<comments>http://blog.austintodo.tw/2011/06/01/how-to-put-a-process-into-background-in-ubuntu/#comments</comments>
		<pubDate>Wed, 01 Jun 2011 05:13:57 +0000</pubDate>
		<dc:creator>austintodo</dc:creator>
				<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://blog.austintodo.tw/?p=377</guid>
		<description><![CDATA[Typically we use screen to do background process stuff, but sometimes we forget doing that before we start a process. So this article is about how to push a running process in ubuntu into background.     ﻿1. Pause the running process press ctrl+z 2. Find out the process id $&#62; jobs 3. restart the [...]]]></description>
			<content:encoded><![CDATA[<p>Typically we use screen to do background process stuff, but sometimes we forget doing that before we start a process.</p>
<p>So this article is about how to push a running process in ubuntu into background.</p>
<p> </p>
<p><span id="more-377"></span>
<p> </p>
<p>﻿1. Pause the running process</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">press ctrl+z</pre></div></div>

<p>2. Find out the process id</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #7a0874; font-weight: bold;">jobs</span></pre></div></div>

<p>3. restart the process in background (assuming id = 1)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #7a0874; font-weight: bold;">bg</span> <span style="color: #000000;">1</span></pre></div></div>

<p>4. escape the process from the current shell</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #7a0874; font-weight: bold;">disown</span> <span style="color: #660033;">-a</span></pre></div></div>

<p>That&#8217;s all</p>
<div class="al2fb_like_button"><script src="http://connect.facebook.net/zh_TW/all.js#xfbml=1"></script><fb:like ref="AL2FB" layout="standard" show_faces="true" width="450" action="like" font="arial" colorscheme="light" href="http://blog.austintodo.tw/2011/06/01/how-to-put-a-process-into-background-in-ubuntu/"></fb:like></div>]]></content:encoded>
			<wfw:commentRss>http://blog.austintodo.tw/2011/06/01/how-to-put-a-process-into-background-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

