<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
        <title>~traviscj/</title>
        <description>feed for traviscj.com/blog</description>
        <link>http://traviscj.com/blog</link>
        <lastBuildDate>Wed, 27 Mar 2013 00:50:38 +0000</lastBuildDate>
        <pubDate>Wed, 13 Mar 2013 00:00:00 +0000</pubDate>
        <item>
                <title>implementation of set operations</title>
                <description>&lt;div id="layout-content"&gt;

&lt;p&gt;We got in a bit of a debate yesterday in the office over the implementation of associative containers, which I thought was pretty fun.

We made up the big chart of complexity results you see below.&lt;/p&gt;

&lt;h3&gt;nomenclature:&lt;/h3&gt;

&lt;ul&gt;

&lt;li&gt;&lt;p&gt;&lt;img class="eq" src="eqs/10624031954-130.png" alt="S" style="vertical-align: -1px" /&gt;, &lt;img class="eq" src="eqs/1228887169310443136-130.png" alt="S_1" style="vertical-align: -3px" /&gt;, and &lt;img class="eq" src="eqs/1228887169310443133-130.png" alt="S_2" style="vertical-align: -3px" /&gt; are subsets of &lt;img class="eq" src="eqs/3287431136534085787-130.png" alt="Omega" style="vertical-align: -0px" /&gt;.&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Denote an element by &lt;img class="eq" src="eqs/1197946507659200153-130.png" alt="einOmega" style="vertical-align: -1px" /&gt;.&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;img class="eq" src="eqs/14080042351-130.png" alt="n" style="vertical-align: -1px" /&gt;,&lt;img class="eq" src="eqs/5261102140379497933-130.png" alt="n_1" style="vertical-align: -3px" /&gt;,&lt;img class="eq" src="eqs/5261102140379497934-130.png" alt="n_2" style="vertical-align: -3px" /&gt;,&lt;img class="eq" src="eqs/9984030031-130.png" alt="N" style="vertical-align: -0px" /&gt; are the sizes of the set &lt;img class="eq" src="eqs/10624031954-130.png" alt="S" style="vertical-align: -1px" /&gt;, &lt;img class="eq" src="eqs/1228887169310443136-130.png" alt="S_1" style="vertical-align: -3px" /&gt;, &lt;img class="eq" src="eqs/1228887169310443133-130.png" alt="S_2" style="vertical-align: -3px" /&gt;, and &lt;img class="eq" src="eqs/3287431136534085787-130.png" alt="Omega" style="vertical-align: -0px" /&gt;, respectively, and &lt;img class="eq" src="eqs/7945723588721286782-130.png" alt="n_1 geq n_2" style="vertical-align: -3px" /&gt;.&lt;/p&gt;

&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;Complexity&lt;/h3&gt;

&lt;table id="alg_set_implementations"&gt;

&lt;tr class="r1"&gt;&lt;td class="c1"&gt;OperationApproach			&lt;/td&gt;&lt;td class="c2"&gt; Hash Table &lt;/td&gt;&lt;td class="c3"&gt; 		Hash Tree &lt;/td&gt;&lt;td class="c4"&gt; Binary List  &lt;/td&gt;&lt;td class="c5"&gt; 	Entry List (sorted)      &lt;/td&gt;&lt;td class="c6"&gt;	Entry List (unsorted)    &lt;/td&gt;&lt;/tr&gt;

&lt;tr class="r2"&gt;&lt;td class="c1"&gt;&lt;img class="eq" src="eqs/5464518014159184586-130.png" alt="e in S		  " style="vertical-align: -1px" /&gt;     &lt;/td&gt;&lt;td class="c2"&gt;&lt;img class="eq" src="eqs/8470864826090420930-130.png" alt="O(1)   		" style="vertical-align: -5px" /&gt;&lt;/td&gt;&lt;td class="c3"&gt; &lt;img class="eq" src="eqs/5373691826820070132-130.png" alt="O(log(n))		" style="vertical-align: -5px" /&gt;   &lt;/td&gt;&lt;td class="c4"&gt; &lt;img class="eq" src="eqs/1320879405108595707-130.png" alt="O(1)			" style="vertical-align: -5px" /&gt;    &lt;/td&gt;&lt;td class="c5"&gt;&lt;img class="eq" src="eqs/5373691826820070132-130.png" alt="O(log(n))		" style="vertical-align: -5px" /&gt;   &lt;/td&gt;&lt;td class="c6"&gt;&lt;img class="eq" src="eqs/1596240660662622762-130.png" alt="O(n)			" style="vertical-align: -5px" /&gt; &lt;/td&gt;&lt;/tr&gt;

&lt;tr class="r3"&gt;&lt;td class="c1"&gt;&lt;img class="eq" src="eqs/4406923804746133357-130.png" alt="S_1 cup S_2    " style="vertical-align: -3px" /&gt;          &lt;/td&gt;&lt;td class="c2"&gt;&lt;img class="eq" src="eqs/2157339809494831364-130.png" alt="O(n_1+n_2)	" style="vertical-align: -5px" /&gt;&lt;/td&gt;&lt;td class="c3"&gt; &lt;img class="eq" src="eqs/2157339809494831364-130.png" alt="O(n_1+n_2)	" style="vertical-align: -5px" /&gt;       &lt;/td&gt;&lt;td class="c4"&gt; &lt;img class="eq" src="eqs/4856259640214513354-130.png" alt="O(N)			" style="vertical-align: -5px" /&gt;    &lt;/td&gt;&lt;td class="c5"&gt;&lt;img class="eq" src="eqs/2157339809494831364-130.png" alt="O(n_1+n_2)	" style="vertical-align: -5px" /&gt;       &lt;/td&gt;&lt;td class="c6"&gt;&lt;img class="eq" src="eqs/4042473919210210838-130.png" alt="O(n_1n_2)		" style="vertical-align: -5px" /&gt; &lt;/td&gt;&lt;/tr&gt;

