<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2enclosuresfull.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:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>John Wong's Blog</title>
	
	<link>http://opensourcebot.com/blog</link>
	<description>Just another Lively' Star....</description>
	<lastBuildDate>Thu, 11 Feb 2010 03:12:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</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/johnwongblog" /><feedburner:info uri="johnwongblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><itunes:explicit>no</itunes:explicit><itunes:subtitle>Just another Lively' Star....</itunes:subtitle><feedburner:browserFriendly></feedburner:browserFriendly><item>
		<title>Class#1: Intro to Discrete Mathematics</title>
		<link>http://opensourcebot.com/blog/2010/02/10/class1-intro-to-discrete-mathematics/</link>
		<comments>http://opensourcebot.com/blog/2010/02/10/class1-intro-to-discrete-mathematics/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 03:00:30 +0000</pubDate>
		<dc:creator>John Wong</dc:creator>
				<category><![CDATA[Discrete Mathematics 10400]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[combinatorial]]></category>
		<category><![CDATA[discrete mathematics]]></category>
		<category><![CDATA[graph theory]]></category>
		<category><![CDATA[logic]]></category>
		<category><![CDATA[number theory]]></category>
		<category><![CDATA[permutation]]></category>
		<category><![CDATA[set theory]]></category>

		<guid isPermaLink="false">http://opensourcebot.com/blog/?p=858</guid>
		<description><![CDATA[I figure this is a good way to review class note, and I will try to write an entry as frequently as possible.
Discrete mathematics: problems over natural numbers, and natural numbers are anything from zero to infinite positive integers.
Discrete mathematics is relatively a new course in computer science. Fairly a decade or two ago, students [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">I figure this is a good way to review class note, and I will try to write an entry as frequently as possible.</p>
<p style="text-align: left;">Discrete mathematics: problems over natural numbers, and natural numbers are anything from zero to infinite positive integers.</p>
<p style="text-align: left;">Discrete mathematics is relatively a new course in computer science. Fairly a decade or two ago, students have to study all the components of discrete mathematics separately, so there will be a class for graph theory, abstract algebra, number theory and logic.</p>
<p style="text-align: left;">The followings are the topics will be discovered in today's discrete mathematics course:<br />
<strong><br />
<span style="text-decoration: underline;">1. combinatorial</span></strong></p>
<p style="text-align: left;">This is one of the most fundamental studies of computer science, as simple as just counting numbers, or method of counting. It includes permutation, combination and binomial theorem. It may seems elementary but combinatorial applications are extremely difficult.</p>
<p style="text-align: left;">Let us consider this case. A computer scientist is asked to study and create a new network system for Verizon (a national-wide telephone company), and the figure below is his draft. A challenge is to detect failure of any point. A complex algorithm must be written for this task, and a computer scientist will need to find out how many ways can this failure occur, method of detection, and such.</p>
<p><img src="http://i47.tinypic.com/mwe4on.jpg" alt="" /></p>
<p style="text-align: left;">Sometime, for a computer scientist, it can be a disaster if the method of counting grows at an exponential rate (try to compute 100, you get power of 43). For most real world application, combinatorial results usually generate millions results, it is very important that one knows how to optimize the calculation.</p>
<p style="text-align: left;">Combinatorial application, can also be as simple as lottery. Choosing 5 numbers from 1-56, and a number from 1-46, will result in <strong>C(56,5) x 46 ~=(approx.) 180 million chances (0.18 billion)</strong>.</p>
<p style="text-align: left;">With coding theory and computer language theory, "string" is also studied in combinatorial application, which is treated as linear arrangement. For both computer science and computer engineering major students, combinatorial is very important.</p>
<p><span id="more-858"></span></p>
<p style="text-align: left;"><span style="text-decoration: underline;"><strong>2. set, relation and function</strong></span></p>
<p style="text-align: left;">Set theory is even more fundamental than method of counting. In fact, a function has a set. Elementarily speaking, {} or set, for example, {1,2,3} is the same as {2,3,1} and {1,3,2}. In combinatorial application, we can find out how many possible ways of the same "set" arrangement. Neglect counting, we see set theory a basic feature of mathematics. In fact, when we carry out combinatorial operations, each arrangement or collection of items are in sets {}.</p>
<p style="text-align: left;">I haven't touch on set theory yet, but fairly speaking, set theory and relation can be seem as simple as (yet as difficult as) collections, membership and probability. When a software engineer programs a class, he is applying set theory, such as class inheritance and such.</p>
<p style="text-align: left;"><span style="text-decoration: underline;"><strong>3. number theory</strong></span><br />
Again, when we are touching computer science, number matters, number rules. A major application of number theory is finding the largest prime, for example. The idea of number theory, asking students to learn what a/b (assume a and b is some integers). The meaning of integers, partitions of integers, meaning of divisions, recursive and linear mathematics will be studied in number theory.</p>
<p style="text-align: left;">An algorithm can be as simple as just print "hello world" (python), but the theory and mechanics behind it is extremely complicate, which, again touches with only numbers. Knowing the reminder of 1234 to the power of 1234 or (1234^1234 % 5) will take hundreds of years for a super computer to find out.</p>
<p style="text-align: left;">Another common use of number theory is encryption, for example, banking encryption and online information encryption.<br />
n = -&gt; p * q (or known as P.N.P).<br />
It is extremely difficult to calculate the 2 prime factors from a 3000 bits.</p>
<p style="text-align: left;">Quantum computing is another story in number theory.</p>
<p style="text-align: left;"><strong>4. graph theory</strong><br />
graph theory is not necessarily the usual graph we see in classroom. A graph can be a set of objects, mathematically speaking, in any shape and form it may takes.</p>
<p style="text-align: left;">The beginning of graph theory can traced back as early as 18th century, around mid 1700 with Euler. His "Seven Bridges of Königsberg" problem led to the today's graph theory. For years, people are engaged to disapprove Euler, but he is always right. For the problem, you may visit this site: <a href="http://www.jcu.edu/math/vignettes/bridges.htm">http://www.jcu.edu/math/vignettes/bridges.htm</a></p>
<p style="text-align: left;">The question of the seven bridges: "Is it possible to cross bridge once and exactly once"? According to Euler it is impossible.</p>
<p style="text-align: left;">Another innovation in the 1970s is a problem with "4 colors theorem", or look at here <a href="http://en.wikipedia.org/wiki/Four_color_theorem">http://en.wikipedia.org/wiki/Four_color_theorem</a><br />
It solution is well recognized because it is the first computer proof ever in history. The answer to this problem is yes, it is possible to color with only four colors.</p>
<p style="text-align: left;">The very last application of graph theory would be "optimization and matching". Google and Yahoo search is a known product of graph theory.</p>
<p style="text-align: left;"><strong>5. logic</strong><br />
Although it is elementary in the beginning, its application is just as robust as other discrete mathematics.</p>
<p style="text-align: left;"><strong>6.Applied Algebra</strong><br />
A recent discussion with an electrical engineering student that I had had an important aspects with applied algebra. His senior project is to build a new network system in rings structure.</p>
<p style="text-align: left;">Linear Algebra is not discussed in discrete mathematics, however, some aspects are discussed in great detail throughout the course.</p>
<p style="text-align: left;">Cryptography, image processing and detection all come back to discrete mathematics. In fact, again, a computer is just a huge string of numbers.</p>
<p style="text-align: left;">Discrete mathematics is not a privilege to only computer science students. Real scientists also study this in order to understand their fields.</p>
<p style="text-align: left;">Numbers, are really powerful.</p>
]]></content:encoded>
			<wfw:commentRss>http://opensourcebot.com/blog/2010/02/10/class1-intro-to-discrete-mathematics/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Google is leaving China</title>
		<link>http://opensourcebot.com/blog/2010/01/12/google-is-leaving-china/</link>
		<comments>http://opensourcebot.com/blog/2010/01/12/google-is-leaving-china/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 04:33:24 +0000</pubDate>
		<dc:creator>John Wong</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://opensourcebot.com/blog/?p=854</guid>
		<description><![CDATA[Yesterday Google's Corporate Development and Chief Legal officer, David Drummond wrote an entry on his blog, announcing that Google would withdraw its business from China, if the two parties' negotiation fail. 
Political censoring has hindered Google from competing against China-native search engine Baidu. Google sounds threatening and this withdrawal may cost both parties billions of [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday Google's Corporate Development and Chief Legal officer, David Drummond wrote an entry on his blog, announcing that Google would withdraw its business from China, if the two parties' negotiation fail. </p>
<p>Political censoring has hindered Google from competing against China-native search engine Baidu. Google sounds threatening and this withdrawal may cost both parties billions of dollars of lost. If negotiation fails, Google will probably re-locate its Asia business strategy to Taiwan.</p>
<p><a href="http://googleblog.blogspot.com/2010/01/new-approach-to-china.html">http://googleblog.blogspot.com/2010/01/new-approach-to-china.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://opensourcebot.com/blog/2010/01/12/google-is-leaving-china/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A sticky note for Ubuntu installation</title>
		<link>http://opensourcebot.com/blog/2010/01/06/a-sticky-note-for-ubuntu-installation/</link>
		<comments>http://opensourcebot.com/blog/2010/01/06/a-sticky-note-for-ubuntu-installation/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 01:12:55 +0000</pubDate>
		<dc:creator>John Wong</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[note]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://opensourcebot.com/blog/?p=851</guid>
		<description><![CDATA[gcin
http://cle.linux.org.tw/trac/wiki/GcinDistros
1im-switch -s gcin
ShowTime theme
12345gpg --keyserver hkp://keyserver.ubuntu.com:11371 --recv-key 881574DE &#38;&#38; gpg -a --export 881574DE &#124; sudo apt-key add -

sudo gedit /etc/apt/sources.list
deb http://ppa.launchpad.net/bisigi/ppa/ubuntu jaunty main
sudo apt-get install showtime-theme
Emacs, checkGmail
123sudo apt-get install emacs
sudo apt-get install checkgmail
checkgmail -update
]]></description>
			<content:encoded><![CDATA[<p><strong>gcin</strong></p>
<p>http://cle.linux.org.tw/trac/wiki/GcinDistros</p>
<div class="codecolorer-container apt_sources mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="apt_sources codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">im-switch -s gcin</div></td></tr></tbody></table></div>
<p><strong>ShowTime theme</strong></p>
<div class="codecolorer-container apt_sources mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="apt_sources codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">gpg --keyserver hkp://keyserver.ubuntu.com:11371 --recv-key 881574DE &amp;&amp; gpg -a --export 881574DE | sudo apt-key add -<br />
<br />
sudo gedit /etc/apt/sources.list<br />
<span style="color: #00007f;">deb</span> <span style="color: #009900;">http://ppa.launchpad.net/bisigi/ppa/ubuntu</span> jaunty <span style="color: #b16000;">main</span><br />
sudo apt-get install showtime-theme</div></td></tr></tbody></table></div>
<p>Emacs, checkGmail</p>
<div class="codecolorer-container apt_sources mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="apt_sources codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sudo apt-get install emacs<br />
sudo apt-get install checkgmail<br />
checkgmail -update</div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://opensourcebot.com/blog/2010/01/06/a-sticky-note-for-ubuntu-installation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python 101: Intro to Python</title>
		<link>http://opensourcebot.com/blog/2010/01/02/python-101-intro-to-python/</link>
		<comments>http://opensourcebot.com/blog/2010/01/02/python-101-intro-to-python/#comments</comments>
		<pubDate>Sun, 03 Jan 2010 02:07:15 +0000</pubDate>
		<dc:creator>John Wong</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[python 101]]></category>

		<guid isPermaLink="false">http://opensourcebot.com/blog/?p=840</guid>
		<description><![CDATA[Most tutorials start with installation, and write a simple program called "Hello World", I will follow this tradition just to make sure we cover the basics. Then I will move into control structures and some basic OOP, because almost everything we do in Python is OOPs.
Where to get python?
http://python.org/download/ and get whichever version you want, [...]]]></description>
			<content:encoded><![CDATA[<p>Most tutorials start with installation, and write a simple program called "Hello World", I will follow this tradition just to make sure we cover the basics. Then I will move into control structures and some basic OOP, because almost everything we do in Python is OOPs.</p>
<p><strong>Where to get python?</strong><br />
http://python.org/download/ and get whichever version you want, either 2.6.4 / 3.1.1 (at the time of this writing)</p>
<p><strong>2.6.4 vs 3.1.1, which one?</strong><br />
It gets very technical when one is asked to explain the difference. Here is the shortest and simplest version:</p>
<blockquote><p>Go with 2.X branch because 3.X branch has a lot of changes, and many existing books, codes and resources are written based on 2.X, so you are better off learning 2.X branch. </p></blockquote>
<p>If you are very serious about learning Python, you will be happy with 2.X and then learn the differences later.</p>
<p>Write Hello World</p>
<p>Just like any other modern programming language,</p>
<div class="codecolorer-container python mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Hello World&quot;</span></div></td></tr></tbody></table></div>
<p>Notice that, unlike C++, Python does not end with semicolon <strong>;</strong></p>
<p>Hack Python Program</p>
<p>As an beginner, you are better off hacking programs, rather than writing the entire program yourself. Once you understand what each line means, then you can write your own program. For example, just change the values or words around.</p>
<p>Unlike complex language like C++, Python is very simple, yet elegant. You do not always need to declare and define types and identifiers.<br />
When we assign a number to any variable, Python knows it is an integer by default. When it is within double quote <strong>""</strong>, Python knows it is a string.</p>
<div class="codecolorer-container python mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">abc = <span style="color: #ff4500;">1</span><br />
cde = <span style="color: #483d8b;">&quot;What&quot;</span></div></td></tr></tbody></table></div>
<p>When you need floating point and other numerical types, then, yes, you do need to specify it. So use the option when it is mandatory.</p>
<p>Here is the major difference between the 3.X and 2.X. By default (2.X) if you do 3 divide 5, you get ZERO, whereas in 3.X you get an answer with demicals. If you are using 2.X, you must add one decimal point to any one of the numbers. For 3.X, you are no longer require to declare this extra decimal, because by default 3/5 will print a rounded answer.</p>
<div class="codecolorer-container python mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">IDLE 2.6.4 &nbsp; &nbsp; &nbsp;<br />
<span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #ff4500;">15</span>/<span style="color: #ff4500;">2</span><br />
<span style="color: #ff4500;">7</span><br />
<span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #ff4500;">3</span>/<span style="color: #ff4500;">5</span><br />
<span style="color: #ff4500;">0</span><br />
<span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #ff4500;">3.0</span> / <span style="color: #ff4500;">5</span><br />
<span style="color: #ff4500;">0.59999999999999998</span><br />
<span style="color: #66cc66;">&gt;&gt;&gt;</span> <br />
<span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #ff4500;">3</span>/<span style="color: #ff4500;">5.00</span><br />
<span style="color: #ff4500;">0.59999999999999998</span><br />
<span style="color: #66cc66;">&gt;&gt;&gt;</span></div></td></tr></tbody></table></div>
<p>Another way is to declare it a floating point, and round it up (check doc / google for answer).<br />
<span id="more-840"></span><br />
<strong>Input Method</strong><br />
Before we jump into control structure, we must learn input method.<br />
<strong>input("")</strong><br />
<strong>raw_input("")</strong></p>
<p>Just remember that raw_input is safer and a better input method than input(). Once we get to list, dictionary and a few other topics, we will see variations like <em>str(input(""))</em>, <em>int(input(""))</em> and etc. Basically if we add a type in-front of an input method, we are restricting the information being inputted, processed and outputted.</p>
<div class="codecolorer-container python mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">a = <span style="color: #008000;">input</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Enter a number: &quot;</span><span style="color: black;">&#41;</span> &nbsp;<span style="color: #808080; font-style: italic;"># &nbsp;a = 1, you get 1</span><br />
<span style="color: #ff7700;font-weight:bold;">print</span> a<br />
b = <span style="color: #008000;">input</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Enter a word: &quot;</span><span style="color: black;">&#41;</span> &nbsp;<span style="color: #808080; font-style: italic;"># b = fgdfg, you get error, by default input is integer</span><br />
<span style="color: #ff7700;font-weight:bold;">print</span> b<br />
c = <span style="color: #008000;">int</span><span style="color: black;">&#40;</span><span style="color: #008000;">input</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Enter a number: &quot;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span> &nbsp;<span style="color: #808080; font-style: italic;"># c = 121, you get 121</span><br />
<span style="color: #ff7700;font-weight:bold;">print</span> c<br />
d = <span style="color: #008000;">int</span><span style="color: black;">&#40;</span><span style="color: #008000;">input</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Enter a word: &quot;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span> &nbsp;<span style="color: #808080; font-style: italic;"># d = ere, you get error, self-explanatory</span><br />
<span style="color: #ff7700;font-weight:bold;">print</span> d<br />
e = <span style="color: #008000;">raw_input</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Enter a number: &quot;</span><span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;"># e = 34, you get 34</span><br />
<span style="color: #ff7700;font-weight:bold;">print</span> e<br />
f = <span style="color: #008000;">raw_input</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Enter a word: &quot;</span><span style="color: black;">&#41;</span> &nbsp;<span style="color: #808080; font-style: italic;"># f = fgdfg, you get fgdfg</span><br />
<span style="color: #ff7700;font-weight:bold;">print</span> f<br />
g = <span style="color: #008000;">int</span><span style="color: black;">&#40;</span><span style="color: #008000;">raw_input</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Enter a number: &quot;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span> &nbsp;<span style="color: #808080; font-style: italic;"># g = 343, you get 343</span><br />
<span style="color: #ff7700;font-weight:bold;">print</span> g<br />
f = <span style="color: #008000;">int</span><span style="color: black;">&#40;</span><span style="color: #008000;">raw_input</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Enter a word: &quot;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span> &nbsp;<span style="color: #808080; font-style: italic;"># f = dfdf, you get error, another self-explanatory</span><br />
<span style="color: #ff7700;font-weight:bold;">print</span> f</div></td></tr></tbody></table></div>
<p><strong><br />
Control Structure</strong><br />
There is no need to go in depth with the things I just mentioned above. Here we will briefly discuss the if-else, for and while loop control structure in Python.</p>
<p>One thing to keep in mind: you must be careful with your <strong>INDENTATIONS</strong>.</p>
<p><strong>IF-ELSE</strong></p>
<div class="codecolorer-container python mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;"># If-Else</span><br />
a = <span style="color: #008000;">int</span><span style="color: black;">&#40;</span><span style="color: #008000;">raw_input</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Enter any number: &quot;</span><span style="color: black;">&#41;</span> &nbsp;<span style="color: #808080; font-style: italic;"># restrict only number can be input</span><br />
<br />
<span style="color: #ff7700;font-weight:bold;">if</span> a == <span style="color: #ff4500;">0</span>: &nbsp; <span style="color: #808080; font-style: italic;"># notice that we use colon : after each operation</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;You won! It is zero&quot;</span><br />
<span style="color: #ff7700;font-weight:bold;">else</span>: &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># notice another colon :</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;You lost. It was zero, but you answered&quot;</span>,a<span style="color: #483d8b;">&quot;,try it next time!&quot;</span></div></td></tr></tbody></table></div>
<p>The interesting thing is the second print statement (things in bold)<br />
        print "You lost. It was zero, but you answered<strong>",a",</strong>try it next time!"<br />
If we want to print our variable along with a string, we can just user comma to separate the result.<br />
By default, this comma will automatically make a whitespace.</p>
<div class="codecolorer-container python mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">a = 10<br />
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;We know a is equal to&quot;</span>,a<span style="color: #483d8b;">&quot;.&quot;</span> &nbsp; <span style="color: #808080; font-style: italic;"># will print --&gt; &nbsp; We know a is equal to 10.</span><br />
<span style="color: #808080; font-style: italic;"># if we do add an extra space before the end quotation</span><br />
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;We know a is equal to &quot;</span>,a<span style="color: #483d8b;">&quot;.&quot;</span> &nbsp;<span style="color: #808080; font-style: italic;"># will print --&gt; We know a is equal to &nbsp;10.</span></div></td></tr></tbody></table></div>
<p>Try to hack this program by adding or changing with different variables, strings and numbers.</p>
<p><strong>IF-ELIF-ELSE</strong></p>
<div class="codecolorer-container python mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;"># if-elif-else program</span><br />
a = <span style="color: #008000;">int</span><span style="color: black;">&#40;</span><span style="color: #008000;">raw_input</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Enter a number between 0 and 10: &quot;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><br />
<span style="color: #ff7700;font-weight:bold;">if</span> a == 0 <span style="color: #ff7700;font-weight:bold;">or</span> a == 10:<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;It contains a zero!&quot;</span><br />
<span style="color: #ff7700;font-weight:bold;">elif</span> a <span style="color: #66cc66;">&gt;</span>= 1 <span style="color: #ff7700;font-weight:bold;">and</span> a <span style="color: #66cc66;">&lt;</span> 5:<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;It is greater than or equal to 1, and less than 5&quot;</span><br />
<span style="color: #ff7700;font-weight:bold;">elif</span> a <span style="color: #66cc66;">&gt;</span>=5 <span style="color: #ff7700;font-weight:bold;">and</span> a <span style="color: #66cc66;">&lt;</span> 10:<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;It is greater than or equal to 5, and less than 10&quot;</span><br />
<span style="color: #ff7700;font-weight:bold;">else</span>:<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Does not follow rule!&quot;</span></div></td></tr></tbody></table></div>
<p>Python has syntaxes like <strong>or</strong>, <strong>and</strong>, <strong>not </strong> for conditional statements. You will learn them all once you get through the next two lessons.</p>
<p><strong>While loop</strong><br />
Notice the last line print "Hello". I show this so that you see unless the loop is satisfy (stops), the last line will not execute. Moreover, you must remember that Python does not has "end" syntax.  So...</p>
<p>BE CAREFUL WITH YOUR INDENTATION.</p>
<div class="codecolorer-container python mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;"># while loop program</span><br />
<br />
a = <span style="color: #008000;">int</span><span style="color: black;">&#40;</span><span style="color: #008000;">input</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Enter a number: &quot;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><br />
<br />
<span style="color: #ff7700;font-weight:bold;">while</span> a <span style="color: #66cc66;">!</span>= 0:<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Try again&quot;</span><br />
&nbsp; &nbsp; a = <span style="color: #008000;">int</span><span style="color: black;">&#40;</span><span style="color: #008000;">input</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Enter a number: &quot;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><br />
<br />
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Hello&quot;</span></div></td></tr></tbody></table></div>
<blockquote><p>Here is the result<br />
Enter a number: 1<br />
Try again<br />
Enter a number: 3<br />
Try again<br />
Enter a number: 0<br />
Hello</p></blockquote>
<p><strong>For loop</strong><br />
Like many languages, by default Python starts counting from ZERO. So range(100) really means from 0 to 99 (there are total of 100 integers). </p>
<p>If you want to print from 1 to 100 (including 100), you can do<br />
    <strong>for a in range(1, 101, 1)</strong>   # range(first element, end element, counting method ]1 is forward])</p>
<div class="codecolorer-container python mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;"># for loop</span><br />
<br />
<span style="color: #ff7700;font-weight:bold;">for</span> a <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span>100<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> a</div></td></tr></tbody></table></div>
<p><strong>Here is the result</strong></p>
<blockquote><p>0<br />
1<br />
2<br />
3<br />
4<br />
....<br />
99</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://opensourcebot.com/blog/2010/01/02/python-101-intro-to-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Year 2010!!</title>
		<link>http://opensourcebot.com/blog/2010/01/01/new-year-2010/</link>
		<comments>http://opensourcebot.com/blog/2010/01/01/new-year-2010/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 06:09:57 +0000</pubDate>
		<dc:creator>John Wong</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[2009]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[rainie yang]]></category>

		<guid isPermaLink="false">http://opensourcebot.com/blog/?p=838</guid>
		<description><![CDATA[Welcome 2010 !!! 
LOL I am tired of reading "Happy New Year" every year on AIM and Facebook. I do not celebrate New Year eve for a few years already because I am not a kid anymore. 
A new decade!!
Yeah, it's 2010, another decade since 2000. So what? Just stay home, like we never had [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>Welcome 2010 !!! </p></blockquote>
<p>LOL I am tired of reading "Happy New Year" every year on AIM and Facebook. I do not celebrate New Year eve for a few years already because I am not a kid anymore. </p>
<blockquote><p>A new decade!!</p></blockquote>
<p>Yeah, it's 2010, another decade since 2000. So what? Just stay home, like we never had a new year before.</p>
<p>I have a boring life now. I really need some works to do over this break. I have a planned agenda before the break, but I am procrastinating. Oh my god, I need stop it. </p>
<p>Oh, I am reading Rainie Yang's bog recently. Her latest entry <a href="http://www.wretch.cc/blog/www77rainie/12076194"> 心.煩...</a> is here. Her blog says a lot about her life. I have read a few other artists' blogs before, yet, I find Rainie's one frankest, especially with her emotion state. For numerous times she mentions that she wants to be in love. </p>
<p>I start learning about the true face of Rainie Yang through various sources: drama, blog, news and interviews. At 娛樂百分百, she interpreted her new song "青春鬥" how she felt as being 25 years old. She said only love could keep her young. As an actress, as well as a star, she could not have an open relationship. She has at least five known love affairs and the only one she ever admitted was with 小鬼, whom was her first boyfriend in high school, and whom she thought she would marry with. Nevertheless, her parents' divorce had her lost faith in marriage and love. A week ago she told the reporters that she was still single, but she felt she was "in love" for the past couple months. She was referring to her role in Hi My Sweetheart. She once admitted that she wanted to be in love, but she would not promise because she could not.</p>
<p>Oh well, it is my time to sleep. I wish everyone has a great starting.</p>
<p>I am really bored without Hi My Sweetheart !!!! >3<</p>
]]></content:encoded>
			<wfw:commentRss>http://opensourcebot.com/blog/2010/01/01/new-year-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Got my room already</title>
		<link>http://opensourcebot.com/blog/2009/12/30/got-my-room-already/</link>
		<comments>http://opensourcebot.com/blog/2009/12/30/got-my-room-already/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 03:23:39 +0000</pubDate>
		<dc:creator>John Wong</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[2009]]></category>

		<guid isPermaLink="false">http://opensourcebot.com/blog/?p=834</guid>
		<description><![CDATA[After a few months of efforts, I finally got a room near school. It is right across the main campus, about 30 seconds away from the gate. I am very happy with it.
As I have mentioned before, I would share this room with a visiting phD Columbia student from Beijing. Nevertheless, the room is large [...]]]></description>
			<content:encoded><![CDATA[<p>After a few months of efforts, I finally got a room near school. It is right across the main campus, about 30 seconds away from the gate. I am very happy with it.</p>
<p>As I have mentioned before, I would share this room with a visiting phD Columbia student from Beijing. Nevertheless, the room is large enough to fit two people, enough space to sleep and work. The basic rent is $720 per month, shared by the two of us. Utility is electricity, and is shared among the four of us, probably between $20 - $30. To round up the total cost, $360 + $40, I am expecting $400 per month per person. This is not bad at all.</p>
<p>I will move in mid-Jan, probably around Jan 10 - 15.</p>
<p>I am looking forward with Hi My Sweetheart ep.10. Oh my god.</p>
<p>Anyway, tomorrow is December 31th, but I am going to stay home. It is too cold to join the crowds at Time Square tomorrow night. Oh well. I am still waiting for Ross to review my grade. I can't believe he gives me B+. My final project deserves an A.</p>
<p>Oh today the NYPD had an investigation near Time Squares because of a suspicious white van. By noon they found the van safe, with only clothes and tables. Man, terrorism is really bad-ass. Ruin people's life.</p>
<p>Si-tu-but seems to be ill today. I hope she gets well soon. <3 I love my hamsters.</p>
]]></content:encoded>
			<wfw:commentRss>http://opensourcebot.com/blog/2009/12/30/got-my-room-already/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hi My Sweetheart (海派甜心)</title>
		<link>http://opensourcebot.com/blog/2009/12/29/hi-my-sweetheart-%e6%b5%b7%e6%b4%be%e7%94%9c%e5%bf%83/</link>
		<comments>http://opensourcebot.com/blog/2009/12/29/hi-my-sweetheart-%e6%b5%b7%e6%b4%be%e7%94%9c%e5%bf%83/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 06:03:28 +0000</pubDate>
		<dc:creator>John Wong</dc:creator>
				<category><![CDATA[Drama]]></category>
		<category><![CDATA[2009]]></category>
		<category><![CDATA[hi-my-sweetheart]]></category>
		<category><![CDATA[rainie yang]]></category>
		<category><![CDATA[海派甜心]]></category>

		<guid isPermaLink="false">http://opensourcebot.com/blog/?p=827</guid>
		<description><![CDATA[Oh my god. I am in love with this drama. I can't stop thinking about the characters and story. It is a really cute drama fantasy. I even image-cut a scene when she cries to her pink tiger doll, and makes it my AIM default.

Rainie Yang is really cute, and her acting is mature and [...]]]></description>
			<content:encoded><![CDATA[<p>Oh my god. I am in love with this drama. I can't stop thinking about the characters and story. It is a really cute drama fantasy. I even image-cut a scene when she cries to her pink tiger doll, and makes it my AIM default.</p>
<p><a title="#" rel="lightbox" href="http://i786.photobucket.com/albums/yy145/gokoproject/750px-HiMySweetheart.jpg" class="highslide-image" onclick="return hs.expand(this);"><img src="http://i786.photobucket.com/albums/yy145/gokoproject/300px-HiMySweetheart.jpg" alt="#" /></a></p>
<p>Rainie Yang is really cute, and her acting is mature and good in Sweetheart. For the last few years, I refused to watch her drama for some unknown reasons. Nevertheless, I find her a good actress in Sweetheart. </p>
<p>I remembered her from Meteor Garden. I was surprise to find out that she was a former member of 4-In Love at age of 16.</p>
<p>Rainie is now 25, and is getting older. Yet, I find her now more attractive. She has femininity - I just like how she is now. Pure and lovely.</p>
<p>I know she has makeup on, Mike. But in my opinion I think she still retains at least 60% - 70% of her beauty without any makeup. I am serious.</p>
<p>Hi My Sweetheart is hilarious. I laugh to death for every 5 minutes. They make the love scene funny too. I am looking forward with ep 10 next Sunday.</p>
<p>I dream that I will find a girl like Chen Bao Zhu (寶茱姐). She is not rude, just very independent and assertive.</p>
]]></content:encoded>
			<wfw:commentRss>http://opensourcebot.com/blog/2009/12/29/hi-my-sweetheart-%e6%b5%b7%e6%b4%be%e7%94%9c%e5%bf%83/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fisher-Yates shuffle in python</title>
		<link>http://opensourcebot.com/blog/2009/12/25/fisher-yates-shuffle-in-python/</link>
		<comments>http://opensourcebot.com/blog/2009/12/25/fisher-yates-shuffle-in-python/#comments</comments>
		<pubDate>Fri, 25 Dec 2009 15:27:44 +0000</pubDate>
		<dc:creator>John Wong</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[2009]]></category>
		<category><![CDATA[random]]></category>

		<guid isPermaLink="false">http://opensourcebot.com/blog/?p=817</guid>
		<description><![CDATA[As I was writing a simple lottery program for TVBoxNow, I was wondering how module random actually worked. I wanted to write my own random module, but it turned out the mathematical philosophies were beyond my calculus knowledge. It was probability and probably also had to deal with linear algebra. 
Great people from Stackflow had [...]]]></description>
			<content:encoded><![CDATA[<p>As I was writing a simple lottery program for TVBoxNow, I was wondering how module random actually worked. I wanted to write my own random module, but it turned out the mathematical philosophies were beyond my calculus knowledge. It was probability and probably also had to deal with linear algebra. </p>
<p>Great people from Stackflow had provided a lot of insights and useful links. There was a brief overview of what Fisher-Yates shuffle on Wikipedia.<br />
<a href="http://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle">Fisher-Yates shuffle</a></p>
<p><a href="http://en.wikipedia.org/wiki/Mersenne_twister">Mersenne Twister</a></p>
<p>It turns out that Python's random module implements Fisher-Yates shuffle and Mersenne Twister methods. Not exactly the same, of course, there are changes made for better optimizations and greater unbiased result.</p>
<div class="codecolorer-container python mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># only run this loop from 0 to 19 (20 times)</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> player <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span>20<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; num_player = <span style="color: #008000;">len</span><span style="color: black;">&#40;</span>lst_shuffle<span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;"># get the total numbers of players</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; k = <span style="color: #dc143c;">random</span>.<span style="color: black;">randrange</span><span style="color: black;">&#40;</span>num_player<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #dc143c;">random</span>.<span style="color: black;">shuffle</span><span style="color: black;">&#40;</span>lst_shuffle,<span style="color: #dc143c;">random</span>.<span style="color: #dc143c;">random</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> player, lst_shuffle<span style="color: black;">&#91;</span>k<span style="color: black;">&#93;</span>, <span style="color: #483d8b;">&quot;random:&quot;</span>,k<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">del</span> lst_shuffle<span style="color: black;">&#91;</span>k<span style="color: black;">&#93;</span></div></td></tr></tbody></table></div>
<p><a href="http://mainline.brynmawr.edu/Courses/cs330/spring2008/ImportantAlgorithms/SRadu%28Fisher-Yates%29.pdf">Additional Reading: The Fisher‐Yates shuffle algorithm</a></p>
<p>I was wondering why there is an optional random.random() function in the end (I know it's optional). Here was a statement I found from the additional reading:</p>
<blockquote><p><strong>Pseudo random number generators</strong><br />
Most, if not all programming languages have libraries that include a pseudo-random<br />
number generator. This generator usually returns a random number between 0 and 1 (not<br />
including 1). In a perfect generator all numbers have the same probability of being selected but<br />
in the pseudo generators some numbers have zero probability.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://opensourcebot.com/blog/2009/12/25/fisher-yates-shuffle-in-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<enclosure url="http://mainline.brynmawr.edu/Courses/cs330/spring2008/ImportantAlgorithms/SRadu%28Fisher-Yates%29.pdf" length="91013" type="application/pdf" /><media:content url="http://mainline.brynmawr.edu/Courses/cs330/spring2008/ImportantAlgorithms/SRadu%28Fisher-Yates%29.pdf" fileSize="91013" type="application/pdf" /><itunes:explicit>no</itunes:explicit><itunes:subtitle>As I was writing a simple lottery program for TVBoxNow, I was wondering how module random actually worked. I wanted to write my own random module, but it turned out the mathematical philosophies were beyond my calculus knowledge. It was probability and pr</itunes:subtitle><itunes:summary>As I was writing a simple lottery program for TVBoxNow, I was wondering how module random actually worked. I wanted to write my own random module, but it turned out the mathematical philosophies were beyond my calculus knowledge. It was probability and probably also had to deal with linear algebra. Great people from Stackflow had [...]</itunes:summary><itunes:keywords>Programming, Python, 2009, random</itunes:keywords></item>
		<item>
		<title>Christmas Eve? Hungry.</title>
		<link>http://opensourcebot.com/blog/2009/12/25/christmas-eve-hungry/</link>
		<comments>http://opensourcebot.com/blog/2009/12/25/christmas-eve-hungry/#comments</comments>
		<pubDate>Fri, 25 Dec 2009 05:53:27 +0000</pubDate>
		<dc:creator>John Wong</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[2009]]></category>
		<category><![CDATA[Christmas]]></category>
		<category><![CDATA[room]]></category>

		<guid isPermaLink="false">http://opensourcebot.com/blog/?p=815</guid>
		<description><![CDATA[
Yes. Christmas Eve already. Happy Christmas.

Nevertheless, what I really want to do is work. Well, actually, I want to eat first, but my refrigerator is empty.
So I have been looking for a room near City College for two months already. I have visited one, which is only two blocks from City and with utilities I [...]]]></description>
			<content:encoded><![CDATA[<blockquote>
<p style="text-align: left;">Yes. Christmas Eve already. Happy Christmas.</p>
</blockquote>
<p style="text-align: left;">Nevertheless, what I really want to do is <strong>work</strong>. Well, actually, I want to eat first, but my refrigerator is empty.</p>
<p style="text-align: left;">So I have been looking for a room near City College for two months already. I have visited one, which is only two blocks from City and with utilities I am expecting $550 a month. The landlord is a nice lady, but I really want to minimize my expense.</p>
<p style="text-align: left;">After spending more than a thousand dollar on Wendy last year, I am really broke. I did have a summer job and it was quite good bonus. Two months ago I decided to save all my money into my bank account, and I have $2200 left.</p>
<p style="text-align: left;">A Columbia PhD student spoke to me if I would share a room with him, between $600 - $700 a month. The deal is that if we divide it half, each of us will only pay $300 - $400. Although I always hate sharing a bedroom with another person, I guess I just have to learn it since MIT and Cornell only provide shared dormitories.</p>
<p style="text-align: left;">After speaking to an admission staff at Cornell, since I have course conflict this year, I would have to apply as a junior standing. For MIT, it's worth a try this year, just to get the experience. To get admitted to MIT, one must demonstrate its unique potential contribution to MIT community, and I already have a concrete idea about what I need to do. It's worth that $70 this year and next year again.</p>
]]></content:encoded>
			<wfw:commentRss>http://opensourcebot.com/blog/2009/12/25/christmas-eve-hungry/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Double standard!? phpBB4</title>
		<link>http://opensourcebot.com/blog/2009/12/23/double-standard-phpbb4/</link>
		<comments>http://opensourcebot.com/blog/2009/12/23/double-standard-phpbb4/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 23:18:11 +0000</pubDate>
		<dc:creator>John Wong</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Uncategorized Category]]></category>
		<category><![CDATA[2009]]></category>
		<category><![CDATA[phpbb]]></category>
		<category><![CDATA[phpbb4]]></category>

		<guid isPermaLink="false">http://opensourcebot.com/blog/?p=811</guid>
		<description><![CDATA[I am very disappointed with phpBB team. Their team members are so double standard. While their own people proposing feature implementations, and have no problem with those, they would warn users not to jump ahead the schedule. 
While there is no specific restriction or vision what they want since the beginning, they police my thoughts [...]]]></description>
			<content:encoded><![CDATA[<p>I am very disappointed with phpBB team. Their team members are so double standard. While their own people proposing feature implementations, and have no problem with those, they would warn users not to jump ahead the schedule. </p>
<p>While there is no specific restriction or vision what they want since the beginning, they police my thoughts and ideas. I am totally sick of their tones and attitude. I was the first one asked people not to draw any tangent, and later they came back to lecture me.</p>
<p>What a shame to these experience software engineers. I am only a freshman in college, and I find myself a better engineer than they are. They tell users their expectations implicitly. They want to discuss archeiture, then please have the developers start the discussion first. Users' engineering experiences do not matter at all. It is about correcting the attitude. </p>
<p>They make users uncomfortable to give in. Users are penalize when their comments offend the developers even if they are facts. They police users' thoughts and ideas. I agree that we need to monitor every reply and to keep our discussions relevant to the subject, however, phpBB team does not let users know their expectations.<br />
<span id="more-811"></span></p>
<blockquote><p>"Introducing ideas..."<br />
"Architecture..."</p></blockquote>
<p>So why wouldn't you people say it all once, make it obvious and state your goals before any user jump in?</p>
<p>They do not want too many inputs at the moment which I also understand very well. However, their attitudes have made users like me leaving the community. I will never returned to phpBB because they are a punch of attitude-problem people. I have a problem with their prejudice on the Chinese and Asian users. In the past some of their team members even made racism remarks. </p>
<p>phpBB4? Please. I am just going to write my own one and make it a commercial (yet, still open source). Goodbye, phpBB. You guys really suck at defining software engineering.</p>
]]></content:encoded>
			<wfw:commentRss>http://opensourcebot.com/blog/2009/12/23/double-standard-phpbb4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	<media:rating>nonadult</media:rating></channel>
</rss><!-- Loaded originally in 0.29 seconds (2010-03-13, 00:30:06). -->
