Jaan Tollander de Balschhttps://jaantollander.github.io/2019-04-07T00:00:00+03:00<em>Computer Science & Applied Mathematics</em>How to Manage Tasks with Kanban2019-04-07T00:00:00+03:002019-04-07T00:00:00+03:00Jaan Tollander de Balschtag:jaantollander.github.io,2019-04-07:/2019-04-07-kanban.html
<p><img src="../images/kanban/KanbanFlowBoard_1000_2x.png" /></p>
<blockquote>
</blockquote>
<p>This article provides a quick overview of Kanban project management system and how it can be used for managing tasks, increasing productivity and visualizing workload. I found about Kanban by following <a href="https://www.youtube.com/watch?v=UdvwVYAaWEc">John Sonmez</a> as I was searching for tools for managing assignments in university. Since then I have been using Kanban for managing university assignments, improving my blog and managing work-related tasks. The text in this article was inspired by two articles, <a href="https://productivityland.com/blog/what-is-kanban-board/">What is Kanban Board?</a> and <a href="https://productivityland.com/lists/best-kanban-apps/">Best Kanban Apps</a>. I recommend reading them in conjunction with this article as they offer a broader picture of Kanban. As an example, the article explains how to use <a href="https://kanbanflow.com/">KanbanFlow</a> for managing school assignments. KanbanFlow was chosen because it has a good set of <a href="https://kanbanflow.com/features">features</a>, it’s easy to use and works in both desktop and mobile.</p>
<p><img src="../images/kanban/KanbanFlowBoard_1000_2x.png" /></p>
<blockquote>
</blockquote>
<p>This article provides a quick overview of Kanban project management system and how it can be used for managing tasks, increasing productivity and visualizing workload. I found about Kanban by following <a href="https://www.youtube.com/watch?v=UdvwVYAaWEc">John Sonmez</a> as I was searching for tools for managing assignments in university. Since then I have been using Kanban for managing university assignments, improving my blog and managing work-related tasks. The text in this article was inspired by two articles, <a href="https://productivityland.com/blog/what-is-kanban-board/">What is Kanban Board?</a> and <a href="https://productivityland.com/lists/best-kanban-apps/">Best Kanban Apps</a>. I recommend reading them in conjunction with this article as they offer a broader picture of Kanban. As an example, the article explains how to use <a href="https://kanbanflow.com/">KanbanFlow</a> for managing school assignments. KanbanFlow was chosen because it has a good set of <a href="https://kanbanflow.com/features">features</a>, it’s easy to use and works in both desktop and mobile.</p>
<p><strong>Keywords</strong>: Productivity, Project Management, Kanban, Pomodoro, KanbanFlow</p>
<h2 id="overview-of-kanban">Overview of Kanban</h2>
<p><strong>Kanban</strong> is a project management system originally used in lean manufacturing, but more recently it has become popular in knowledge work. Kanban is commonly applied in Agile software development, but can also be applied for managing school assignments and writing a blog. The core principles of Kanban are:</p>
<ol type="1">
<li>Visualize your work</li>
<li>Limit your work in process</li>
<li>Focus on flow</li>
</ol>
<p>The <strong>Kanban board</strong> consists of <strong>columns</strong> and <strong>cards</strong>. It visualizes the project such that each card represents an individual <strong>task</strong> in the project and each column represents the <strong>state</strong> of the particular task. By convention, the cards are moved from left to right. Kanban board can also have multiple <strong>members</strong> working on the project. Kanban board can also be associated with a <strong>timer</strong>. The timer can be used to measure the amount of time it takes to complete a task, which can then be used to estimate the future workload of similar tasks.</p>
<p>The standard columns are:</p>
<ul>
<li><strong><em>To-Do</em></strong> – Tasks that are not yet started.</li>
<li><strong><em>Work In Progress (WIP)</em></strong> – Tasks that are in progress. This column can be limited to only be able to have a certain number of tasks at a time in order to limit multitasking.</li>
<li><strong><em>Done</em></strong> – Tasks that are completed.</li>
</ul>
<p>Columns can be added, removed and modified as needed for the project. Each card has the following attributes:</p>
<ul>
<li><strong><em>Title</em></strong> – The name of the task.</li>
<li><strong><em>Description</em></strong> – Describes what the task is about.</li>
<li><strong><em>Due date</em></strong> – The date and time when the task is due.</li>
<li><strong><em>Subtasks</em></strong> – Subtasks needed to complete the task. Subtasks should be simple, otherwise, consider creating another Kanban card of that subtask.</li>
<li><strong><em>Color</em></strong> – Colors can be used to indicate the type of the task.</li>
<li><strong><em>Label</em></strong> – Labels can be used to classify task into categories.</li>
<li><strong><em>Member</em></strong> – Project members assigned to the task.</li>
</ul>
<p>The timer has two options:</p>
<ul>
<li><strong><em>Stopwatch</em></strong> – Stopwatch can be used to measure the time taken to complete a task.</li>
<li><strong><em>Pomodoro</em></strong> – <a href="https://kanbanflow.com/pomodoro-technique">Pomodoro technique</a> is a time management technique based on using 25 minute timeboxes referred as Pomodoro for focused work separated by short 3-5 minute breaks and longer 15-30 minutes break after four Pomodori are done.</li>
</ul>
<h2 id="example-managing-school-assignments">Example: Managing School Assignments</h2>
<p><img src="../images/kanban/school_assignments.png" /></p>
<p>My personal Kanban board for school assignments consists of the standard columns: <em>To-do</em>, <em>In progress</em> and <em>Done</em>. Tasks are added into <em>To-do</em> column with a title containing the course name or an abbreviation of it, the exercise round and the name. Each task has a due date which is set. Some tasks have subtasks and these should be also listed. Colors for tasks are set such that each active course has a unique color. This makes different courses easier to identify.</p>
<p>The workflow follows the standard pattern. Move tasks from <em>To-do</em> to <em>In progress</em> column as you start working on them. Then once the task is completed it’s moved into <em>Done</em> column.</p>
Exploring the Pointwise Convergence of Legendre Series for Piecewise Analytic Functions2019-03-09T00:00:00+02:002019-03-09T00:00:00+02:00Jaan Tollander de Balschtag:jaantollander.github.io,2019-03-09:/2019-03-09-legendre-series.html
<p><img src="../images/legendre_series/legendre_series.png" /></p>
<p>This article numerically explores the behavior of the pointwise convergence of Legendre series for piecewise analytic functions. The article extensively covers all of the mathematics required for forming and computing the series as well as pseudocode code for some of the non-trivial the algorithms. It extends the research made in the papers by Babuska and Hakula <span class="citation" data-cites="Babuska2014 Babuska2019">(1, 2)</span> by proving evidence for the conjectures about the Legendre series in a large number of points in the domain and up to very high degree series approximations. The numerical results are represented as figures provided with explanations. The Python code for computing and recreating the results is provided in <a href="https://github.com/jaantollander/LegendreSeries">LegendreSeries</a> repository.</p>
<p><img src="../images/legendre_series/legendre_series.png" /></p>
<p>This article numerically explores the behavior of the pointwise convergence of Legendre series for piecewise analytic functions. The article extensively covers all of the mathematics required for forming and computing the series as well as pseudocode code for some of the non-trivial the algorithms. It extends the research made in the papers by Babuska and Hakula <span class="citation" data-cites="Babuska2014 Babuska2019">(1, 2)</span> by proving evidence for the conjectures about the Legendre series in a large number of points in the domain and up to very high degree series approximations. The numerical results are represented as figures provided with explanations. The Python code for computing and recreating the results is provided in <a href="https://github.com/jaantollander/LegendreSeries">LegendreSeries</a> repository.</p>
<p><strong>Table of contents</strong></p>
<!-- TOC depthFrom:2 depthTo:6 withLinks:1 updateOnSave:1 orderedList:0 -->
<ul>
<li><a href="#legendre-polynomials">Legendre Polynomials</a></li>
<li><a href="#legendre-series">Legendre Series</a></li>
<li><a href="#piecewise-analytic-functions">Piecewise Analytic Functions</a></li>
<li><a href="#legendre-series-of-step-function">Legendre Series of Step Function</a></li>
<li><a href="#legendre-series-of-v-function">Legendre Series of V Function</a></li>
<li><a href="#pointwise-convergence">Pointwise Convergence</a></li>
<li><a href="#convergence-line">Convergence Line</a></li>
<li><a href="#conjectures-of-pointwise-convergence">Conjectures of Pointwise Convergence</a></li>
<li><a href="#results">Results</a>
<ul>
<li><a href="#step-function">Step Function</a></li>
<li><a href="#v-function">V Function</a></li>
</ul></li>
<li><a href="#python-code">Python Code</a></li>
<li><a href="#conclusions">Conclusions</a></li>
<li><a href="#references">References</a></li>
</ul>
<!-- /TOC -->
<p><strong>Keywords</strong>: Legendre polynomials, Classical orthogonal polynomials, Piecewise analytic functions, Legendre series, Generalized Fourier series, Convergence of Fourier series</p>
<h2 id="legendre-polynomials">Legendre Polynomials</h2>
<p><img src="../images/legendre_series/legendre_polynomials.png" /></p>
<p><a href="https://en.wikipedia.org/wiki/Legendre_polynomials">Legendre polynomials</a> are a system of complete and orthogonal polynomials defined over the <strong>domain</strong> <span class="math inline">\(Ω=[-1, 1]\)</span> which is an interval between the <strong>edges</strong> <span class="math inline">\(-1\)</span> and <span class="math inline">\(1\)</span>, as a <strong>recursive formula</strong> <span class="math display">\[
\begin{aligned}
P_{0}(x) &= 1\\
P_{1}(x) &= x \\
P_{n}(x) &= \frac{2n-1}{n} x P_{n-1}(x) - \frac{n-1}{n} P_{n-2}(x), n≥2.
\end{aligned}
\tag{1}
\label{recursive-formula}
\]</span> The recursive definition enables efficient computing of numerical values of high degree Legendre polynomials at specific points in the domain.</p>
<p>Legendre polynomials also have important properties which are used for forming the Legendre series. The <strong>terminal values</strong>, i.e. the values at the edges, of Legendre polynomials can be derived from the recursive formula <span class="math display">\[
\begin{aligned}
P_{n}(1) &= 1 \\
P_{n}(-1) &= (-1)^n.
\end{aligned}
\tag{2}
\label{terminal-values}
\]</span> The <strong>symmetry</strong> property also follows from the recursive formula <span class="math display">\[
\begin{aligned}
P_n(-x) = (-1)^n P_n(x).
\end{aligned}
\tag{3}
\label{symmetry}
\]</span> The <strong>inner product</strong> is denoted by the angles <span class="math display">\[
\begin{aligned}
⟨P_m(x), P_n(x)⟩_{2} &= \int_{-1}^{1} P_m(x) P_n(x) \,dx \\
&= \frac{2}{2n + 1} δ_{mn},
\end{aligned}
\tag{4}
\label{inner-product}
\]</span> where <span class="math inline">\(δ_{mn}\)</span> is Kronecker delta. <!-- **Orthogonality** which follows from the inner product
\[
\begin{aligned}
\|P_{n}\|_{2}^{2} = \frac{2}{2n + 1}.
\end{aligned}
\] --> <strong>Differentiation</strong> of Legendre polynomials can be defined in terms of Legendre polynomials themselves as <span class="math display">\[
(2n+1) P_n(x) = \frac{d}{dx} \left[ P_{n+1}(x) - P_{n-1}(x) \right].
\tag{5}
\label{differentiation-rule}
\]</span> The differentiation <span class="math inline">\(\eqref{differentiation-rule}\)</span> rule can also be formed into the <strong>integration rule</strong> <span class="math display">\[
∫P_n(x)dx = \frac{1}{2n+1} (P_{n+1}(x) - P_{n-1}(x)).
\tag{6}
\label{integration-rule}
\]</span></p>
<h2 id="legendre-series">Legendre Series</h2>
<p>The <strong>Legendre series</strong> is a <a href="https://en.wikipedia.org/wiki/Series_expansion">series expansion</a> which is formed using Legendre polynomials. Legendre series of function <span class="math inline">\(f\)</span> is defined as <span class="math display">\[
f(x) = ∑_{n=0}^{∞}C_{n}P_{n}(x).
\tag{7}
\label{legendre-series}
\]</span> where <span class="math inline">\(C_n∈ℝ\)</span> are the <strong>Legendre series coefficients</strong> and <span class="math inline">\(P_n(x)\)</span> Legendre polynomials of degree <span class="math inline">\(n\)</span>. The formula for the coefficients is defined <span class="math display">\[
C_n = \frac{2n+1}{2} \int_{-1}^{1} f(x) P_{n}(x)\,dx.
\tag{8}
\label{legendre-series-coefficients}
\]</span></p>
<hr />
<p><strong>Proof</strong>: The Legendre series coefficients can be derived using the Legendre series formula <span class="math inline">\(\eqref{legendre-series}\)</span> and the inner product <span class="math inline">\(\eqref{inner-product}\)</span>. <span class="math display">\[
\begin{aligned}
f(x) &= ∑_{m=0}^{∞}C_{m}P_{m}(x) \\
P_{n}(x) f(x) &= P_{n}(x) \sum _{m=0}^{\infty }C_{m}P_{m}(x) \\
∫_{-1}^{1}P_{n}(x) f(x)\,dx &= ∫_{-1}^{1} P_{n}(x) \sum _{m=0}^{\infty }C_{m}P_{m}(x)\,dx \\
∫_{-1}^{1}P_{n}(x) f(x)\,dx &= \sum _{m=0}^{\infty }C_{m}∫_{-1}^{1} P_{n}(x) P_{m}(x)\,dx \\
∫_{-1}^{1}P_{n}(x) f(x)\,dx &= C_{n}∫_{-1}^{1} P_{n}(x) P_{n}(x)\,dx \\
C_{n} &= {\langle f,P _{n}\rangle _{2} \over \|P _{n}\|_{2}^{2}} \\
C_n &= \frac{2n+1}{2} \int_{-1}^{1} f(x) P_{n}(x)\,dx.
\end{aligned}
\]</span></p>
<hr />
<p>The <strong>partial sum</strong> of the series expansion gives us an approximation of the function <span class="math inline">\(f\)</span>. It’s obtained by limiting the series to a finite number of terms <span class="math inline">\(k\)</span> <span class="math display">\[
f_k(x)=\sum _{n=0}^{k}C_{n}P_{n}(x).
\tag{9}
\label{partial-sum}
\]</span> The <strong>approximation error</strong> <span class="math inline">\(ε_k\)</span> is obtained by subtracting the partial sum <span class="math inline">\(f_k\)</span> from the real value of the function <span class="math inline">\(f\)</span> <span class="math display">\[
ε_k(x) = f(x)-f_k(x).
\tag{10}
\label{approximation-error}
\]</span> The actual analysis of the approximation errors will be using the absolute value of the error <span class="math inline">\(|ε_k(x)|.\)</span></p>
<h2 id="piecewise-analytic-functions">Piecewise Analytic Functions</h2>
<p><img src="../images/legendre_series/piecewise_functions.png" /></p>
<p>The motivation for studying a series expansion for piecewise analytic functions is to understand the behavior of a continuous approximation of a function with non-continuous or non-differentiable points. The series expansion will be studied on two special cases of piecewise analytic functions, the <strong>step function</strong> and the <strong>V function</strong>. The results obtained from studying these two special cases generalizes into all piecewise analytic functions, but this is not proven here.</p>
<p><strong>Piecewise analytic function</strong> <span class="math inline">\(f(x):Ω → ℝ\)</span> is defined <span class="math display">\[
f(x) = \sum_{i=1}^{m} c_i | x-a_i |^{b_i} + v(x),
\tag{11}
\label{piecewise-analytic-function}
\]</span> where <span class="math inline">\(a_i∈(-1,1)\)</span> are the <strong>singularities</strong>, <span class="math inline">\(b_i∈ℕ_0\)</span> are the <strong>degrees</strong>, <span class="math inline">\(c_i∈ℝ\)</span> are the scaling coefficients and <span class="math inline">\(v(x)\)</span> is an analytic function. The <strong>V function</strong> is piecewise analytic function of degree <span class="math inline">\(b=1\)</span> and it is defined as <span class="math display">\[
u(x) = c ⋅ |x - a| + (α + βx).
\tag{12}
\label{v-function}
\]</span> The <strong>step function</strong> is piecewise analytic function of degree <span class="math inline">\(b=0\)</span> and it is obtained as the derivative of the V-function <span class="math display">\[
\frac{d}{dx} u(x) = u'(x) = c ⋅ \operatorname{sign}{(x - a)} + β.
\tag{13}
\label{step-function}
\]</span> As can be seen, the V function is the absolute value scaled with <span class="math inline">\(c\)</span>, translated with <span class="math inline">\(α\)</span> and rotated by <span class="math inline">\(βx\)</span> and the step function is sign function that is scaled with <span class="math inline">\(c\)</span> and translated with <span class="math inline">\(β\)</span>.</p>
<p>We’ll also note that the <strong>derivative of step function</strong> is zero <span class="math display">\[
\frac{d}{dx} u'(x) = u''(x) = 0.
\tag{14}
\label{step-function-derivative}
\]</span> This will be used when forming the Legendre series.</p>
<h2 id="legendre-series-of-step-function">Legendre Series of Step Function</h2>
<iframe width="1280" height="640" src="https://www.youtube.com/embed/lFiMoiqpuCg" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen>
</iframe>
<p>The coefficients for the Legendre series of the step function will be referred as <strong>step function coefficients</strong>. A formula for them in terms of Legendre polynomials at the singularity <span class="math inline">\(a\)</span> can be obtained by substituting the step function <span class="math inline">\(\eqref{step-function}\)</span> in place of the function <span class="math inline">\(f\)</span> in the Legendre series coefficient formula <span class="math inline">\(\eqref{legendre-series-coefficients}\)</span> <span class="math display">\[
\begin{aligned}
A_n &= \frac{2n+1}{2} \int_{-1}^{1} u'(x) P_{n}(x)\,dx \\
&=
\begin{cases}
β-ac, & n=0 \\
c(P_{n-1}(a)-P_{n+1}(a)), & n≥1\\
\end{cases}.
\end{aligned}
\tag{15}
\label{step-function-coefficients}
\]</span></p>
<hr />
<p><strong>Proof</strong>: The coefficients for degree <span class="math inline">\(n=0\)</span> are obtained from direct integration <span class="math display">\[
\begin{aligned}
A_{0} &= \frac{1}{2} \int_{-1}^{1} u^{\prime}(x) \,dx \\
&= \beta + \frac{1}{2} c \int_{-1}^{1} \operatorname{sign}{\left (x - a \right )}\,dx \\
&= \beta + \frac{1}{2} c \left(\int_{-1}^{a} -1\,dx + \int_{a}^{1} 1\,dx\right) \\
&= \beta - ac.
\end{aligned}
\tag{16}
\label{step-function-coefficients-0}
\]</span></p>
<p>The coefficients for degrees <span class="math inline">\(n≥1\)</span> are obtained by using <a href="https://en.wikipedia.org/wiki/Integration_by_parts">integration by parts</a>, integral rule <span class="math inline">\(\eqref{integration-rule}\)</span>, terminal values <span class="math inline">\(\eqref{terminal-values}\)</span> and the derivative of step function <span class="math inline">\(\eqref{step-function-derivative}\)</span> <span class="math display">\[
\begin{aligned}
A_{n} &= \frac{2n+1}{2} \int_{-1}^{1} u^{\prime}(x) P_{n}(x)\,dx, n≥1\\
&= \frac{2n+1}{2} \left( \left[u^\prime(x) \int P_n(x) dx\right]_{-1}^{1} - \int_{-1}^{1} u^{\prime\prime}(x) P_n(x) dx \right) \\
&= \frac{2n+1}{2} \left[ \frac{1}{2n+1} (P_{n+1}(x) - P_{n-1}(x)) u^\prime(x) \right]_{-1}^{1} \\
&= \frac{1}{2} \left[ (P_{n+1}(x) - P_{n-1}(x)) u^\prime(x) \right]_{-1}^{1} \\
&= \frac{1}{2} \left(\left[ (P_{n+1}(x) - P_{n-1}(x)) u^\prime(x) \right]_{-1}^{a} + \left[ (P_{n+1}(x) - P_{n-1}(x)) u^\prime(x) \right]_{a}^{1}\right) \\
&= \frac{1}{2} \left(\left[ (P_{n+1}(x) - P_{n-1}(x)) \cdot (-c+\beta) \right]_{-1}^{a} + \left[ (P_{n+1}(x) - P_{n-1}(x)) \cdot (c+\beta) \right]_{a}^{1}\right) \\
&= c \cdot \left(P_{n-1}(a) - P_{n+1}(a)\right).
\end{aligned}
\tag{17}
\label{step-function-coefficients-n}
\]</span></p>
<h2 id="legendre-series-of-v-function">Legendre Series of V Function</h2>
<iframe width="1280" height="640" src="https://www.youtube.com/embed/kEzZ1tElEHk" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen>
</iframe>
<p>The coefficients for the Legendre series of the step function will be referred as <strong>V function coefficients</strong>. A formula for them in terms of step function coefficients can be obtained by substituting the V function <span class="math inline">\(\eqref{v-function}\)</span> in place of the function <span class="math inline">\(f\)</span> in the Legendre series coefficient formula <span class="math inline">\(\eqref{legendre-series-coefficients}\)</span> <span class="math display">\[
\begin{aligned}
B_n &= \frac{2n+1}{2} \int_{-1}^{1} u(x) P_{n}(x)\,dx. \\
&=
\begin{cases}
\frac{a^{2} c}{2} + α + \frac{c}{2}, & n=0 \\
-\frac{A_{n+1}}{2n +3} + \frac{A_{n-1}}{2n - 1}, & n≥1
\end{cases}.
\end{aligned}
\tag{18}
\label{v-function-coefficients}
\]</span></p>
<hr />
<p><strong>Proof</strong>: The coefficients for degree <span class="math inline">\(n=0\)</span> are obtained from direct integration <span class="math display">\[
\begin{aligned}
B_{0} &= \frac{1}{2} ∫_{-1}^{1} u(x) \,dx \\
&= \frac{a^{2} c}{2} + α + \frac{c}{2}.
\end{aligned}
\tag{19}
\label{v-function-coefficients-0}
\]</span></p>
<p>The coefficients for degrees <span class="math inline">\(n≥1\)</span> are obtained by using <a href="https://en.wikipedia.org/wiki/Integration_by_parts">integration by parts</a>, integral rule <span class="math inline">\(\eqref{integration-rule}\)</span> and substituting the step function coefficient formula <span class="math inline">\(\eqref{step-function-coefficients}\)</span> <span class="math display">\[
\begin{aligned}
B_{n} =& \frac{2n+1}{2} \int_{-1}^{1} u(x) P_{n}(x)\,dx, \quad n \geq 1 \\
=& \frac{2n + 1}{2} \left ( \left [ u(x) \int P_n(x)\,dx \right ]_{-1}^{1} - \int_{-1}^{1} u'(x) \int P_{n}\,dx\,dx \right ) \\
=& -\frac{1}{2} \int_{-1}^{1} \left [ P_{n+1}(x) - P_{n-1}(x) \right ] u'(x) \,dx\\
=& -\frac{1}{2} \int_{-1}^{1} P_{n+1}(x) u'(x)\,dx + \frac{1}{2} \int_{-1}^{1} P_{n-1}(x) u'(x)\,dx.\\
=& -\frac{A_{n+1}}{2n +3} + \frac{A_{n-1}}{2n - 1}.
\end{aligned}
\tag{20}
\label{v-function-coefficients-n}
\]</span></p>
<!-- ## The Approximation Error
Lets denote
\[
a'_n = P_{n-1}(a) - P_{n+1}(a)
\]
When substituted in the series formula the series takes form
\[
\begin{aligned}
u^{\prime}_k(x) &= \beta - a c + c \sum_{n=1}^{k} a'_n P_{n}(x)
\end{aligned}
\]
The absolute values of the error \(ε\) for the series is defined as
\[
\begin{aligned}
ε_k(x) &= u^′(x) - u_k^′(x) \\
&= c \left(\operatorname{sign}{\left (x - a \right )} - \left(-a + \sum_{n=1}^{k} P_{n}(x) \left(P_{n-1}(a) - P_{n+1}(a)\right)\right) \right).
\end{aligned}
\]
TODO: isolate the effect of β on the error
Lets denote
\[
b'_n = -\frac{a'_{n+1}}{2n +3} + \frac{a'_{n-1}}{2n - 1}, n≥2
\]
Then
\[
u_k(x) = \frac{a^{2} c}{2} + α + \frac{c}{2} + b_1 P(1) + c\sum_{n=2}^{k}b'_nP(x) \\
= α + b_1 P(1) + c\left(\frac{a^{2}+1}{2} + \sum_{n=2}^{k}b'_nP(x)\right)
\]
Error
\[
ε_k(x) = |u(x) - u_k(x)| \\
= c ⋅ |x - a| + (α + βx) - \Big(\frac{a^{2} c}{2} + α + \frac{c}{2} + \sum_{n=1}^{k}b_nP(x)\Big)
\] -->
<h2 id="pointwise-convergence">Pointwise Convergence</h2>
<figure>
<img src="../images/legendre_series/pointwise_convergence/step_function/0.5/-0.9000000.png" alt="Example of pointwise convergence a step function series." /><figcaption><em>Example of pointwise convergence a step function series.</em></figcaption>
</figure>
<blockquote>
</blockquote>
<p>The series is said to <a href="https://en.wikipedia.org/wiki/Pointwise_convergence"><strong>converge pointwise</strong></a> if the partial sum <span class="math inline">\(f_k(x)\)</span> tends to the value <span class="math inline">\(f(x)\)</span> as the degree <span class="math inline">\(k\)</span> approaches infinity in every <span class="math inline">\(x\)</span> in the domain <span class="math inline">\(Ω\)</span> <span class="math display">\[
\lim_{k→∞} f_k(x)=f(x).
\tag{21}
\label{pointwise_convergence}
\]</span> Equivalently in terms of the approximation error which approaches zero <span class="math display">\[
\lim_{k→∞} ε_k(x)=0.
\tag{22}
\label{approximation_error_convergence}
\]</span> Numerical exploration of the pointwise convergence explores the behavior of the approximation error <span class="math inline">\(ε_k(x)\)</span> as a function of degree <span class="math inline">\(k\)</span> up to a finite degree <span class="math inline">\(n\)</span> at some finite amount of points <span class="math inline">\(x\)</span> selected from the domain <span class="math inline">\(Ω.\)</span> The numerical approach answers to <em>how the series converges</em> contrary to the analytical approach which answers <em>if the series converges</em>.</p>
<h2 id="convergence-line">Convergence Line</h2>
<p>The exploration is done by computing a <strong>convergence line</strong> which contains two parameters:</p>
<ol type="1">
<li><p>The <strong>convergence rate</strong> which is the maximal rate at which the error approaches zero as the degree grows.</p></li>
<li><p>The <strong>convergence distance</strong> which is a value proportional to the degree when the series reaches the maximal rate of convergence.</p></li>
</ol>
<p>The definition of the converge line requires a definition for a line. A <strong>line between two points</strong> <span class="math inline">\((x_0,y_0)\)</span> and <span class="math inline">\((x_1,y_1)\)</span> where <span class="math inline">\(x_0≠x_1\)</span> is defined as <span class="math display">\[
y=(x-x_{0})\,{\frac {y_{1}-y_{0}}{x_{1}-x_{0}}}+y_{0}.
\tag{23}
\label{line1}
\]</span> An alternative form of this formula is <span class="math display">\[
y=\tilde{a}x+\tilde{β},
\tag{24}
\label{line2}
\]</span> where the coefficient <span class="math inline">\(\tilde{α}=\frac {y_{1}-y_{0}}{x_{1}-x_{0}}\)</span> is referred as the <strong>slope</strong> and the coefficient <span class="math inline">\(\tilde{β}=(y_{0}-x_{0}\tilde{α})\)</span> is referred as the <strong>intercept</strong>.</p>
<hr />
<p>The pseudocode for the convergence line algorithm is then as follows:</p>
<p><strong>Input</strong>: A sequence of strictly monotonically increasing positive real numbers <span class="math inline">\((x_1,x_2,...,x_n)\)</span> and a sequence of positive real numbers <span class="math inline">\((y_1,y_2,...,y_n)\)</span> that converges towards zero (decreasing). Limit for the smallest value of the slope <span class="math inline">\(\tilde{α}_{min}\)</span>.</p>
<p><strong>Output</strong>: A convergence line defined by the values <span class="math inline">\(\tilde{α}\)</span> and <span class="math inline">\(\tilde{β}\)</span> which minimizes <span class="math inline">\(\tilde{α}\)</span> and minimizes <span class="math inline">\(\tilde{β}\)</span> such that <span class="math inline">\(\tilde{α}≥\tilde{α}_{min}\)</span> and <span class="math inline">\(y_i=\tilde{α}x_i+\tilde{β}\)</span> for all <span class="math inline">\(i=1,2,...,n.\)</span></p>
<p><span class="math inline">\(\operatorname{Find-Convergence-Line}((x_1,x_2,…,x_n),(y_1,y_2,…,y_n),\tilde{α}_{min})\)</span></p>
<ol type="1">
<li><span class="math inline">\(i=1\)</span></li>
<li><span class="math inline">\(j=i\)</span></li>
<li><strong>while</strong> <span class="math inline">\(j≠n\)</span></li>
<li>….. <span class="math inline">\(k=\underset{k>j}{\operatorname{argmax}}\left(\dfrac{y_k-y_j}{x_k-x_j}\right)\)</span></li>
<li>….. <span class="math inline">\(\tilde{α} = \dfrac{y_k-y_j}{x_k-x_j}\)</span></li>
<li>….. <strong>if</strong> <span class="math inline">\(\tilde{α} < \tilde{α}_{min}\)</span></li>
<li>….. ….. <strong>break</strong></li>
<li>….. <span class="math inline">\(i=j\)</span></li>
<li>….. <span class="math inline">\(j=k\)</span></li>
<li><span class="math inline">\(\tilde{α}=\dfrac{y_j-y_i}{x_j-x_i}\)</span></li>
<li><span class="math inline">\(\tilde{β}=y_i-x_i \tilde{α}\)</span></li>
<li><strong>return</strong> <span class="math inline">\((\tilde{α}, \tilde{β})\)</span></li>
</ol>
<hr />
<p>The approximation errors generated by the Legendre series have linear convergence in logarithmic scale, and therefore we need to convert the values into logarithmic scale, find the convergence line and then convert the line into exponential form <span class="math inline">\(βx^{-α}\)</span>.</p>
<p><strong>Input</strong>: The degrees <span class="math inline">\((k_1,k_2,...,k_n)\)</span> corresponding to the approximation errors <span class="math inline">\((ε_1,ε_2,...,ε_n)\)</span> generated by a series and the limit <span class="math inline">\(\tilde{α}_{min}\)</span>.</p>
<p><strong>Output</strong>: The coefficient <span class="math inline">\(α\)</span> correspond to the rate of convergence and the coefficient <span class="math inline">\(β\)</span> corresponds to the distance of convergence such that <span class="math inline">\(ε_k≤βk_i^{-α}\)</span> for all <span class="math inline">\(i=1,2,...,n.\)</span></p>
<p><span class="math inline">\(\operatorname{Find-Convergence-Line-Log}((k_1,k_2,...,k_n),(ε_1,ε_2,...,ε_n),a_{min})\)</span></p>
<ol type="1">
<li><span class="math inline">\(x=(\log_{10}(k_1),\log_{10}(k_2),...,\log_{10}(k_n))\)</span></li>
<li><span class="math inline">\(y=(\log_{10}(|ε_1|,\log_{10}(|ε_2|,...,\log_{10}(|ε_n|))\)</span></li>
<li><span class="math inline">\((\tilde{α},\tilde{b})=\operatorname{Find-Convergence-Line}(x,y,\tilde{α}_{min})\)</span></li>
<li><span class="math inline">\(α=-\tilde{α}\)</span></li>
<li><span class="math inline">\(β=10^\tilde{β}\)</span></li>
<li><strong>return</strong> <span class="math inline">\((α,β)\)</span></li>
</ol>
<!-- Transform line back into exponential form
\[
\begin{aligned}
\hat{y} &= ax + b \\
10^{\hat{y}} &= 10^{ax+b} \\
10^{\hat{y}} &= 10^b ⋅ {(10^x)}^a \\
\end{aligned}
\] -->
<h2 id="conjectures-of-pointwise-convergence">Conjectures of Pointwise Convergence</h2>
<p>The papers by Babuska and Hakula <span class="citation" data-cites="Babuska2014 Babuska2019">(1, 2)</span> introduced two conjectures about the convergence rate and convegence distance. They are stated as follows. The convergence rate <span class="math inline">\(α\)</span> depends on <span class="math inline">\(x\)</span> and the degree <span class="math inline">\(b\)</span> <span class="math display">\[
α(x,b)=
\begin{cases}
\max(b,1), & x=a \\
b+1/2, & x∈\{-1,1\} \\
b+1, & x∈(-1,a)∪(a,1). \\
\end{cases}
\tag{25}
\label{convergence-rate}
\]</span> As can be seen, there are different convergence rates at the edges, singularity and elsewhere.</p>
<p>The convergence distance <span class="math inline">\(β\)</span> depends on <span class="math inline">\(x\)</span> but is independent of the degree <span class="math inline">\(b\)</span>. <strong>Near singularity</strong> we have <span class="math display">\[
β(a±ξ)≤Dξ^{-ρ}, ρ=1
\tag{26}
\label{convergence-distance-near-singularity}
\]</span> and <strong>near edges</strong> we have <span class="math display">\[
β(±(1-ξ))≤Dξ^{-ρ}, ρ=1/4
\tag{27}
\label{convergence-distance-near-edges}
\]</span> where <span class="math inline">\(ξ\)</span> is small positive number and <span class="math inline">\(D\)</span> is a positive constant. The behaviour near the singularity is related to the <a href="https://en.wikipedia.org/wiki/Gibbs_phenomenon">Gibbs phenomenom</a>.</p>
<h2 id="results">Results</h2>
<p>The results were obtained by computing the approximation error <span class="math inline">\(\eqref{approximation-error}\)</span> for the step function and V function up to degree <span class="math inline">\(n=10^5.\)</span> The values of <span class="math inline">\(x\)</span> from the domain <span class="math inline">\(Ω\)</span> were chosen to include the edges, singularity, and its negation, zero, points near the edges and singularity, and points elsewhere in the domain. Then pointwise convergence was analyzed by finding the convergence line, i.e. the values for the rate of convergence <span class="math inline">\(α\)</span> and the distance of convergence <span class="math inline">\(β\)</span>, for the approximation errors. The values were then verified to follow the conjectures <span class="math inline">\(\eqref{convergence-rate}\)</span>, <span class="math inline">\(\eqref{convergence-distance-near-edges}\)</span> and <span class="math inline">\(\eqref{convergence-distance-near-singularity}\)</span> as can be seen from the figures below.</p>
<h3 id="step-function">Step Function</h3>
<p>The following results where <span class="math inline">\(a=0.5\)</span> and <span class="math inline">\(b=0\)</span> for the step function.</p>
<p><img src="../images/legendre_series/pointwise_convergence/step_function/0.5/-1.0000000.png" /></p>
<p><img src="../images/legendre_series/pointwise_convergence/step_function/0.5/1.0000000.png" /></p>
<p>Pointwise convergence at the edges has a convergence rate of <span class="math inline">\(α=1/2\)</span>.</p>
<p><img src="../images/legendre_series/pointwise_convergence/step_function/0.5/-0.5000000.png" /></p>
<p><img src="../images/legendre_series/pointwise_convergence/step_function/0.5/0.5000000.png" /></p>
<p>Pointwise convergence at the singularity and its negation has convergence rate of <span class="math inline">\(α=1\)</span>.</p>
<!-- ![](../images/legendre_series/pointwise_convergence/step_function/0.5/0.0000000.png) -->
<!-- Zero -->
<p><img src="../images/legendre_series/pointwise_convergence/step_function/0.5/0.4900000.png" /></p>
<p><img src="../images/legendre_series/pointwise_convergence/step_function/0.5/0.4990000.png" /></p>
<p><img src="../images/legendre_series/pointwise_convergence/step_function/0.5/0.4999000.png" /></p>
<p><img src="../images/legendre_series/pointwise_convergence/step_function/0.5/0.5100000.png" /></p>
<p><img src="../images/legendre_series/pointwise_convergence/step_function/0.5/0.5010000.png" /></p>
<p><img src="../images/legendre_series/pointwise_convergence/step_function/0.5/0.5001000.png" /></p>
<p>Pointwise convergence near singularity <span class="math inline">\(a±ξ\)</span> has a rate of convergence <span class="math inline">\(α=1\)</span> but as can be seen, the distance of convergence <span class="math inline">\(β\)</span> increases as <span class="math inline">\(x\)</span> moves closer to the singularity from either side.</p>
<p><img src="../images/legendre_series/pointwise_convergence/step_function/0.5/-0.9990000.png" /></p>
<p><img src="../images/legendre_series/pointwise_convergence/step_function/0.5/-0.9999000.png" /></p>
<p><img src="../images/legendre_series/pointwise_convergence/step_function/0.5/-0.9999900.png" /></p>
<p><img src="../images/legendre_series/pointwise_convergence/step_function/0.5/0.9990000.png" /></p>
<p><img src="../images/legendre_series/pointwise_convergence/step_function/0.5/0.9999000.png" /></p>
<p><img src="../images/legendre_series/pointwise_convergence/step_function/0.5/0.9999900.png" /></p>
<p>Pointwise convergence near edges <span class="math inline">\(±(1-ξ)\)</span> has a rate of convergence <span class="math inline">\(α=1\)</span> but similarly to points near singularity as <span class="math inline">\(x\)</span> moves closer to the edges the distance of convergence <span class="math inline">\(β\)</span> increases. Also, the pre-asymptotic region, i.e., region with different convergence rate, is clearly visible.</p>
<p><img src="../images/legendre_series/convergence_distances/step_function/0.5.png" /></p>
<p>The convergence distances <span class="math inline">\(β\)</span> are plotted into a graph as a function of <span class="math inline">\(x\)</span>. The behavior at the near edges and near singularity can be clearly seen. Values in these regions can be plotted on a logarithmic scale.</p>
<p><img src="../images/legendre_series/convergence_distances_loglog/step_function/0.5/near_left_a.png" /></p>
<p><img src="../images/legendre_series/convergence_distances_loglog/step_function/0.5/near_right_a.png" /></p>
<p>Near-singularity convergence distances <span class="math inline">\(β(a±ξ)\)</span> as a function of <span class="math inline">\(x\)</span> are linear at the logarithmic scale where the parameter <span class="math inline">\(ρ≈1.0.\)</span></p>
<p><img src="../images/legendre_series/convergence_distances_loglog/step_function/0.5/near_left_edge.png" /></p>
<p><img src="../images/legendre_series/convergence_distances_loglog/step_function/0.5/near_right_edge.png" /></p>
<p>Near edges, convergence distances <span class="math inline">\(β(±(1-ξ))\)</span> as a function of <span class="math inline">\(x\)</span> are linear at the logarithmic scale where the parameter <span class="math inline">\(ρ≈1/4.\)</span></p>
<h3 id="v-function">V Function</h3>
<p>The following results where <span class="math inline">\(a=0.5\)</span> and <span class="math inline">\(b=1\)</span> for the V function. The results are similar, but not identical to those of the step function.</p>
<p><img src="../images/legendre_series/pointwise_convergence/v_function/0.5/-1.0000000.png" /></p>
<p><img src="../images/legendre_series/pointwise_convergence/v_function/0.5/1.0000000.png" /></p>
<p>Pointwise convergence at the edges has a convergence rate of <span class="math inline">\(α=1+1/2\)</span>.</p>
<p><img src="../images/legendre_series/pointwise_convergence/v_function/0.5/-0.5000000.png" /></p>
<p>Pointwise convergence at the negation of singularity has convergence rate of <span class="math inline">\(α=2\)</span></p>
<p><img src="../images/legendre_series/pointwise_convergence/v_function/0.5/0.5000000.png" /></p>
<p>Pointwise convergence at the singularity has a convergence rate of <span class="math inline">\(α=1\)</span>. As can be seen, the convergence pattern is almost linear with very little oscillation.</p>
<!-- ![](../images/legendre_series/pointwise_convergence/v_function/0.5/0.0000000.png) -->
<!-- Zero -->
<p><img src="../images/legendre_series/pointwise_convergence/v_function/0.5/0.4900000.png" /></p>
<p><img src="../images/legendre_series/pointwise_convergence/v_function/0.5/0.4990000.png" /></p>
<p><img src="../images/legendre_series/pointwise_convergence/v_function/0.5/0.4999000.png" /></p>
<p><img src="../images/legendre_series/pointwise_convergence/v_function/0.5/0.5100000.png" /></p>
<p><img src="../images/legendre_series/pointwise_convergence/v_function/0.5/0.5010000.png" /></p>
<p><img src="../images/legendre_series/pointwise_convergence/v_function/0.5/0.5001000.png" /></p>
<p>Pointwise convergence near singularity <span class="math inline">\(a±ξ\)</span> has a rate of convergence <span class="math inline">\(α=2\)</span> but as can be seen, the distance of convergence <span class="math inline">\(β\)</span> increases as <span class="math inline">\(x\)</span> moves closer to the singularity from either side.</p>
<p><img src="../images/legendre_series/pointwise_convergence/v_function/0.5/-0.9990000.png" /></p>
<p><img src="../images/legendre_series/pointwise_convergence/v_function/0.5/-0.9999000.png" /></p>
<p><img src="../images/legendre_series/pointwise_convergence/v_function/0.5/-0.9999900.png" /></p>
<p><img src="../images/legendre_series/pointwise_convergence/v_function/0.5/0.9990000.png" /></p>
<p><img src="../images/legendre_series/pointwise_convergence/v_function/0.5/0.9999000.png" /></p>
<p><img src="../images/legendre_series/pointwise_convergence/v_function/0.5/0.9999900.png" /></p>
<p>Pointwise convergence near edges <span class="math inline">\(±(1-ξ)\)</span> has a rate of convergence <span class="math inline">\(α=2\)</span> but similarly to points near singularity as <span class="math inline">\(x\)</span> moves closer to the edges the distance of convergence <span class="math inline">\(β\)</span> increases. Also, the pre-asymptotic region, i.e., region with different convergence rate, is clearly visible.</p>
<p><img src="../images/legendre_series/convergence_distances/v_function/0.5.png" /></p>
<p>The convergence distances <span class="math inline">\(β\)</span> are plotted into a graph as a function of <span class="math inline">\(x\)</span>. The behavior at the near edges and near singularity can be clearly seen. Values in these regions can be plotted on a logarithmic scale.</p>
<p><img src="../images/legendre_series/convergence_distances_loglog/v_function/0.5/near_left_a.png" /></p>
<p><img src="../images/legendre_series/convergence_distances_loglog/v_function/0.5/near_right_a.png" /></p>
<p>Near-singularity convergence distances <span class="math inline">\(β(a±ξ)\)</span> as a function of <span class="math inline">\(x\)</span> are linear at the logarithmic scale where the parameter <span class="math inline">\(ρ≈1.0.\)</span></p>
<p><img src="../images/legendre_series/convergence_distances_loglog/v_function/0.5/near_left_edge.png" /></p>
<p><img src="../images/legendre_series/convergence_distances_loglog/v_function/0.5/near_right_edge.png" /></p>
<p>Near edges, convergence distances <span class="math inline">\(β(±(1-ξ))\)</span> as a function of <span class="math inline">\(x\)</span> are linear at the logarithmic scale where the parameter <span class="math inline">\(ρ≈1/4.\)</span></p>
<h2 id="python-code">Python Code</h2>
<p>The source code for the algorithms, plots, and animations is available in <a href="https://github.com/jaantollander/LegendreSeries">LegendreSeries</a> GitHub repository. It also contains the instructions on how to run the code.</p>
<h2 id="conclusions">Conclusions</h2>
<p>The results show that the Legendre series for piecewise analytic functions follows the conjectures <span class="math inline">\(\eqref{convergence-rate}, \eqref{convergence-distance-near-singularity}\)</span> and <span class="math inline">\(\eqref{convergence-distance-near-edges}\)</span> with high precision upto very high degree series expansion.</p>
<p>The future research could be extended to study the effects of the position of the singularity <span class="math inline">\(a\)</span> to the constant <span class="math inline">\(D\)</span> or to study series expansion using other classical orthogonal polynomials and special cases of Jacobi polynomials such as Chebyshev polynomials, but their formulas are unlikely to have convenient closed-form solutions and could, therefore, be more difficult to study.</p>
<h2 id="references" class="unnumbered">References</h2>
<div id="refs" class="references">
<div id="ref-Babuska2014">
<p>1. BABUŠKA, Ivo and HAKULA, Harri. On the $p$-version of FEM in one dimension: The known and unknown features. [online]. 2014. P. 1–25. Available from: <a href="http://arxiv.org/abs/1401.1483" class="uri">http://arxiv.org/abs/1401.1483</a></p>
</div>
<div id="ref-Babuska2019">
<p>2. BABUŠKA, Ivo and HAKULA, Harri. Pointwise error estimate of the Legendre expansion : The known and unknown features. <em>Computer Methods in Applied Mechanics and Engineering</em> [online]. 2019. Vol. 345, no. 339380, p. 748–773. DOI <a href="https://doi.org/10.1016/j.cma.2018.11.017">10.1016/j.cma.2018.11.017</a>. Available from: <a href="https://doi.org/10.1016/j.cma.2018.11.017" class="uri">https://doi.org/10.1016/j.cma.2018.11.017</a></p>
</div>
</div>
Noise Filtering Using 1€ Filter2018-12-29T00:00:00+02:002018-12-29T00:00:00+02:00Jaan Tollander de Balschtag:jaantollander.github.io,2018-12-29:/2018-12-29-noise-filtering-using-one-euro-filter.html
<p><img src="../images/one_euro_filter.gif" /></p>
<blockquote>
</blockquote>
<p>This article explores the 1€ Filter (1e filter, 1 euro filter, One Euro Filter), a simple, but powerful algorithm for filtering real-time noisy signals. The article focuses on the implementation of the algorithm in practice, and it covers the mathematical basis, a pseudocode implementation and simple pure Python implementation of the algorithm. In order to understand why and how the filter works, I recommend reading the original article <span class="citation" data-cites="one_euro_filter">(1)</span>.</p>
<p><img src="../images/one_euro_filter.gif" /></p>
<blockquote>
</blockquote>
<p>This article explores the 1€ Filter (1e filter, 1 euro filter, One Euro Filter), a simple, but powerful algorithm for filtering real-time noisy signals. The article focuses on the implementation of the algorithm in practice, and it covers the mathematical basis, a pseudocode implementation and simple pure Python implementation of the algorithm. In order to understand why and how the filter works, I recommend reading the original article <span class="citation" data-cites="one_euro_filter">(1)</span>.</p>
<h2 id="the-1-filter">The 1€ Filter</h2>
<p>The <a href="http://cristal.univ-lille.fr/~casiez/1euro/">1€ Filter</a> is a low pass filter for filtering noisy signals in real time. It’s also a simple filter with only two configurable parameters. The signal at time <span class="math inline">\(T_i\)</span> is denoted as a value <span class="math inline">\(X_i\)</span> and the filtered signal as value <span class="math inline">\(\hat{X}_i\)</span>. The filter is implemented using <em>exponential smoothing</em> <span class="math display">\[
\hat{X}_1 = X_1 \\
\hat{X}_i = α X_i + (1-α) \hat{X}_{i-1}, i≥2
\tag{exponential-smoothing}
\label{exponential-smoothing}
\]</span> where the smoothing factor <span class="math inline">\(α∈[0, 1]\)</span>, instead of being a constant, is adaptive, i.e. dynamically computed using information about the rate of change (speed) of the signal. This aims to balance the jitter versus lag trade-off since people are more sensitive to jitter at low speeds and more sensitive to lag at high speeds. The smoothing factor is defined as <span class="math display">\[
α = \frac{1}{1 + \dfrac{τ}{T_e}},
\tag{smoothing-factor}
\label{smoothing-factor}
\]</span> where <span class="math inline">\(T_e\)</span> is the sampling period computed from the time difference between the samples <span class="math display">\[
T_e=T_i-T_{i-1}
\tag{sampling-period}
\]</span> and <span class="math inline">\(τ\)</span> is time constant computed using the cutoff frequency <span class="math display">\[
τ = \frac{1}{2πf_C}.
\tag{time-constant}
\]</span></p>
<p>The cutoff frequency <span class="math inline">\(f_C\)</span> which is designed to increase linearly as the rate of change, aka speed, increases <span class="math display">\[
f_C=f_{C_{min}} + β|\hat{\dot{X}}_i|
\tag{cutoff-frequency}
\]</span> where <span class="math inline">\(f_{C_{min}}>0\)</span> is the <em>minimum cutoff frequency</em>, <span class="math inline">\(β>0\)</span> is the <em>speed coefficient</em> and <span class="math inline">\(\hat{\dot{X}}_i\)</span> is the filtered rate of change. The rate of change <span class="math inline">\(\hat{X}_i\)</span> is defined as the discrete derivative of the signal <span class="math display">\[
\dot{X}_1 = 0 \\
\dot{X}_i = \frac{X_i-\hat{X}_{i-1}}{T_e}, i≥2,
\tag{derivative}
\]</span> which is then filtered using <span class="math inline">\(\eqref{exponential-smoothing}\)</span> with a constant cutoff frequency <span class="math inline">\(f_{C_d},\)</span> by default <span class="math inline">\(f_{C_d}=1\)</span>.</p>
<h2 id="the-algorithm">The Algorithm</h2>
<p>The One Euro Filter algorithm as pseudocode. The precise implementation of the One-Euro-filter will depend on the programming language and paradigm in question. This particular algorithm is written in a functional style.</p>
<p><span class="math inline">\(\operatorname{Smoothing-Factor}(f_C, T_e)\)</span></p>
<ol type="1">
<li><span class="math inline">\(r=2π⋅f_c⋅T_e\)</span></li>
<li><strong>return</strong> <span class="math inline">\(\dfrac{r}{r+1}\)</span></li>
</ol>
<p><span class="math inline">\(\operatorname{Exponential-Smoothing}(α, X_i, \hat{X}_{i-1})\)</span></p>
<ol type="1">
<li><strong>return</strong> <span class="math inline">\(α X_i + (1-α) \hat{X}_{i-1}\)</span></li>
</ol>
<p><span class="math inline">\(\operatorname{One-Euro-Filter}(T_i,X_i,T_{i-1},\hat{X}_{i-1},\hat{\dot{X}}_{i-1},f_C,β,f_{C_d})\)</span> for <span class="math inline">\(i≥2\)</span></p>
<ol type="1">
<li><span class="math inline">\(T_e=T_i-T_{i-1}\)</span></li>
<li><span class="math inline">\(α_d=\operatorname{Smoothing-Factor}(T_e, f_{C_d})\)</span></li>
<li><span class="math inline">\(\dot{X}_i = \dfrac{X_i-\hat{X}_{i-1}}{T_e}\)</span></li>
<li><span class="math inline">\(\hat{\dot{X}}_i=\operatorname{Exponential-Smoothing}(α_d, \dot{X}_i, \hat{\dot{X}}_{i-1})\)</span></li>
<li><span class="math inline">\(f_C=f_{C_{min}} + β|\hat{\dot{X}}_i|\)</span></li>
<li><span class="math inline">\(α=\operatorname{Smoothing-Factor}(f_C, T_e)\)</span></li>
<li><span class="math inline">\(\hat{X}_i=\operatorname{Exponential-Smoothing}(α, X_i, \hat{X}_{i-1})\)</span></li>
<li><strong>return</strong> <span class="math inline">\(T_i,\hat{X}_i,\hat{\dot{X}}_i\)</span></li>
</ol>
<h2 id="tuning-the-filter">Tuning the Filter</h2>
<p>There are two configurable parameters in the model, the <em>minimum cutoff frequency</em> <span class="math inline">\(f_{C_{min}}\)</span> and the <em>speed coefficient</em> <span class="math inline">\(β\)</span>. Decreasing minimum cutoff frequency will decrease slow speed jitter. Increasing speed coefficient will decrease speed lag.</p>
<h2 id="python-implementation">Python Implementation</h2>
<p>The following object-oriented Python implementation is also available in <a href="https://github.com/jaantollander/OneEuroFilter">OneEuroFilter</a> GitHub repository. The object-oriented approach stores the previous values inside the object instead of giving them explicitly as a return value as functional implementation would. It should be relatively simple to implement this algorithm in other languages.</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode python"><code class="sourceCode python"><a class="sourceLine" id="cb1-1" data-line-number="1"><span class="im">import</span> math</a>
<a class="sourceLine" id="cb1-2" data-line-number="2"></a>
<a class="sourceLine" id="cb1-3" data-line-number="3"></a>
<a class="sourceLine" id="cb1-4" data-line-number="4"><span class="kw">def</span> smoothing_factor(t_e, cutoff):</a>
<a class="sourceLine" id="cb1-5" data-line-number="5"> r <span class="op">=</span> <span class="dv">2</span> <span class="op">*</span> math.pi <span class="op">*</span> cutoff <span class="op">*</span> t_e</a>
<a class="sourceLine" id="cb1-6" data-line-number="6"> <span class="cf">return</span> r <span class="op">/</span> (r <span class="op">+</span> <span class="dv">1</span>)</a>
<a class="sourceLine" id="cb1-7" data-line-number="7"></a>
<a class="sourceLine" id="cb1-8" data-line-number="8"></a>
<a class="sourceLine" id="cb1-9" data-line-number="9"><span class="kw">def</span> exponential_smoothing(a, x, x_prev):</a>
<a class="sourceLine" id="cb1-10" data-line-number="10"> <span class="cf">return</span> a <span class="op">*</span> x <span class="op">+</span> (<span class="dv">1</span> <span class="op">-</span> a) <span class="op">*</span> x_prev</a>
<a class="sourceLine" id="cb1-11" data-line-number="11"></a>
<a class="sourceLine" id="cb1-12" data-line-number="12"></a>
<a class="sourceLine" id="cb1-13" data-line-number="13"><span class="kw">class</span> OneEuroFilter:</a>
<a class="sourceLine" id="cb1-14" data-line-number="14"> <span class="kw">def</span> <span class="fu">__init__</span>(<span class="va">self</span>, t0, x0, dx0<span class="op">=</span><span class="fl">0.0</span>, min_cutoff<span class="op">=</span><span class="fl">1.0</span>, beta<span class="op">=</span><span class="fl">0.0</span>,</a>
<a class="sourceLine" id="cb1-15" data-line-number="15"> d_cutoff<span class="op">=</span><span class="fl">1.0</span>):</a>
<a class="sourceLine" id="cb1-16" data-line-number="16"> <span class="co">"""Initialize the one euro filter."""</span></a>
<a class="sourceLine" id="cb1-17" data-line-number="17"> <span class="co"># The parameters.</span></a>
<a class="sourceLine" id="cb1-18" data-line-number="18"> <span class="va">self</span>.min_cutoff <span class="op">=</span> <span class="bu">float</span>(min_cutoff)</a>
<a class="sourceLine" id="cb1-19" data-line-number="19"> <span class="va">self</span>.beta <span class="op">=</span> <span class="bu">float</span>(beta)</a>
<a class="sourceLine" id="cb1-20" data-line-number="20"> <span class="va">self</span>.d_cutoff <span class="op">=</span> <span class="bu">float</span>(d_cutoff)</a>
<a class="sourceLine" id="cb1-21" data-line-number="21"> <span class="co"># Previous values.</span></a>
<a class="sourceLine" id="cb1-22" data-line-number="22"> <span class="va">self</span>.x_prev <span class="op">=</span> <span class="bu">float</span>(x0)</a>
<a class="sourceLine" id="cb1-23" data-line-number="23"> <span class="va">self</span>.dx_prev <span class="op">=</span> <span class="bu">float</span>(dx0)</a>
<a class="sourceLine" id="cb1-24" data-line-number="24"> <span class="va">self</span>.t_prev <span class="op">=</span> <span class="bu">float</span>(t0)</a>
<a class="sourceLine" id="cb1-25" data-line-number="25"></a>
<a class="sourceLine" id="cb1-26" data-line-number="26"> <span class="kw">def</span> <span class="fu">__call__</span>(<span class="va">self</span>, t, x):</a>
<a class="sourceLine" id="cb1-27" data-line-number="27"> <span class="co">"""Compute the filtered signal."""</span></a>
<a class="sourceLine" id="cb1-28" data-line-number="28"> t_e <span class="op">=</span> t <span class="op">-</span> <span class="va">self</span>.t_prev</a>
<a class="sourceLine" id="cb1-29" data-line-number="29"></a>
<a class="sourceLine" id="cb1-30" data-line-number="30"> <span class="co"># The filtered derivative of the signal.</span></a>
<a class="sourceLine" id="cb1-31" data-line-number="31"> a_d <span class="op">=</span> smoothing_factor(t_e, <span class="va">self</span>.d_cutoff)</a>
<a class="sourceLine" id="cb1-32" data-line-number="32"> dx <span class="op">=</span> (x <span class="op">-</span> <span class="va">self</span>.x_prev) <span class="op">/</span> t_e</a>
<a class="sourceLine" id="cb1-33" data-line-number="33"> dx_hat <span class="op">=</span> exponential_smoothing(a_d, dx, <span class="va">self</span>.dx_prev)</a>
<a class="sourceLine" id="cb1-34" data-line-number="34"></a>
<a class="sourceLine" id="cb1-35" data-line-number="35"> <span class="co"># The filtered signal.</span></a>
<a class="sourceLine" id="cb1-36" data-line-number="36"> cutoff <span class="op">=</span> <span class="va">self</span>.min_cutoff <span class="op">+</span> <span class="va">self</span>.beta <span class="op">*</span> <span class="bu">abs</span>(dx_hat)</a>
<a class="sourceLine" id="cb1-37" data-line-number="37"> a <span class="op">=</span> smoothing_factor(t_e, cutoff)</a>
<a class="sourceLine" id="cb1-38" data-line-number="38"> x_hat <span class="op">=</span> exponential_smoothing(a, x, <span class="va">self</span>.x_prev)</a>
<a class="sourceLine" id="cb1-39" data-line-number="39"></a>
<a class="sourceLine" id="cb1-40" data-line-number="40"> <span class="co"># Memorize the previous values.</span></a>
<a class="sourceLine" id="cb1-41" data-line-number="41"> <span class="va">self</span>.x_prev <span class="op">=</span> x_hat</a>
<a class="sourceLine" id="cb1-42" data-line-number="42"> <span class="va">self</span>.dx_prev <span class="op">=</span> dx_hat</a>
<a class="sourceLine" id="cb1-43" data-line-number="43"> <span class="va">self</span>.t_prev <span class="op">=</span> t</a>
<a class="sourceLine" id="cb1-44" data-line-number="44"></a>
<a class="sourceLine" id="cb1-45" data-line-number="45"> <span class="cf">return</span> x_hat</a></code></pre></div>
<p>An example of how to use the One Euro Filter for filtering a signal in real time.</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode python"><code class="sourceCode python"><a class="sourceLine" id="cb2-1" data-line-number="1"><span class="co"># Let signal be a generator that yields a tuple (t, x)</span></a>
<a class="sourceLine" id="cb2-2" data-line-number="2"><span class="co"># where t is time and x the values of the signal.</span></a>
<a class="sourceLine" id="cb2-3" data-line-number="3">signal <span class="op">=</span> ...</a>
<a class="sourceLine" id="cb2-4" data-line-number="4"></a>
<a class="sourceLine" id="cb2-5" data-line-number="5"><span class="co"># Instantiate the OneEuroFilter with initial values and</span></a>
<a class="sourceLine" id="cb2-6" data-line-number="6"><span class="co"># your value for parameters min_cutoff and beta.</span></a>
<a class="sourceLine" id="cb2-7" data-line-number="7">t0, x0 <span class="op">=</span> <span class="bu">next</span>(signal)</a>
<a class="sourceLine" id="cb2-8" data-line-number="8">one_euro_filter <span class="op">=</span> OneEuroFilter(</a>
<a class="sourceLine" id="cb2-9" data-line-number="9"> t0<span class="op">=</span>t0,</a>
<a class="sourceLine" id="cb2-10" data-line-number="10"> x0<span class="op">=</span>x0,</a>
<a class="sourceLine" id="cb2-11" data-line-number="11"> min_cutoff<span class="op">=</span>...,</a>
<a class="sourceLine" id="cb2-12" data-line-number="12"> beta<span class="op">=</span>...</a>
<a class="sourceLine" id="cb2-13" data-line-number="13">)</a>
<a class="sourceLine" id="cb2-14" data-line-number="14"></a>
<a class="sourceLine" id="cb2-15" data-line-number="15"><span class="co"># Filter the signal in real time.</span></a>
<a class="sourceLine" id="cb2-16" data-line-number="16"><span class="cf">for</span> (t, x) <span class="kw">in</span> signal:</a>
<a class="sourceLine" id="cb2-17" data-line-number="17"> x_hat <span class="op">=</span> one_euro_filter(t, x)</a>
<a class="sourceLine" id="cb2-18" data-line-number="18"> ...</a></code></pre></div>
<h2 id="references" class="unnumbered">References</h2>
<div id="refs" class="references">
<div id="ref-one_euro_filter">
<p>1. CASIEZ, Géry, ROUSSEL, Nicolas and VOGEL, Daniel. 1€ filter: A simple speed-based low-pass filter for noisy input in interactive systems. In : <em>Proceedings of the sigchi conference on human factors in computing systems</em>. ACM, 2012. p. 2527–2530. </p>
</div>
</div>
Tools and Methods for Reading Articles Online2018-12-19T00:00:00+02:002018-12-19T00:00:00+02:00Jaan Tollander de Balschtag:jaantollander.github.io,2018-12-19:/2018-12-19-reading-articles-online.html
<p><img src="../images/feedly-interface.png" /></p>
<p>The internet contains a vast amount of readable online resources for learning, including blog articles, documentation, and Wikipedia. Without the proper tools and methods, it can be challenging to manage which ones you have read and to store and categorize them somewhere where they can be found later. This article explores tools and methods for reading and managing articles online. It’s written for students, researchers, and people who are interested in reading or research.</p>
<p><img src="../images/feedly-interface.png" /></p>
<p>The internet contains a vast amount of readable online resources for learning, including blog articles, documentation, and Wikipedia. Without the proper tools and methods, it can be challenging to manage which ones you have read and to store and categorize them somewhere where they can be found later. This article explores tools and methods for reading and managing articles online. It’s written for students, researchers, and people who are interested in reading or research.</p>
<h2 id="technologies">Technologies</h2>
<p><img src="../images/pocket-interface.png" /></p>
<p>Online content is usually recurrent, i.e. its updated on a daily, weekly or monthly basis. <a href="https://en.wikipedia.org/wiki/Web_syndication">Web syndication</a> can be used to follow the updates of recurrent of content. Common formats of syndication include RSS and Atom. Syndicated content is referred as a feed and they are usually managed using an application referred to as a feed aggregator.</p>
<p><a href="https://feedly.com/"><strong>Feedly</strong></a> is a popular feed aggregator, that works on the browser and various mobile devices. Its minimalistic and functional interface is perfect for saving, managing and reviewing feeds. Articles can be saved to boards such <em>read later</em> or custom ones for storage or later review.</p>
<p>Feeds, unfortunately, don’t always contain full articles, but only a summary of the contents. This means that articles can’t always be read-only using a feed aggregator, but require either visiting the website or aggregating the article from the website in order to read it. Aggregating articles is a good choice because it makes articles easier to read by getting rid of unnecessary distractions like popups in websites, standardizing the format of the article and allowing custom features such as pagination of the article.</p>
<p><a href="https://getpocket.com/"><strong>Pocket</strong></a> is an application that can be used to save, aggregate and read web content. Pocket integrates Kobo e-readers out of the box and Kindle users can use a service like <a href="https://p2k.co/">Pocket to Kindle</a>. Feedly integrates with Pocket allowing articles saved to Pocket directly from Feedly.</p>
<h2 id="using-feedly-and-pocket">Using Feedly and Pocket</h2>
<div style="position:relative;height:0;padding-bottom:56.21%">
<iframe src="https://www.youtube.com/embed/6lLe1wkbGQ8?ecver=2" style="position:absolute;width:100%;height:100%;left:0" width="641" height="360" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen>
</iframe>
</div>
<blockquote>
</blockquote>
<p>Here are the steps of using Feedly and Pocket.</p>
<!-- following feeds -->
<ol type="1">
<li><p><strong>Follow</strong> – Any website that includes a feed such as Atom or RSS can be followed using Feedly. Some ways of following feeds are either from the Feedly application itself by using the <em>add content</em> button on left-corner, using Feedly’s browser extension in the website that you want to follow or on mobile devices using the <em>share</em> option and selecting Feedly from the application menu.</p></li>
<li><p><strong>Organize</strong> – When adding new feeds place them in feeds named after their genre. For example, if you were to follow this blog, you could put it under <em>Programming</em>.</p></li>
</ol>
<!-- review process -->
<ol start="3" type="1">
<li><strong>Review</strong> – Select a board such as <em>All</em> or one of your custom boards. New content should show next to the sidebar. Select the first one, decide if the content of the feed is interesting by reading the title and the summary. If it is interesting content to the <em>read later</em> board and then move to the next one and repeat this step.</li>
</ol>
<!-- reading process -->
<ol start="4" type="1">
<li><p><strong>Read</strong> – After reviewing new content, select the <em>read later</em> board. Some feeds have their full content provided by the feed and can be read using Feedly, other have to be read from the website or aggregated using Pocket. If aggregation is needed use the <em>save to Pocket</em> button.</p></li>
<li><p><strong>Save</strong> – After reading the content it can be saved to a board where it can be found later. When using Pocket archive the content.</p></li>
</ol>
Tools and Methods for Reading Books and Articles on E-Reader2018-11-29T00:00:00+02:002018-11-29T00:00:00+02:00Jaan Tollander de Balschtag:jaantollander.github.io,2018-11-29:/2018-11-29-electronic-reading.html
<p><img src="../images/kobo-koreader-pdf-landscape.jpg" /></p>
<blockquote>
</blockquote>
<p>This article delves into details on how to read and manage electronic books and articles in EPUB and PDF formats. It offers practical advice on which tools, software and methods to use. All the recommendations in this article are based on my own experience and the methods that I have experimented with. The article is directed for students, researchers and people who are interested in a more methodical and organized way of managing and reading books and written material in electronic formats. The article continues from the article <a href="../2018/2018-08-02-electronic-literature.html"><em>Reading and Managing Electronic Literature</em></a> which touched on the subject more abstractly.</p>
<p><img src="../images/kobo-koreader-pdf-landscape.jpg" /></p>
<blockquote>
</blockquote>
<p>This article delves into details on how to read and manage electronic books and articles in EPUB and PDF formats. It offers practical advice on which tools, software and methods to use. All the recommendations in this article are based on my own experience and the methods that I have experimented with. The article is directed for students, researchers and people who are interested in a more methodical and organized way of managing and reading books and written material in electronic formats. The article continues from the article <a href="../2018/2018-08-02-electronic-literature.html"><em>Reading and Managing Electronic Literature</em></a> which touched on the subject more abstractly.</p>
<h2 id="overview-on-the-technology">Overview on the Technology</h2>
<p><img src="../images/calibre-goodreads-koreader-kobo.png" /></p>
<p>This article discusses methods and tools to manage and read ebooks and articles in <strong>EPUB</strong> and <strong>PDF</strong> file formats. In practice, EPUBs are easier to handle on an e-reader device, but at the time of writing, they cannot handle well certain special formatting such as equations. PDFs are widely used file format for scientific and technical documents, but due to the fixed layout – they display the same way on all devices – PDFs are more difficult to handle. EPUB files, on the other hand, were designed to be reflowable – that is they can be adjusted to the display. For example, you cannot easily resize the text on PDFs and highlighting is not natively supported on Kobo e-reader devices. This article list some ways to overcome these challenges. Here are the hardware and software used in the making of the article:</p>
<ul>
<li><p><a href="https://us.kobobooks.com/products/kobo-aura-one"><strong>Kobo Aura One</strong></a> – I will be using the Kobo Aura One e-reading device. The software recommendations are to be based on compatibility with this device. There are also other e-readers, the most popular being Kindle. You should explore your options and make your choice based on your needs. I chose a Kobo device because they don’t require jailbreaking for installing custom software whereas Kindle device does.</p></li>
<li><p><a href="http://koreader.rocks/"><strong>Koreader</strong></a> – <em>Koreader</em> is a document viewer for E-ink devices. It can be installed on the side of the standard Kobo software, <em>Nickel</em>. Koreader has more sophisticated and advanced PDF reader than Nickel. It’s able to crop whitespace to display PDFs better and supports highlighting for PDFs.</p></li>
<li><p><a href="https://www.goodreads.com"><strong>Goodreads</strong></a> – Goodreads is a popular social cataloging website for books, annotations, and reviews. It has a large community of readers and a large database of books and authors to search from. This makes Goodreads excellent application for keeping lists of books such as <em>want to read</em>, <em>reading</em> and <em>read</em>. Goodreads also has a community of other readers for discussing books.</p></li>
<li><p><a href="https://calibre-ebook.com/"><strong>Calibre</strong></a> – Calibre is an application for managing e-book files and metadata. It’s a free, open-source, cross-platform e-book manager software that supports all major e-book formats, including EPUB and PDF formats. Calibre’s Kobo plugin enables Calibre to be used to send and delete books on Kobo devices.</p></li>
</ul>
<h2 id="managing-e-books-with-goodreads-and-calibre">Managing E-books with Goodreads and Calibre</h2>
<div style="position:relative;height:0;padding-bottom:56.21%">
<iframe src="https://www.youtube.com/embed/mYyXUSsThtI?ecver=2" style="position:absolute;width:100%;height:100%;left:0" width="641" height="360" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen>
</iframe>
</div>
<blockquote>
</blockquote>
<p>Managing e-books consists of tracking books, e.g. books you want to read, are currently reading, and have read, managing the electronic library of the e-book files and their metadata and sending or deleting books to the e-reader device. The process of managing e-books using Goodreads and Calibre consists of following steps:</p>
<ol type="1">
<li><p><strong>Search</strong> – Search for the book you are looking for in Goodreads. If the book doesn’t exist in the database, users can add new books to the database.</p></li>
<li><p><strong>Review</strong> – Reading reviews or summaries can help to understand the main points made in the book. This knowledge can help you to read the book and decide if it’s worth investing time into reading it in the first place.</p></li>
<li><p><strong>Shelve</strong> – Add the book to <code>Want to Read</code> shelve. Also, adding the book to a custom shelve, usually named by its genre, helps to categorize your books. Under <code>Genres</code> subtitle, Goodreads lists the names of the shelves where other people have added the given book. Use these as suggestions when categorizing your book.</p></li>
<li><p><strong>Acquire</strong> – Acquire a copy of the book. Goodreads contain links to buy the book from retailers. These links can be found under the section <em>get a copy</em>. Some books are free and can be found using the URL or searching in Google.</p></li>
<li><p><strong>Add to Calibre</strong> – Add the book to Calibre by using the <code>add books</code> button.</p></li>
<li><p><strong>Metadata</strong> – Use Calibre to fetch the metadata and the cover image from the web and to check that the metadata is correct and update it if needed.</p></li>
<li><p><strong>Connect e-reader</strong> – Connect your e-reader to the computer. Calibre should automatically detect it.</p></li>
<li><p><strong>Send to a Device</strong> – Select book and press <code>send to a device</code> in order to send the books to the e-reader.</p></li>
</ol>
<p>You can now safely eject your e-reader and you should be able to start reading the books. You might also want to track your reading process. Goodreads can be used to track books that you are currently reading and have read.</p>
<ol type="1">
<li><p><strong>Currently Reading</strong> – Add the book to <code>Currently Reading</code> when you have invested sufficient amount of effort into reading it, for example, the first 30 pages.</p></li>
<li><p><strong>Read</strong> – Add the book to <code>Read</code> shelve once you have read it. Remember to add the date when you finished reading the book. This way you can track your reading progress. Optionally, if you want to review the book later, add the book also to a custom shelve called <code>needs review</code>.</p></li>
</ol>
<p>One of the benefits of tracking your reading is to share it with other people. For instance, check out my profile on <a href="https://www.goodreads.com/jaantollander">Goodreads</a> to the kind of books that I have read or my favorite books.</p>
<h2 id="managing-research-papers-using-mendeley">Managing Research Papers using Mendeley</h2>
<p><img src="../images/mendeley_k2pdfopt.png" /></p>
<p>Compared to books, managing research papers requires managing the metadata for generating citations. Also, an optional but useful action is to optimize the PDF files for e-readers, which makes them easier and faster to read. For this purpose two software can be used, <em>Mendeley</em> and <em>k2pdfopt</em>. Both of the software are free and cross-platform.</p>
<ul>
<li><p><a href="https://www.mendeley.com/"><strong>Mendeley</strong></a> is an application for managing and organizing scholarly papers and citations. Mendeley can automatically fetch article metadata, it can store the articles on device and cloud, and generate citations from the articles. Because Mendeley can store pure citation data, by adding BibTeX files, it can be used to store citation data for books that you may have stored in Calibre.</p></li>
<li><p><a href="http://www.willus.com/k2pdfopt/"><strong>k2pdfopt</strong></a> is a software that can optimize PDF (and DJVU) files for e-readers, for example by removing whitespace, increasing font size or converting two-column text into one column. This is very useful for reading research papers because their layout is often not optimal for e-reader screens.</p></li>
</ul>
<p>The process of managing research papers consists of:</p>
<ol type="1">
<li><p>Add the paper to <em>Mendeley</em>. Mendeley will store the paper on a designated directory which can be changed from the settings.</p></li>
<li><p>(Optional) Use <em>k2pdfopt</em> generate an optimized version of the original version.</p></li>
<li><p>Add the optimized version to <em>Calibre</em> from where it can be added to the E-reader.</p></li>
</ol>
<h2 id="optimizing-pdfs-using-k2pdfopt">Optimizing PDFs using K2pdfopt</h2>
<figure>
<img src="../images/k2pdfopt_conversion.png" alt="Optimized PDF file. Original version on left side, optimized version on the right size." /><figcaption>Optimized PDF file. <a href="../documents/ieee_twocolumn_template.pdf">Original version</a> on left side, <a href="../documents/ieee_twocolumn_template_k2opt.pdf">optimized version</a> on the right size.</figcaption>
</figure>
<blockquote>
</blockquote>
<figure>
<img src="../images/k2pdfopt_interface.png" alt="The Linux terminal interface of k2pdfopt." /><figcaption>The Linux terminal interface of k2pdfopt.</figcaption>
</figure>
<blockquote>
</blockquote>
<p>There are many examples of how to use k2pdfopt on the website. For Linux users, after installation typing <code>k2pdfopt <filename></code> on the terminal will open an interface that will display all the different options for optimizing the document. For example, download <a href="../documents/iee_twocolumn_template.pdf"><code>iee_twocolumn_template.pdf</code></a> and optimize it using <code>k2pdfopt iee_twocolumn_template.pdf -col 2 -n</code>.</p>
<h2 id="reading-pdfs-using-koreader">Reading PDFs using KOReader</h2>
<figure>
<img src="../images/kobo-koreader-pdf-landscape.jpg" alt="Displaying a PDF in landscape mode using KOReader." /><figcaption><em>Displaying a PDF in landscape mode using KOReader.</em></figcaption>
</figure>
<blockquote>
</blockquote>
<p>The Kobo devices ship with the ability to read pdf files, but the capabilities of the Kobo standard software, <em>Nickel</em>, are limited. <a href="http://koreader.rocks/"><em>KOReader</em></a> is an alternative document reader for E-ink devices. It’s better for reading pdf files because it’s faster and has features that the standard reader is lacking, such as:</p>
<ul>
<li>Sophisticated whitespace cropping</li>
<li>Ability to toggle between landscape and portrait modes</li>
<li>Ability to highlight text</li>
<li>Ability to navigate using the table of contents</li>
<li>Better page flipping and scrolling</li>
<li>Ability to toggle scroll mode on and off</li>
</ul>
<p>I recommend to watch a review about Koreader made by the eBook Reader: <a href="https://www.youtube.com/watch?v=i2oSOeAnD10"><em>Kobo Aura One KOReader PDF Review</em></a>.</p>
<p>KOReader has to installed on the e-reading device separately. Currently, supported devices can be found on their website. The Wiki contains the official installation instructions for the supported devices. As of August 2018, the installation KOReader on Kobo Aura One involved downloading archived files, copying files over to the Kobo device, and connecting and disconnecting the device to let it update. It was quite simple and straightforward, but I would still recommend to backup your Kobo files before the installation.</p>
Reading and Managing Electronic Literature2018-08-02T00:00:00+03:002018-08-02T00:00:00+03:00Jaan Tollander de Balschtag:jaantollander.github.io,2018-08-02:/2018-08-02-electronic-literature.html
<p><img src="../images/reading-hardware.png" /></p>
<p>The world is becoming increasingly more electronic and the internet is connecting the people around the world. The internet has increased the access to information and its quantity to the greatest as it has ever been in history. This has resulted in the rise of the popularity of electronic publishing and development of new technology for literature. To thrive in this new era of literature, one has to cultivate an efficient process for managing, reading and understanding it and utilize the capabilities of new technology. This article gives an overview of the process of reading, managing and understanding electronic literature, and explains the new technologies and how they are used in the process.</p>
<p><img src="../images/reading-hardware.png" /></p>
<p>The world is becoming increasingly more electronic and the internet is connecting the people around the world. The internet has increased the access to information and its quantity to the greatest as it has ever been in history. This has resulted in the rise of the popularity of electronic publishing and development of new technology for literature. To thrive in this new era of literature, one has to cultivate an efficient process for managing, reading and understanding it and utilize the capabilities of new technology. This article gives an overview of the process of reading, managing and understanding electronic literature, and explains the new technologies and how they are used in the process.</p>
<hr />
<blockquote>
</blockquote>
<!-- TOC depthFrom:2 depthTo:6 withLinks:1 updateOnSave:1 orderedList:0 -->
<ul>
<li><a href="#why-is-reading-important">Why is Reading Important</a></li>
<li><a href="#the-goal-of-reading">The Goal of Reading</a></li>
<li><a href="#finding-content">Finding Content</a></li>
<li><a href="#components-of-written-works">Components of Written Works</a>
<ul>
<li><a href="#content">Content</a></li>
<li><a href="#metadata">Metadata</a></li>
</ul></li>
<li><a href="#the-reading-process">The Reading Process</a>
<ul>
<li><a href="#motivation">Motivation</a></li>
<li><a href="#understanding-content">Understanding Content</a></li>
</ul></li>
<li><a href="#technology">Technology</a>
<ul>
<li><a href="#common-file-formats">Common File Formats</a></li>
<li><a href="#common-content-types">Common Content Types</a></li>
<li><a href="#devices-and-hardware">Devices and Hardware</a></li>
</ul></li>
</ul>
<!-- /TOC -->
<p>This is the introductory part of a multipart post about how to read and manage electronic literature. This part will explain the basic concepts about the reading process and technology related to electronic literature. Subsequent parts will cover in detail various reading and managing workflows for different types of content using specific software.</p>
<h2 id="why-is-reading-important">Why is Reading Important</h2>
<p>Reading is a way to access the valuable information and insights that people have had and collected while working in particular field or technology without having to go through the same mistakes and the journey as the authors have. In other words, reading shortcuts the process of trial and error for learning making it an essential skill for any person who wants to learn new concepts faster and more efficiently. Reading gives a new perspective on the world improving your sense of what is possible. However, always accompany new information by a healthy dose of skepticism which prevents the knowledge from turning into constraints.</p>
<h2 id="the-goal-of-reading">The Goal of Reading</h2>
<p>The goal of reading for some may be simply the pleasure of reading and passing time, but most people seek to learn and understand new concepts. Learning and understanding should be the goal of reading and it should define the methods that are used. The methods for efficient reading include taking highlights and notes, writing about the subject, making connections to other literature and the world, and engaging with the community. It should be noted that most people are not accustomed to this because it requires significantly more thinking and work than simply reading. The read knowledge should be applied in practice. The outcomes of applying the knowledge may correspond to the expectation in the literature or create totally new knowledge which can then be written down and passed on to other people.</p>
<h2 id="finding-content">Finding Content</h2>
<p>Finding good content to read can initially be challenging. One strategy is based on finding media, including podcasts, presentations, conference recording, and talks, where interesting people present their works, tell their story and deliver their message. This helps to create a connection to these people, validate their legitimacy, understand their values and develop a genuine interest in their content. The approach also acts as a filter because the guests have to be validated by the host, increasing the likelihood that their content is something that you would also value. Once you start reading the content of these authors their sources and the works that have influenced them might also begin to interest you. This is another way to find authors.</p>
<h2 id="components-of-written-works">Components of Written Works</h2>
<p>Reading and managing (electronic) written works requires understanding their components, the <strong>content</strong> and the <strong>metadata</strong>. Next sections will explain the meaning and further break down of these components.</p>
<h3 id="content">Content</h3>
<p>Content refers to the informational part of the work. The internal structure is different for different types of content, for example, books versus articles. Here are some important structural elements and explanation about why they are relevant:</p>
<ul>
<li><p><strong>Body</strong> refers to the main part of the work, the part that contains the actual content of the work. The body is grouped into sections by the common themes or topics. Each section can also be grouped into subsections. Sections consist mainly of text, images, and citations, but may have special elements, such as formulas, equations or source code, depending on the context.</p></li>
<li><p><strong>Contents</strong>, or alternatively <strong>Table of Contents</strong>, is a list of section titles with their page numbers. Contents have two purposes: To aid in navigating the work and to inform about the general structure and grouping of the topics in the work. Electronic formats of literature usually have contents integrated into the format. It is usually wise to read through the contents before reading the rest of the content.</p></li>
<li><p><strong>Glossary</strong> is an alphabetical listing of words. In the context of a written work, a glossary contains explanations of words specific to the subject of the work. Glossaries contain words that are central to the work and therefore reading and understanding them can help in understanding the content.</p></li>
<li><p><strong>About the Author(s)</strong> is a section that contains information about the author(s). It can be helpful to know about the authors to understand why they wrote the work. Their life experiences and situation has usually had a great impact on the work. Searching for videos or podcasts on the internet to learn more about the authors and their works explained in their words.</p></li>
<li><p><strong>Acknowledgements</strong> contains the author’s expressions of gratitude to others. These may be people or entities who helped or inspired the creation of the work. Learning about these people help you to grow the network of people researching and writing about interesting topics.</p></li>
<li><p><strong>Bibliography</strong>, <strong>references</strong> and <strong>notes</strong> is a list of citations to the published and unpublished sources. Within the body when a citation is used it is marked using specific syntaxes, such as numerical or the name of the author and year. Citation syntax is a stylistic choice. Following the citations can be a way to find related and relevant literature on the same subject as the work.</p></li>
</ul>
<h3 id="metadata">Metadata</h3>
<p>Metadata provides information about the given written work which makes it important for content management. Electronic literature is distributed in a file and the file may include the metadata related to the work. Metadata includes:</p>
<ul>
<li><p><strong>Title</strong> is the name of the work. It is the most important piece of information for identifying the work. Usually, titles are unique, but not always. Confusion between books with a similar name can be resolved by looking at the authors.</p></li>
<li><p><strong>Authors</strong> describe who created the work. Books often have only one author, but works such as scholarly papers are often written by many authors.</p></li>
<li><p><strong>File format</strong> defines the structure and type of data stored in a file. Most common formats for electronic literature are EPUB, PDF, and HTML. File formats and their differences are explained in the technology section.</p></li>
<li><p><strong>Cover art</strong> is an image on the outside of the work which serves as promotional and aesthetic functions. In literature, usually, books and comics have cover art. Along with the title, the cover is a key piece of identifying information for managing a library of books.</p></li>
<li><p><strong>Rating</strong> is a numeric score, usually from one to five stars, given by the users in order to access the work. Ratings are can be aggregated from sites like Amazon, where they are given by other people.</p></li>
<li><p><strong>Tags</strong> are individual pieces of information, like keywords, that describe the contents of the work. They are relevant for managing electronic libraries.</p></li>
<li><p><strong>Ids</strong> are the identifiers of the work. There exists various different identifiers such as <a href="http://www.issn.org/understanding-the-issn/what-is-an-issn/">ISSN</a>, <a href="https://www.isbn-international.org/content/what-isbn">ISBN</a>, <a href="https://www.doi.org">DOI</a> and site-specific identifiers such <a href="https://arxiv.org/">ArXiv ID</a> or <a href="https://www.ncbi.nlm.nih.gov/pubmed/">PMID</a>.</p></li>
<li><p><strong>Published</strong> is the date when the work was published.</p></li>
<li><p><strong>Publisher</strong> is the name of the entity that published the work.</p></li>
<li><p><strong>Languages</strong> is the language in which the work is written.</p></li>
<li><p><strong>Summary</strong> or <strong>abstract</strong> is a condensed presentation of the contents of the written work.</p></li>
</ul>
<h2 id="the-reading-process">The Reading Process</h2>
<p>After finding interesting books, articles, papers or reading the material, the next challenge will be the reading itself. Both, <strong>the motivation to read</strong> and <strong>understanding the content</strong> play important roles in the reading process.</p>
<h3 id="motivation">Motivation</h3>
<p>Motivation translates into the time and effort that we are willing to put into reading. Here are some of the ways I keep myself motivated to read more.</p>
<ol type="1">
<li><p><strong>Physical Place</strong> – For reading, find a place without distractions. The library, cafe or beach in the summer are some good options. Prefer places with natural light and avoid places with artificial lights, they cause unnecessary visual stress. In noisy places use earplugs or noise canceling headphones.</p></li>
<li><p><strong>Reading Quota</strong> – Having a quota of reading a certain number of pages per day can help to break down the reading goals. For instance, reading fifty pages per day would yield around one book a week.</p></li>
<li><p><strong>Create Habits</strong> – Making reading a daily habit, by going to your preferred place to read, having coffee, tea or other beverage or stimulant and sitting down to read your daily reading quota. If you reading at the beach you can go swimming every time you finish a certain number of pages. Be creative at creating the reading habits so that they will stick.</p></li>
<li><p><strong>Progress List</strong> – Keeping a list of what you have read can also be of help. The list can be used to how much progress you have made, its useful for reference and can be used to show others what you have read. Seeing progress can motivate the reading process especially if you share the list with others increasing your sense of accountability.</p></li>
</ol>
<h3 id="understanding-content">Understanding Content</h3>
<p>In order to ensure that time and effort is not wasted when reading, you should aim to understand the concent. The true efficiency of reading is determined, not just by how much you read, but by how much you understand and learn. The difficulty of fully understanding a written work depends on its content. Books, with only text and simple images, written for the public are often easier to read than a research paper dedicated to a specific area of research containing specialized content such as formulas and equations, charts or source code. Below I note some of the different steps of understanding the content, unlocking its knowledge and getting more value out of reading.</p>
<p>While reading you should:</p>
<ol type="1">
<li><p><strong>Highlight Text and Take Notes</strong> – Making reading more conscious process by highlighting and taking notes can help to better retain the read information. Highlights and notes can later be used to review the work.</p></li>
<li><p><strong>Read Out Loud</strong> – Certain types of literature, such as stories and poetry, are best understood when read out loud. This is also a good way to practice speaking and pronunciation of words.</p></li>
<li><p><strong>Breaks</strong> – Take active breaks. Go for a walk, swimming or do some other low-level physical activity, preferably outside in nature. This can help de-stressing and let the unconscious parts of the brain to do their work.</p></li>
</ol>
<p>The review process consists of:</p>
<ol type="1">
<li><p><strong>Review the Highlights and Notes</strong> – Read the highlights and notes either directly from your device or export them. From the highlights, write down definitions and short difficult pieces of information word for word in order to understand them thoroughly. For longer highlights, compress them into your own words. This can help you retain and understand the information and make it easier to access the book’s knowledge at a later time. Writing things down can be very laborious therefore only focus on key concepts and information.</p></li>
<li><p><strong>Re-read</strong> – Reading the whole work or parts of it multiple times will improve your understanding of the content. Reading the whole work may be impractical for long books, but shorter texts like articles can easily be read multiple times.</p></li>
<li><p><strong>Use the Knowledge</strong> – Use the work’s knowledge in your own writings. Teach it to other people. Make connections between this work and other work’s, resources and your own experiences. This is one of the core reasons for reading in the first place.</p></li>
</ol>
<h2 id="technology">Technology</h2>
<h3 id="common-file-formats">Common File Formats</h3>
<p><img src="../images/reading-file-formats.png" /></p>
<p>In regards to the technology of electronic literature, we need to understand the most common file formats for electronic written content. The differences between the file formats impact the choices of technologies and the process that needs to use. The most common file formats, <strong>EPUB</strong>, <strong>PDF</strong> and <strong>HTML</strong> are explained below.</p>
<ul>
<li><p><a href="https://en.wikipedia.org/wiki/EPUB"><strong>Electronic Publication</strong> (EPUB)</a> is a file format for electronic publications with the extension <code>.epub</code>. It is the preferred file format for e-books. EPUB is designed for reading and it has dedicated features for this purpose. Documents in EPUB format are <em>reflowable</em>, which means that the document layout can be adjusted by the user. For example, re-sizable fonts, changeable text, and adjustable margins allow the text to be optimized for a particular display, which makes reading easier. Page bookmarking, and passage highlighting and notes are also supported and they are important for the reading process. EPUB format also has the ability to store metadata which enables libraries that can store books and be searched. This is useful for managing electronic publications.</p></li>
<li><p><a href="https://en.wikipedia.org/wiki/PDF"><strong>Portable Document Format</strong> (PDF)</a> is a file format with the extension <code>.pdf</code> It is used to represent documents in fixed-layout independent of the platform. Fixed-layout means that each file encapsulates the complete description of the document, including the text, fonts, graphics and other information. For this reason, the displayed layout of the document cannot be (easily) adjusted by the user compared to EPUBs. PDFs are a popular format for academic publishing which often require special formatting such as equations.</p></li>
<li><p><a href="https://en.wikipedia.org/wiki/HTML"><strong>Hypertext Markup Language</strong> (HTML)</a> with <a href="https://en.wikipedia.org/wiki/Cascading_Style_Sheets"><strong>Cascading Style Sheets</strong> (CSS)</a> are the languages responsible for the text, links and presentation of a web page. JavaScript (JS) provides web content its interactivity, but we will ignore and focus static (non-interactive) content. The files are usually served by the server and displayed by the browser without the user having to interact with the actual raw files.</p></li>
</ul>
<h3 id="common-content-types">Common Content Types</h3>
<p><img src="../images/reading-content-types.png" /></p>
<p>Different electronic content types use different file formats. The format affects the process of managing and reading the particular type of content. Common content types including <strong>electronic books</strong>, <strong>academic publications</strong>, <strong>online articles</strong> and <strong>software documentation</strong> are explained below.</p>
<ul>
<li><p><a href="https://en.wikipedia.org/wiki/E-book"><strong>Electronic books</strong> (e-books)</a> are usually distributed in EPUB format, but books with content such as equation that require specialized formatting are often distributed in PDF format. Compared to traditional books, e-books are portable, easy to reference and highlight, allow searching them using keywords and are easier to organize and manage. Dedicated e-readers make reading e-books more convenient and easier than traditional books.</p></li>
<li><p><strong>Academic publications</strong> such as scholarly papers published in academic journals are a commonly read in the academic world. They most often come in PDF format due to special formatting requirements.</p></li>
<li><p><strong>Online articles</strong> are found in blogs, online newspapers and magazines, Wikipedia and other online publications. They are served through the website in HTML format. Because online articles come from various websites with different layouts, potential popups, advertisement, and other distractions it is suggested to use an aggregator to aggregate the content and display it in a simplified format. This makes reading online articles easier, reducing potential distractions, allowing pagination and increasing efficiency. Also, online media is often recurrent in nature. New blog posts, news articles or magazine articles are usually created on daily, weekly or monthly schedule.</p></li>
<li><p><a href="https://en.wikipedia.org/wiki/Software_documentation"><strong>Software documentation</strong></a> is a class of documents that describe how a particular software operates and the roles of the people involved in its development. Types of documents include requirements, architecture/design, technical, end user and marketing documents. Software documentation is part of the software engineering discipline. The documents themselves are usually in HTML and PDF format, and sometimes also in EPUB format.</p></li>
</ul>
<h3 id="devices-and-hardware">Devices and Hardware</h3>
<p><img src="../images/reading-hardware.png" /></p>
<p>The best choice of hardware depends on the activity in the reading process and on the content type. The choice for reading a book with lots of text and few pictures is different from reading web article with interactive content. Similarly, the choice for managing content is different from reading it. The hardware choices considered in this article are <strong>desktops</strong>, <strong>laptops</strong>, <strong>tablets</strong>, <strong>smartphones</strong> and <strong>e-readers</strong>. The most viable choice from given hardware should be determined by their properties. Here is a list of key properties and how they affect reading and managing electronic content:</p>
<ul>
<li><p><strong>Dimensions</strong> – The physical size and weight determine the portability of the device. Smaller, thinner and lighter devices are easier to carry than larger, heavier devices. Smaller ones, like smartphones, fit into a pocket but larger ones, like tablets, e-readers, and laptops, require to be carried in hand, backpack or briefcase. Desktops obviously aren’t portable.</p></li>
<li><p><strong>Screen Type</strong> – There are many types of screens; LCD, OLED, and AMOLED are common among computer, tablet and smartphone screens. E-readers have their own type of screen, the <a href="https://en.wikipedia.org/wiki/E_Ink">E-ink</a> screen. E-ink screens have a more paper-like look, they are eye-friendly and facilitate longer battery life compared to other devices (days vs hours). However, the tradeoff is slower refresh rate which makes E-ink screen more tedious for interactive tasks, such as highlighting or taking notes, than other screen types.</p></li>
<li><p><strong>Screen Size</strong> – The size of the screen effects how easy it is to read from the device and how much information is displayed at given moment. The optimal screen size for reading is the one that displays just enough information and is easy to read from. Displaying excessive information or other information that the actual content can be distractive and drain mental energy. Usually, screen sizes from smallest to largest are a smartphone, e-reader, tablet, laptop, and desktop.</p></li>
<li><p><strong>Features</strong> – Available features and software depend on the device and its operating system, and have a direct effect on usability. Different devices require different software for reading and managing the various types of content. Differences between devices should be considered when choosing a device. For example, interacting with a device requires either the input or output of information. Usually, more powerful devices, like computers, are faster at handling inputs, which makes them more suited for input dependent tasks such as managing content. On the other hand output dependent tasks, such as reading, if done for a longer period of time benefit from using less powerful, more domain-specific devices, like e-readers, because the reduced input speed makes them less distracting.</p></li>
<li><p><strong>Price</strong> – The price is determining factor when choosing hardware. Consider investing in the most useful and versatile hardware first, for example, a (hybrid) laptop.</p></li>
</ul>
<p>In order to choose the right hardware, find reviews comparing different hardware and their properties. Video reviews or websites that compare different hardware are a good place to start.</p>
Scientific Writing with Markdown2018-01-25T00:00:00+02:002018-01-25T00:00:00+02:00Jaan Tollander de Balschtag:jaantollander.github.io,2018-01-25:/2018-01-25-writing-markdown.html
<p><img src="../images/writing-markdown-image.png" /></p>
<blockquote>
</blockquote>
<p>This blog post covers how to use <em>markdown</em> for scientific and technical writing, which often involves writing equations, code blocks, citations and other unique features depending on the document in question. I include software recommendations for writing and converting markdown it into other formats such as HTML <em>(blog posts, slides, documentation, etc)</em>, PDF <em>(essays, reports, etc)</em> or EPUB <em>(books)</em>. In fact, this blog post itself is created from a markdown file.</p>
<p><img src="../images/writing-markdown-image.png" /></p>
<blockquote>
</blockquote>
<p>This blog post covers how to use <em>markdown</em> for scientific and technical writing, which often involves writing equations, code blocks, citations and other unique features depending on the document in question. I include software recommendations for writing and converting markdown it into other formats such as HTML <em>(blog posts, slides, documentation, etc)</em>, PDF <em>(essays, reports, etc)</em> or EPUB <em>(books)</em>. In fact, this blog post itself is created from a markdown file.</p>
<h2 id="what-is-markdown-and-should-i-use-it">What is Markdown and should I use it?</h2>
<p><a href="https://daringfireball.net/projects/markdown/">Markdown</a> is a lightweight markup language with plain text formatting syntax. It was originally made for creating web content such as emails and blog posts (HTML), but can be converted into other formats such as PDF via tools like Pandoc. I use markdown due to its popularity, simple syntax, and availability of tools that can convert markdown into other formats.</p>
<p>Unlike word or google docs, markdown is written in a plain text document and then converted into the final document. Markdown is not the best choice for documents which require lots of small customizations in styles, fonts or outlook. For example, the resume seen on my blog is written using google docs, because the customizations with colors, indentations and fonts would be a real hassle using markdown. On the other hand, markdown excels at creating documents which need little customization or have premade styles available such as reports. Markdown is also among the easiest ways to create web content.</p>
<h2 id="creating-documents">Creating Documents</h2>
<div style="position:relative;height:0;padding-bottom:56.25%">
<iframe src="https://www.youtube.com/embed/bUhuwmyvbqg?ecver=2" style="position:absolute;width:100%;height:100%;left:0" width="640" height="360" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen>
</iframe>
</div>
<blockquote>
</blockquote>
<p>Markdown can be used for writing many different types of documents. The most common use case is to write web content such blog posts but writing essays, research papers, books, documentation, slides among many other types is possible. I made GitHub repository <a href="https://github.com/jaantollander/MarkdownTemplates"><strong>Markdown Templates</strong></a> that contains example documents. The examples are structured as follows:</p>
<ul>
<li><code><filename>.md</code> is the source file written in markdown.</li>
<li><code><filename>.bib</code> is the <em>optional</em> file for bibliography entries.</li>
<li><code>Makefile</code> contains the commands to compile the markdown documents into the desired format.</li>
</ul>
<p>Next sections cover the required software and the basics of markdown syntax.</p>
<h2 id="software-for-markdown">Software for Markdown</h2>
<p>To get started writing markdown on <strong>desktop</strong> we need to download software for writing and converting markdown into documents.</p>
<ol type="1">
<li><a href="https://pandoc.org/installing.html"><strong>Install Pandoc</strong></a>. <a href="https://pandoc.org/">Pandoc</a> is the primary tool that we are going to use for converting markup formats into other formats.</li>
<li><a href="https://www.latex-project.org/get/"><strong>Install LaTeX</strong></a>. <a href="https://www.latex-project.org/">LaTeX</a> is a typesetting system, designed for the production of technical and scientific documentation. LaTeX installation is required for creating PDF documents since they are created via LaTeX.</li>
<li><a href="https://atom.io/"><strong>Install Atom</strong></a>. <a href="https://atom.io/">Atom</a> is modern, cross-platform code editor built using web technologies. The use of web-technologies allows Atom to be extensible, customizable and it enables other useful features. This guide heavily relies on the packages that are available to Atom. Install following packages for writing markdown by navigating to <code>Edit > Preferences > Packages</code>
<ul>
<li><code>language-markdown</code> for better markdown syntax support compared to the default package <code>language-gfm</code> (GitHub-flavored Markdown).</li>
<li><code>markdown-preview-plus</code> package allow markdown preview using Pandoc, which support equations and citations. You need to disable <code>markdown-preview</code> for this package to work properly.</li>
<li><code>platformio-ide-terminal</code> for a terminal inside Atom. The terminal is used for invoking command for converting markdown files using Pandoc.</li>
<li><code>pdf-view</code> for can be used for viewing PDF documents converting markdown to pdf.</li>
</ul></li>
</ol>
<p>For writing markdown <strong>online</strong>, for example, edit markdown file inside Google Drive, can try <a href="https://stackedit.io/">StackEdit</a> or for emails, there is browser plugin called <a href="https://markdown-here.com/">Markdown Here</a>.</p>
<h2 id="markdown-syntax">Markdown Syntax</h2>
<p>This section covers the basic syntax of markdown and specific features for scientific writing such as syntax highlighting, equations, and citations.</p>
<h3 id="basics">Basics</h3>
<p>Demonstrations about the basic markdown syntax can be found from <a href="https://daringfireball.net/projects/markdown/syntax">John Gruber’s original spec</a> or <a href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet">Markdown Cheatsheet</a> in GitHub. I recommend reading at least Markdown-Cheatsheet to understand the basics. In addition to markdown understanding, basics on HTML can be useful for creating web content if using inline HTML.</p>
<h3 id="syntax-highlighting">Syntax Highlighting</h3>
<p>Standard markdown syntax supports code blocks but not syntax highlighting. Support for syntax highlighting can be achieved through the use of converters such as Pandoc that supports it as well as site such as GitHub supports it by default.</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode python"><code class="sourceCode python"><a class="sourceLine" id="cb1-1" data-line-number="1"><span class="kw">def</span> foo():</a>
<a class="sourceLine" id="cb1-2" data-line-number="2"> <span class="cf">return</span> <span class="st">"bar"</span></a></code></pre></div>
<h3 id="equations">Equations</h3>
<p>Equations can be written either using <code>\[ ... \]</code> or inline using <code>\( ... \)</code>. For example, Cauchy’s integral formula can be written as</p>
<p><code>\[ f(a)={\frac {1}{2\pi i}}\oint _{\gamma }{\frac {f(z)}{z-a}}\,dz \]</code></p>
<p>which in HTML will be displayed by <a href="https://www.mathjax.org/">Mathjax</a> as</p>
<p><span class="math display">\[ f(a)={\frac {1}{2\pi i}}\oint _{\gamma }{\frac {f(z)}{z-a}}\,dz \]</span></p>
<p>Inline equations such as <span class="math inline">\(a^2 + b^2 = c^2\)</span> which in markdown translates to <code>\(a^2 + b^2 = c^2\)</code> will display on the same line as the text. In order for this to work in HTML, we need to use Pandoc option <code>--mathjax</code>.</p>
<p>Another feature that can make writing complicated equations easier is using <a href="https://unicode-table.com/en/">unicode characters</a> for mathematical symbols. For instance <code>\[ 𝐱 ∈ ℝ^2 \]</code> can be rendered by Mathjax</p>
<p><span class="math display">\[ 𝐱 ∈ ℝ^2 \]</span></p>
<p>In order to easily input these mathematical symbols install Atom package <code>latex-completions</code>. A mapping between corresponding Unicode characters and latex commands can be found at <a href="http://milde.users.sourceforge.net/LUCR/Math/data/unimathsymbols.txt">unimathsymbols.txt</a>.</p>
<h3 id="citations">Citations</h3>
<p>Citations can be used inside markdown by using <a href="https://hackage.haskell.org/package/pandoc-citeproc">pandoc-citeproc</a> library, which included in the Pandoc installation. To use pandoc-citeproc Pandoc needs to be invoked using options</p>
<ol type="1">
<li><code>--filter pandoc-citeproc</code> and</li>
<li><code>--bibliography=FILE</code> to include the given bibliography file.</li>
</ol>
<p>Bibliography entries are stored in a bibliography file <code><filename>.bib</code> using <code>biblatex</code> syntax. For example articles are stored using <code>@article</code></p>
<div class="sourceCode" id="cb2"><pre class="sourceCode bibtex"><code class="sourceCode bibtex"><a class="sourceLine" id="cb2-1" data-line-number="1"><span class="va">@article</span>{<span class="ot">key_article</span>,</a>
<a class="sourceLine" id="cb2-2" data-line-number="2"> <span class="dt">author</span> = {Peter Adams},</a>
<a class="sourceLine" id="cb2-3" data-line-number="3"> <span class="dt">title</span> = {The title of the work},</a>
<a class="sourceLine" id="cb2-4" data-line-number="4"> <span class="dt">journal</span> = {The name of the journal},</a>
<a class="sourceLine" id="cb2-5" data-line-number="5"> <span class="dt">year</span> = {1993},</a>
<a class="sourceLine" id="cb2-6" data-line-number="6"> <span class="dt">number</span> = {2},</a>
<a class="sourceLine" id="cb2-7" data-line-number="7"> <span class="dt">pages</span> = {201-213},</a>
<a class="sourceLine" id="cb2-8" data-line-number="8"> <span class="dt">month</span> = {7},</a>
<a class="sourceLine" id="cb2-9" data-line-number="9"> <span class="dt">note</span> = {An optional note},</a>
<a class="sourceLine" id="cb2-10" data-line-number="10"> <span class="dt">volume</span> = {4}</a>
<a class="sourceLine" id="cb2-11" data-line-number="11">}</a></code></pre></div>
<p>Online resources such as websites are stored using <code>@online</code></p>
<div class="sourceCode" id="cb3"><pre class="sourceCode bibtex"><code class="sourceCode bibtex"><a class="sourceLine" id="cb3-1" data-line-number="1"><span class="va">@online</span>{<span class="ot">key_online</span>,</a>
<a class="sourceLine" id="cb3-2" data-line-number="2"> <span class="dt">title</span> = {Generating Bibliographies with biblatex and biber},</a>
<a class="sourceLine" id="cb3-3" data-line-number="3"> <span class="dt">organization</span> = {Wikibooks},</a>
<a class="sourceLine" id="cb3-4" data-line-number="4"> <span class="dt">date</span> = {2016},</a>
<a class="sourceLine" id="cb3-5" data-line-number="5"> <span class="dt">urldate</span> = {2016-03-07},</a>
<a class="sourceLine" id="cb3-6" data-line-number="6"> <span class="dt">url</span> = {https://en.wikibooks.org/wiki/LaTeX/Generating_Bibliographies_with_biblatex_and_biber},</a>
<a class="sourceLine" id="cb3-7" data-line-number="7"> <span class="dt">keywords</span> = {untrusted},</a>
<a class="sourceLine" id="cb3-8" data-line-number="8">}</a></code></pre></div>
<p>These entries can be referred using <code>@key_name</code>. The full biblatex reference documentation can be found from <a href="http://tug.ctan.org/macros/latex/exptl/biblatex/doc/biblatex.pdf">biblatex.pdf</a>.</p>
<p>Optionally citation styles can be changed using option <code>--cls=FILE</code>. Citation files use <a href="http://citationstyles.org/">Citation Style Language (CSL)</a>. Different citation styles and examples of them can be found from <a href="https://www.zotero.org/styles">Zotero Styles</a>. In order to use these styles, you can either download them or refer directly to the raw cls file in <a href="https://github.com/citation-style-language/styles">Citation Styles (GitHub)</a>.</p>
Customizing Unity for Productivity2018-01-03T11:47:00+02:002018-01-03T11:47:00+02:00Jaan Tollander de Balschtag:jaantollander.github.io,2018-01-03:/2018-01-03-customizing-unity-for-productivity.html
<p><img src="../images/ubuntu-desktop-2.png" /></p>
<blockquote>
</blockquote>
<p>This blog post covers customizations that I have found useful for the overall feel and usage of the <a href="https://en.wikipedia.org/wiki/Unity_(user_interface)">Unity</a> desktop environment (default on Ubuntu 16.04). I cover how to set up useful features such as <em>workspaces</em>, <em>hiding the launcher</em>, <em>changing to a custom theme</em> as well as <em>modifying the date and time format of the clock</em> and <em>changing default user folder paths</em>.</p>
<p><img src="../images/ubuntu-desktop-2.png" /></p>
<blockquote>
</blockquote>
<p>This blog post covers customizations that I have found useful for the overall feel and usage of the <a href="https://en.wikipedia.org/wiki/Unity_(user_interface)">Unity</a> desktop environment (default on Ubuntu 16.04). I cover how to set up useful features such as <em>workspaces</em>, <em>hiding the launcher</em>, <em>changing to a custom theme</em> as well as <em>modifying the date and time format of the clock</em> and <em>changing default user folder paths</em>.</p>
<h2 id="unity-tweak-tool">Unity Tweak Tool</h2>
<p><img src="../images/unity-tweak-tool.png" /></p>
<p>To start off we need to install <strong>Unity Tweak Tool</strong>, a settings manager for the Unity desktop.</p>
<pre><code>sudo apt-get install unity-tweak-tool</code></pre>
<p>Unity Tweak Tool is required for changing settings that can’t be set from the default Ubuntu settings menu and would otherwise require the use of the command line.</p>
<h2 id="launcher-and-dash">Launcher and Dash</h2>
<div style="position:relative;height:0;padding-bottom:56.21%">
<iframe src="https://www.youtube.com/embed/BCjEZ7HtSQI?ecver=2" style="position:absolute;width:100%;height:100%;left:0" width="641" height="360" frameborder="0" gesture="media" allow="encrypted-media" allowfullscreen>
</iframe>
</div>
<blockquote>
</blockquote>
<p>Unity launcher is the sidebar on the left side in the desktop. I recommend hiding the launcher to increase the usable screen size and reduce distraction. <strong>Auto-hide the launcher</strong> by navigating to <code>Unity Tweak Tool > Launcher</code> and toggling <code>Auto-hide</code> on.</p>
<p>Instead of having to click icons on the launcher you should press the <em>super key</em> (windows key in most keyboards) to open <strong>dash</strong> and type the name of the program select it and press enter. This is faster and saves cognitive energy.</p>
<h2 id="workspaces">Workspaces</h2>
<div style="position:relative;height:0;padding-bottom:56.21%">
<iframe src="https://www.youtube.com/embed/R_fObp2J8s4?ecver=2" style="position:absolute;width:100%;height:100%;left:0" width="641" height="360" frameborder="0" gesture="media" allow="encrypted-media" allowfullscreen>
</iframe>
</div>
<blockquote>
</blockquote>
<p>Workspaces are virtual desktops that can reduce clutter and make the desktop easier to navigate. <strong>Workspaces can be enabled</strong> by navigating to <code>Unity Tweak Tool > Workspace Settings</code> and toggling the <code>workspace switcher</code> on. You can adjust the number of horizontal and vertical workspaces available to suit your needs.</p>
<h2 id="theme">Theme</h2>
<div style="position:relative;height:0;padding-bottom:56.21%">
<iframe src="https://www.youtube.com/embed/D26R-o8c464?ecver=2" style="position:absolute;width:100%;height:100%;left:0" width="641" height="360" frameborder="0" gesture="media" allow="encrypted-media" allowfullscreen>
</iframe>
</div>
<blockquote>
</blockquote>
<p>Unity allows the use custom themes. You should leverage this option to set up a theme that you find pleasant to look at when working on the computer.</p>
<p>I prefer darker themes over lighter themes. Darker themes reduce visual stress when working on the computer and look better than lighter ones. Following a suggestion in ask Ubuntu article <a href="https://askubuntu.com/questions/800730/dark-gtk-theme-for-ubuntu-16-04-unity"><em>Dark GTK theme for Ubuntu 16.04</em></a>, I switched to a theme called Arc-theme. Install this theme using commands:</p>
<pre><code>sudo add-apt-repository ppa:noobslab/themes
sudo apt-get update
sudo apt-get install arc-theme</code></pre>
<p>The new theme can be changed by navigating to <code>Unity Tweak Tool > Theme</code> and selecting <code>Arc-dark</code>.</p>
<h2 id="wallpaper">Wallpaper</h2>
<figure>
<img src="../images/ubuntu_os_logo_black_yellow_28786_1680x1050.jpg" alt="My wallpaper" /><figcaption><a href="https://wallpaperscraft.com/download/ubuntu_os_logo_black_yellow_28786/1680x1050"><em>My wallpaper</em></a></figcaption>
</figure>
<blockquote>
</blockquote>
<p>I use minimalistic dark wallpaper to match the Arc-dark theme. Good wallpaper makes your desktop look cool and dark wallpapers reduce the amount of light emitted by an empty screen. The easiest way to set up a new wallpaper is to right click it to select <code>Set as Wallpaper</code>. Wallpapers are saved to a directory at <code>Pictures/Wallpapers</code>.</p>
<h2 id="date-and-time-format">Date and Time Format</h2>
<figure>
<img src="../images/dconf-editor-datetime.png" alt="dconf Editor" /><figcaption><em>dconf Editor</em></figcaption>
</figure>
<blockquote>
</blockquote>
<p>The date and time format of the clock in Ubuntu panel can be set to have a custom format. I use the format of <code>YYYY-MM-DD H:M</code>. In order to configure the time format, you need to first install dconf Editor.</p>
<pre><code>sudo apt-get dconf-editor</code></pre>
<p>After installation navigate to <code>dconf Editor > com > canonical > indicator > datetime</code>. In this menu toggle <code>time-format</code> to <code>custom</code> and set the value inside <code>custom-time-format</code> to the format you want.</p>
<p>These instructions are based on the article <a href="http://ubuntuhandbook.org/index.php/2015/12/time-date-format-ubuntu-panel/"><em>How to Customize Time & Date Format in Ubuntu Panel</em></a>.</p>
<h2 id="default-user-folders">Default User Folders</h2>
<figure>
<img src="../images/default-user-folders-2.png" alt="Custom location for default user folders" /><figcaption><em>Custom location for default user folders</em></figcaption>
</figure>
<blockquote>
</blockquote>
<p>Anyone with a computer setup with a separate SSD disk and mass storage might want to change the paths of their default user folders such as <code>Documents/</code>, <code>Downloads/</code>, <code>Music/</code>, <code>Pictures</code> and <code>Videos</code> to the mass storage location instead of the SSD. This saves space on the SSD. These paths can be changed by modifying configuration file located at <code>~/.config/user-dirs.dirs</code>.</p>
<blockquote>
</blockquote>
<figure>
<img src="../images/user-dirs-gedit.png" alt="Modified paths for default user folders" /><figcaption><em>Modified paths for default user folders</em></figcaption>
</figure>
<blockquote>
</blockquote>
<p>Open the file using a text editor of your choice, for example, Gedit.</p>
<pre><code>gedit ~/.config/user-dirs.dirs</code></pre>
<p>Then replace the default path with the path of your custom location. I originally found this instruction from the article <a href="https://askubuntu.com/questions/67044/change-default-user-folders-path"><em>Change default user folders path</em></a>.</p>
Mathematical Programming Workflow with Julia and Atom2017-10-25T08:15:00+03:002017-10-25T08:15:00+03:00Jaan Tollander de Balschtag:jaantollander.github.io,2017-10-25:/2017-10-25-mathematical-programming-workflow-with-atom-and-julia.html
<p><img src="../images/atom-euler.png" /></p>
<blockquote>
</blockquote>
<p>One of the many challenges at university, studying applied mathematics, has been finding tools for efficiently solving mathematical and algorithmic problems, and documenting them using a computer. This post covers how to improve your workflow for these kinda of problems using the capabilities of modern code editors and programming languages. These will increase your productivity and make problem-solving more fun and documenting easier.</p>
<p><img src="../images/atom-euler.png" /></p>
<blockquote>
</blockquote>
<p>One of the many challenges at university, studying applied mathematics, has been finding tools for efficiently solving mathematical and algorithmic problems, and documenting them using a computer. This post covers how to improve your workflow for these kinda of problems using the capabilities of modern code editors and programming languages. These will increase your productivity and make problem-solving more fun and documenting easier.</p>
<h2 id="required-software">Required Software</h2>
<p>The list of software and tools we are going to be using</p>
<ul>
<li><a href="https://atom.io/">Atom</a> is modern, cross-platform code editor built using web technologies. The use of web-technologies allows Atom to be extensible, customizable and it enables lots of useful features to work.</li>
<li><a href="https://julialang.org/">Julia</a> is high-level, a high-performance dynamic programming language for numerical computing.</li>
<li><a href="https://pandoc.org/">Pandoc</a> is a tool for converting markup formats into another.</li>
<li><a href="https://daringfireball.net/projects/markdown/">Markdown</a> is a lightweight markup language with plain text formatting syntax. Markdown is commonly used to write web content such as blog posts or documentation. Markdown files can be converted into HTML for web documentation or PDFs via Pandoc.</li>
<li><a href="https://www.latex-project.org/">LaTeX</a> is a high-quality typesetting system, designed for the production of technical and scientific documentation. LaTeX is required for creating PDFs from Markdown using Pandoc. This is useful for creating handouts from assignments.</li>
</ul>
<p>Installation instructions</p>
<ul>
<li><a href="https://atom.io/">Install Atom</a></li>
<li><a href="https://julialang.org/downloads/">Download Julia</a></li>
<li><a href="https://pandoc.org/installing.html">Install Pandoc</a></li>
<li><a href="https://www.latex-project.org/get/">Download LaTeX</a></li>
</ul>
<p>Add Julia, Pandoc, and LaTeX to the path if they were not added to the path during installation.</p>
<h2 id="atom-packages">Atom Packages</h2>
<figure>
<img src="../images/atom-packages.png" alt="Atom preferences" /><figcaption><em>Atom preferences</em></figcaption>
</figure>
<blockquote>
</blockquote>
<p>Packages are what gives Atom its powers. Packages can be added from <code>Edit > Preferences > Packages</code>. Here is a short list of the packages that are needed:</p>
<ul>
<li><code>language-julia</code></li>
<li><code>uber-juno</code></li>
<li><code>latex-completions</code> (This does not work with markdown files when language-markdown is enabled. I don’t yet know how to fix it. Works fine otherwise.)</li>
<li><code>hasklig</code> (optinal but improves readability of Julia code since Julia uses similar syntax as Haskell for some operations)</li>
<li><code>language-markdown</code></li>
<li><code>markdown-preview-plus</code> uses Pandoc to preview markdown files. This enables support for equation through <code>mathjax</code> and support for citations through <code>pandoc-citeproc</code>.</li>
</ul>
<p>Some configurations you should configure in the plugins</p>
<ul>
<li>Enable <code>mathjax</code> for <code>markdown-preview-plus</code> plugin</li>
</ul>
<h2 id="practicing-skills">Practicing Skills</h2>
<figure>
<img src="../images/project-Euler-p001-example.png" alt="Project Euler workflow using Julia and Atom. This image shows how to solve the problem 1 using naive and efficient algorithm." /><figcaption><em>Project Euler workflow using Julia and Atom. This image shows how to solve the problem 1 using naive and efficient algorithm.</em></figcaption>
</figure>
<blockquote>
</blockquote>
<figure>
<img src="../images/project-Euler-example-markdown.png" alt="Example of using Markdown with markdown-preview plugin" /><figcaption><em>Example of using Markdown with markdown-preview plugin</em></figcaption>
</figure>
<blockquote>
</blockquote>
<p>One of my favorite ways to practice algorithmic problem solving is <a href="https://projecteuler.net/">Project Euler</a>. Project Euler contains various problems that require both programming and mathematical skills to obtain a solution, especially for the harder problems.</p>
<ol type="1">
<li><code><problem>.jl</code>: Write the algorithm into the Julia file. Common pattern to write the
<ul>
<li>Write the actual algorithm. Julia has a lot of useful properties for mathematical programming which can be found by reading <a href="https://docs.julialang.org/en/stable/">documentation</a>.</li>
<li>Use <code>assert(...)</code> to test that your algorithm works for example values that were given in the problem description.</li>
<li>Use <code>@time</code> macro to receive running time and allocated memory. Be sure to do this after compiling the function once to obtain a good measurement.</li>
</ul></li>
<li><code><problem>.md</code>: Write the relevant mathematics into the markdown file. Use markdown preview to preview the HTML version. This is optional but useful for complicated problems.</li>
</ol>
Ergonomic Workstation2017-10-01T11:52:00+03:002017-10-01T11:52:00+03:00Jaan Tollander de Balschtag:jaantollander.github.io,2017-10-01:/2017-10-01-ergonomic-workstation.html
<p><img src="../images/workstation.jpg" /></p>
<blockquote>
</blockquote>
<p>In this post, I cover some key features that anyone working long hours using a computer should consider in their workstation setup to improve health and productivity. I explain details on what features my setup includes and why these features are important.</p>
<p><img src="../images/workstation.jpg" /></p>
<blockquote>
</blockquote>
<p>In this post, I cover some key features that anyone working long hours using a computer should consider in their workstation setup to improve health and productivity. I explain details on what features my setup includes and why these features are important.</p>
<h2 id="height-adjustable-table-ergonomic-chair">Height Adjustable Table & Ergonomic Chair</h2>
<p>Health aspects of sitting have received more attention in recent years. The right choice of furniture can improve both, <em>health</em> and <em>working efficiency</em>. I personally own a saddle chair, <a href="http://salli.com/en/salli-swingfit">Salli SwingFit</a>, and an adjustable table, <a href="http://salli.com/en/salli-office">Salli Office</a>, produced by <a href="http://salli.com/en">Salli</a>, a Finnish company that manufactures ergonomic furniture. Saddle chair improves your posture while sitting, which helps to avoid lower back problems caused by sitting. Adjustable table enables the adjustment of the height of the table to preferable height.</p>
<h2 id="screens">Screens</h2>
<figure>
<img src="../images/benq-xl2411-1.png" alt="BenQ ZOWIE XL2411 144Hz 24 inch e-Sports Monitor" /><figcaption><em>BenQ ZOWIE XL2411 144Hz 24 inch e-Sports Monitor</em></figcaption>
</figure>
<blockquote>
</blockquote>
<p>I have two <a href="http://zowie.benq.com/en/product/monitor/xl/xl2411.html">24" BenQ Zowie monitors</a>. It is very important that the height of the monitor can be adjusted which allows better position for the neck. Also, monitors that can be rotated 90° can be used to display longer text files. I would advise buying 27" monitors instead of 24" if your budget allows it since the extra height is very useful for graphical work and it can display a larger portion of code.</p>
<h2 id="keyboard">Keyboard</h2>
<figure>
<img src="../images/kinesis-advantage-2.jpg" alt="Kinesis Advantage 2" /><figcaption><em>Kinesis Advantage 2</em></figcaption>
</figure>
<blockquote>
</blockquote>
<p>The keyboard is extremely important and often underrated part of a high-efficiency workstation. <em>Ergonomic keyboards</em>, such as <a href="https://www.kinesis-ergo.com/shop/advantage2/">Kinesis Advantage 2</a>, are <em>separated in the middle</em> which allows the hands to be in a more natural position in the keyboard, reducing unnecessary stress from the shoulders. Due to the <em>3-dimensional layout</em>, all the keys are easily reachable, making it easier to use all ten fingers and faster to type with. The cherry MX brown <em>switches</em> also make it very pleasant to type with.</p>
<p>I recommend using <a href="https://www.gnu.org/software/gtypist/index.html">GNU typist</a>, a typing tutor software, to improve typing your skills. It is what I used it to learn to type with Kinesis Advantage and it took me around 4-5 days to get to comfortable skill level so that typing was easy again.</p>
<h2 id="computer">Computer</h2>
<figure>
<img src="../images/ubuntu-details.png" alt="Details of my computer" /><figcaption><em>Details of my computer</em></figcaption>
</figure>
<blockquote>
</blockquote>
<p>Most important properties for a desktop computer are <em>quietness</em> and <em>speed</em>. Quietness is the most important property since increased noise can have a huge negative impact on productivity. Speed is the second most important property and should be maximized as long as the build is within your budget and does not increase the level of noise. The computer power cable should be hooked into overvoltage protection to protect your valuable hardware. When it comes to the operating system, I would suggest Linux based distribution, such as Ubuntu, for anyone interested in programming.</p>
<h2 id="workroom">Workroom</h2>
<p>Some considerations about the workroom itself</p>
<ul>
<li><strong>Avoid having lights on</strong> while working on the computer. Additional artificial lights will simply cause extra fatigue and reduce productivity.</li>
<li><strong>Workroom should have an openable window</strong> for some fresh air. Also, natural light is better than artificial light for cognitive performance.</li>
</ul>
Scala Programming using IntelliJ IDEA2016-11-30T00:00:00+02:002016-11-30T00:00:00+02:00Jaan Tollander de Balschtag:jaantollander.github.io,2016-11-30:/2016-11-30-intellij-scala.html
<p><img src="../images/intellij-scala.png" /></p>
<blockquote>
</blockquote>
<p>This short guide explains some reasons for switching to <a href="https://www.jetbrains.com/idea/">IntelliJ IDEA</a> as an alternative IDE for <a href="https://eclipse.org/">Eclipse</a> for writing <a href="https://www.scala-lang.org/">Scala</a>. We also show how to do the setup. IntelliJ IDEA is a Java IDE from JetBrains, which can also be used for writing Kotlin, Scala, and Groovy. Here are some reasons why I use IntelliJ</p>
<ul>
<li>Easy and intuitive to learn for people of any skill level</li>
<li>User-friendly and sophisticated interface</li>
<li>Designed in a way that allows it to be used by using keyboard only</li>
<li>Has option to choose a dark theme such as <em>Darcula</em>. Dark themes are much more pleasant for the eyes, especially later in the evening</li>
<li>By default uses <a href="https://fonts.google.com/specimen/Source+Code+Pro">Source Code Pro</a> font, which is font designed for coding applications</li>
<li>Has powerful refactoring and static code analysis tools</li>
</ul>
<p>IntelliJ’s <a href="https://www.youtube.com/user/intellijideavideo">youtube channel</a> contains more material and guides for those who are interested.</p>
<p><img src="../images/intellij-scala.png" /></p>
<blockquote>
</blockquote>
<p>This short guide explains some reasons for switching to <a href="https://www.jetbrains.com/idea/">IntelliJ IDEA</a> as an alternative IDE for <a href="https://eclipse.org/">Eclipse</a> for writing <a href="https://www.scala-lang.org/">Scala</a>. We also show how to do the setup. IntelliJ IDEA is a Java IDE from JetBrains, which can also be used for writing Kotlin, Scala, and Groovy. Here are some reasons why I use IntelliJ</p>
<ul>
<li>Easy and intuitive to learn for people of any skill level</li>
<li>User-friendly and sophisticated interface</li>
<li>Designed in a way that allows it to be used by using keyboard only</li>
<li>Has option to choose a dark theme such as <em>Darcula</em>. Dark themes are much more pleasant for the eyes, especially later in the evening</li>
<li>By default uses <a href="https://fonts.google.com/specimen/Source+Code+Pro">Source Code Pro</a> font, which is font designed for coding applications</li>
<li>Has powerful refactoring and static code analysis tools</li>
</ul>
<p>IntelliJ’s <a href="https://www.youtube.com/user/intellijideavideo">youtube channel</a> contains more material and guides for those who are interested.</p>
<h2 id="setting-up-intellij-idea">Setting Up IntelliJ IDEA</h2>
<p>The official <a href="https://www.jetbrains.com/help/idea/meet-intellij-idea.html">IntelliJ IDEA guide</a> offers more in-depth details for using IntelliJ, which also contains <a href="https://www.jetbrains.com/help/idea/scala.html">Scala section</a>. Here is the short guide to get up and running with IntelliJ</p>
<ol type="1">
<li>Request for a <a href="https://www.jetbrains.com/student/">student license</a>. With a student license, you can get the professional versions of JetBrains products for free.</li>
<li><a href="https://www.jetbrains.com/idea/download">Download IntelliJ IDEA</a>. If you applied for student license download the <em>Ultimate</em> edition otherwise download the <em>Community</em> edition.</li>
<li>Install Scala plugin</li>
<li><em>Optional</em>: Set theme to <em>Darcula</em>.</li>
<li><em>Linux users</em>: Make desktop entry, by searching from settings <em>create desktop entry</em>.</li>
</ol>
<h2 id="importing-a-project">Importing a Project</h2>
<div style="position:relative;height:0;padding-bottom:56.21%">
<iframe src="https://www.youtube.com/embed/V_gcPUO7X-I?ecver=2" style="position:absolute;width:100%;height:100%;left:0" width="641" height="360" frameborder="0" gesture="media" allowfullscreen>
</iframe>
</div>
<blockquote>
</blockquote>
<p>This is a guide toward for Aalto University Scala programming courses. <em>CS-A1140 Data Structures and Algorithms</em> course files are used as an example.</p>
<ul>
<li>Project dependensies: <code>A1140-libs.zip</code></li>
<li>Project file. E.g. <code>A1140-r1-peakFinder.zip</code></li>
</ul>
<p>Import Eclipse project files</p>
<ol type="1">
<li>Open IntelliJ Idea</li>
<li>Choose <code>Import Project</code></li>
<li>Select extracted project files folder. E.g. <code>A1140-r1-peakFinder</code></li>
<li>Choose to import as <code>Eclipse project</code></li>
<li>Keep pressing <code>next</code> and finally press <code>finish</code></li>
</ol>
<p>Setting up Scala SDK</p>
<ol type="1">
<li>Set scala SDK by opening exercise file in IntelliJ and pop should suggest to setup scala SDK.</li>
</ol>
<p>Setting up the dependencies</p>
<ol type="1">
<li>Open <code>project structure</code> window</li>
<li>Select <code>modules</code> choose <code>Dependencies</code> tab</li>
<li>Press the <em>plus</em> sign to add new dependencies</li>
<li>Select all the <code>.jar</code> files inside the <code>A1140-libs/lib</code> directory</li>
<li>Press <em>OK</em></li>
</ol>