&lt;tr class="r4"&gt;&lt;td class="c1"&gt;&lt;img class="eq" src="eqs/1098129240933513673-130.png" alt="S_1 cap S_2    " style="vertical-align: -3px" /&gt;          &lt;/td&gt;&lt;td class="c2"&gt;&lt;img class="eq" src="eqs/252883509434770480-130.png" alt="O(n_1)		" style="vertical-align: -5px" /&gt;&lt;/td&gt;&lt;td class="c3"&gt; &lt;img class="eq" src="eqs/7231717545583325144-130.png" alt="O(log(n_1)n_2)" style="vertical-align: -5px" /&gt;     &lt;/td&gt;&lt;td class="c4"&gt; &lt;img class="eq" src="eqs/4856259640214513354-130.png" alt="O(N)			" style="vertical-align: -5px" /&gt;    &lt;/td&gt;&lt;td class="c5"&gt;&lt;img class="eq" src="eqs/1252910509567770665-130.png" alt="O(n_2)		" style="vertical-align: -5px" /&gt;       &lt;/td&gt;&lt;td class="c6"&gt;&lt;img class="eq" src="eqs/4042473919210210838-130.png" alt="O(n_1n_2)		" style="vertical-align: -5px" /&gt; &lt;/td&gt;&lt;/tr&gt;

&lt;tr class="r5"&gt;&lt;td class="c1"&gt;space complexity            &lt;/td&gt;&lt;td class="c2"&gt;&lt;img class="eq" src="eqs/1596240660662622762-130.png" alt="O(n)			" style="vertical-align: -5px" /&gt;&lt;/td&gt;&lt;td class="c3"&gt; &lt;img class="eq" src="eqs/8888370160959002452-130.png" alt="O(n)          " style="vertical-align: -5px" /&gt;     &lt;/td&gt;&lt;td class="c4"&gt; &lt;img class="eq" src="eqs/3830867017015318162-130.png" alt="O(N)" style="vertical-align: -5px" /&gt; bits.       &lt;/td&gt;&lt;td class="c5"&gt;&lt;img class="eq" src="eqs/8888370160959002452-130.png" alt="O(n)          " style="vertical-align: -5px" /&gt;    &lt;/td&gt;&lt;td class="c6"&gt;&lt;img class="eq" src="eqs/8888370160959002452-130.png" alt="O(n)          " style="vertical-align: -5px" /&gt;

&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;As I said&amp;ndash;this was just what came out of my memory of an informal discussion, so I make no guarantees that any of it is correct.

Let me know if you spot something wrong!

We used the examples  &lt;img class="eq" src="eqs/7001977647496365764-130.png" alt="S_1 = {1,2,3,4,5}" style="vertical-align: -5px" /&gt; and &lt;img class="eq" src="eqs/6424349263334108066-130.png" alt="S_2 = {500000}" style="vertical-align: -5px" /&gt; to think through some things.&lt;/p&gt;

&lt;h3&gt;Details on Implementations&lt;/h3&gt;

&lt;h4&gt;Hash Table&lt;/h4&gt;

&lt;ul&gt;

&lt;li&gt;&lt;p&gt;Assumptions: hash collisions rare/table lookups constant time.&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;b&gt;contains&lt;/b&gt;:     hash the element &lt;img class="eq" src="eqs/12928038884-130.png" alt="e" style="vertical-align: -1px" /&gt;, table lookup, if 1 then in set.                                     &lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;b&gt;union&lt;/b&gt;:        create new table &lt;img class="eq" src="eqs/13312079976120142-130.png" alt="ht" style="vertical-align: -1px" /&gt;, set &lt;img class="eq" src="eqs/5948597068569472272-130.png" alt="ht[e]=1" style="vertical-align: -5px" /&gt; for all &lt;img class="eq" src="eqs/12928038884-130.png" alt="e" style="vertical-align: -1px" /&gt; in either set.&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;b&gt;intersection&lt;/b&gt;: create new table &lt;img class="eq" src="eqs/13312079976120142-130.png" alt="ht" style="vertical-align: -1px" /&gt;, then for each &lt;img class="eq" src="eqs/2703073543268554018-130.png" alt="ein S_2" style="vertical-align: -3px" /&gt;, if &lt;img class="eq" src="eqs/2703073543268554017-130.png" alt="ein S_1" style="vertical-align: -3px" /&gt; set &lt;img class="eq" src="eqs/1584722659171598536-130.png" alt="ht[e] = 1" style="vertical-align: -5px" /&gt;.  &lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;b&gt;space&lt;/b&gt;:        Actual space used and table lookup complexity is highly dependent on the hash function : &lt;img class="eq" src="eqs/5896517359383951476-130.png" alt="h(x)=x" style="vertical-align: -5px" /&gt; requires &lt;img class="eq" src="eqs/9984030031-130.png" alt="N" style="vertical-align: -0px" /&gt; bits for the table but collisions are impossible(identical to bitset); &lt;img class="eq" src="eqs/5896517359383951421-130.png" alt="h(x)=1" style="vertical-align: -5px" /&gt; requires only 1 bit for the table but necessitates a separate list of colliding elements(identical to sorted/unsorted list, depending on how collisions are handled.)&lt;/p&gt;

&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;Hash Tree&lt;/h4&gt;

&lt;ul&gt;

&lt;li&gt;&lt;p&gt;Assumptions: hash collisions rare/tree lookups logarithmic time(well balanced trees).&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;b&gt;contains&lt;/b&gt;:     hash elt, tree lookup, if 1 then in set.&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;b&gt;union&lt;/b&gt;:        must iterate over both sets (eg, tree traversal)&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;b&gt;intersection&lt;/b&gt;: lookup for each elt in n_2.&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;b&gt;space&lt;/b&gt;:        Each element requires storage, plus the overhead of the tree.&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Implementations details: To make average runtime more likely and depending on size of set, can use an AVL, Red Black, Splay, or B-Trees instead of simple binary search trees.&lt;/p&gt;

