<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>technotroph</title>
	<atom:link href="http://technotroph.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://technotroph.wordpress.com</link>
	<description>random thoughts about mozilla hacking and the computing world</description>
	<lastBuildDate>Thu, 02 May 2013 06:27:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='technotroph.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>technotroph</title>
		<link>http://technotroph.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://technotroph.wordpress.com/osd.xml" title="technotroph" />
	<atom:link rel='hub' href='http://technotroph.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Collection of FP Articles by Paul Callaghan</title>
		<link>http://technotroph.wordpress.com/2013/05/02/collection-of-fp-articles-by-paul-callaghan/</link>
		<comments>http://technotroph.wordpress.com/2013/05/02/collection-of-fp-articles-by-paul-callaghan/#comments</comments>
		<pubDate>Thu, 02 May 2013 06:19:41 +0000</pubDate>
		<dc:creator>jasonyeo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dependent types]]></category>
		<category><![CDATA[functional programming]]></category>
		<category><![CDATA[haskell]]></category>
		<category><![CDATA[paul callaghan]]></category>
		<category><![CDATA[prag pub]]></category>

		<guid isPermaLink="false">http://technotroph.wordpress.com/?p=215</guid>
		<description><![CDATA[Thinking Functionally with Haskell Part 1: Thinking Functionally with Haskell- Introduction to Haskell Part 2: Thinking Functionally with Haskell &#8211; Type system Part 3: Thinking Functionally with Haskell &#8211; A kata to apply what is taught so far Part 4: Thinking Functionally with Haskell &#8211; Plumbing with monads Dependent Types Part 1: Dependent Types Part [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotroph.wordpress.com&#038;blog=26324483&#038;post=215&#038;subd=technotroph&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<h1>Thinking Functionally with Haskell</h1>
<ul>
<li>Part 1: <a id="qlink_2gi21vna7a" href="http://pragprog.com/magazines/2012-08/thinking-functionally-with-haskell">Thinking Functionally with Haskell</a>- Introduction to Haskell</li>
<li>Part 2: <a id="qlink_6pv9nqvxtw" href="http://pragprog.com/magazines/2012-09/thinking-functionally-with-haskell">Thinking Functionally with Haskell</a> &#8211; Type system</li>
<li>Part 3: <a id="qlink_w55ug75jkr" href="http://pragprog.com/magazines/2012-10/thinking-functionally-with-haskell">Thinking Functionally with Haskell</a> &#8211; A kata to apply what is taught so far</li>
<li>Part 4: <a id="qlink_qrbw8wctei" href="http://pragprog.com/magazines/2012-11/thinking-functionally-with-haskell">Thinking Functionally with Haskell</a> &#8211; Plumbing with monads</li>
</ul>
<div>
<h1>Dependent Types</h1>
<div>
<ul>
<li>Part 1: <a href="http://pragprog.com/magazines/2013-04/dependent-types">Dependent Types</a></li>
<li>Part 2: <a href="http://pragprog.com/magazines/2013-05/dependent-types-part-ii">Dependent Types</a></li>
</ul>
</div>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/technotroph.wordpress.com/215/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/technotroph.wordpress.com/215/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotroph.wordpress.com&#038;blog=26324483&#038;post=215&#038;subd=technotroph&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://technotroph.wordpress.com/2013/05/02/collection-of-fp-articles-by-paul-callaghan/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/df4e511ca1ecf66a86a231d7bc728d07?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jasonyeo</media:title>
		</media:content>
	</item>
		<item>
		<title>OCaml, ocamlfind and camlp4 quirks</title>
		<link>http://technotroph.wordpress.com/2013/03/18/ocaml-ocamlfind-and-camlp4-quirks/</link>
		<comments>http://technotroph.wordpress.com/2013/03/18/ocaml-ocamlfind-and-camlp4-quirks/#comments</comments>
		<pubDate>Mon, 18 Mar 2013 05:59:35 +0000</pubDate>
		<dc:creator>jasonyeo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[camlp4]]></category>
		<category><![CDATA[deriving]]></category>
		<category><![CDATA[ocaml]]></category>
		<category><![CDATA[ocamlbuild]]></category>
		<category><![CDATA[ocamlfind]]></category>
		<category><![CDATA[ocsigen]]></category>

		<guid isPermaLink="false">http://technotroph.wordpress.com/?p=205</guid>
		<description><![CDATA[I&#8217;ve been playing around with OCaml for my final year project. The language is awesome but the ecosystem seems lacking in many ways. Compared to other languages like Ruby, Python and even Haskell, OCaml doesn&#8217;t seem to have a lot of people using and talking about it. The biggest problem I find when using ocaml [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotroph.wordpress.com&#038;blog=26324483&#038;post=205&#038;subd=technotroph&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been playing around with OCaml for my final year project. The language is awesome but the ecosystem seems lacking in many ways. Compared to other languages like Ruby, Python and even Haskell, OCaml doesn&#8217;t seem to have a lot of people using and talking about it.</p>
<p>The biggest problem I find when using ocaml is the build system. There are a lot of tools to simplify the build process. There&#8217;s ocamlbuild and ocamlfind. But I find that the documentations aren&#8217;t very helpful. For example, I can&#8217;t find any documentations about writing META files for ocamlfind. Neither can I find any guides about writing _tag files for ocamlbuild. I guess the best way around this is for the users of these tools to post their own guides and document their issues. Sp I&#8217;m going to write this post so that I can save another user the headaches that I&#8217;ve went through.</p>
<p>For my final year project, I&#8217;m working with Jeremy Yallop&#8217;s <a title="deriving" href="https://github.com/hnrgrgr/deriving">deriving</a> library. The library uses camlp4 (original syntax). To install the library to your system, install opam and execute this command:</p>
<pre>$&gt; opam install deriving-ocsigen</pre>
<p>Opam is a package manager for OCaml libraries. After installing, make sure you have findlib installed. Then test your installation:</p>
<pre>$&gt; ocaml
        OCaml version 4.00.1
# #use "topfind";;</pre>
<p>You should see a menu with some commands to get you started with findlib. Next execute these commands in your ocaml toploop:</p>
<pre># #camlp4o;;
# #require "deriving-ocsigen.syntax";;</pre>
<p>You should see some output showing that the library&#8217;s path is added to ocaml&#8217;s search path. Next, let&#8217;s try to evaluate some code that use the deriving library.</p>
<pre class="brush: fsharp; title: ; notranslate">
type point = { mutable x : int; mutable y : int }
     deriving (Eq, Show);;
</pre>
<p>If the above code is successfully evaluated, then you should have the deriving library installed on your system. To compile code that uses the deriving library, you have to use ocamlfind telling it to use the camlp4o (original syntax) and to use the deriving-ocsigen.syntax package.</p>
<pre>ocamlfind ocamlc -package deriving-ocsigen.syntax -syntax camlp4o -c point_seq.ml -o point</pre>
<p>That&#8217;s it. Hope I&#8217;ve saved you some headaches when using ocamlfind with libraries that use camlp4. I believe the above commands should work with other libraries that use camlp4 (sexplib) too.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/technotroph.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/technotroph.wordpress.com/205/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotroph.wordpress.com&#038;blog=26324483&#038;post=205&#038;subd=technotroph&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://technotroph.wordpress.com/2013/03/18/ocaml-ocamlfind-and-camlp4-quirks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/df4e511ca1ecf66a86a231d7bc728d07?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jasonyeo</media:title>
		</media:content>
	</item>
		<item>
		<title>Python Closures and the Python 2.7 nonlocal Solution</title>
		<link>http://technotroph.wordpress.com/2012/10/01/python-closures-and-the-python-2-7-nonlocal-solution/</link>
		<comments>http://technotroph.wordpress.com/2012/10/01/python-closures-and-the-python-2-7-nonlocal-solution/#comments</comments>
		<pubDate>Mon, 01 Oct 2012 09:22:19 +0000</pubDate>
		<dc:creator>jasonyeo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://technotroph.wordpress.com/?p=202</guid>
		<description><![CDATA[In python, functions are first class. A language with first class functions allows functions to be passed as a variable and returned from a function just like other first class data types like integers or floats. Some notable language with first class functions are Python, JavaScript, Scheme and Haskell. Therefore in python, it&#8217;s possible to [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotroph.wordpress.com&#038;blog=26324483&#038;post=202&#038;subd=technotroph&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>In python, functions are first class. A language with first class functions allows functions to be passed as a variable and returned from a function just like other first class data types like integers or floats. Some notable language with first class functions are Python, <a title="JavaScript Closures" href="http://jibbering.com/faq/notes/closures/">JavaScript</a>, <a href="http://www.racket-lang.org/" title="Racket Scheme">Scheme</a> and <a href="http://www.haskell.org/haskellwiki/Haskell" title="Haskell">Haskell</a>.</p>
<p>Therefore in python, it&#8217;s possible to do things like this:</p>
<pre class="brush: python; title: ; notranslate">
def raise_to_base(n):
  def my_pow(x):
    return x**n
  return my_pow

&gt;&gt;&gt; pow_base_5 = raise_to_base(5)
&gt;&gt;&gt; pow_base_5(2) # =&amp;gt; 32
</pre>
<p>(above code is taken from <a title="Python Closures Explained" href="http://www.shutupandship.com/2012/01/python-closures-explained.html">Python Closures Explained</a>)</p>
<p>I have created a function that returns another function. And the inner function is known as a closure. A &#8220;closure&#8221; is an expression (typically a function) that can have free variables together with an environment that binds those variables (that &#8220;closes&#8221; the expression). With closures, we can do other neat things like this:</p>
<pre class="brush: python; title: ; notranslate">
def outer():
  y = 0
  def inner():
    nonlocal y
    y+=1
    return y
  return inner


&gt;&gt;&gt; f = outer()

&gt;&gt;&gt; f()
1
&gt;&gt;&gt; f()
2
&gt;&gt;&gt; f()
3
</pre>
<p>The inner function now becomes something like a method in OOP. It controls the way the variable y is accessed from the outside. But there&#8217;s a problem when we want to do this in Python 2.7. The above code works only in Python 3.x. The <a title="nonlocal" href="http://http://www.python.org/dev/peps/pep-3104/#proposed-solution">nonlocal</a> keyword does not exist in Python 2.7. To solve this problem, we can use dictionaries (or we can also create another object) to store the y variable in a namespace that the inner function can access.</p>
<pre class="brush: python; title: ; notranslate">
def outer():
  d = {'y' : 0}
  def inner():
    d['y'] += 1
    return d['y']
  return inner
</pre>
<p>Though IMO, it&#8217;s kinda weird that we can&#8217;t access the non local variable but we can access the dictionary.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/technotroph.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/technotroph.wordpress.com/202/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotroph.wordpress.com&#038;blog=26324483&#038;post=202&#038;subd=technotroph&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://technotroph.wordpress.com/2012/10/01/python-closures-and-the-python-2-7-nonlocal-solution/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/df4e511ca1ecf66a86a231d7bc728d07?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jasonyeo</media:title>
		</media:content>
	</item>
		<item>
		<title>Connecting to NUS wifi on Arch</title>
		<link>http://technotroph.wordpress.com/2012/07/04/connecting-to-nus-wifi-on-arch/</link>
		<comments>http://technotroph.wordpress.com/2012/07/04/connecting-to-nus-wifi-on-arch/#comments</comments>
		<pubDate>Wed, 04 Jul 2012 11:19:23 +0000</pubDate>
		<dc:creator>jasonyeo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[arch]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[netcfg]]></category>
		<category><![CDATA[nus]]></category>
		<category><![CDATA[wpa]]></category>
		<category><![CDATA[wpa2 enterprise]]></category>

		<guid isPermaLink="false">http://technotroph.wordpress.com/?p=198</guid>
		<description><![CDATA[I recently have to move to arch due to some annoying gcc problems on the OSX of my macbook but it seems that configuring the wifi to connect to the NUS network on arch isn&#8217;t that easy.  The NUS wifi network is configured with WPA2 enterprise authentication. I referred to Tech That!&#8217;s blog post to [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotroph.wordpress.com&#038;blog=26324483&#038;post=198&#038;subd=technotroph&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I recently have to move to arch due to some annoying gcc problems on the OSX of my macbook but it seems that configuring the wifi to connect to the NUS network on arch isn&#8217;t that easy. <br />
The NUS wifi network is configured with WPA2 enterprise authentication. I referred to Tech That!&#8217;s <a href="http://techthat.net/2010/06/17/wpa2-enterprise-wireless-with-netcfg/" title="techthat">blog post</a> to configure it. </p>
<p> First, you have to get the <a href="https://wiki.archlinux.org/index.php/Netcfg" title="netcfg wiki">netcfg</a> and the <a href="https://wiki.archlinux.org/index.php/WPA_supplicant" title="wpa_supplicant wiki">wpa_supplicant</a> packages.<br />
<code><br />
sudo pacman -S netcfg wpa_supplicant<br />
</code><br />
netcfg allows you to configure your wifi according to profiles and manages the profiles for you. wpa_supplicant is used for configuring the authentication.<br />
Next, copy /etc/network.d/examples/wireless-wpa-config to /etc/network.d/nus. In this example, I shall name it as nus.<br />
<code><br />
sudo cp /etc/network.d/examples/wireless-wpa-config /etc/network.d/nus<br />
</code><br />
Then, make sure your /etc/wpa_supplicant.conf looks like this:<br />
<code><br />
ctrl_interface=/var/run/wpa_supplicant</p>
<p>network={<br />
  ssid="NUS"<br />
  key_mgmt=WPA-EAP<br />
  eap=PEAP<br />
  group=CCMP<br />
  pairwise=CCMP<br />
  identity="NUSSTU\"<br />
  password=""<br />
  priority=1<br />
  ca_path="/etc/ssl/certs"<br />
  phase2="auth=MSCHAPV2"<br />
}<br />
</code></p>
<p>Lastly, start the netcfg profile. The profile name should correspond to the file name of the profile configuration file in /etc/network.d/.<br />
<code><br />
sudo netcfg nus<br />
</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/technotroph.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/technotroph.wordpress.com/198/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotroph.wordpress.com&#038;blog=26324483&#038;post=198&#038;subd=technotroph&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://technotroph.wordpress.com/2012/07/04/connecting-to-nus-wifi-on-arch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/df4e511ca1ecf66a86a231d7bc728d07?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jasonyeo</media:title>
		</media:content>
	</item>
		<item>
		<title>Javascript Shell in Your Terminal</title>
		<link>http://technotroph.wordpress.com/2012/06/12/javascript-shell-in-your-terminal/</link>
		<comments>http://technotroph.wordpress.com/2012/06/12/javascript-shell-in-your-terminal/#comments</comments>
		<pubDate>Tue, 12 Jun 2012 02:10:35 +0000</pubDate>
		<dc:creator>jasonyeo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[rhino]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://technotroph.wordpress.com/?p=191</guid>
		<description><![CDATA[I&#8217;m currently working on the Sage Notebook and I&#8217;ve been writing code in javascript. To test snippets of js code, I usually open up either firebug or the dev console on Chrome to test it. Which is pretty annoying. I have to wait for the browser to load, then I&#8217;ve to wait for firebug to [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotroph.wordpress.com&#038;blog=26324483&#038;post=191&#038;subd=technotroph&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m currently working on the <a title="Sage Math" href="http://github.com/sagemath/sagenb">Sage Notebook</a> and I&#8217;ve been writing code in javascript. To test snippets of js code, I usually open up either firebug or the dev console on Chrome to test it. Which is pretty annoying. I have to wait for the browser to load, then I&#8217;ve to wait for firebug to load, then I have to click on the console prompt in firebug. So, I&#8217;ve decided to look for a quicker solution to my problem. I&#8217;ve previously seen a <a title="WAT" href="https://www.destroyallsoftware.com/talks/wat">talk</a> that a web developer gave (it&#8217;s really funny, you should watch it!) and he gave live demos of javascript running on his command line. Kinda like a javascript repl. So I&#8217;ve decided to look for it and I found <a title="Rhino" href="http://www.mozilla.org/rhino">rhino</a>.</p>
<blockquote><p><strong>Rhino</strong> is an open-source implementation of <a title="en/JavaScript" href="https://developer.mozilla.org/en/JavaScript" rel="internal">JavaScript</a> written entirely in Java. It is typically embedded into Java applications to provide scripting to end users. It is embedded in J2SE 6 as the default Java scripting engine.</p></blockquote>
<p>The best thing about rhino is that it has a javascript shell. (IMO, that&#8217;s the best thing about it. It comes with other cool things like a debugger by the way.)</p>
<h3>Setting Up Rhino (On the OSX)</h3>
<p>First, download <a title="Rhino" href="http://www.mozilla.org/rhino/download.html">Rhino</a>. Extract it. Then, create the ~/Library/java/Extensions directory if it&#8217;s not created yet. Lastly, copy js.jar from the rhino folder to ~/Library/java/Extensions. Or you can copy and paste the following commands to your Terminal.<br />
<code><br />
mkdir -p ~/Library/java/Extensions<br />
cp ~/Downloads/rhino1_7R3/js.jar ~/Library/java/Extensions<br />
</code><br />
To test it, execute this in the Terminal:<br />
<code><br />
java org.mozilla.javascript.tools.shell.Main<br />
</code><br />
You should see this in your Terminal:<br />
<code><br />
Rhino 1.7 release 3 2011 05 09<br />
js&gt;<br />
</code><br />
And..you&#8217;re done. Oh a quick tip, instead of typing that long command to your terminal, you can alias it. You can do so by putting this in your ~/.bash_profile:<br />
<code><br />
alias js="java org.mozilla.javascript.tools.shell.Main"<br />
</code><br />
Enjoy!<br />
<br />
Note: If you want to have readline capabilities like line editing, history, etc, you might want to put this in the ~/.bash_profile instead:<br />
<code><br />
alias js="rlwrap java org.mozilla.javascript.tools.shell.Main"<br />
</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/technotroph.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/technotroph.wordpress.com/191/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotroph.wordpress.com&#038;blog=26324483&#038;post=191&#038;subd=technotroph&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://technotroph.wordpress.com/2012/06/12/javascript-shell-in-your-terminal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/df4e511ca1ecf66a86a231d7bc728d07?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jasonyeo</media:title>
		</media:content>
	</item>
		<item>
		<title>Are You a Git Junkie?</title>
		<link>http://technotroph.wordpress.com/2012/05/15/are-you-a-git-junkie/</link>
		<comments>http://technotroph.wordpress.com/2012/05/15/are-you-a-git-junkie/#comments</comments>
		<pubDate>Mon, 14 May 2012 18:14:18 +0000</pubDate>
		<dc:creator>jasonyeo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://technotroph.wordpress.com/?p=185</guid>
		<description><![CDATA[Yup! You can still contribute to Mozilla even if you prefer git over mercurial. Here are the repositories for various mozilla projects. mozilla-central comm-central rust-lang pdf.js<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotroph.wordpress.com&#038;blog=26324483&#038;post=185&#038;subd=technotroph&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><img class="alignnone" title="GitHub" src="http://upload.wikimedia.org/wikipedia/commons/b/b3/GitHub.svg" alt="GitHub" width="485" height="214" /><br />
Yup! You can still contribute to Mozilla even if you prefer git over mercurial. Here are the repositories for various mozilla projects.</p>
<ul>
<li><a title="mozilla-central" href="https://github.com/mozilla/mozilla-central">mozilla-central</a></li>
<li><a title="comm-central" href="https://github.com/protz/comm-central">comm-central</a></li>
<li><a title="rust-lang" href="https://github.com/mozilla/rust">rust-lang</a></li>
<li><a title="pdf.js" href="https://github.com/mozilla/pdf.js">pdf.js</a></li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/technotroph.wordpress.com/185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/technotroph.wordpress.com/185/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotroph.wordpress.com&#038;blog=26324483&#038;post=185&#038;subd=technotroph&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://technotroph.wordpress.com/2012/05/15/are-you-a-git-junkie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/df4e511ca1ecf66a86a231d7bc728d07?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jasonyeo</media:title>
		</media:content>

		<media:content url="http://upload.wikimedia.org/wikipedia/commons/b/b3/GitHub.svg" medium="image">
			<media:title type="html">GitHub</media:title>
		</media:content>
	</item>
		<item>
		<title>Memoize it, the Python way!</title>
		<link>http://technotroph.wordpress.com/2012/04/05/memoize-it-the-python-way/</link>
		<comments>http://technotroph.wordpress.com/2012/04/05/memoize-it-the-python-way/#comments</comments>
		<pubDate>Wed, 04 Apr 2012 20:34:55 +0000</pubDate>
		<dc:creator>jasonyeo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[algorithms]]></category>
		<category><![CDATA[fibonacci]]></category>
		<category><![CDATA[memoization]]></category>
		<category><![CDATA[pep318]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[recursion]]></category>

		<guid isPermaLink="false">http://technotroph.wordpress.com/?p=168</guid>
		<description><![CDATA[I am currently reading Python Algorithms by Magnus Hetland Lie. It&#8217;s an awesome book about coding algorithms in python. You should check it out. One of the things that I thought it was really interesting is the use of decorators when memoizing in python. In case you don&#8217;t know, memoization is the use of caches [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotroph.wordpress.com&#038;blog=26324483&#038;post=168&#038;subd=technotroph&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I am currently reading <a title="python algorithms" href="http://www.amazon.com/Python-Algorithms-Mastering-Language-Experts/dp/1430232374/ref=sr_1_sc_1?ie=UTF8&amp;qid=1333223443&amp;sr=8-1-spell" target="_blank">Python Algorithms</a> by <a title="Hetland" href="http://hetland.org" target="_blank">Magnus Hetland Lie</a>. It&#8217;s an awesome book about coding algorithms in python. You should check it out. One of the things that I thought it was really interesting is the use of decorators when memoizing in python.</p>
<p>In case you don&#8217;t know, memoization is the use of caches to retrieve previously computed values to reduce the time complexity of algorithms.</p>
<p>For example, this is the code for to compute the nth fibonacci number:</p>
<pre>def fib(n):
    if n == 1: return 1
    return fib(n-1) + fib(n-2)</pre>
<p>The running time for this piece of code is <a title="fib run time" href="http://stackoverflow.com/questions/360748/computational-complexity-of-fibonacci-sequence">exponential</a>. The memoized version of the function goes like this:</p>
<pre>f = [-1]*n
def pre_fib(n):
    f[0] = 1
    f[1] = 1
    fib(n)
def fib(n):
    if f[n] != -1: return f[n]
    return f[n-1] + f[n-2]</pre>
<p>This version of the fibonacci function is polynomial. The key lies in the use of the array to retrieve previously computed values instead of computing it again.</p>
<h3>Decorate Your Python</h3>
<p>In <a title="PEP 0318" href="www.python.org/dev/peps/pep-0318/" target="_blank">Python</a>, we can transform functions using <a title="Decorator" href="http://en.wikipedia.org/wiki/Decorator_pattern">decorators</a>. It is a design pattern that allows the programmer to add behavior to existing objects. To decorate our fibonacci function, we need to first define what behavior we want to add to the function. This is how we define the decorator:</p>
<pre>from functools import wraps

def memo(func):
    cache = {}
    @wraps(func)
    def wrap(*args):
        if args not in cache:
            cache[args] = func(*args)
        return cache[args]
    return wrap</pre>
<p>This piece of code simply wraps the function that we want to memoize and calls it if the value we are looking for is not in the cache. If it is in the cache, it simply returns the value from the cache. Here comes the beauty of using decorators to memoize the fibonacci function. IMO, it&#8217;s really elegant. See it for yourself:</p>
<pre>@memo
def fib(n):
    if n&lt;2: return 1
    return fib(n-1) + fib(n-2)</pre>
<p>That&#8217;s it! It&#8217;s really easy. Now simply call the fib function to see it in action!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/technotroph.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/technotroph.wordpress.com/168/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotroph.wordpress.com&#038;blog=26324483&#038;post=168&#038;subd=technotroph&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://technotroph.wordpress.com/2012/04/05/memoize-it-the-python-way/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/df4e511ca1ecf66a86a231d7bc728d07?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jasonyeo</media:title>
		</media:content>
	</item>
		<item>
		<title>The Best Developer Job Advertisement Ever?</title>
		<link>http://technotroph.wordpress.com/2012/04/02/the-best-developer-job-advertisement-ever/</link>
		<comments>http://technotroph.wordpress.com/2012/04/02/the-best-developer-job-advertisement-ever/#comments</comments>
		<pubDate>Mon, 02 Apr 2012 02:00:39 +0000</pubDate>
		<dc:creator>jasonyeo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[automattic]]></category>
		<category><![CDATA[hacker]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[jobs]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[response headers]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://technotroph.wordpress.com/?p=170</guid>
		<description><![CDATA[I stumbled upon this while working on my networking assignment. I made a http connection to my blog and this is what I saw in the http response headers: X-hacker: If you're reading this, you should vist automattic.com/jobs and apply to join the fun, mention this header. Cool huh.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotroph.wordpress.com&#038;blog=26324483&#038;post=170&#038;subd=technotroph&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I stumbled upon this while working on my networking assignment. I made a http connection to my <a href="http://technotroph.wordpress.com">blog</a> and this is what I saw in the http response headers:<br />
<code><br />
X-hacker: If you're reading this, you should vist automattic.com/jobs and apply to join the fun, mention this header.<br />
</code><br />
Cool huh.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/technotroph.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/technotroph.wordpress.com/170/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotroph.wordpress.com&#038;blog=26324483&#038;post=170&#038;subd=technotroph&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://technotroph.wordpress.com/2012/04/02/the-best-developer-job-advertisement-ever/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/df4e511ca1ecf66a86a231d7bc728d07?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jasonyeo</media:title>
		</media:content>
	</item>
		<item>
		<title>Python, The Lazy Mathematician&#8217;s Langauge</title>
		<link>http://technotroph.wordpress.com/2012/03/29/python-the-lazy-mathematicians-langauge/</link>
		<comments>http://technotroph.wordpress.com/2012/03/29/python-the-lazy-mathematicians-langauge/#comments</comments>
		<pubDate>Wed, 28 Mar 2012 17:31:47 +0000</pubDate>
		<dc:creator>jasonyeo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[algorithms]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[modulus]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://technotroph.wordpress.com/?p=166</guid>
		<description><![CDATA[I was supposed to compute a exponentiation modulo 10 table for my networking homework. The question went like this: Write a Exponentiation Modulo 10 table for 0 to 9. That is x = 0 to 9, y = 0 to 9 and the table values are x^y mod 10. After computing the first few values, [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotroph.wordpress.com&#038;blog=26324483&#038;post=166&#038;subd=technotroph&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I was supposed to compute a exponentiation modulo 10 table for my networking homework. The question went like this:</p>
<blockquote><p>Write a Exponentiation Modulo 10 table for 0 to 9. That is x = 0 to 9, y = 0 to 9 and the table values are x^y mod 10.</p></blockquote>
<p>After computing the first few values, I got tired and fired up my python shell to get the computer to compute for me. This was my code:</p>
<p><code><br />
&gt;&gt;&gt; for x in range(10):<br />
...     print [x**y % 10 for y in range(10)]<br />
</code></p>
<p>This is the output:</p>
<p><code><br />
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0]<br />
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1]<br />
[1, 2, 4, 8, 6, 2, 4, 8, 6, 2]<br />
[1, 3, 9, 7, 1, 3, 9, 7, 1, 3]<br />
[1, 4, 6, 4, 6, 4, 6, 4, 6, 4]<br />
[1, 5, 5, 5, 5, 5, 5, 5, 5, 5]<br />
[1, 6, 6, 6, 6, 6, 6, 6, 6, 6]<br />
[1, 7, 9, 3, 1, 7, 9, 3, 1, 7]<br />
[1, 8, 4, 2, 6, 8, 4, 2, 6, 8]<br />
[1, 9, 1, 9, 1, 9, 1, 9, 1, 9]<br />
</code></p>
<p>Not bad huh. I am pretty impressed that python can do it in just two lines of code.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/technotroph.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/technotroph.wordpress.com/166/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotroph.wordpress.com&#038;blog=26324483&#038;post=166&#038;subd=technotroph&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://technotroph.wordpress.com/2012/03/29/python-the-lazy-mathematicians-langauge/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/df4e511ca1ecf66a86a231d7bc728d07?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jasonyeo</media:title>
		</media:content>
	</item>
		<item>
		<title>I Wanna Flip Bits, Not Burgers!</title>
		<link>http://technotroph.wordpress.com/2012/03/24/i-wanna-flip-bits-not-burgers/</link>
		<comments>http://technotroph.wordpress.com/2012/03/24/i-wanna-flip-bits-not-burgers/#comments</comments>
		<pubDate>Fri, 23 Mar 2012 22:31:24 +0000</pubDate>
		<dc:creator>jasonyeo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[gsoc]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[sage]]></category>
		<category><![CDATA[thunderbird]]></category>

		<guid isPermaLink="false">http://technotroph.wordpress.com/?p=163</guid>
		<description><![CDATA[After talking to mentors throughout this week, I finally have two proposals for my GSoC application. I will be applying for SageMath and Thunderbird. The Matlab Alternative I&#8217;m really excited about contributing to Sage. It&#8217;s a open source alternative to popular proprietary products such as Matlab and Mathematica. What&#8217;s really cool about it is that [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotroph.wordpress.com&#038;blog=26324483&#038;post=163&#038;subd=technotroph&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>After talking to mentors throughout this week, I finally have two proposals for my <a title="soc" href="http://code.google.com/soc/" target="_blank">GSoC</a> application. I will be applying for <a title="SageMath" href="http://www.sagemath.org" target="_blank">SageMath</a> and Thunderbird.</p>
<h3>The Matlab Alternative</h3>
<p>I&#8217;m really excited about contributing to Sage. It&#8217;s a open source alternative to popular proprietary products such as Matlab and Mathematica. What&#8217;s really cool about it is that it&#8217;s in my favorite language, python! I will be working on improving the <a title="Sage Note Book" href="http://test.sagenb.org" target="_blank">SageNB</a> usability. See my a draft of my proposal <a title="My Sage GSoC Proposal" href="https://groups.google.com/forum/?fromgroups#!topic/sage-gsoc/QYvRI_5nSYQ" target="_blank">here</a>.</p>
<h3>Automate, automate, automate</h3>
<p>As for Thunderbird, I am going to work on their automated email ISP configuration manager. Specifically, I&#8217;m gonna work on the database. They call it the <a title="ispdb" href="http://ispdb.mozillamessaging.com/" target="_blank">ISPDB</a>. It&#8217;s a database that the ISP configuration manager queries for server configurations of email domains. The user simply have to supply their email address and the manager will query for the configuration (server address, port, protocol, etc) of the email domain. Currently, there&#8217;s no way for users to submit configurations to ISPDB directly, so that&#8217;s what I&#8217;m going to implement for this summer. Another feature that I&#8217;m gonna implement is to allow users to edit (or propose changes) to the configurations.</p>
<p>Things are kinda hazy now but I think things will get clearer soon as I talk to the mentors. Hope my proposals get approved. <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Update: The url for the svn code repo is at <a href="http://svn.mozilla.org/mozillamessaging.com/sites/ispdb.mozillamessaging.com/trunk/ispdb/">http://svn.mozilla.org/mozillamessaging.com/sites/ispdb.mozillamessaging.com/trunk/ispdb/</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/technotroph.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/technotroph.wordpress.com/163/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotroph.wordpress.com&#038;blog=26324483&#038;post=163&#038;subd=technotroph&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://technotroph.wordpress.com/2012/03/24/i-wanna-flip-bits-not-burgers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/df4e511ca1ecf66a86a231d7bc728d07?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jasonyeo</media:title>
		</media:content>
	</item>
	</channel>
</rss>
