<?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>zhtlancer&#039;s blog (English)</title>
	<atom:link href="http://en.zhtlancer.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://en.zhtlancer.com</link>
	<description>alpha...</description>
	<lastBuildDate>Sat, 30 Jan 2010 09:56:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Project Eular #4 #5 #6 (Python)</title>
		<link>http://en.zhtlancer.com/2010/01/project-eular-4-5-6-python/</link>
		<comments>http://en.zhtlancer.com/2010/01/project-eular-4-5-6-python/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 09:53:57 +0000</pubDate>
		<dc:creator>zhtlancer</dc:creator>
				<category><![CDATA[Algorithm]]></category>
		<category><![CDATA[Project Eular]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://en.zhtlancer.com/?p=45</guid>
		<description><![CDATA[Yet another three easy problems. #4 Find the largest palindrome made from the product of two 3-digit numbers. A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99. Find the largest palindrome made from the product of two 3-digit numbers. [...]]]></description>
			<content:encoded><![CDATA[<p class="first-child "><span title="Y" class="cap"><span>Y</span></span>et another three easy problems.</p>
<p><a href="http://projecteuler.net/index.php?section=problems&amp;id=6" target="_blank" onclick="pageTracker._trackPageview('/outgoing/projecteuler.net/index.php?section=problems_amp_id=6&amp;referer=');"><strong>#4 Find the largest palindrome made from the product of two 3-digit numbers.</strong></a></p>
<blockquote><p>A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.</p>
<p>Find the largest palindrome made from the product of two 3-digit numbers.</p></blockquote>
<pre name="code" class="python">
#!/usr/bin/env python

biggest = 0

def isPalindromic(num):
    num_str = str(num)
    num_halflen = len(num_str)/2
    for idx in range(0, num_halflen):
        if num_str[idx] != num_str[-(idx+1)]:
            return False
    return True

for x in range(100, 999):
    for y in range(100, 999):
        if isPalindromic(x*y) and x*y &gt; biggest:
            biggest = x*y

print biggest</pre>
<p><a href="http://projecteuler.net/index.php?section=problems&amp;id=5" target="_blank" onclick="pageTracker._trackPageview('/outgoing/projecteuler.net/index.php?section=problems_amp_id=5&amp;referer=');"><strong>#5 What is the smallest number divisible by each of the numbers 1 to 20?</strong></a></p>
<blockquote><p>2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.</p>
<p>What is the smallest number that is evenly divisible by all of the numbers from 1 to 20?</p></blockquote>
<pre name="code" class="python">
#!/usr/bin/env python

def isPrimeUnder20(num):
    for tmp in range(2, num):
        if num%tmp == 0:
            return False
    return True

factor_list = []

for x in range(2, 20):
    if isPrimeUnder20(x):
        power_x = 1
        while x**power_x &lt;= 20:
            power_x += 1
        factor_list.append(x**(power_x-1))
        print x,power_x-1

prod = 1
for x in factor_list:
    prod *= x

print prod</pre>
<p><a href="http://projecteuler.net/index.php?section=problems&amp;id=6" target="_blank" onclick="pageTracker._trackPageview('/outgoing/projecteuler.net/index.php?section=problems_amp_id=6&amp;referer=');"><strong>#6 What is the difference between the sum of the squares and the square of the sums?</strong></a></p>
<blockquote><p>The sum of the squares of the first ten natural numbers is,<br />
1^(2) + 2^(2) + &#8230; + 10^(2) = 385</p>
<p>The square of the sum of the first ten natural numbers is,<br />
(1 + 2 + &#8230; + 10)^(2) = 55^(2) = 3025</p>
<p>Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is 3025 − 385 = 2640.</p>
<p>Find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum.</p></blockquote>
<pre name="code" class="python">
#!/usr/bin/env python

sum_of_square = 0
for x in range(1, 101):
    sum_of_square += x**2

sum_tmp = 0
for x in range(1, 101):
    sum_tmp += x
square_of_sum = sum_tmp**2

delta = square_of_sum - sum_of_square
print delta</pre>
]]></content:encoded>
			<wfw:commentRss>http://en.zhtlancer.com/2010/01/project-eular-4-5-6-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project Eular #3 (Python)</title>
		<link>http://en.zhtlancer.com/2010/01/project-eular-3-python/</link>
		<comments>http://en.zhtlancer.com/2010/01/project-eular-3-python/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 04:51:28 +0000</pubDate>
		<dc:creator>zhtlancer</dc:creator>
				<category><![CDATA[Project Eular]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Algorithm]]></category>

		<guid isPermaLink="false">http://en.zhtlancer.com/?p=42</guid>
		<description><![CDATA[Find the largest prime factor of a composite number. The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ? #!/usr/bin/env python num = 600851475143 seg_size = 10000 base_factor = 0 prime_factors = [] while base_factor*seg_size < num: for tmp in range(seg_size*base_factor, seg_size*(base_factor+1)): if [...]]]></description>
			<content:encoded><![CDATA[<p class="first-child "><strong><span title="F" class="cap"><span>F</span></span>ind the largest prime factor of a composite number.</strong></p>
<blockquote><p>
The prime factors of 13195 are 5, 7, 13 and 29.<br />
What is the largest prime factor of the number 600851475143 ?
</p></blockquote>
<pre name="code" class="python">
#!/usr/bin/env python  

num = 600851475143
seg_size = 10000
base_factor = 0
prime_factors = []

while base_factor*seg_size < num:
    for tmp in range(seg_size*base_factor, seg_size*(base_factor+1)):
        if tmp>1 and num%tmp == 0:
            prime_factors.append(tmp)
            while num%tmp == 0:
                num = num / tmp
            print "num:",num," ",tmp
        base_factor = base_factor + 1

print prime_factors
</pre>
]]></content:encoded>
			<wfw:commentRss>http://en.zhtlancer.com/2010/01/project-eular-3-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project Eular #2 (Python)</title>
		<link>http://en.zhtlancer.com/2010/01/project-eular-2-python/</link>
		<comments>http://en.zhtlancer.com/2010/01/project-eular-2-python/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 02:51:31 +0000</pubDate>
		<dc:creator>zhtlancer</dc:creator>
				<category><![CDATA[Algorithm]]></category>
		<category><![CDATA[Project Eular]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://en.zhtlancer.com/?p=36</guid>
		<description><![CDATA[Project Eular #2 Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, &#8230; Find the sum of all the even-valued terms in the sequence which do not [...]]]></description>
			<content:encoded><![CDATA[<p class="first-child "><span title="P" class="cap"><span>P</span></span>roject Eular #2</p>
<blockquote><p>Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:<br />
1, 2, 3, 5, 8, 13, 21, 34, 55, 89, &#8230;<br />
Find the sum of all the even-valued terms in the sequence which do not exceed four million.
</p></blockquote>
<pre name="code" class="python">
#!/usr/bin/env python

sum = 0
num1 = 0
num2 = 1
while num2 <= 4000000:
    print num2
    if num2 % 2 == 0:
        sum += num2
    temp = num2
    num2 = num1+num2
    num1 = temp
print sum
</pre>
]]></content:encoded>
			<wfw:commentRss>http://en.zhtlancer.com/2010/01/project-eular-2-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project Eular #1(Python)</title>
		<link>http://en.zhtlancer.com/2010/01/project-eular-1-python/</link>
		<comments>http://en.zhtlancer.com/2010/01/project-eular-1-python/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 02:43:05 +0000</pubDate>
		<dc:creator>zhtlancer</dc:creator>
				<category><![CDATA[Algorithm]]></category>
		<category><![CDATA[Project Eular]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://en.zhtlancer.com/?p=32</guid>
		<description><![CDATA[Project Eular #1 If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000. #!/usr/bin/env python sum = 0 for num in range(3,1000,3): [...]]]></description>
			<content:encoded><![CDATA[<p class="first-child "><span title="P" class="cap"><span>P</span></span>roject Eular #1</p>
<blockquote><p>If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.<br />
Find the sum of all the multiples of 3 or 5 below 1000.</p></blockquote>
<pre name="code" class="python">
#!/usr/bin/env python

sum = 0
for num in range(3,1000,3):
    sum ＝ sum+num
for num in range(5,1000,5):
    sum = sum+num
for num in range(15,1000,15):
    sum = sum-num
print sum
</pre>
]]></content:encoded>
			<wfw:commentRss>http://en.zhtlancer.com/2010/01/project-eular-1-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shortcut keys for BlackBerry qwerty devices</title>
		<link>http://en.zhtlancer.com/2010/01/shortcut-keys-for-blackberry-qwerty-devices/</link>
		<comments>http://en.zhtlancer.com/2010/01/shortcut-keys-for-blackberry-qwerty-devices/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 11:34:18 +0000</pubDate>
		<dc:creator>zhtlancer</dc:creator>
				<category><![CDATA[BlackBerry]]></category>

		<guid isPermaLink="false">http://en.zhtlancer.com/?p=12</guid>
		<description><![CDATA[BlackBerry has implemented plenty of shortcut keys to help improve users&#8217; experience. Also, there are some hidden functions that can only be triggered by special key combination. There is a collection of Blackberry shortcut keys, which are collected during my BlackBerry addiction time. Hope they are helpful to those who are new to BlackBerry. Enjoy~ [...]]]></description>
			<content:encoded><![CDATA[<p class="first-child "><span title="B" class="cap"><span>B</span></span>lackBerry has implemented plenty of shortcut keys to help improve users&#8217; experience. Also, there are some hidden functions that can only be triggered by special key combination.</p>
<p>There is a collection of Blackberry shortcut keys, which are collected during my BlackBerry addiction time. Hope they are helpful to those who are new to BlackBerry.</p>
<p>Enjoy~</p>
<blockquote>
<h4>in Message Screen:</h4>
<p>alt+s: sms    alt+m:mms    alt+p:call log    alt+i:income message    alt+o: outgoing message    alt+u:toggel read/unread    n/p:next/previous day</p>
<h4>home screen(may differs between different themes):</h4>
<div>alt+nmll: switch signal strength to number mode</div>
<p>alt+lglg: log viewer<br />
alt+cap+h: system info<br />
alt+cap+del: reset<br />
q: keymaster<br />
r: alarm<br />
t: tasks<br />
u: calculator<br />
i: isms (compose sms)<br />
o: options<br />
p: call log<br />
a: address book<br />
s: search<br />
d: memopad<br />
f: profiles<br />
g: 3gtan<br />
h: program menu<br />
k: keypad lock<br />
l: calendar<br />
x: media<br />
c: compose email<br />
b: browser<br />
m: message<br />
w: connection manager</p>
<h4>in service book page:</h4>
<p>alt+sbeb: enable service book import</p>
<h4>in status page:</h4>
<div>buyr: call time</div>
<div>test: run device tests</div>
<div>in sim card page:</div>
<div>mepd</p>
<h4>in text input field:</h4>
<p>alt+trackball/trackwheel click: copy<br />
left shift+trackball/trackwheel click: paste</p>
<h4>in list field:</h4>
<p>num+space: prev page<br />
space: next page</p>
</div>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://en.zhtlancer.com/2010/01/shortcut-keys-for-blackberry-qwerty-devices/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