&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;Binary List (&lt;img class="eq" src="eqs/9196833176370112257-130.png" alt="l_e = {0,1}" style="vertical-align: -4px" /&gt;)&lt;/h4&gt;

&lt;ul&gt;

&lt;li&gt;&lt;p&gt;&lt;b&gt;contains&lt;/b&gt;:     access &lt;img class="eq" src="eqs/4508475340621848735-130.png" alt="e^{th}" style="vertical-align: -1px" /&gt; element of vector/bitset.               &lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;b&gt;union&lt;/b&gt;:        must iterate over all items which could be in the set.&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;b&gt;intersection&lt;/b&gt;: same.&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;b&gt;space&lt;/b&gt;:        Each element in the set &lt;img class="eq" src="eqs/3287431136534085787-130.png" alt="Omega" style="vertical-align: -0px" /&gt; requires one bit.&lt;/p&gt;

&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;Element List (&lt;img class="eq" src="eqs/66679011490178383-130.png" alt="l_i = e" style="vertical-align: -4px" /&gt;, sorted)&lt;/h4&gt;

&lt;ul&gt;

&lt;li&gt;&lt;p&gt;&lt;b&gt;contains&lt;/b&gt;:     binary search on list for &lt;img class="eq" src="eqs/12928038884-130.png" alt="e" style="vertical-align: -1px" /&gt;.                                                                &lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;b&gt;union&lt;/b&gt;:        pointer for each list, step until both point to end.                                          &lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;b&gt;intersection&lt;/b&gt;: pointer for each list, step the pointer indicating the smaller value until end of shorter list(the remaining elements in the longer list can not be in both lists.)&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;b&gt;space&lt;/b&gt;:        Each element in the set must be stored.&lt;/p&gt;

&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;Element List (&lt;img class="eq" src="eqs/66679011490178383-130.png" alt="l_i = e" style="vertical-align: -4px" /&gt;, unsorted)&lt;/h4&gt;

&lt;ul&gt;

&lt;li&gt;&lt;p&gt;&lt;b&gt;contains&lt;/b&gt;:     must iterate over entire list since elt could be anywhere.    &lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;b&gt;union&lt;/b&gt;:        for each elt of n_1, will iterate over half of n_2 on average &lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;b&gt;intersection&lt;/b&gt;: for each elt of n_1, will iterate over half of n_2 on average.&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;b&gt;space&lt;/b&gt;:        Each element in the set must be stored.&lt;/p&gt;

&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;Tree notes&lt;/h3&gt;

&lt;ul&gt;

&lt;li&gt;&lt;p&gt;B-Trees vs Red/Black vs AVL vs Splay:&lt;/p&gt;

&lt;ul&gt;

&lt;li&gt;&lt;p&gt;each try to minimize the &lt;b&gt;depth&lt;/b&gt; of a tree:&lt;/p&gt;

&lt;ul&gt;

&lt;li&gt;&lt;p&gt;B-Trees by breaking the &lt;img class="eq" src="eqs/7356025761343158802-130.png" alt="leq 2" style="vertical-align: -3px" /&gt; children per node and doing more comparisons at each level,&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;AVL/Splay trees by keeping the tree as balanced as possible.&lt;/p&gt;

&lt;/li&gt;&lt;/ul&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;B-Trees can get a performance edge from cache locality (good for disk reads, ENORMOUS amounts of data, etc)&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;AVL/RedBlack trees try to self-balance to minimize depth. &lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;AVL rebalances (an &lt;img class="eq" src="eqs/140383173717494808-130.png" alt="O(log n)" style="vertical-align: -5px" /&gt; operation) when a the heights of subtrees of a node differ by more than 1;&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;RedBlack trees rebalance (an &lt;img class="eq" src="eqs/3830867016890317865-130.png" alt="O(1)" style="vertical-align: -5px" /&gt; operation) when paths to leaves contain different numbers of black nodes.&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;AVL requires longest and shortest depth of tree to be within one(and has &lt;img class="eq" src="eqs/4127589913839313352-130.png" alt="O(log(n))" style="vertical-align: -5px" /&gt; work to rebalance) while RedBlack trees requires longest and shortest depth to be &amp;lt;=2 and has O(1) work to rebalance.&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Splay trees try to to 'splay&amp;rsquo; commonly accessed nodes to more shallow parts of the tree so that subsequent accesses require less tree traversal.&lt;/p&gt;

&lt;/li&gt;

&lt;/ul&gt;



&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;Practical Use&lt;/h3&gt;

&lt;p&gt;In closing, I wanted to point out a few ways these implementations come up in C++ and MATLAB.&lt;/p&gt;

&lt;p&gt;In C&lt;tt&gt;&lt;/tt&gt;, most of these options are supported. In particular:&lt;/p&gt;

&lt;ul&gt;

&lt;li&gt;&lt;p&gt;Hash tables are a typical implementation of &lt;a href="http://www.cplusplus.com/reference/unordered_set/unordered_set/"&gt;unordered_set&lt;/a&gt; &lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Hash trees are a typical implementation of &lt;a href="http://www.cplusplus.com/reference/set/set/"&gt;set&lt;/a&gt; (also see the example on &lt;a href="http://en.wikipedia.org/wiki/Unordered_associative_containers_(C%2B%2B)"&gt;wikipedia&lt;/a&gt;.)&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Binary lists have a space efficient implementation in &lt;a href="http://www.cplusplus.com/reference/bitset/bitset/"&gt;bitset&lt;/a&gt;&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Support for element-list style set specification is included in STL's &lt;a href="http://www.cplusplus.com/reference/algorithm/"&gt;algorithm&lt;/a&gt; function collection under &lt;a href="http://www.cplusplus.com/reference/algorithm/set_difference/"&gt;set_difference&lt;/a&gt;, &lt;a href="http://www.cplusplus.com/reference/algorithm/set_intersection/"&gt;set_intersection&lt;/a&gt;, &lt;a href="http://www.cplusplus.com/reference/algorithm/set_union/"&gt;set_union&lt;/a&gt;, and &lt;a href="http://www.cplusplus.com/reference/algorithm/find/"&gt;find&lt;/a&gt;.&lt;/p&gt;

