<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Maurício Gardini - Blog</title><link href="/" rel="alternate"></link><link href="/feeds/blog.atom.xml" rel="self"></link><id>/</id><updated>2019-11-02T00:00:00-03:00</updated><entry><title>Sorting Algorithms Studies: Selection Sort</title><link href="/blog/sorting-algorithms-studies-selection-sort/" rel="alternate"></link><published>2019-11-02T00:00:00-03:00</published><updated>2019-11-02T00:00:00-03:00</updated><author><name>Maurício Gardini</name></author><id>tag:None,2019-11-02:/blog/sorting-algorithms-studies-selection-sort/</id><summary type="html">&lt;p&gt;After some hiatus, let&amp;#8217;s continue with the Sorting Algorithms Studies series.
Let&amp;#8217;s talk about &lt;strong&gt;Selection Sort&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;This algorithm showcases a very natural way to order things, one that …&lt;/p&gt;</summary><content type="html">&lt;p&gt;After some hiatus, let&amp;#8217;s continue with the Sorting Algorithms Studies series.
Let&amp;#8217;s talk about &lt;strong&gt;Selection Sort&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;This algorithm showcases a very natural way to order things, one that you
probably already used yourself: repeatedly finding the lowest value, and
putting it at the start of the&amp;nbsp;list.&lt;/p&gt;
&lt;div class="section" id="explanation"&gt;
&lt;h2&gt;Explanation&lt;/h2&gt;
&lt;p&gt;This algorithm works by, starting at the first element of the list, repeatedly
comparing the current value with the next value, searching for the lowest
value - or the highest, if the order is decrescent -, until the end of the
elements of the current iteration. When the inner loop ends, the value that
was identified as being the lowest - or the highest, if the order is
decrescent -, is placed at the start of the list. Having provided the
clarifications, from now on this article will focus on the crescent order
implementation. After the end of the last inner loop, the algorithm starts a
new inner loop, excluding the value that was just swapped, and repeats the
same procedure&amp;nbsp;above.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="structure"&gt;
&lt;h2&gt;Structure&lt;/h2&gt;
&lt;p&gt;It is comprised by two nested&amp;nbsp;loops:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;The &lt;strong&gt;outer one&lt;/strong&gt; loops amongst the numbers that comprise the range between
0 and the size of the array, minus 1. Example: if the array has size 5,
the outer loop will loop from 0 to 4. Let&amp;#8217;s call the number of the outer
loop &lt;tt class="docutils literal"&gt;x&lt;/tt&gt;.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;inner loop&lt;/strong&gt; is the one that actually makes the comparisons and swaps.
It loops amongst the numbers that comprise the range between 0 plus the
number of the outer loop (&lt;tt class="docutils literal"&gt;x&lt;/tt&gt;) and the length of the array, minus 1.
Example: if the array has size 5, the inner loop will loop from 0 to 4 on
the first outer loop, 1 to 4 in the second outer loop, and so on. Let&amp;#8217;s
call the number of the inner loop &lt;tt class="docutils literal"&gt;y&lt;/tt&gt;.&lt;/li&gt;
&lt;li&gt;For each &lt;tt class="docutils literal"&gt;y&lt;/tt&gt; in the inner loop, it &lt;strong&gt;compares&lt;/strong&gt; the element on the index
&lt;tt class="docutils literal"&gt;y&lt;/tt&gt; with the element on the index &lt;tt class="docutils literal"&gt;y + 1&lt;/tt&gt;, searching for the element
with the lowest value, placing its index in an auxiliary value. Let&amp;#8217;s call
it &lt;tt class="docutils literal"&gt;swap_index&lt;/tt&gt;.&lt;/li&gt;
&lt;li&gt;At the end of the inner loop, it swaps the element on the index &lt;tt class="docutils literal"&gt;x&lt;/tt&gt; with
the element in the index &lt;tt class="docutils literal"&gt;swap_index&lt;/tt&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Also, there is an Selection Sort implementation with a minor optimization.
Instead of just looking for the lowest value at each loop, it also looks for
the highest value, making two swaps per loop. And, as each loop progresses,
the range of elements to be compared by the next loop diminishes by&amp;nbsp;two.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="code"&gt;
&lt;h2&gt;Code&lt;/h2&gt;
&lt;p&gt;This is the implementation of Selection Sort in Python. It may look slighter
more complex than the usual Selection Sort implementation, but that&amp;#8217;s because
I&amp;#8217;ll to provide codes that work both for the crescent and decrescent&amp;nbsp;sorting.&lt;/p&gt;
&lt;p&gt;&lt;script src="https://gist.github.com/mauriciogardini/631299812e631eec455c4700d840d972.js"&gt;&lt;/script&gt;&lt;/p&gt;
&lt;p&gt;And this is the implementation of optimized Selection Sort in Python. Again, this
codes works both for the crescent and decrescent&amp;nbsp;sorting.&lt;/p&gt;
&lt;p&gt;&lt;script src="https://gist.github.com/mauriciogardini/8dd28c0cd46e5ee778be856fc27c00e6.js"&gt;&lt;/script&gt;&lt;/p&gt;
&lt;p&gt;Finally, &lt;a class="reference external" href="https://algorithm-visualizer.org/brute-force/selection-sort"&gt;here&amp;#8217;s&lt;/a&gt; the interactive algorithm
visualization, with step-by-step&amp;nbsp;execution.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="complexity"&gt;
&lt;h2&gt;Complexity&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Worst-case performance&lt;/strong&gt;:&amp;nbsp;O(n²)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Best-case performance&lt;/strong&gt;:&amp;nbsp;O(n²)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Average performance&lt;/strong&gt;:&amp;nbsp;O(n²)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Space complexity&lt;/strong&gt; &lt;sup id="fnref1:1"&gt;&lt;a href="#fn:1" rel="footnote"&gt;1&lt;/a&gt;&lt;/sup&gt;:&amp;nbsp;O(n)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Auxiliary space&lt;/strong&gt; &lt;sup id="fnref1:2"&gt;&lt;a href="#fn:2" rel="footnote"&gt;2&lt;/a&gt;&lt;/sup&gt;: O(1) for the normal
implementation; O(2) for the optimized implementation.
&lt;sup id="fnref1:3"&gt;&lt;a href="#fn:3" rel="footnote"&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="benchmark"&gt;
&lt;h2&gt;Benchmark&lt;/h2&gt;
&lt;p&gt;As the posts from the Sorting Algorithms Studies are posted, I&amp;#8217;ll benchmark
the algorithms against each other. For now, there&amp;#8217;s only Bubble Sort,
Insertion Sort and Selection Sort to be&amp;nbsp;shown.&lt;/p&gt;
&lt;table border="1" class="docutils"&gt;
&lt;colgroup&gt;
&lt;col width="57%" /&gt;
&lt;col width="43%" /&gt;
&lt;/colgroup&gt;
&lt;thead valign="bottom"&gt;
&lt;tr&gt;&lt;th class="head" colspan="2"&gt;Sorting 1000 different arrays with 1000 randomly sorted elements&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;th class="head"&gt;Algorithm&lt;/th&gt;
&lt;th class="head"&gt;Average Time Spent (seconds)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;&lt;td&gt;Selection Sort Optimized - Crescent&lt;/td&gt;
&lt;td&gt;0.0752946375&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Selection Sort Optimized - Decrescent&lt;/td&gt;
&lt;td&gt;0.0753254230&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Insertion Sort Optimized - Decrescent&lt;/td&gt;
&lt;td&gt;0.0754734700&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Selection Sort - Decrescent&lt;/td&gt;
&lt;td&gt;0.0768013875&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Selection Sort - Crescent&lt;/td&gt;
&lt;td&gt;0.0769227114&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Insertion Sort Optimized - Crescent&lt;/td&gt;
&lt;td&gt;0.0774509237&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Insertion Sort - Decrescent&lt;/td&gt;
&lt;td&gt;0.1340322953&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Insertion Sort - Crescent&lt;/td&gt;
&lt;td&gt;0.1360035590&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Bubble Sort - Decrescent&lt;/td&gt;
&lt;td&gt;0.1568078588&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Bubble Sort - Crescent&lt;/td&gt;
&lt;td&gt;0.1597317403&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Bubble Sort Optimized - Decrescent&lt;/td&gt;
&lt;td&gt;0.1602741867&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Bubble Sort Optimized - Crescent&lt;/td&gt;
&lt;td&gt;0.1618632810&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div class="line-block"&gt;
&lt;div class="line"&gt;&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;table border="1" class="docutils"&gt;
&lt;colgroup&gt;
&lt;col width="57%" /&gt;
&lt;col width="43%" /&gt;
&lt;/colgroup&gt;
&lt;thead valign="bottom"&gt;
&lt;tr&gt;&lt;th class="head" colspan="2"&gt;Sorting 1000 different arrays with 1000 elements in ascending order&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;th class="head"&gt;Algorithm&lt;/th&gt;
&lt;th class="head"&gt;Average Time Spent (seconds)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;&lt;td&gt;Bubble Sort Optimized - Crescent&lt;/td&gt;
&lt;td&gt;0.0002221006&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Insertion Sort - Crescent&lt;/td&gt;
&lt;td&gt;0.0003292135&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Insertion Sort Optimized - Crescent&lt;/td&gt;
&lt;td&gt;0.0003776510&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Selection Sort Optimized - Decrescent&lt;/td&gt;
&lt;td&gt;0.0864848356&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Selection Sort - Crescent&lt;/td&gt;
&lt;td&gt;0.0876183987&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Selection Sort - Decrescent&lt;/td&gt;
&lt;td&gt;0.0900442983&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Selection Sort Optimized - Crescent&lt;/td&gt;
&lt;td&gt;0.0924761386&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Bubble Sort - Crescent&lt;/td&gt;
&lt;td&gt;0.0998125052&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Insertion Sort Optimized - Decrescent&lt;/td&gt;
&lt;td&gt;0.1702091216&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Bubble Sort - Decrescent&lt;/td&gt;
&lt;td&gt;0.2626039418&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Bubble Sort Optimized - Decrescent&lt;/td&gt;
&lt;td&gt;0.2685824222&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Insertion Sort - Decrescent&lt;/td&gt;
&lt;td&gt;0.3066988004&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div class="line-block"&gt;
&lt;div class="line"&gt;&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;table border="1" class="docutils"&gt;
&lt;colgroup&gt;
&lt;col width="57%" /&gt;
&lt;col width="43%" /&gt;
&lt;/colgroup&gt;
&lt;thead valign="bottom"&gt;
&lt;tr&gt;&lt;th class="head" colspan="2"&gt;Sorting 1000 different arrays with 1000 elements in descending order&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;th class="head"&gt;Algorithm&lt;/th&gt;
&lt;th class="head"&gt;Average Time Spent (seconds)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;&lt;td&gt;Bubble Sort Optimized - Decrescent&lt;/td&gt;
&lt;td&gt;0.0001869991&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Insertion Sort - Decrescent&lt;/td&gt;
&lt;td&gt;0.0002643334&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Insertion Sort Optimized - Decrescent&lt;/td&gt;
&lt;td&gt;0.0004072941&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Selection Sort - Decrescent&lt;/td&gt;
&lt;td&gt;0.0790777007&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Selection Sort Optimized - Crescent&lt;/td&gt;
&lt;td&gt;0.0794137814&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Selection Sort - Crescent&lt;/td&gt;
&lt;td&gt;0.0829683988&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Selection Sort Optimized - Decrescent&lt;/td&gt;
&lt;td&gt;0.0836715313&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Bubble Sort - Decrescent&lt;/td&gt;
&lt;td&gt;0.0884681934&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Insertion Sort Optimized - Crescent&lt;/td&gt;
&lt;td&gt;0.1560818879&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Bubble Sort - Crescent&lt;/td&gt;
&lt;td&gt;0.2418319963&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Bubble Sort Optimized - Crescent&lt;/td&gt;
&lt;td&gt;0.2456611876&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Insertion Sort - Crescent&lt;/td&gt;
&lt;td&gt;0.2854158659&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class="section" id="wrapping-up"&gt;
&lt;h2&gt;Wrapping&amp;nbsp;Up&lt;/h2&gt;
&lt;p&gt;Selection Sort is another of those simple algorithm that we use more often
than we realize. As the Bubble and Insertion Sort, it doesn&amp;#8217;t performs well,
but it may be enough for some scenarios, like when you have really small&amp;nbsp;lists.&lt;/p&gt;
&lt;p&gt;Stay tuned for the next chapters of this&amp;nbsp;series!&lt;/p&gt;
&lt;/div&gt;
</content><category term="Blog"></category><category term="Sorting Algorithms"></category><category term="Studies"></category><category term="Selection Sort"></category><category term="Python"></category></entry><entry><title>Sorting Algorithms Studies: Insertion Sort</title><link href="/blog/sorting-algorithms-studies-insertion-sort/" rel="alternate"></link><published>2019-10-01T00:00:00-03:00</published><updated>2019-10-01T00:00:00-03:00</updated><author><name>Maurício Gardini</name></author><id>tag:None,2019-10-01:/blog/sorting-algorithms-studies-insertion-sort/</id><summary type="html">&lt;p&gt;Continuing the Sorting Algorithms Studies series, let&amp;#8217;s talk about &lt;strong&gt;Insertion Sort&lt;/strong&gt;.
Basically, this algorithm takes inspiration from the way that you would
normally sort a hand of shuffled&amp;nbsp;cards …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Continuing the Sorting Algorithms Studies series, let&amp;#8217;s talk about &lt;strong&gt;Insertion Sort&lt;/strong&gt;.
Basically, this algorithm takes inspiration from the way that you would
normally sort a hand of shuffled&amp;nbsp;cards.&lt;/p&gt;
&lt;div class="section" id="explanation"&gt;
&lt;h2&gt;Explanation&lt;/h2&gt;
&lt;p&gt;This algorithm works by, starting at the second element of the list, repeatedly
comparing the current value with the previous value, and swapping them if the
previous value is higher than the current value; or, if the sorting is being
done in decrescent order, if the previous value is lower than the current value.
Having provided the clarifications, from now on this article will focus on the
crescent order&amp;nbsp;implementation.&lt;/p&gt;
&lt;p&gt;Besides doing that with the previous element, if there was a swap, before going
ahead and making the comparisons amongst the next elements, it goes retroactively,
verifying if the swapped element is in the right place. If it isn&amp;#8217;t, continues
swapping it with the previous elements until it is. After that, the algorithm
resumes the comparisons with the next&amp;nbsp;elements.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="structure"&gt;
&lt;h2&gt;Structure&lt;/h2&gt;
&lt;p&gt;It is comprised by two nested&amp;nbsp;loops:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;The &lt;strong&gt;outer one&lt;/strong&gt; loops amongst the numbers that comprise the range between
1 and the size of the array, minus 1. Example: if the array has size 5,
the outer loop will loop from 1 to 4. Let&amp;#8217;s call the number of the outer
loop &lt;tt class="docutils literal"&gt;x&lt;/tt&gt;.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;inner loop&lt;/strong&gt; is the one that actually makes the comparisons and swaps.
It loops amongst the numbers that comprise the range between &lt;tt class="docutils literal"&gt;x&lt;/tt&gt; and 0,
not including zero itself. Let&amp;#8217;s call the number of the inner loop &lt;tt class="docutils literal"&gt;y&lt;/tt&gt;.
But, although the loop is comprised by these values, an inner loop iteration
will only be executed if the element in the &lt;tt class="docutils literal"&gt;y&lt;/tt&gt; index is lower than the
element in the &lt;tt class="docutils literal"&gt;y - 1&lt;/tt&gt; index. Example: if the array has size 5, the inner
loop will loop from 2 to 0 on the first outer loop, 3 to 0 in the second outer
loop, and so on, always checking the condition stated&amp;nbsp;above.&lt;/li&gt;
&lt;li&gt;For each &lt;tt class="docutils literal"&gt;y&lt;/tt&gt; in the inner loop, as the condition above was already checked
as a requirement for the loop iteration to be valid, all that is left is to
swap the element in the index &lt;tt class="docutils literal"&gt;y&lt;/tt&gt; with the one in the index &lt;tt class="docutils literal"&gt;y - 1&lt;/tt&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Also, there is an Insertion Sort implementation with a minor optimization.
Instead of continuously swapping elements, for each outer loop, it stores the
value of the element in the &lt;tt class="docutils literal"&gt;x&lt;/tt&gt; index in an auxiliary variable. Then, it
keeps assigning the value in the index &lt;tt class="docutils literal"&gt;y&lt;/tt&gt; to the &lt;tt class="docutils literal"&gt;y + 1&lt;/tt&gt; index as long
as &lt;tt class="docutils literal"&gt;y&lt;/tt&gt; is bigger or equal to zero and the value in the index &lt;tt class="docutils literal"&gt;y&lt;/tt&gt; is
greater than the value in the auxiliary variable. Finally, when the inner
loop is finished, the auxiliary variable value is assigned to the &lt;tt class="docutils literal"&gt;y + 1&lt;/tt&gt;
index.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="code"&gt;
&lt;h2&gt;Code&lt;/h2&gt;
&lt;p&gt;This is the implementation of Insertion Sort in Python. It may look slighter
more complex than the usual Insertion Sort implementation, but that&amp;#8217;s because
I&amp;#8217;ll to provide codes that work both for the crescent and decrescent&amp;nbsp;sorting.&lt;/p&gt;
&lt;p&gt;&lt;script src="https://gist.github.com/mauriciogardini/8786f1079e785b227aef79eac0c9aa4d.js"&gt;&lt;/script&gt;&lt;/p&gt;
&lt;p&gt;And this is the implementation of optimized Insertion Sort in Python. Again, this
codes works both for the crescent and decrescent&amp;nbsp;sorting.&lt;/p&gt;
&lt;p&gt;&lt;script src="https://gist.github.com/mauriciogardini/e0e9b751bdf90e8f415062e8a81fdbc1.js"&gt;&lt;/script&gt;&lt;/p&gt;
&lt;p&gt;Finally, &lt;a class="reference external" href="https://algorithm-visualizer.org/brute-force/insertion-sort"&gt;here&amp;#8217;s&lt;/a&gt; the interactive algorithm
visualization, with step-by-step&amp;nbsp;execution.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="complexity"&gt;
&lt;h2&gt;Complexity&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Worst-case performance&lt;/strong&gt;:&amp;nbsp;O(n²)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Best-case performance&lt;/strong&gt;:&amp;nbsp;O(n)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Average performance&lt;/strong&gt;:&amp;nbsp;O(n²)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Space complexity&lt;/strong&gt; &lt;sup id="fnref1:1"&gt;&lt;a href="#fn:1" rel="footnote"&gt;1&lt;/a&gt;&lt;/sup&gt;:&amp;nbsp;O(n)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Auxiliary space&lt;/strong&gt; &lt;sup id="fnref1:2"&gt;&lt;a href="#fn:2" rel="footnote"&gt;2&lt;/a&gt;&lt;/sup&gt;: O(2) for the normal
implementation; O(2) for the optimized implementation.
&lt;sup id="fnref1:3"&gt;&lt;a href="#fn:3" rel="footnote"&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="benchmark"&gt;
&lt;h2&gt;Benchmark&lt;/h2&gt;
&lt;p&gt;As the posts from the Sorting Algorithms Studies are posted, I&amp;#8217;ll benchmark
the algorithms against each other. For now, there&amp;#8217;s only Bubble Sort and
Insertion Sort to be&amp;nbsp;shown.&lt;/p&gt;
&lt;table border="1" class="docutils"&gt;
&lt;colgroup&gt;
&lt;col width="53%" /&gt;
&lt;col width="24%" /&gt;
&lt;col width="24%" /&gt;
&lt;/colgroup&gt;
&lt;thead valign="bottom"&gt;
&lt;tr&gt;&lt;th class="head" colspan="3"&gt;Sorting 1000 different arrays with 1000 randomly sorted elements&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;th class="head" rowspan="2"&gt;Algorithm&lt;/th&gt;
&lt;th class="head" colspan="2"&gt;Average Time Spent (seconds)&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;th class="head"&gt;Crescent&lt;/th&gt;
&lt;th class="head"&gt;Decrescent&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;&lt;td&gt;Insertion Sort Optimized&lt;/td&gt;
&lt;td&gt;0.0753&lt;/td&gt;
&lt;td&gt;0.0736&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Insertion Sort&lt;/td&gt;
&lt;td&gt;0.1372&lt;/td&gt;
&lt;td&gt;0.1312&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Bubble Sort&lt;/td&gt;
&lt;td&gt;0.1582&lt;/td&gt;
&lt;td&gt;0.1544&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Bubble Sort Optimized&lt;/td&gt;
&lt;td&gt;0.1596&lt;/td&gt;
&lt;td&gt;0.1566&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div class="line-block"&gt;
&lt;div class="line"&gt;&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;table border="1" class="docutils"&gt;
&lt;colgroup&gt;
&lt;col width="53%" /&gt;
&lt;col width="24%" /&gt;
&lt;col width="24%" /&gt;
&lt;/colgroup&gt;
&lt;thead valign="bottom"&gt;
&lt;tr&gt;&lt;th class="head" colspan="3"&gt;Sorting 1000 different arrays with 1000 elements in ascending order&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;th class="head" rowspan="2"&gt;Algorithm&lt;/th&gt;
&lt;th class="head" colspan="2"&gt;Average Time Spent (seconds)&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;th class="head"&gt;Crescent&lt;/th&gt;
&lt;th class="head"&gt;Decrescent&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;&lt;td&gt;Bubble Sort Optimized&lt;/td&gt;
&lt;td&gt;0.0001&lt;/td&gt;
&lt;td&gt;0.2260&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Insertion Sort&lt;/td&gt;
&lt;td&gt;0.0002&lt;/td&gt;
&lt;td&gt;0.2700&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Insertion Sort Optimized&lt;/td&gt;
&lt;td&gt;0.0003&lt;/td&gt;
&lt;td&gt;0.1450&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Bubble Sort&lt;/td&gt;
&lt;td&gt;0.0839&lt;/td&gt;
&lt;td&gt;0.2211&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div class="line-block"&gt;
&lt;div class="line"&gt;&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;table border="1" class="docutils"&gt;
&lt;colgroup&gt;
&lt;col width="53%" /&gt;
&lt;col width="24%" /&gt;
&lt;col width="24%" /&gt;
&lt;/colgroup&gt;
&lt;thead valign="bottom"&gt;
&lt;tr&gt;&lt;th class="head" colspan="3"&gt;Sorting 1000 different arrays with 1000 elements in descending order&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;th class="head" rowspan="2"&gt;Algorithm&lt;/th&gt;
&lt;th class="head" colspan="2"&gt;Average Time Spent (seconds)&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;th class="head"&gt;Crescent&lt;/th&gt;
&lt;th class="head"&gt;Decrescent&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;&lt;td&gt;Bubble Sort Optimized&lt;/td&gt;
&lt;td&gt;0.2533&lt;/td&gt;
&lt;td&gt;0.0002&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Insertion Sort&lt;/td&gt;
&lt;td&gt;0.2929&lt;/td&gt;
&lt;td&gt;0.0002&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Insertion Sort Optimized&lt;/td&gt;
&lt;td&gt;0.1607&lt;/td&gt;
&lt;td&gt;0.0003&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Bubble Sort&lt;/td&gt;
&lt;td&gt;0.2491&lt;/td&gt;
&lt;td&gt;0.0919&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class="section" id="wrapping-up"&gt;
&lt;h2&gt;Wrapping&amp;nbsp;Up&lt;/h2&gt;
&lt;p&gt;Insertion Sort is a simple algorithm, one that we use daily more than we
realize. As the Bubble Sort, it doesn&amp;#8217;t performs well, but it may be enough
for some scenarios, like when you have really small&amp;nbsp;lists.&lt;/p&gt;
&lt;p&gt;Stay tuned for the next chapters of this&amp;nbsp;series!&lt;/p&gt;
&lt;/div&gt;
</content><category term="Blog"></category><category term="Sorting Algorithms"></category><category term="Studies"></category><category term="Insertion Sort"></category><category term="Python"></category></entry><entry><title>White Noise</title><link href="/blog/white-noise/" rel="alternate"></link><published>2019-08-26T00:00:00-03:00</published><updated>2019-08-26T00:00:00-03:00</updated><author><name>Maurício Gardini</name></author><id>tag:None,2019-08-26:/blog/white-noise/</id><summary type="html">&lt;p&gt;When it&amp;#8217;s time to sleep, random noises bother me a lot. And, although I&amp;#8217;m a
very noise aware person, some of my neighbors&amp;nbsp;aren&amp;#8217;t.&lt;/p&gt;
&lt;p&gt;There are the …&lt;/p&gt;</summary><content type="html">&lt;p&gt;When it&amp;#8217;s time to sleep, random noises bother me a lot. And, although I&amp;#8217;m a
very noise aware person, some of my neighbors&amp;nbsp;aren&amp;#8217;t.&lt;/p&gt;
&lt;p&gt;There are the neighbors&amp;#8217; parties that go beyond the allowed times, and
talking to them about this isn&amp;#8217;t very&amp;nbsp;fruitful.&lt;/p&gt;
&lt;p&gt;There are also neighbors which have their TVs in a volume that is too loud,
and my current apartment doesn&amp;#8217;t have any&amp;nbsp;soundproofing.&lt;/p&gt;
&lt;p&gt;Finally, there are the random night noises: traffic, sirens, revving cars
and motorcycles, barking dogs&amp;#8230; Well, you got&amp;nbsp;it.&lt;/p&gt;
&lt;p&gt;As most of these things are not in my control (and I gave up on talking with
my neighbors, because this was being more stressful than fruitful), I had to
try some ways of fighting this. And, for quite some time, I&amp;#8217;ve been trying
something that it&amp;#8217;s really effective (at least for now): White&amp;nbsp;Noise.&lt;/p&gt;
&lt;div class="section" id="what-is-this"&gt;
&lt;h2&gt;What is&amp;nbsp;this?&lt;/h2&gt;
&lt;p&gt;Technically, white noise is an audio signal that has the same intensity at
different frequencies. Its name is an analogy from white light, which contains
all the frequencies combined together. An example of white noise is the static
that comes when you try to tune a radio, but it is&amp;nbsp;nonexistent.&lt;/p&gt;
&lt;div class="figure"&gt;
&lt;img alt="White noise image" src="/images/blog/white-noise/white-noise-white-noise.jpg" /&gt;
&lt;p class="caption"&gt;White noise&amp;nbsp;image.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Other than that, white noise is also used colloquially to describe constant
background noises. The most common examples are rain, sea and fireplace, but
there&amp;#8217;s also people that find washing machine and air conditioning noises
appealing as white&amp;nbsp;noises.&lt;/p&gt;
&lt;p&gt;Basically, as it contains all frequencies, the white noise masks other noises.
And, added to the fact that white noise is a constant sound, there is no
unpredictability, which raises less awareness, diminishing the risk of&amp;nbsp;disturbing.&lt;/p&gt;
&lt;p&gt;When I started thinking about this, I can see that I had previous experience
with this kind of thing, and it had kind of a nostalgic factor: back when
I still lived with my parents, their house had asbestos roof (yeah, I know
that asbestos isn&amp;#8217;t a good thing nowadays, but these were older times), and
when it rained, it resulted in a constant noise that blocked pretty much any
other sounds that existed. This even made it hard to watch &lt;span class="caps"&gt;TV&lt;/span&gt; in times
when there was heavy rain. Little that I know that I already was being
benefited by some kind of white&amp;nbsp;noise.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="how-i-use-it"&gt;
&lt;h2&gt;How I use&amp;nbsp;it&lt;/h2&gt;
&lt;p&gt;What I do is that, when I lie in my bed, I put my earphones, turn on my white
noise app, rest my head in my pillow and close my&amp;nbsp;eyes.&lt;/p&gt;
&lt;p&gt;My perception is of a linear noise that fills my hearing and inhibits me from
hearing pretty much anything else, allowing me to relax&amp;nbsp;faster.&lt;/p&gt;
&lt;p&gt;As for the app, the one that I&amp;#8217;m currently using is &lt;a class="reference external" href="https://apps.apple.com/us/app/mynoise/id813099896"&gt;MyNoise&lt;/a&gt;.
It has many kind of noises, and there are some of them than need to be bought.
You can also customize each of the noises, removing or lowering certain
frequencies that may be bothering your&amp;nbsp;experience.&lt;/p&gt;
&lt;div class="figure"&gt;
&lt;img alt="MyNoise app" class="phone-picture" src="/images/blog/white-noise/white-noise-mynoise-app.jpg" /&gt;
&lt;p class="caption"&gt;MyNoise&amp;nbsp;app.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;I currently only use the White Noise &lt;span class="amp"&gt;&amp;amp;&lt;/span&gt; Co. noise.  Based on my previous
experiences and memories, it would make more sense that I used the Rain Noise,
but I don&amp;#8217;t think that the rain noise that&amp;#8217;s on the app looks like the
real rain noise that I&amp;#8217;m used to. For me, it reminds me of a stream, a river.
In fact, that&amp;#8217;s one of the reasons for me to use the White Noise &lt;span class="amp"&gt;&amp;amp;&lt;/span&gt; Co. noise:
because, for me, it kinda sounds like a heavy&amp;nbsp;rain.&lt;/p&gt;
&lt;p&gt;MyNoise also has &lt;a class="reference external" href="https://apps.apple.com/us/app/mynoise/id813099896"&gt;a website&lt;/a&gt;, which can be an alternative
if you don&amp;#8217;t want to download an app. I used it so much that I had to
&lt;a class="reference external" href="https://mynoise.net/donate.php"&gt;donate&lt;/a&gt; to it. It&amp;#8217;s a cause that it&amp;#8217;s worth&amp;nbsp;supporting!&lt;/p&gt;
&lt;div class="figure"&gt;
&lt;img alt="MyNoise site" src="/images/blog/white-noise/white-noise-mynoise-site.jpg" /&gt;
&lt;p class="caption"&gt;MyNoise&amp;nbsp;site.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;It&amp;#8217;s worth noting that there are tons of white noise apps and websites. I just
mentioned MyNoise&amp;#8217;s app and site because this is what I actually&amp;nbsp;use.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="other-uses"&gt;
&lt;h2&gt;Other&amp;nbsp;Uses&lt;/h2&gt;
&lt;p&gt;I sometimes find it hard to concentrate to read a book, even more if it is in
a foreign language. And, for that, white noise also comes to rescue. At first,
it may seem annoying, but once you get into the flow, it helps a&amp;nbsp;lot.&lt;/p&gt;
&lt;p&gt;Also, when I&amp;#8217;m studying at home, it can be a noisy place sometimes. When you
really need to be focused on something, any distraction bothers a lot. And
white noise can help a little too.  Of course, I can&amp;#8217;t play it on a really
high volume, because I need to be aware of my surroundings (phone, doorbell),
but it&amp;nbsp;helps.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="have-a-try-maybe"&gt;
&lt;h2&gt;Have a try,&amp;nbsp;maybe?&lt;/h2&gt;
&lt;p&gt;If you are enduring some of the problems mentioned here, maybe have a try on
white noise. It may sound weird at first, but if it &amp;#8220;makes the click&amp;#8221; for you,
you&amp;#8217;ll see how beneficial it can&amp;nbsp;be.&lt;/p&gt;
&lt;/div&gt;
</content><category term="Blog"></category><category term="White Noise"></category></entry><entry><title>Sorting Algorithms Studies: Bubble Sort</title><link href="/blog/sorting-algorithms-studies-bubble-sort/" rel="alternate"></link><published>2019-08-20T00:00:00-03:00</published><updated>2019-08-20T00:00:00-03:00</updated><author><name>Maurício Gardini</name></author><id>tag:None,2019-08-20:/blog/sorting-algorithms-studies-bubble-sort/</id><summary type="html">&lt;p&gt;Lately, I decided to revise on some subjects that I studied a long time ago.
One of these subjects is sorting algorithms. And, by studying it, I thought
that creating …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Lately, I decided to revise on some subjects that I studied a long time ago.
One of these subjects is sorting algorithms. And, by studying it, I thought
that creating a material explaining these algorithms could be helpful. Yeah,
it&amp;#8217;s one more person talking about this, but different people have different
visions, and looking through other perspectives is always a good&amp;nbsp;thing.&lt;/p&gt;
&lt;p&gt;The first article on this subject will be about the first sorting algorithm
that people learn, usually: &lt;strong&gt;Bubble Sort&lt;/strong&gt;.&lt;/p&gt;
&lt;div class="section" id="explanation"&gt;
&lt;h2&gt;Explanation&lt;/h2&gt;
&lt;p&gt;This algorithm works by repeatedly comparing the current value with the next
value, and swapping them if the next value is lower than the current value;
or, if the sorting is being done in decrescent order, if the next value is
higher than the current value. Having provided the clarifications, from now
on this article will focus on the crescent order&amp;nbsp;implementation.&lt;/p&gt;
&lt;p&gt;Some say that the name comes from the fact that, as it happens with the
bubbles, that rise to the top in the water, so it happens too to list
elements with greater values, which are recurrently pushed to the end (top) of
the&amp;nbsp;list.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="structure"&gt;
&lt;h2&gt;Structure&lt;/h2&gt;
&lt;p&gt;It is comprised by two nested&amp;nbsp;loops:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;The &lt;strong&gt;outer one&lt;/strong&gt; loops amongst the numbers that comprise the range between
0 and the size of the array, minus 2. Example: if the array has size 5,
the outer loop will loop from 0 to 3. Let&amp;#8217;s call the number of the outer
loop &lt;tt class="docutils literal"&gt;x&lt;/tt&gt;.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;inner loop&lt;/strong&gt; is the one that actually makes the comparisons and swaps.
It loops amongst the numbers that comprise the range between 0 and the length
of the array, minus 2, minus the number of the outer loop (&lt;tt class="docutils literal"&gt;x&lt;/tt&gt;). Example:
if the array has size 5, the inner loop will loop from 0 to 3 on the first
outer loop, 0 to 2 in the second outer loop, and so on. Let&amp;#8217;s call the
number of the inner loop &lt;tt class="docutils literal"&gt;y&lt;/tt&gt;.&lt;/li&gt;
&lt;li&gt;For each &lt;tt class="docutils literal"&gt;y&lt;/tt&gt; in the inner loop, it &lt;strong&gt;compares&lt;/strong&gt; the element on the index
&lt;tt class="docutils literal"&gt;y&lt;/tt&gt; with the element on the index &lt;tt class="docutils literal"&gt;y + 1&lt;/tt&gt;. If the first is greater
than the second, the elements are&amp;nbsp;swapped.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Also, there is an optimized Bubble Sort implementation. Basically, for each
outer loop, a &lt;tt class="docutils literal"&gt;swapped&lt;/tt&gt; &lt;strong&gt;flag&lt;/strong&gt; is set to False. If there is any swap in an
inner loop, &lt;tt class="docutils literal"&gt;swapped&lt;/tt&gt; is set to True. At the end of the last inner loop,
if &lt;tt class="docutils literal"&gt;swapped&lt;/tt&gt; is False, it means that the array is sorted and no more outer
loops are needed, so the outer loop can be ended prematurely and the array
can be&amp;nbsp;returned.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="code"&gt;
&lt;h2&gt;Code&lt;/h2&gt;
&lt;p&gt;This is the implementation of Bubble Sort in Python. It may look slighter
more complex than the usual Bubble Sort implementation, but that&amp;#8217;s because
I&amp;#8217;ll to provide codes that work both for the crescent and decrescent&amp;nbsp;sorting.&lt;/p&gt;
&lt;p&gt;&lt;script  type="application/javascript" src="https://gist.github.com/mauriciogardini/ad3d4b683dc253494c385dbe745aa858.js"&gt;&lt;/script&gt;&lt;/p&gt;
&lt;p&gt;And this is the implementation of optimized Bubble Sort in Python. Again, this
codes works both for the crescent and decrescent&amp;nbsp;sorting.&lt;/p&gt;
&lt;p&gt;&lt;script src="https://gist.github.com/mauriciogardini/dadf6cda30bf381c94275afa6c65c10e.js"&gt;&lt;/script&gt;&lt;/p&gt;
&lt;p&gt;Finally, &lt;a class="reference external" href="https://algorithm-visualizer.org/brute-force/bubble-sort"&gt;here&amp;#8217;s&lt;/a&gt; the interactive algorithm
visualization, with step-by-step&amp;nbsp;execution.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="complexity"&gt;
&lt;h2&gt;Complexity&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Worst-case performance&lt;/strong&gt;:&amp;nbsp;O(n²)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Best-case performance&lt;/strong&gt;: O(n²) for the normal implementation; O(n) for the
optimized&amp;nbsp;implementation&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Average performance&lt;/strong&gt;:&amp;nbsp;O(n²)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Space complexity&lt;/strong&gt; &lt;sup id="fnref1:1"&gt;&lt;a href="#fn:1" rel="footnote"&gt;1&lt;/a&gt;&lt;/sup&gt;:&amp;nbsp;O(n)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Auxiliary space&lt;/strong&gt; &lt;sup id="fnref1:2"&gt;&lt;a href="#fn:2" rel="footnote"&gt;2&lt;/a&gt;&lt;/sup&gt;: O(1) for the normal
implementation; O(2) for the optimized implementation.
&lt;sup id="fnref1:3"&gt;&lt;a href="#fn:3" rel="footnote"&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="benchmark"&gt;
&lt;h2&gt;Benchmark&lt;/h2&gt;
&lt;p&gt;As the posts from the Sorting Algorithms Studies are posted, I&amp;#8217;ll benchmark
the algorithms against each other. For now, there&amp;#8217;s only Bubble Sort to be&amp;nbsp;shown.&lt;/p&gt;
&lt;table border="1" class="docutils"&gt;
&lt;colgroup&gt;
&lt;col width="53%" /&gt;
&lt;col width="24%" /&gt;
&lt;col width="24%" /&gt;
&lt;/colgroup&gt;
&lt;thead valign="bottom"&gt;
&lt;tr&gt;&lt;th class="head" colspan="3"&gt;Sorting 1000 different arrays with 1000 randomly sorted elements&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;th class="head" rowspan="2"&gt;Algorithm&lt;/th&gt;
&lt;th class="head" colspan="2"&gt;Average Time Spent (seconds)&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;th class="head"&gt;Crescent&lt;/th&gt;
&lt;th class="head"&gt;Decrescent&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;&lt;td&gt;Bubble Sort&lt;/td&gt;
&lt;td&gt;0.1692&lt;/td&gt;
&lt;td&gt;0.1692&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Bubble Sort Optimized&lt;/td&gt;
&lt;td&gt;0.1704&lt;/td&gt;
&lt;td&gt;0.1702&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div class="line-block"&gt;
&lt;div class="line"&gt;&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;table border="1" class="docutils"&gt;
&lt;colgroup&gt;
&lt;col width="53%" /&gt;
&lt;col width="24%" /&gt;
&lt;col width="24%" /&gt;
&lt;/colgroup&gt;
&lt;thead valign="bottom"&gt;
&lt;tr&gt;&lt;th class="head" colspan="3"&gt;Sorting 1000 different arrays with 1000 elements in ascending order&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;th class="head" rowspan="2"&gt;Algorithm&lt;/th&gt;
&lt;th class="head" colspan="2"&gt;Average Time Spent (seconds)&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;th class="head"&gt;Crescent&lt;/th&gt;
&lt;th class="head"&gt;Decrescent&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;&lt;td&gt;Bubble Sort Optimized&lt;/td&gt;
&lt;td&gt;0.0002&lt;/td&gt;
&lt;td&gt;0.2563&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Bubble Sort&lt;/td&gt;
&lt;td&gt;0.0985&lt;/td&gt;
&lt;td&gt;0.2519&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div class="line-block"&gt;
&lt;div class="line"&gt;&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;table border="1" class="docutils"&gt;
&lt;colgroup&gt;
&lt;col width="53%" /&gt;
&lt;col width="24%" /&gt;
&lt;col width="24%" /&gt;
&lt;/colgroup&gt;
&lt;thead valign="bottom"&gt;
&lt;tr&gt;&lt;th class="head" colspan="3"&gt;Sorting 1000 different arrays with 1000 elements in descending order&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;th class="head" rowspan="2"&gt;Algorithm&lt;/th&gt;
&lt;th class="head" colspan="2"&gt;Average Time Spent (seconds)&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;th class="head"&gt;Crescent&lt;/th&gt;
&lt;th class="head"&gt;Decrescent&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;&lt;td&gt;Bubble Sort Optimized&lt;/td&gt;
&lt;td&gt;0.2435&lt;/td&gt;
&lt;td&gt;0.0001&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Bubble Sort&lt;/td&gt;
&lt;td&gt;0.2373&lt;/td&gt;
&lt;td&gt;0.0890&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class="section" id="wrapping-up"&gt;
&lt;h2&gt;Wrapping&amp;nbsp;Up&lt;/h2&gt;
&lt;p&gt;Bubble Sort is a simple algorithm, easy to understand and implement. It doesn&amp;#8217;t
performs well, but it may be enough for some scenarios, like when you have
really small lists of when there&amp;#8217;s not much time to make a better
implementation (like in a&amp;nbsp;hackaton).&lt;/p&gt;
&lt;p&gt;Stay tuned for the next chapters of this&amp;nbsp;series!&lt;/p&gt;
&lt;/div&gt;
</content><category term="Blog"></category><category term="Sorting Algorithms"></category><category term="Studies"></category><category term="Bubble Sort"></category><category term="Python"></category></entry><entry><title>Digital Bullet Journal</title><link href="/blog/digital-bullet-journal/" rel="alternate"></link><published>2019-06-28T00:00:00-03:00</published><updated>2019-06-28T00:00:00-03:00</updated><author><name>Maurício Gardini</name></author><id>tag:None,2019-06-28:/blog/digital-bullet-journal/</id><summary type="html">&lt;p&gt;I&amp;#8217;ve been reading about ways to organize my thoughts, trying to be more
productive and more conscious about the tasks that I tackle. And, after having
a try at …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I&amp;#8217;ve been reading about ways to organize my thoughts, trying to be more
productive and more conscious about the tasks that I tackle. And, after having
a try at Kanban, &lt;span class="caps"&gt;GTD&lt;/span&gt; and others — and not adapting well to them —, I decided to
try Bullet Journal, also know as&amp;nbsp;BuJo.&lt;/p&gt;
&lt;div class="section" id="bullet-journal"&gt;
&lt;h2&gt;Bullet&amp;nbsp;Journal&lt;/h2&gt;
&lt;p&gt;The definition of &lt;a class="reference external" href="bulletjournal.com"&gt;Bullet Journal&lt;/a&gt;, by the creator himself,
is &amp;#8220;the analog method for the digital age that will help you track the past,
order the present, and design your&amp;nbsp;future&amp;#8221;.&lt;/p&gt;
&lt;div class="figure"&gt;
&lt;img alt="Bullet Journal site" src="/images/blog/digital-bullet-journal/digital-bullet-journal-bullet-journal.jpg" /&gt;
&lt;p class="caption"&gt;Bullet Journal&amp;nbsp;site.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;The problem about this definition is the word &amp;#8220;analog&amp;#8221; which, in other words,
means to&amp;nbsp;me:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Not available at all&amp;nbsp;times;&lt;/li&gt;
&lt;li&gt;Can&amp;#8217;t be backed up in an easy&amp;nbsp;way;&lt;/li&gt;
&lt;li&gt;Has an irregular input method (My writing is not the prettiest thing in the&amp;nbsp;world&amp;#8230;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The idea of Bullet Journal being an analog media is intentional, however, and
has its&amp;nbsp;pros:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Doesn&amp;#8217;t depend on an internet connection or even any kind of&amp;nbsp;power;&lt;/li&gt;
&lt;li&gt;When you are writing analogically, people say that you are being more
thoughtful and conscious about what you&amp;#8217;re&amp;nbsp;writing.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Despite that, I choose to try to adopt it&amp;nbsp;because:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;It&amp;#8217;s highly customizable: nothing is predetermined, nothing is&amp;nbsp;mandatory;&lt;/li&gt;
&lt;li&gt;You can use it to pretty much anything:&lt;ul&gt;
&lt;li&gt;Organize your daily tasks and&amp;nbsp;to-dos;&lt;/li&gt;
&lt;li&gt;Log activities and&amp;nbsp;facts;&lt;/li&gt;
&lt;li&gt;Taking notes of ideas and&amp;nbsp;thoughts;&lt;/li&gt;
&lt;li&gt;Compile&amp;nbsp;lists;&lt;/li&gt;
&lt;li&gt;Track down&amp;nbsp;habits;&lt;/li&gt;
&lt;li&gt;&amp;#8230;and pretty much anything&amp;nbsp;else.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class="section" id="trying-it-the-digital-way"&gt;
&lt;h2&gt;Trying it, the digital&amp;nbsp;way&lt;/h2&gt;
&lt;p&gt;But, as I said earlier, the &amp;#8220;analogic&amp;#8221; part of it bothered me. And that&amp;#8217;s when
I thought: can&amp;#8217;t I make it&amp;nbsp;digital?&lt;/p&gt;
&lt;p&gt;My requirements for it&amp;nbsp;were:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Inputting on it should be simple, not getting in the way of the&amp;nbsp;information;&lt;/li&gt;
&lt;li&gt;Despite the fact that most Bullet Journal users love to decorate their
journals, I&amp;#8217;m a fan of clean and concise design, so my tool should have
a little bit of customization, but not much would be&amp;nbsp;needed;&lt;/li&gt;
&lt;li&gt;Should be available everywhere I have an internet connection (pretty much
everywhere where I am&amp;nbsp;daily);&lt;/li&gt;
&lt;li&gt;Should be easily&amp;nbsp;exportable.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I searched for people which were trying to do the same and, for my surprise, I
found them. The three most common ways that people use to create an online
BuJo&amp;nbsp;are:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Evernote: I never been a fan of it, but looks like this is the most common
way of going&amp;nbsp;digital;&lt;/li&gt;
&lt;li&gt;iPad softwares, like GoodNotes, Noteshelf and Notability: probably it&amp;#8217;s one
of the best and most appealing ways to create a digital Bullet Journal, and
it would me my choice if I could. But, despite the fact that I can&amp;#8217;t afford
an iPad at the moment, taking an iPad (or any valuable stuff) with me in my
day to day routine would be kinda risky, as I don&amp;#8217;t live at the safest of
places at the&amp;nbsp;moment;&lt;/li&gt;
&lt;li&gt;Bullet Journal apps: they usually follow an specific interpretation of
BuJo, which makes them not that&amp;nbsp;customizable.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Thinking about the tools that I had around, I tried starting a Bullet Journal
on a Google Docs document. It had a summary, and each of its pages were
equivalent to an analogic page. I tried using it for about 3 months, but as it
grew in size I found it harder and harder to manage. Even adding anchors to
specific chapters didn&amp;#8217;t make it easier to&amp;nbsp;use.&lt;/p&gt;
&lt;p&gt;After giving some thought about it — and not willing to give up on the idea of
a Bullet Journal yet —, I tried moving it to a Google Sheets file. And yes, it
sounds weird and counterintuitive at first, but let me talk more about&amp;nbsp;it.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="journaling-in-google-sheets"&gt;
&lt;h2&gt;Journaling in Google&amp;nbsp;Sheets&lt;/h2&gt;
&lt;p&gt;My experience using Google Docs wasn&amp;#8217;t for nothing: at least, with that I
discovered what worked for me and what didn&amp;#8217;t, Bullet Journal-wise. I came up
with three&amp;nbsp;premises:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Write once, display in many&amp;nbsp;places;&lt;/li&gt;
&lt;li&gt;Each information must have a&amp;nbsp;purpose;&lt;/li&gt;
&lt;li&gt;Automate a new week/month creation the maximum as&amp;nbsp;possible.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Using Google Sheets, each Bullet Journal would be a sheet page. The pages
navigation on Google Sheets is simple, due to the pages menu button and for the
possibility to hide past and unused pages, which is good to reduce the
cluttering. There&amp;#8217;s even the possibility of a little bit of customization, as
you can add a color to a page&amp;nbsp;tab.&lt;/p&gt;
&lt;p&gt;And, with that in mind, I came up to the conclusion that my Bullet Journal has,
basically, 4 types of&amp;nbsp;pages:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Year&amp;nbsp;Calendar&lt;/li&gt;
&lt;li&gt;Month&amp;nbsp;View&lt;/li&gt;
&lt;li&gt;Week&amp;nbsp;View&lt;/li&gt;
&lt;li&gt;List&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="section" id="year-calendar"&gt;
&lt;h3&gt;Year&amp;nbsp;Calendar&lt;/h3&gt;
&lt;div class="figure"&gt;
&lt;img alt="Year Calendar" src="/images/blog/digital-bullet-journal/digital-bullet-journal-year-calendar.jpg" /&gt;
&lt;p class="caption"&gt;Year&amp;nbsp;Calendar.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;A Calendar of the whole year. Despite the fact that this type of page made it
to be featured at my second Bullet Journal iteration, I&amp;#8217;m thinking about
removing this page, as I don&amp;#8217;t use it that often. Also, it doesn&amp;#8217;t provide any
information that isn&amp;#8217;t already in another&amp;nbsp;view.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="month-view"&gt;
&lt;h3&gt;Month&amp;nbsp;View&lt;/h3&gt;
&lt;div class="figure"&gt;
&lt;img alt="Month View" src="/images/blog/digital-bullet-journal/digital-bullet-journal-month-view.jpg" /&gt;
&lt;p class="caption"&gt;Month&amp;nbsp;View.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;The view of a single month. It&amp;#8217;s where the appointments are written. Also, I
integrated the habit tracker on this view, for the sake of succinctness. In my
private Bullet Journal, I identify each habit using a two letter identifier,
much like a periodic table element, so &amp;#8220;Meditating&amp;#8221; would become &amp;#8220;Me&amp;#8221;. At last,
there is some conditional formatting on the appointment fields, as the days
that have passed will be grayed out, so you know where to look in the moment
that you open the&amp;nbsp;page.&lt;/p&gt;
&lt;p&gt;This page is named in the pattern &lt;cite&gt;&amp;lt;Year&amp;gt; | &amp;lt;Three letter month identifier&amp;gt;&lt;/cite&gt;,
e.g. 2019 | &lt;span class="caps"&gt;AUG&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;When it&amp;#8217;s needed to setup a new month, the process is quite simple. On the
bottom of this page, below the fold, there are some metadata that are
responsible for making this configuration easier. Having said that, the
following steps must be&amp;nbsp;followed:&lt;/p&gt;
&lt;ol class="arabic simple"&gt;
&lt;li&gt;Duplicate a month&amp;nbsp;page;&lt;/li&gt;
&lt;li&gt;Remove the appointments and clear the habit tracking&amp;nbsp;data;&lt;/li&gt;
&lt;li&gt;Fill the metadatas: Month&amp;#8217;s First Day and Month&amp;#8217;s Last&amp;nbsp;Day.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;With that, the information regarding the title and the days of the week will be
automatically calculated. It may be needed to remove (or add) a day in the
month, if it&amp;#8217;s a 30 day one, but that&amp;#8217;s about&amp;nbsp;it.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="week-view"&gt;
&lt;h3&gt;Week&amp;nbsp;View&lt;/h3&gt;
&lt;div class="figure"&gt;
&lt;img alt="Week View" src="/images/blog/digital-bullet-journal/digital-bullet-journal-week-view.jpg" /&gt;
&lt;p class="caption"&gt;Week&amp;nbsp;View.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;The view of a single week, starting in a Sunday. It&amp;#8217;s composed of 9 sections: a
mini calendar, a blank space for each day of the week and an extra space for
random notes. As in the month view, there is some conditional formatting on the
daily information fields, as the days that have passed will be grayed out, so
you know where to look in the moment that you open the&amp;nbsp;page.&lt;/p&gt;
&lt;p&gt;This page is named in the pattern &lt;cite&gt;&amp;lt;Year&amp;gt; | &amp;lt;Three letter month identifier&amp;gt; |
&amp;lt;First day of the week in a two-digit format&amp;gt;-&amp;lt;Last day of the week in a
two-digit format&amp;gt;&lt;/cite&gt;, e.g. 2019 | &lt;span class="caps"&gt;AUG&lt;/span&gt; |&amp;nbsp;04-10.&lt;/p&gt;
&lt;p&gt;As in the month view, the process of creating a new week page is quite simple.
On the bottom of this page, below the fold, there are some metadata that are
responsible for making this configuration easier. Having said that, the
following steps must be&amp;nbsp;followed:&lt;/p&gt;
&lt;ol class="arabic simple"&gt;
&lt;li&gt;Duplicate a week&amp;nbsp;page;&lt;/li&gt;
&lt;li&gt;Remove the information of each&amp;nbsp;day;&lt;/li&gt;
&lt;li&gt;Fill the calendar with the appropriate data (will be less laborious if you
keep the Year Calendar on your Bullet Journal, then you can just copy from&amp;nbsp;it);&lt;/li&gt;
&lt;li&gt;Fill the metadata: Week&amp;#8217;s First&amp;nbsp;Day.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;With that, the information regarding the title and the days that compose the
week will be automatically&amp;nbsp;calculated.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="list"&gt;
&lt;h3&gt;List&lt;/h3&gt;
&lt;div class="figure"&gt;
&lt;img alt="List View" src="/images/blog/digital-bullet-journal/digital-bullet-journal-list-view.jpg" /&gt;
&lt;p class="caption"&gt;List&amp;nbsp;View.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;A list of, pretty much, anything I need to log: post ideas, things to study,&amp;nbsp;etc.&lt;/p&gt;
&lt;p&gt;Normally, its composed of a single column list, but the number of columns may
grow as needed. For example, for things to study, you may feel the need to
include a &amp;#8220;Reference&amp;#8221;&amp;nbsp;column.&lt;/p&gt;
&lt;p&gt;To create a new list, just copy from an existing one and remove the&amp;nbsp;content.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="section" id="for-now-it-s-working"&gt;
&lt;h2&gt;For now, it&amp;#8217;s&amp;nbsp;working&lt;/h2&gt;
&lt;p&gt;It&amp;#8217;s been around 4 months that I&amp;#8217;ve been using Bullet Journal and, for now,
it&amp;#8217;s doing its job. I&amp;#8217;m being more accountable on where I spend my time and
more focused on how to spend my free&amp;nbsp;time.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ll probably try to use it for at least two more months, to see if it really
it&amp;#8217;s worth the effort, but I&amp;#8217;m sure that the fact that the approach I&amp;#8217;m
following is a digital one is contributing lots to its&amp;nbsp;success.&lt;/p&gt;
&lt;p&gt;If you want to try using &lt;a class="reference external" href="https://docs.google.com/spreadsheets/d/12D42KRRZujTWHMBxV82i13STwaqfO5cqwBZ_Nmhe40w/"&gt;my template&lt;/a&gt;,
feel free to &lt;a class="reference external" href="https://docs.google.com/spreadsheets/d/12D42KRRZujTWHMBxV82i13STwaqfO5cqwBZ_Nmhe40w/copy"&gt;make a copy of it&lt;/a&gt;. And, if you
have any suggestions or comments, &lt;a href="&amp;#109;&amp;#97;&amp;#105;&amp;#108;&amp;#116;&amp;#111;&amp;#58;&amp;#99;&amp;#111;&amp;#110;&amp;#116;&amp;#97;&amp;#99;&amp;#116;&amp;#064;&amp;#109;&amp;#097;&amp;#117;&amp;#114;&amp;#105;&amp;#099;&amp;#105;&amp;#111;&amp;#103;&amp;#097;&amp;#114;&amp;#100;&amp;#105;&amp;#110;&amp;#105;&amp;#046;&amp;#099;&amp;#111;&amp;#109;"&gt;please do contact me&lt;/a&gt;!&lt;/p&gt;
&lt;/div&gt;
</content><category term="Blog"></category><category term="Bullet Journal"></category></entry><entry><title>New Site, New Content</title><link href="/blog/new-site-new-content/" rel="alternate"></link><published>2019-06-03T00:00:00-03:00</published><updated>2019-06-03T00:00:00-03:00</updated><author><name>Maurício Gardini</name></author><id>tag:None,2019-06-03:/blog/new-site-new-content/</id><summary type="html">&lt;p&gt;6 years. That&amp;#8217;s approximately how long since I&amp;#8217;ve written a post in my personal
site. Lots of things happened since then, but about 2 years ago I decided …&lt;/p&gt;</summary><content type="html">&lt;p&gt;6 years. That&amp;#8217;s approximately how long since I&amp;#8217;ve written a post in my personal
site. Lots of things happened since then, but about 2 years ago I decided that
it was time to start writing again. Yeah, you read that right: 2 years ago. And
this post will describe why it took so long and what happened since&amp;nbsp;then.&lt;/p&gt;
&lt;div class="section" id="a-small-recap"&gt;
&lt;h2&gt;A small&amp;nbsp;recap&lt;/h2&gt;
&lt;p&gt;My old personal site was, actually, a Tumblr. It had many limitations but, for
the purpose of sharing my thoughts, it was enough. And, together with a custom
domain, it did the trick for some&amp;nbsp;time.&lt;/p&gt;
&lt;div class="figure"&gt;
&lt;img alt="Old site screenshot." src="/images/blog/new-site-new-content/new-site-new-content-old-site.jpg" /&gt;
&lt;p class="caption"&gt;Screenshot of my old&amp;nbsp;site.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;I posted for some time on this site, but… Well, “life” happened since then: an
8-6 job, college at night… Everybody does that, I know. It shouldn’t be an
excuse for this. But, at the time, it was enough of a hassle for me to stop&amp;nbsp;writing.&lt;/p&gt;
&lt;p&gt;Despite not writing, I kept on reading a lot. And, with that, I frequently found
content that I felt the need to share. For this purpose, I used Facebook. But,
in the middle of 2014, I was feeling more annoyed than pleased on being a
Facebook user, so I deactivated my profile on it (I kept it this way until 2016,
when I reactivated it and since then I use it as a “read-only”&amp;nbsp;media).&lt;/p&gt;
&lt;p&gt;With the deactivation of my Facebook, the main place that I had to share the
interesting content that I found during my daily online reading didn’t exist
anymore. So I started using Twitter as a tool to share these links. But, as I
am not an active social media user, my Twitter profile ended up being a
collection of links. Again, it wasn’t that appropriate as well, but it was
what I had at my reach at the&amp;nbsp;moment.&lt;/p&gt;
&lt;p&gt;In the end of 2015, I finally finished my Graduation on Computer Science. It was
a milestone in my life, both for the knowledge and friends that I got from that,
but also from the extra time that I would have from now&amp;nbsp;on.&lt;/p&gt;
&lt;p&gt;In the meantime, I got increasingly interested in beer, as a drinker and as a
self-learner on the subject. So, in 2016, I became an affiliate of CervaSerra, a
local homebrewers association. With that, I became exposed to a whole lot of new
information, and it made me interested in studying and producing content about
it as&amp;nbsp;well.&lt;/p&gt;
&lt;p&gt;During 2017, I decided that it was time to create a more appropriate media to
share my thoughts. And then my effort to make my new site&amp;nbsp;started.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="new-site"&gt;
&lt;h2&gt;New&amp;nbsp;site&lt;/h2&gt;
&lt;p&gt;From the start, I had decided that my new site would be static. With that, I
hoped to&amp;nbsp;have:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;More control over what I’ll share and how I want to display my&amp;nbsp;content;&lt;/li&gt;
&lt;li&gt;Small/smaller hassle on the deploy&amp;nbsp;process;&lt;/li&gt;
&lt;li&gt;Low/lower back-end&amp;nbsp;dependency.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Going back to my older times, when I was exposed to Ruby during the development
of the now defunct Lector, I remembered of Middleman, a Ruby-powered static site
generator. And, then, I started creating my new personal site with&amp;nbsp;it.&lt;/p&gt;
&lt;p&gt;But, for reasons that I don’t remember that well at the moment, I felt that
Middleman wasn’t what I was looking for. Looking for alternatives, I found Hugo,
a Go-powered static site generator. And, again, I started working on my new site
using&amp;nbsp;that.&lt;/p&gt;
&lt;p&gt;I fiddled around with Hugo for a lot more time than with Middleman, but after
that I felt that Hugo was closer, but not what I was looking for either. And,
looking for more alternatives, I found my weapon of choice: Pelican, a
Python-powered static site&amp;nbsp;generator.&lt;/p&gt;
&lt;p&gt;Pelican probably isn’t better or worst than Middleman or Hugo, I know. But,
probably because it’s made in Python, which is my day-to-day language, and also
is a language that is closer to my heart, I felt more secure on using&amp;nbsp;it.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="the-development-process"&gt;
&lt;h2&gt;The development&amp;nbsp;process&lt;/h2&gt;
&lt;p&gt;Having high standards about the things that I create, I knew that, even though
I had chosen the tool that I would use to create the site, it wouldn’t be a
simple and short&amp;nbsp;job.&lt;/p&gt;
&lt;p&gt;Initially, I thought about choosing one of the themes that
&lt;a class="reference external" href="https://github.com/getpelican/pelican-themes"&gt;pelican themes&lt;/a&gt; provides. “Yeah, I’ll do that, so i
can focus on the content”. Yeah,&amp;nbsp;right.&lt;/p&gt;
&lt;p&gt;I wanted something minimalist, focused on the reading. I found some themes
that had this thought as its main purpose, but they weren’t exactly what I
needed. “Oh, really? What a surprise!”, you may say. I know, I was just delaying
the inevitable: I was going to create my&amp;nbsp;theme.&lt;/p&gt;
&lt;p&gt;And so I did it. I wanted it to be minimalist, focused on reading and as
&lt;span class="caps"&gt;CSS&lt;/span&gt;-only as possible - and it was what I think that I achieved -, although I
needed a little bit of (vanilla) Javascript here and there (Not that much,&amp;nbsp;though).&lt;/p&gt;
&lt;p&gt;Having a focus on reading, I thought that appropriate font sizing was really
important. So, I tried to implement the concept of Modular Scale. Or, as the
&lt;a class="reference external" href="http://modularscale.com/"&gt;Modular Scale site&lt;/a&gt; says, “a multi-stranded modular
scale”, as it uses more than one ratio. I don’t have a broad knowledge on
typography, so I don’t know if I got it right, but the result of trying to
apply it was satisfactory for my lay&amp;nbsp;eyes.&lt;/p&gt;
&lt;div class="figure"&gt;
&lt;img alt="Modular Scale site." src="/images/blog/new-site-new-content/new-site-new-content-modular-scale.jpg" /&gt;
&lt;p class="caption"&gt;Modular Scale&amp;nbsp;site.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;I also wanted to implement search. Normally, it requires a back-end, or to use a
third-party alternative, like Google. There is a pelican plugin,
&lt;a class="reference external" href="https://github.com/getpelican/pelican-plugins/tree/master/tipue_search"&gt;tipue search&lt;/a&gt;, that implements that, but it relies on jQuery,
and I didn’t want to add that dependency. Searching for an alternative,
I found &lt;a class="reference external" href="http://joevennix.com/2011/05/25/How-I-Implement-Static-Site-Search.html"&gt;Joe Vennix’s implementation of a search engine&lt;/a&gt; that
relies on the &lt;span class="caps"&gt;RSS&lt;/span&gt; feed to make its searches. Looked good enough for me, but it
also had jQuery dependency. As it was smaller and simpler than the Pelican
Plugin, I decided to convert his implementation to a Vanilla Javascript one,
and so I did. I’ll make a post about it in the&amp;nbsp;future.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="my-first-open-source-contribution"&gt;
&lt;h2&gt;My First Open Source&amp;nbsp;Contribution&lt;/h2&gt;
&lt;p&gt;When you work with an open source project, you have the opportunity to
be helpful, either by helping the others to achieve their goals by answering
doubts, for example; or by making a code&amp;nbsp;contribution.&lt;/p&gt;
&lt;p&gt;Despite all my time with programming, I had never submitted a pull request
to a project in Github. Again, I blame myself for not doing that yet, and
more specifically I blame my&amp;nbsp;self-confidence.&lt;/p&gt;
&lt;p&gt;But, during the creation of this site, I was instigated to make a contribution
to the Pelican project to solve the lack of a feature that I thought that was
interesting. And that&amp;#8217;s exactly what I&amp;nbsp;did!&lt;/p&gt;
&lt;p&gt;Of course, contributing to a project has its rules, and I didn&amp;#8217;t know them, so
I can&amp;#8217;t say that the process was completely seamless. But there&amp;#8217;s some learning
in everything, and once I surpassed these difficulties, I managed to make my
commit to pass the tests and now I have a pull request that is ready to be&amp;nbsp;merged.&lt;/p&gt;
&lt;p&gt;Having said that, making this pull request (and managing to make it eligible
to be merged) gave me courage to contribute more and, if I feel that I can
help in some project, I&amp;#8217;ll probably feel more capable&amp;nbsp;now.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="old-habits-die-hard"&gt;
&lt;h2&gt;Old Habits Die&amp;nbsp;Hard&lt;/h2&gt;
&lt;p&gt;During the creation of this site, obviously I had to produce a lot of code.
And, for that task, every developer has its favorite text&amp;nbsp;editor.&lt;/p&gt;
&lt;p&gt;I started the project using Atom, the text editor created by GitHub. I was
using this editor for some months when I started the project, so I got used
to it. But, as the title of the chapter says, &amp;#8220;old habits die hard&amp;#8221;, and
some features were missing for me. But, nevertheless, I continued using this&amp;nbsp;editor.&lt;/p&gt;
&lt;p&gt;But, then, I started having problems with some default plug-ins, which were
producing behaviors that were undesirable for me. So, I disabled one plug-in,
then I had to disable another, and another&amp;#8230; And, soon enough, there wasn&amp;#8217;t
many differences between using Atom the way that I was using and using
Notepad or something similar. Maybe the color coding and the file tree would
be missing, but there wasn&amp;#8217;t much more than&amp;nbsp;that.&lt;/p&gt;
&lt;p&gt;So, I decided to go back to my trusty friend: Vim. It was my editor of choice
for about 4 years and, after a year of Atom, here I was back at Vim&amp;nbsp;again.&lt;/p&gt;
&lt;div class="figure"&gt;
&lt;img alt="My current Vim setup." src="/images/blog/new-site-new-content/new-site-new-content-vim.jpg" /&gt;
&lt;p class="caption"&gt;My current Vim&amp;nbsp;setup.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;As nobody that I know use Vim with its default configuration as a day-to-day
editor, I fiddled around with .vimrc and plugins for quite some time. So,
expect some texts about this editor as well. There are many knowledge nuggets
to be&amp;nbsp;shared.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="there-s-room-for-all"&gt;
&lt;h2&gt;There&amp;#8217;s room for&amp;nbsp;all!&lt;/h2&gt;
&lt;p&gt;As I stated above, there is an urge to write, but it isn&amp;#8217;t limited to
programming, tech stuff and life blog, subjects that used to appear on
my old site and still will appear here under the &lt;a class="reference internal" href="/blog"&gt;Blog&lt;/a&gt;&amp;nbsp;section.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ll also use this space to post beer-related&amp;nbsp;stuff:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;The full recipes of the &lt;a class="reference internal" href="/brewed-beers"&gt;Brewed Beers&lt;/a&gt; so far, as writing down all the
variables that were involved on the brewing process is a great way of
discovering what you did right and&amp;nbsp;wrong;&lt;/li&gt;
&lt;li&gt;My &lt;a class="reference internal" href="/beer-maps"&gt;Beer Maps&lt;/a&gt;, where I map all the beer-related places of the cities
that I already&amp;nbsp;visited;&lt;/li&gt;
&lt;li&gt;Other ideas that may come to my&amp;nbsp;mind;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Also, as I said before, I stumble upon interesting links that I want to share.
Then, there&amp;#8217;ll be a place to post this content. My areas of interest are the
broadest possible, so there isn&amp;#8217;t a particular theme that will surpass amongst
the others. For these unpredictability, I&amp;#8217;ll file these posts under what I call
&lt;a class="reference internal" href="/curated-randomness"&gt;Curated Randomness&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;At last, as there is some book reading as well, when appropriate I’ll share my
two cents about the &lt;a class="reference internal" href="/books"&gt;Books&lt;/a&gt; that I&amp;nbsp;read.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="and-that-s-pretty-much-it"&gt;
&lt;h2&gt;&amp;#8230;and that&amp;#8217;s pretty much&amp;nbsp;it.&lt;/h2&gt;
&lt;p&gt;I really hope you can find something of your interest&amp;nbsp;here.&lt;/p&gt;
&lt;p&gt;I worked really hard to create this site and will do my best to keep creating
and sharing quality content. After all, there&amp;#8217;s a lot to be discovered and
learned out&amp;nbsp;there!&lt;/p&gt;
&lt;/div&gt;
</content><category term="Blog"></category><category term="Personal Site"></category><category term="Pelican"></category><category term="Open Source"></category><category term="Vim"></category></entry><entry><title>Lector - A news reader for people who want one simple thing: read</title><link href="/blog/lector-a-news-reader-for-people-who-want-one-simple-thing-read/" rel="alternate"></link><published>2013-06-24T00:00:00-03:00</published><updated>2013-06-24T00:00:00-03:00</updated><author><name>Maurício Gardini</name></author><id>tag:None,2013-06-24:/blog/lector-a-news-reader-for-people-who-want-one-simple-thing-read/</id><summary type="html">&lt;p&gt;Yeah, it’s been awhile since my last post here. In my mind, trying to
deliver a constant stream of information would be easier. But, with all
the things that …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Yeah, it’s been awhile since my last post here. In my mind, trying to
deliver a constant stream of information would be easier. But, with all
the things that have been happening in my life, it gets harder and harder
to stop everything and write. Nevertheless, this hiatus happened for a
good reason: it happened so I could have more time for the realization
of a dream of&amp;nbsp;mine.&lt;/p&gt;
&lt;p&gt;I’ve been reading feeds for quite some time, and in a quite intense way
too: it was not unusual for me that Google Reader showed me a (feared by
many) 1000+ on its counter. And I always liked that things worked this way.
I like the feeling of navigating through a giant sea of information, searching
for unknown lands full of fresh and relevant&amp;nbsp;information.&lt;/p&gt;
&lt;p&gt;Google Reader always have been my reader of choice. I really tried using
other ones, but they ended up being bulky, counterintuitive, ugly. However,
even being my top of mind when it comes to &lt;span class="caps"&gt;RSS&lt;/span&gt; readers, Google Reader wasn’t
perfect. But, although its defects kinda bothered me, they were minor, so the
discomfort wasn’t strong enough to propel me to create something. Yeah, I was
stuck in the comfort&amp;nbsp;zone.&lt;/p&gt;
&lt;p&gt;But, then, Google announced they would be killing Reader. At first, there was
shock, followed by bewilderment… And, at last, a spark. A spark that lit the
fire that would end up igniting the flame of proactivity, of the creativity,
of idealism: it’s time to build the &lt;span class="caps"&gt;RSS&lt;/span&gt; reader I always&amp;nbsp;wanted.&lt;/p&gt;
&lt;p&gt;By joining forces with a friend that had the same wishes and wills, we made
our &lt;span class="caps"&gt;RSS&lt;/span&gt; reader possible. We built a product that makes us proud of it. We
created&amp;nbsp;Lector.&lt;/p&gt;
&lt;div class="section" id="lector-for-those-who-read"&gt;
&lt;h2&gt;Lector: for those who&amp;nbsp;read&lt;/h2&gt;
&lt;div class="figure"&gt;
&lt;img alt="Lector: for those who read." src="/images/blog/lector-a-news-reader-for-people-who-want-one-simple-thing-read/lector-a-news-reader-for-people-who-want-one-simple-thing-read-example.jpg" /&gt;
&lt;p class="caption"&gt;Lector: for those who&amp;nbsp;read.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Lector is a &lt;span class="caps"&gt;RSS&lt;/span&gt; reader targeted for those who want a no frills reading
experience. To achieve this, we designed an as clean as possible layout,
avoiding the use of anything that could cause the sensation of restrainment
in any way; also, we tried to remove any structure or marking that could
distract you from what really matters: the content. We also have a very
interesting set of hotkeys, ready to be used by those who can’t move the
hands away from the keyboard, providing a fast and seamless&amp;nbsp;navigation.&lt;/p&gt;
&lt;p&gt;But, of course, we aren’t stopping there. An application with a pleasant
interface and nice performance is just the start. We have many ideas yet to be
implemented, and we are eager to implement them. Why? Because we are &lt;span class="caps"&gt;RSS&lt;/span&gt;
reader’s users, just like you. We want an application that can provide us a
wide range of features as badly as you. Nonetheless, time is our only enemy,
because we are sure that we can achieve the goals that we are aiming for.
There may be some daring ones, but we are up for the&amp;nbsp;challenge.&lt;/p&gt;
&lt;p&gt;Besides all the things that we already want to implement, we are really eager
to know what you, Lector user, would like to see implemented. We are probably
missing something that is really important to much people. So, after you try it
out, leave us a feedback on how it can be improved, or about what feature
is&amp;nbsp;missing.&lt;/p&gt;
&lt;p&gt;Oh, and, at last: it will be a paid service. But, please, don’t see this as a
bad thing: by requiring you a little amount of money to use the service, we
can, then, assure you that we won’t monetize your private information; or
else, that the servers will manage to take the load that is&amp;nbsp;required.&lt;/p&gt;
&lt;p&gt;So, yeah, that’s pretty much it. And it is with great joy that I can finally
invite you all: please, do try Lector. Maybe your Google Reader replacement
is&amp;nbsp;here.&lt;/p&gt;
&lt;p&gt;Edit: unfortunately, due to time constraints and external factors, we decided
to shut down the&amp;nbsp;project.&lt;/p&gt;
&lt;/div&gt;
</content><category term="Blog"></category><category term="Lector"></category><category term="RSS"></category><category term="RSS Reader"></category></entry><entry><title>Using IFTTT to fix the missing pipes on your internet experience</title><link href="/blog/using-ifttt-to-fix-the-missing-pipes-on-your-internet-experience/" rel="alternate"></link><published>2013-02-27T00:00:00-03:00</published><updated>2013-02-27T00:00:00-03:00</updated><author><name>Maurício Gardini</name></author><id>tag:None,2013-02-27:/blog/using-ifttt-to-fix-the-missing-pipes-on-your-internet-experience/</id><summary type="html">&lt;p&gt;I’m an avid user of Google Reader, at least for my standards: I’m signed up
to a bunch of feeds, look over hundreds of items, read dozens of …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I’m an avid user of Google Reader, at least for my standards: I’m signed up
to a bunch of feeds, look over hundreds of items, read dozens of articles.
It really is a great tool (Actually, any &lt;span class="caps"&gt;RSS&lt;/span&gt; feed reader would do, but Google
Reader is the best one for me) and the daily use of it pretty much suffices
my need of fresh information and&amp;nbsp;news.&lt;/p&gt;
&lt;p&gt;But with Google Reader’s information abundance came another problem: tab
management. It wasn’t unusual for me that, when I read my feeds, in a matter
of minutes I’d end up having 10, 20 tabs open. Not a great thing for memory
management, neither for user experience (Try opening 20 tabs in a 13&amp;#8221; screen
and see if you can distinguish what is in each&amp;nbsp;tab).&lt;/p&gt;
&lt;div class="figure"&gt;
&lt;img alt="And this used to be the result of a RSS reading session. Or worse." src="/images/blog/using-ifttt-to-fix-the-missing-pipes-on-your-internet-experience/using-ifttt-to-fix-the-missing-pipes-on-your-internet-experience-rss-reading.jpg" /&gt;
&lt;p class="caption"&gt;And this used to be the result of a &lt;span class="caps"&gt;RSS&lt;/span&gt; reading session. Or&amp;nbsp;worse.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;I looked for alternatives to try to make things work&amp;nbsp;better:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Using other browsers: I tried Safari and Chrome, but the good and old
Firefox is still my favorite (and current) browser. Hell, I even tried
compiling Waterfox - a high performance browser based on Mozilla Firefox -
for Mac &lt;span class="caps"&gt;OS&lt;/span&gt;, but I failed on that&amp;nbsp;task;&lt;/li&gt;
&lt;li&gt;Installing extensions to improve the tab management: Tab Mix Plus helped
quite a lot here, allowing me to stack rows of tabs instead of a unique row
and for improving foreground link&amp;nbsp;opening;&lt;/li&gt;
&lt;li&gt;Configurations on the browser’s config to improve memory management and
other&amp;nbsp;things.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Some of the solutions quoted above helped more than the others, but none of
them was a definitive keeper. But then a thought came to my mind: maybe the
problem isn’t the browser. Maybe the problem is… me. Me and my tab management
failure. And that’s when I started to think differently and then &lt;span class="caps"&gt;IFTTT&lt;/span&gt; came
to my&amp;nbsp;mind.&lt;/p&gt;
&lt;div class="section" id="ifttt-put-the-internet-to-work-for-you"&gt;
&lt;h2&gt;&lt;span class="caps"&gt;IFTTT&lt;/span&gt; - Put the internet to work for&amp;nbsp;you&lt;/h2&gt;
&lt;p&gt;&lt;span class="caps"&gt;IFTTT&lt;/span&gt; (Stands for “&lt;span class="caps"&gt;IF&lt;/span&gt; This Then That”) is a service that enables you to
connect channels. Sounds weird, but this idea solves many of the problems
that a more demanding internet user may find throughout his day-to-day&amp;nbsp;browsing.&lt;/p&gt;
&lt;p&gt;This service works using the formula (Or, as they call, “recipe”) “if this
then that”, being “this” the trigger that will provoke the “that”, the action
by itself. Also, there are the ingredients, which are the pieces of data
used/transmitted by the&amp;nbsp;action.&lt;/p&gt;
&lt;p&gt;Still hard to understand? Let me narrow it down to an&amp;nbsp;example:&lt;/p&gt;
&lt;div class="figure"&gt;
&lt;img alt="Just a simple example." src="/images/blog/using-ifttt-to-fix-the-missing-pipes-on-your-internet-experience/using-ifttt-to-fix-the-missing-pipes-on-your-internet-experience-rss-ifttt-example.jpg" /&gt;
&lt;p class="caption"&gt;Just a simple&amp;nbsp;example.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Pretty self explanatory now, huh? Then, every time I upload a new photo to
Facebook, a copy of it will be uploaded to Dropbox (More specifically to the
path “Facebook/Personal”). Simple, isn’t&amp;nbsp;it?&lt;/p&gt;
&lt;p&gt;Among the available channels to fiddle with, I can cite Delicious, Evernote,
Flickr, Foursquare, Gmail, Google Calendar, Last.fm, Tumblr, Twitter… The list
is long and continually&amp;nbsp;grows.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="my-new-rss-readings-modus-operandi"&gt;
&lt;h2&gt;My new &lt;span class="caps"&gt;RSS&lt;/span&gt; reading’s modus&amp;nbsp;operandi&lt;/h2&gt;
&lt;p&gt;Now, to explain how &lt;span class="caps"&gt;IFTTT&lt;/span&gt; helped with my personal problem, I’ll have to
introduce you to three other&amp;nbsp;services:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Pocket, a read it later service: It gets your links and store them for you
to read later, pretty simple. It also has a Firefox extension, which I&amp;nbsp;use;&lt;/li&gt;
&lt;li&gt;Pinboard, a bookmarking site: It stores the links that you may find useful
for future&amp;nbsp;use;&lt;/li&gt;
&lt;li&gt;Readability, a service for decluttering webpages on behalf of a better
reading experience (I know that Pocket has this feature, but I like to keep
each thing on its&amp;nbsp;place).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Having that said, let me dive into how I read my feeds: when browsing through
my feeds on Google Reader, if I find something that I want to read, instead
of opening it in a new tab, I just click on the nifty Pocket icon that is
present on each Reader’s item (Thanks to the Firefox&amp;nbsp;extension).&lt;/p&gt;
&lt;div class="figure"&gt;
&lt;img alt="Adding items to Pocket with its Firefox extension is really easy." src="/images/blog/using-ifttt-to-fix-the-missing-pipes-on-your-internet-experience/using-ifttt-to-fix-the-missing-pipes-on-your-internet-experience-pocket-extension.jpg" /&gt;
&lt;p class="caption"&gt;Adding items to Pocket with its Firefox extension is really&amp;nbsp;easy.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;This action automatically adds the item to Pocket and, then, I can keep on
browsing through the remaining feeds ‘till there’s none left. And no, I
usually don’t read any article directly on Google Reader, unless it is a
short one or if I want to read it really&amp;nbsp;badly.&lt;/p&gt;
&lt;div class="figure"&gt;
&lt;img alt="Pocket: visually pleasant and very practical." src="/images/blog/using-ifttt-to-fix-the-missing-pipes-on-your-internet-experience/using-ifttt-to-fix-the-missing-pipes-on-your-internet-experience-pocket.jpg" /&gt;
&lt;p class="caption"&gt;Pocket: visually pleasant and very&amp;nbsp;practical.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;With all the items I want to read in Pocket, I dive into the reading process
by itself. From here, the items can be included into three&amp;nbsp;recipes:&lt;/p&gt;
&lt;div class="figure"&gt;
&lt;img alt="The recipes I’m using at the moment." src="/images/blog/using-ifttt-to-fix-the-missing-pipes-on-your-internet-experience/using-ifttt-to-fix-the-missing-pipes-on-your-internet-experience-ifttt-recipes.jpg" /&gt;
&lt;p class="caption"&gt;The recipes I’m using at the&amp;nbsp;moment.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Explaining: if I want to bookmark it, I just mark it as favorite and it is
automatically added to Pinboard as a private bookmark; if I want to share it
with my friends, I just tag it with a custom tag and it is automatically added
to Pinboard as a public bookmark with the custom tag; if the article is too
big to read at the moment or it treats about a subject that I don’t want to
read just now, I just tag it with the tag “read-it-later” and it is
automatically added to Readability; and, if it doesn’t apply to any of the
previous cases, I just read it and delete&amp;nbsp;it.&lt;/p&gt;
&lt;p&gt;By using this modus operandi, I solved the tab management problem by its
root and, at the same time, organized the links that I stumble upon in a more
intelligent&amp;nbsp;way.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="but-of-course-you-can-do-plenty-more"&gt;
&lt;h2&gt;But, of course, you can do plenty&amp;nbsp;more&amp;#8230;&lt;/h2&gt;
&lt;p&gt;&lt;span class="caps"&gt;IFTTT&lt;/span&gt; is now an essential service for me. I’d happily pay for it if I had to,
&amp;#8216;cause the array of things that can be done with it are almost&amp;nbsp;endless.&lt;/p&gt;
&lt;p&gt;Maybe my use case isn’t the best one to showcase all the power that &lt;span class="caps"&gt;IFTTT&lt;/span&gt;
provides to the user, but you can check by yourself all that this service has
to offer: just go to the browse section of their site and check out all the
interesting ideas of things to be done. Maybe you’ll find there the solution
to a problem that you have, but you hadn’t noticed yet. Here are some examples
of other interesting applications of &lt;span class="caps"&gt;IFTTT&lt;/span&gt;:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Save starred items from Google Reader to Pocket (I could use this one as an
alternative to Pocket’s&amp;nbsp;extension);&lt;/li&gt;
&lt;li&gt;Send a &lt;span class="caps"&gt;SMS&lt;/span&gt; about the weather every&amp;nbsp;morning;&lt;/li&gt;
&lt;li&gt;Save a video marked as Watch Later on Youtube to&amp;nbsp;Pocket;&lt;/li&gt;
&lt;li&gt;And many, many&amp;nbsp;others.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Hopefully, &lt;span class="caps"&gt;IFTTT&lt;/span&gt; will be useful for many of you &amp;#8216;cause, as I said, it allows
many, many possibilities. Then, if you discovered an interesting recipe or if
you already use &lt;span class="caps"&gt;IFTTT&lt;/span&gt; and would like to share something you use quite often,
be my&amp;nbsp;guest!&lt;/p&gt;
&lt;/div&gt;
</content><category term="Blog"></category><category term="IFTTT"></category><category term="Google Reader"></category><category term="Pinboard"></category><category term="Pocket"></category><category term="Readability"></category></entry><entry><title>Slate: a Mac OS X window manager for power users</title><link href="/blog/slate-a-mac-os-x-window-manager-for-power-users/" rel="alternate"></link><published>2013-02-17T00:00:00-03:00</published><updated>2013-02-17T00:00:00-03:00</updated><author><name>Maurício Gardini</name></author><id>tag:None,2013-02-17:/blog/slate-a-mac-os-x-window-manager-for-power-users/</id><summary type="html">&lt;p&gt;Well, as I already stated, even though I’m quite a newbie when it comes to
Linux, it doesn’t mean that I’m not curious about some products developed …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Well, as I already stated, even though I’m quite a newbie when it comes to
Linux, it doesn’t mean that I’m not curious about some products developed for
it. And one that I’ve been curious since the moment that I first read about
was &lt;span class="caps"&gt;XMONAD&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;&lt;span class="caps"&gt;XMONAD&lt;/span&gt; is a keyboard-based automated window manager developed in Haskell. It
basically places the windows that you open in a tiled environment, exempting
you (Entirely or mostly, depends on how picky and demanding you are) from the
task of resizing and organizing them. Also, you keep its configurations in a
config file, just like bashrc or vimrc, which is always good. Well, when you
see it in action, you’ll agree on how awesome this thing&amp;nbsp;is.&lt;/p&gt;
&lt;p&gt;&lt;div class="picture-frame"&gt;
  &lt;div class="picture-video"&gt;
    &lt;iframe src="https://www.youtube.com/embed/LN4Ov6ZLcrI" frameborder="0"&gt;&lt;/iframe&gt;
  &lt;/div&gt;
  &lt;div class="caption picture-caption"&gt;So. Fast.&lt;/div&gt;
&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Nevertheless, I’m a Mac &lt;span class="caps"&gt;OS&lt;/span&gt; user, and using &lt;span class="caps"&gt;XMONAD&lt;/span&gt; on it is not as seamless
and practical as it is on Linux. So, of course I had to find something
equivalent. Enter&amp;nbsp;Slate.&lt;/p&gt;
&lt;div class="section" id="slate-my-new-window-manager"&gt;
&lt;h2&gt;Slate: my new window&amp;nbsp;manager&lt;/h2&gt;
&lt;p&gt;Slate is a Mac &lt;span class="caps"&gt;OS&lt;/span&gt; X window manager made for those who are tired of fiddling
around with the mouse when it comes to resizing, focusing and arranging
programs. With Slate, all comes down to the keyboard: just customize the
dotfile with the hotkeys of your liking and you are good to go. If you are
a software developer, you know how important it is to maximize the time you
spend on the keyboard (Even more if you use vim or emacs), and that’s one of
the main reasons for me to adopt&amp;nbsp;it.&lt;/p&gt;
&lt;p&gt;Basically, Slate allows you to perform the following actions through
keyboard&amp;nbsp;hotkeys:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Move and/or resize&amp;nbsp;windows;&lt;/li&gt;
&lt;li&gt;Directionally focus&amp;nbsp;windows;&lt;/li&gt;
&lt;li&gt;Activate preset&amp;nbsp;layouts;&lt;/li&gt;
&lt;li&gt;Create, delete, and activate snapshots of the current state of&amp;nbsp;windows&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="figure"&gt;
&lt;img alt="An example on how my windows are arranged usually." src="/images/blog/slate-a-mac-os-x-window-manager-for-power-users/slate-a-mac-os-x-window-manager-for-power-users-slate-example.jpg" /&gt;
&lt;p class="caption"&gt;An example on how my windows are arranged&amp;nbsp;usually.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="section" id="configuring-slates-dotfile-the-basics"&gt;
&lt;h2&gt;Configuring Slate’s dotfile: the&amp;nbsp;basics&lt;/h2&gt;
&lt;p&gt;As I stated before, Slate is configured through a dotfile called .slate that
is placed in the home directory. And, to make it even more clear how Slate is
configured, I’ll strip down my .slate as we dive into each concept (or, if you
want to check it out by yourself, just check it at&amp;nbsp;Github).&lt;/p&gt;
&lt;p&gt;Slate’s readme says that you can configure it using the following&amp;nbsp;directives:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;config-: For global&amp;nbsp;configurations;&lt;/li&gt;
&lt;li&gt;alias-: To create alias&amp;nbsp;variables;&lt;/li&gt;
&lt;li&gt;layout-: To configure layouts. Even though I don’t use layouts yet, I’ll put
an example on how to configure&amp;nbsp;it;&lt;/li&gt;
&lt;li&gt;default-: To default certain layouts or snapshots to certain screen&amp;nbsp;configurations;&lt;/li&gt;
&lt;li&gt;bind-: For key bindings. It’s the one I use most. I’ll narrow down to the
location bindings along with an example of each of the main cases I&amp;nbsp;use;&lt;/li&gt;
&lt;li&gt;source- To load configurations from another&amp;nbsp;file.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="figure"&gt;
&lt;img alt="How my location hotkeys could be pictured." src="/images/blog/slate-a-mac-os-x-window-manager-for-power-users/slate-a-mac-os-x-window-manager-for-power-users-hotkeys.jpg" /&gt;
&lt;p class="caption"&gt;How my location hotkeys could be&amp;nbsp;pictured.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="section" id="and-theres-more"&gt;
&lt;h2&gt;And there’s&amp;nbsp;more…&lt;/h2&gt;
&lt;p&gt;There are even more things that Slate allows you to do. For example, I only
mentioned about snapshots, that allows you to save your current window layout
and restore it whenever you want. There’s also the possibility of Slate being
more “&lt;span class="caps"&gt;GUI&lt;/span&gt;-friendly”, as there are configurations for showing icon overlays to
help focus changing or grids for visual aid when resizing&amp;nbsp;windows.&lt;/p&gt;
&lt;p&gt;So, if you’re on a Mac and feel adventurous, have a try. I used to use Moom to
place and resize my windows, but Slate does the job much more seamlessly, and
it’s a keeper for&amp;nbsp;me.&lt;/p&gt;
&lt;/div&gt;
</content><category term="Blog"></category><category term="Mac OS X"></category><category term="Slate"></category><category term="Window manager"></category><category term="Xmonad"></category><category term="Linux"></category></entry><entry><title>Hello World!</title><link href="/blog/hello-world/" rel="alternate"></link><published>2013-02-13T00:00:00-02:00</published><updated>2013-02-13T00:00:00-02:00</updated><author><name>Maurício Gardini</name></author><id>tag:None,2013-02-13:/blog/hello-world/</id><summary type="html">&lt;p&gt;Well, I’m Maurício Gardini, and this is my&amp;nbsp;website.&lt;/p&gt;
&lt;p&gt;In my inaugural post, I was planning to talk about myself. But the draft of
this post was becoming kinda …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Well, I’m Maurício Gardini, and this is my&amp;nbsp;website.&lt;/p&gt;
&lt;p&gt;In my inaugural post, I was planning to talk about myself. But the draft of
this post was becoming kinda… huge. So, I’ll leave my “bio things” at the
About section and narrow this post to things related to what I’ll write about
in this&amp;nbsp;blog.&lt;/p&gt;
&lt;p&gt;It’s kind of a big thing to me to finally turn this idea into reality, ‘cause
this website was something that I wanted to accomplish for quite a long&amp;nbsp;time.&lt;/p&gt;
&lt;p&gt;I live by a motto: “Stay curious”. And, while this is a good thing generally
speaking, it can be kinda troublesome because I have many interests, but
little free time allied with a huge time management problem. And that’s why
this site’s launch got delayed… And delayed… And&amp;nbsp;delayed.&lt;/p&gt;
&lt;p&gt;Anyway: in this site, I’ll talk mainly about the things that I experience,
use and discover. Yeah, it’s going to be more like a technical site than a
blog, but I’m not intending to be very formal&amp;nbsp;either.&lt;/p&gt;
&lt;p&gt;So, yeah. Stay tuned for the upcoming updates.&amp;nbsp;=)&lt;/p&gt;
</content><category term="Blog"></category><category term="Hello World"></category></entry></feed>