&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;MATLAB does support list-style set operations via the &lt;b&gt;ismember&lt;/b&gt;, &lt;b&gt;union&lt;/b&gt;, and &lt;b&gt;intersect&lt;/b&gt; commands(as well as &lt;b&gt;setdiff&lt;/b&gt;):&lt;/p&gt;

&lt;div class="codeblock"&gt;

&lt;div class="blockcontent"&gt;&lt;pre&gt;

S1 = [3,2,1]			% declare list

ismember(1,S1)			% true

S2 = 2					% 1-elt lists are lists.

S3 = setdiff(S1,S2);	% remove elements of S2 from S1

S4 = union(S2,S3)		% recombine S2 and S3 (ie, S1)

S5 = union(S4,3)		% also works for elements.

S6 = intersection(S1,S2)% common elements

&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Interestingly, MATLAB returns sorted arrays regardless of whether they are sorted or not.&lt;/p&gt;

&lt;p&gt;Sets can also be manipulated in either the binary list or element list formats, because MATLAB supports indexing matrices by either a binary vector or a vector of indices.&lt;/p&gt;

&lt;div class="codeblock"&gt;

&lt;div class="blockcontent"&gt;&lt;pre&gt;

vec = 10:20;

oe1=mod(vec,2)==1		% logical array of odd elements

oe2=find(mod(vec,2)==1)	% index array of odd elements.

vec(oe1)				% slicing by logical

vec(oe2)				% slicing by index

&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;While researching this blog entry, I was also surprised to learn that MATLAB has support for maps. &lt;/p&gt;

&lt;div class="codeblock"&gt;

&lt;div class="blockcontent"&gt;&lt;pre&gt;

k={'Bid', 'Ask', 'Open', 'Close'};

v={10.10,10.15, 9.90, 9.95};

stock=containers.Map(k, v);

stock.keys

stock.values

stock.isKey('Close')

stock('Close')=3

stock('Close')

stock.remove('Close')

&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Pretty neat!&lt;/p&gt;

&lt;div id="footer"&gt;

&lt;div id="footer-text"&gt;

Page generated 2013-03-26 19:51:05 CDT, by &lt;a href="http://jemdoc.jaboc.net/"&gt;jemdoc&lt;/a&gt;.

&lt;/div&gt;

&lt;/div&gt;

&lt;/div&gt;
</description>
                <link>http://traviscj.com/blog/implementation_of_set_operations.html</link>
                <guid>implementation_of_set_operations</guid>
                <pubDate>Wed, 13 Mar 2013 00:00:00 +0000 </pubDate>
        </item>
	
        <item>
                <title>website basics</title>
                <description>&lt;div id="layout-content"&gt;

&lt;p&gt;Several of my classmates in graduate school are considering making websites around now, and have asked me to explain it.

I figured I'd explain the stack as I have it set up, and where you could make tradeoffs.

For now, I'm not going to include too many detail here; I just want to outline the possibilities and lingo so that researching options is a bit easier for the uninitiated.&lt;/p&gt;

&lt;p&gt;First off, many people are perfectly happy to use the school's email and department web space.

If you only want to have a list of relevant papers and soforth, then this is a fine approach.

See the very bottom of this post for a couple potential ideas for organizing it.&lt;/p&gt;

&lt;p&gt;An alternative to this is to buy a domain name, and doing a combination of email and web hosting with it.

A few other reasons you might consider this path:&lt;/p&gt;

&lt;ul&gt;

&lt;li&gt;&lt;p&gt;You want to build an internet brand.&lt;/p&gt;

&lt;ul&gt;

&lt;li&gt;&lt;p&gt;One particular perk here is an email address on your domain.&lt;/p&gt;

&lt;/li&gt;&lt;/ul&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;You want to develop web-based software&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;You want your web identity to be independent of where you currently work(something that can persist across multiple careers or institutions)&lt;/p&gt;

&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;All of these apply to me, so that's the route I went with. If you're on the fence, a few other things I use my server for include:&lt;/p&gt;

&lt;ul&gt;

&lt;li&gt;&lt;p&gt;Running python or C-based numerical experiments&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Running an OpenVPN to have consistent access to my desktop at home from anywhere with an internet connection&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;A &lt;a href="http://code.traviscj.com/"&gt;code&lt;/a&gt; repository to showcase projects I've been working on and also serve as a backup of my work&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;a private bittorrent tracker to transfer large files without tying up Dropbox space&lt;/p&gt;

&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Have I convinced you? Good! I want to cover some of the key ideas, and then we'll get into how my setup is cobbled together.

First, when you type in &amp;ldquo;traviscj.com&amp;rdquo; to your web browser, the first thing that happens is that a DNS server maps that domain name into an IP address.

The IP address is a unique locator for the machine serving the internet(be it email or, in this case, HTTP.)

It enables your computer to ask my server for a particular page.

Alternatively, when you email some email address @traviscj.com, your email client asks some DNS servers which server is responsible for emails at @traviscj.com.

The DNS server again returns an IP address that can be used, and your email client connects to it to send email there.

Therefore, our setup will need to include: buying a domain name from a registrar, setting up a DNS server for that domain, setting up a server to handle HTTP requests, and finally, setting up a server to deal with email.&lt;/p&gt;

&lt;p&gt;In my setup, I use &lt;a href="https://www.nearlyfreespeech.net/"&gt;NearlyFreeSpeech.NET&lt;/a&gt; as my registrar, &lt;a href="http://www.linode.com/?r=c27d1d7a54857a70aeabd415708138d47c21ab40"&gt;Linode&lt;/a&gt; for both their virtual private server and DNS hosting(through their very nice web interface, not a custom setup,) and &lt;a href="http://www.google.com/intl/en/enterprise/apps/business/"&gt;Google Apps&lt;/a&gt; for email and calendar. Domain registration typically runs about $10 per year, DNS/website hosting is around $20 per month, and Google Mail is around $50 per year.

Less expensive options for website hosting are available, but most impose some limit on flexibility. However, if you only need website hosting, it also greatly simplifies the procedure.

One economical option is to use NearlyFreeSpeech.NET as a domain registrar, DNS server and web/database server (as needed.)&lt;/p&gt;

&lt;p&gt;For a new VPS setup, the step is to secure your hosting.

Once you've activated it, you'll need to set up a Linux distribution on it and configure web servers and whatever else you need.

At least on Linode, this is a trivial matter of picking which distribution and having them load a disk image onto your node, then waiting for it to install(it's quick.)&lt;/p&gt;

&lt;p&gt;While that's finishing is a good time to set up Google Apps to get the email rolling.

The setup is straightforward, though I haven't done it since they abolished the 'Personal Apps&amp;rsquo; hosting.&lt;/p&gt;

&lt;p&gt;Once your setup has progressed to the point that the machine has an IP address listed and your mail setup is complete, it's a good time to purchase your domain name. 

You can do this sooner, but you might as well do the whole setup at once.

After purchasing the domain, you can point it to the IP address providing your hosting, and also add in any Google Apps mail info, as needed.&lt;/p&gt;

&lt;p&gt;Now comes the hard part&amp;ndash;waiting for the DNS info to propagate around the world so that other people can start seeing your website and email can be delivered.

While you wait is a good time to start adding some content to your website.

My two primary recommendations here are &lt;a href="http://jemdoc.jaboc.net/"&gt;jemdoc&lt;/a&gt; (for academics, particularly those whose webpages have a mathematical slant) and &lt;a href="http://wordpress.org/"&gt;wordpress&lt;/a&gt; (for everyone else.)

If you like the look and feel of jemdoc but wanted a more blog-style setup, one option is my own &lt;a href="https://github.com/traviscj/tcjblog"&gt;tcjblog&lt;/a&gt;.

If you like online, live editing of Wordpress are not interested in the blog styling, keep in mind that it is easy to create static pages as well.&lt;/p&gt;

&lt;p&gt;Now you're set!

Enjoy your online presence!&lt;/p&gt;

&lt;div id="footer"&gt;

&lt;div id="footer-text"&gt;

Page generated 2013-03-26 19:51:05 CDT, by &lt;a href="http://jemdoc.jaboc.net/"&gt;jemdoc&lt;/a&gt;.

&lt;/div&gt;

&lt;/div&gt;

&lt;/div&gt;
</description>
                <link>http://traviscj.com/blog/website_basics.html</link>
                <guid>website_basics</guid>
                <pubDate>Fri, 15 Feb 2013 00:00:00 +0000 </pubDate>
        </item>
	
        <item>
                <title>some tips for project euler problems</title>
                <description>&lt;div id="layout-content"&gt;

&lt;p&gt;I wanted to make a list of a few tips on solving &lt;a href="http://projecteuler.net"&gt;Project Euler&lt;/a&gt; problems that have been helpful for me while I solve them.

These are general principles, even though I do most of my Project Euler coding in Python.&lt;/p&gt;

&lt;p&gt;Without further ado:&lt;/p&gt;

&lt;ul&gt;

&lt;li&gt;&lt;p&gt;If the problem is asking for something concerning the number of digits, typically this indicates that the use of the &lt;img class="eq" src="eqs/1356017761457159114-130.png" alt="log n" style="vertical-align: -4px" /&gt; function is warranted.&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;If the problem is asking for the last few digits, modulo arithmetic might speed it up considerably.&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Some might consider this cheating, but looking up some small numbers in the &lt;a href="http://oeis.org/"&gt;Online Encyclopedia of Integer Sequences&lt;/a&gt; is occasionally pretty helpful.&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Many problems boil down to: Find numbers with property &lt;img class="eq" src="eqs/11264033881-130.png" alt="X" style="vertical-align: -0px" /&gt; and property &lt;img class="eq" src="eqs/11392034264-130.png" alt="Y" style="vertical-align: -0px" /&gt;. Two solutions are:&lt;/p&gt;

&lt;ul&gt;

&lt;li&gt;&lt;p&gt;Brute force: Try all numbers with tests of property &lt;img class="eq" src="eqs/11264033881-130.png" alt="X" style="vertical-align: -0px" /&gt; and &lt;img class="eq" src="eqs/11392034264-130.png" alt="Y" style="vertical-align: -0px" /&gt;.&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Find numbers with property &lt;img class="eq" src="eqs/11264033881-130.png" alt="X" style="vertical-align: -0px" /&gt; and filter by a test of property &lt;img class="eq" src="eqs/11392034264-130.png" alt="Y" style="vertical-align: -0px" /&gt;.&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Find numbers with property &lt;img class="eq" src="eqs/11392034264-130.png" alt="Y" style="vertical-align: -0px" /&gt; and filter by a test of property &lt;img class="eq" src="eqs/11264033881-130.png" alt="X" style="vertical-align: -0px" /&gt;.&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Find the set of numbers with property &lt;img class="eq" src="eqs/11264033881-130.png" alt="X" style="vertical-align: -0px" /&gt; and the set of numbers with property &lt;img class="eq" src="eqs/11392034264-130.png" alt="Y" style="vertical-align: -0px" /&gt;. Compute their intersection.&lt;/p&gt;

&lt;/li&gt;

&lt;/ul&gt;



&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;I've found that it's sometimes hard to predict which one will end up being the fastest.

It depends on the relative speed of the tests and the generators, and the frequency of finding numbers which have that property.&lt;/p&gt;

&lt;div id="footer"&gt;

&lt;div id="footer-text"&gt;

Page generated 2013-03-26 19:51:07 CDT, by &lt;a href="http://jemdoc.jaboc.net/"&gt;jemdoc&lt;/a&gt;.

&lt;/div&gt;

&lt;/div&gt;

&lt;/div&gt;
</description>
                <link>http://traviscj.com/blog/some_tips_for_project_euler_problems.html</link>
                <guid>some_tips_for_project_euler_problems</guid>
                <pubDate>Sat, 26 Jan 2013 00:00:00 +0000 </pubDate>
        </item>
	
        <item>
                <title>Some Recent Photography</title>
                <description>&lt;div id="layout-content"&gt;

&lt;p&gt;My girlfriend and I were out by the lake taking pictures recently. 

I was trying to get the Chicago skyline, but we really weren't in the right place for it. 

So instead I settled for taking some long exposure photos of stuff I found. &lt;/p&gt;

&lt;script src="http://traviscj.com/lightbox2/js/jquery-1.7.2.min.js"&gt;&lt;/script&gt;

&lt;script src="http://traviscj.com/lightbox2/js/lightbox.js"&gt;&lt;/script&gt;

&lt;link href="http://traviscj.com/lightbox2/css/lightbox.css" rel="stylesheet" /&gt;

&lt;a href="http://traviscj.com/pictures/lakefront/DSC_0015.jpg" rel="lightbox[lakefront]"&gt;&lt;img src="http://traviscj.com/pictures/lakefront/DSC_0015_thumb.jpg"&gt;&lt;/a&gt;

&lt;a href="http://traviscj.com/pictures/lakefront/DSC_0018.jpg" rel="lightbox[lakefront"&gt;&lt;img src="http://traviscj.com/pictures/lakefront/DSC_0018_thumb.jpg"&gt;&lt;/a&gt;

&lt;p&gt;I think they came out pretty good, especially because it was all a ruse to get her to the lakefront so that I could ask if she would marry me. 

She said yes!&lt;/p&gt;

&lt;div id="footer"&gt;

&lt;div id="footer-text"&gt;

Page generated 2013-03-26 19:51:07 CDT, by &lt;a href="http://jemdoc.jaboc.net/"&gt;jemdoc&lt;/a&gt;.

&lt;/div&gt;

&lt;/div&gt;

&lt;/div&gt;
</description>
                <link>http://traviscj.com/blog/some_recent_photography.html</link>
                <guid>some_recent_photography</guid>
                <pubDate>Sun, 16 Dec 2012 00:00:00 +0000 </pubDate>
        </item>
	
        <item>
                <title>Game of Life</title>
                <description>&lt;div id="layout-content"&gt;

&lt;p&gt;When I was a sophomore in high school, I was fascinated with

&lt;a href=""&gt;Conway's Game of Life&lt;/a&gt;.

I still am. I did a pretty rudamentary study of the kinds of patterns that could

form from the simple rules of the game.&lt;/p&gt;

&lt;p&gt;One thing that wasn't available when I was a sophomore was Youtube.

Two of my favorite Game of Life videos:&lt;/p&gt;

&lt;ul&gt;

&lt;li&gt;&lt;p&gt;&lt;a href="http://www.youtube.com/watch?v=xP5-iIeKXE8"&gt;lifeception&lt;/a&gt;&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href="http://www.youtube.com/watch?v=C2vgICfQawE"&gt;epic life&lt;/a&gt;&lt;/p&gt;

&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Another direction that Game of Life has gone recently is something that I really should have thought of, honestly.

Many times I've thought that there's at least some superficial relationship between Game of Life and diffusion equations.

Turns out that S. Rafler has extended Game of Life to continuous domains through what he calls &lt;a href="http://arxiv.org/abs/1111.1567"&gt;SmoothLife&lt;/a&gt;.&lt;/p&gt;

&lt;div id="footer"&gt;

&lt;div id="footer-text"&gt;

Page generated 2013-03-26 19:51:08 CDT, by &lt;a href="http://jemdoc.jaboc.net/"&gt;jemdoc&lt;/a&gt;.

&lt;/div&gt;

&lt;/div&gt;

&lt;/div&gt;
</description>
                <link>http://traviscj.com/blog/game_of_life.html</link>
                <guid>game_of_life</guid>
                <pubDate>Tue, 20 Nov 2012 00:00:00 +0000 </pubDate>
        </item>
	
        <item>
                <title>Perturbation Theory Problems with bvp4c</title>
                <description>&lt;div id="layout-content"&gt;

&lt;p&gt;I have been watching Nathan Kutz&amp;rsquo; lectures on Coursera. 

One change he made to the course since I took AMATH 581 at University of Washington was introducing the MATLAB function &lt;b&gt;bvp4c&lt;/b&gt;. 

I immediately realized that this would be nice for solving boundary layer problems that arise in asymptotics.&lt;/p&gt;

&lt;p&gt;Following my life philosophy of doing the dumbest thing that could possibly work, I tried implementing Nathan's code for a single-layer boundary layer problem from Holmes, Chapter 2:&lt;/p&gt;



&lt;div class="eqwl"&gt;&lt;img class="eqwl" src="eqs/1362288315453010922-130.png" alt=" begin{split} text{DE:} qquad &amp;amp; epsilon y'' + 2y' + 2y = 0 text{BC:} qquad &amp;amp; y(0)=0, quad y(1)=1 end{split} " /&gt;

&lt;br /&gt;&lt;/div&gt;&lt;p&gt;The code for this DE looks like:&lt;/p&gt;

&lt;div class="codeblock"&gt;

&lt;div class="blockcontent"&gt;&lt;pre&gt;

clear all; close all;clc

epsilonVec = [1,1e-1,1e-2];

BS={};

for i=1:length(epsilonVec);

	epsilon = epsilonVec(i);

	singular_rhs_anon=@(x,y) [y(2); (-2*y(2)-2*y(1))/epsilon];

	singular_bc_anon=@(yl,yr) [yl(1)-0; yr(1)-1];



	init = bvpinit(linspace(0,1,20), [0,0]);

	sol = bvp4c(singular_rhs_anon, ...

	            singular_bc_anon, init);

	x = linspace(0,1,1000);

	BS{i}=deval(sol, x);

end

plot(x,BS{1}(1,:),x,BS{2}(1,:),x,BS{3}(1,:));

legend('\epsilon=1','\epsilon=1e-1','\epsilon=1e-2');

&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Here, the rhs function works exactly like a standard ODE45 call(turn the second order DE into a system of first order DE; coefficient on &lt;img class="eq" src="eqs/7125508497151938304-130.png" alt="y''" style="vertical-align: -4px" /&gt; term should be 1). The bc function specifies the right and left bounds.

The guess given to bvpinit is critical, but it seems that &lt;img class="eq" src="eqs/6203092067392157416-130.png" alt="(0,0)" style="vertical-align: -5px" /&gt; worked okay here.

Also note that the granularity might need to be turned up for more difficult problems.

Finally, note the use of anonymous functions to define a function without a separate MATLAB .m file.&lt;/p&gt;

&lt;p&gt;This generates plots like the following:&lt;/p&gt;

&lt;table class="imgtable"&gt;&lt;tr&gt;&lt;td&gt;

&lt;img src="perturb_with_bvp4c.png" alt="Boundary Layer with BVP4c" /&gt;&amp;nbsp;&lt;/td&gt;

&lt;td align="left"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;This is a pretty slick way to solve boundary layer problems! &lt;/p&gt;

&lt;p&gt;There's a lot of existing stuff out there on this. A quick google search for 'perturbation problems with bvp4c&amp;rsquo; turned up:&lt;/p&gt;

&lt;ul&gt;

&lt;li&gt;&lt;p&gt;&lt;a href="http://www.tem.uoc.gr/~marina/BVP_tutorial.pdf"&gt;Solving Boundary Value Problems for ODE with bvp4c&lt;/a&gt;: A more careful description of everything above.&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;a href="http://www.cs.usask.ca/~spiteri/M314/notes/chapter3.pdf"&gt;Boundary Value Problems&lt;/a&gt;: a nice writeup about BVP in general, and also a lot of intuition for how it should work&lt;/p&gt;

&lt;/li&gt;

&lt;/ul&gt;

&lt;div id="footer"&gt;

&lt;div id="footer-text"&gt;

Page generated 2013-03-26 19:51:10 CDT, by &lt;a href="http://jemdoc.jaboc.net/"&gt;jemdoc&lt;/a&gt;.

&lt;/div&gt;

&lt;/div&gt;

&lt;/div&gt;
</description>
                <link>http://traviscj.com/blog/perturbation_theory_problems_with_bvp4c.html</link>
                <guid>perturbation_theory_problems_with_bvp4c</guid>
                <pubDate>Mon, 22 Oct 2012 00:00:00 +0000 </pubDate>
        </item>
	
        <item>
                <title>more stupid matlab tricks</title>
                <description>&lt;div id="layout-content"&gt;

&lt;p&gt;I've been setting up long-ish runs on my MATLAB instance lately, which is nice because I can wanter off to do something else. The trouble is that I occasionally forget to come back or refocus on work again.&lt;/p&gt;

&lt;p&gt;I've come up with two solutions to this:

* The first is to use growlnotify to pop up a persistant growl message. This works well enough as long as I'm at the computer:&lt;/p&gt;

&lt;div class="codeblock"&gt;

&lt;div class="blockcontent"&gt;&lt;pre&gt;

system('growlnotify -s -m "somefile is done"')

&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;* For more extended aways or if I'm going to take a nap while it runs, I might do something more like:&lt;/p&gt;

&lt;div class="codeblock"&gt;

&lt;div class="blockcontent"&gt;&lt;pre&gt;

system('echo "matlab: uflX_aw_constr_log_5_15 done" | msmtp -a traviscj (mycell)@txt.att.net')

&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You need some setup before this works: I did a &lt;b&gt;brew install msmtp&lt;/b&gt; and set up a .msmtprc file. After that, it should work goldenly, at least for AT&amp;T customers. Others might need to look up their email/sms gateway number.&lt;/p&gt;

&lt;div id="footer"&gt;

&lt;div id="footer-text"&gt;

Page generated 2013-03-26 19:51:10 CDT, by &lt;a href="http://jemdoc.jaboc.net/"&gt;jemdoc&lt;/a&gt;.

&lt;/div&gt;

&lt;/div&gt;

&lt;/div&gt;
</description>
                <link>http://traviscj.com/blog/more_stupid_matlab_tricks.html</link>
                <guid>more_stupid_matlab_tricks</guid>
                <pubDate>Fri, 28 Sep 2012 00:00:00 +0000 </pubDate>
        </item>
	
        <item>
                <title>debugging matlab mex</title>
                <description>&lt;div id="layout-content"&gt;

&lt;p&gt;One thing I've been doing a bit of lately is debugging MATLAB mex files; it seemed worth documenting.

The broad strokes:&lt;/p&gt;

&lt;ul&gt;

&lt;li&gt;&lt;p&gt;recompile all mex codes with &amp;rsquo;-g&amp;rsquo;&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;quit MATLAB&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;From a command prompt, run&lt;/p&gt;

&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="codeblock"&gt;

&lt;div class="blockcontent"&gt;&lt;pre&gt;

$ /Applications/MATLAB_R2012a.app/bin/matlab -Dgdb

[snip]

(gdb) run -nojvm

&amp;gt;&amp;gt; run_your_mex_file

&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This gives debugging output. If there is an error in the code, you're dropped back to a gdb prompt, where you can continue debugging in a semi-normal fashion.

Typically, I end up doing a 'where&amp;rsquo; to get a stack trace, and debug from there more-or-less like usual.&lt;/p&gt;

&lt;div id="footer"&gt;

&lt;div id="footer-text"&gt;

Page generated 2013-03-26 19:51:10 CDT, by &lt;a href="http://jemdoc.jaboc.net/"&gt;jemdoc&lt;/a&gt;.

&lt;/div&gt;

&lt;/div&gt;

&lt;/div&gt;
</description>
                <link>http://traviscj.com/blog/debugging_matlab_mex.html</link>
                <guid>debugging_matlab_mex</guid>
                <pubDate>Thu, 16 Aug 2012 00:00:00 +0000 </pubDate>
        </item>
	
        <item>
                <title>Meta post: How my blog works</title>
                <description>&lt;div id="layout-content"&gt;

&lt;p&gt;A while back, Sharvil requested a quick overview of how I post stuff to my blog, so I thought I'd post a rundown of it.&lt;/p&gt;

&lt;p&gt;At the base, I use a git repository to store files named entryNNNN.txt. Each has the basic format:&lt;/p&gt;

&lt;div class="codeblock"&gt;

&lt;div class="blockcontent"&gt;&lt;pre&gt;

title: Meta post: How my blog works

author: travis johnson

date: 2012/07/27

category: software

content:

A while back, Sharvil requested a quick overview of how I post stuff to my blog, so I thought I'd post a rundown of it.

At the base, I use a git repository to store files named entryNNNN.txt. Each has the basic format:

&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;To start a new post and fill in some of this, I have a script called 'newentry.sh&amp;rsquo;, which determines the latest entry number and adds one to get a new filename (eg, entry0081.txt).&lt;/p&gt;

&lt;ul&gt;

&lt;li&gt;&lt;p&gt;The title entry is blank by default&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;I am hardcoded as the author in the script. (Eventually, I'd like tcjblog to support multiple authors&amp;hellip; but it doesn't yet.)&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Category defaults to 'personal&amp;rsquo;, but I probably could have picked 'software&amp;rsquo;, instead.&lt;/p&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Content is empty. Everything after the 'content:&amp;rsquo; line is parsed as standard jemdoc.&lt;/p&gt;

&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;The first pass of my script loops over the entryNNNN.txt files and generates the 'by date&amp;rsquo; and 'by category&amp;rsquo; pages, along with the long index, in the form of .jemdoc files.

Then it calls jemdoc on each file to generate the .html files from the .jemdoc files.

Finally, the files are all copied to the server.

This is all managed by a makefile, so these steps amount to running 'make clean &amp;amp;&amp;amp; make blog &amp;amp;&amp;amp; make update.&amp;rsquo;

Of course, this is a bit of a pain too, so I added it as a post-commit hook in my git repository.

Therefore, after I make some updates, I just check them in, and the rest is automatic.&lt;/p&gt;

&lt;div id="footer"&gt;

&lt;div id="footer-text"&gt;

Page generated 2013-03-26 19:51:10 CDT, by &lt;a href="http://jemdoc.jaboc.net/"&gt;jemdoc&lt;/a&gt;.

&lt;/div&gt;

&lt;/div&gt;

&lt;/div&gt;
</description>
                <link>http://traviscj.com/blog/meta_post_how_my_blog_works.html</link>
                <guid>meta_post_how_my_blog_works</guid>
                <pubDate>Fri, 27 Jul 2012 00:00:00 +0000 </pubDate>
        </item>
	
        <item>
                <title>More cracking D-Link Files</title>
                <description>&lt;div id="layout-content"&gt;

&lt;p&gt;Somehow, in the process of a router reconfiguration, I reset the password without the new password getting saved into 1Password.

So I found myself locked out of my own router.

I was about to reset it, thinking, &amp;ldquo;Hey, at least I have a backup of the settings from 2 nights ago!&amp;rdquo; and then realized, &amp;ldquo;I bet that settings file has the password right in it.&amp;rdquo;&lt;/p&gt;

&lt;p&gt;Googling around a bit turned up &lt;a href="http://www.shulerent.com/2009/08/21/cracking-the-d-link-settings-file/"&gt;this guy&lt;/a&gt;, but he only wrote VBA and a Windows binary.

His pseudo-code looked pretty easy to translate into Python, so I did just that. Here's the result: &lt;a href="https://github.com/traviscj/decode_gws"&gt;D-Link DIR615 B2 v2.25 Decoder&lt;/a&gt; (no encoder, yet&amp;hellip;)&lt;/p&gt;

&lt;div id="footer"&gt;

&lt;div id="footer-text"&gt;

Page generated 2013-03-26 19:51:10 CDT, by &lt;a href="http://jemdoc.jaboc.net/"&gt;jemdoc&lt;/a&gt;.

&lt;/div&gt;

&lt;/div&gt;

&lt;/div&gt;
</description>
                <link>http://traviscj.com/blog/more_cracking_d-link_files.html</link>
                <guid>more_cracking_d-link_files</guid>
                <pubDate>Wed, 27 Jun 2012 00:00:00 +0000 </pubDate>
        </item>
	
</channel>
</rss>