Janith's Bloghttps://janithl.github.io/2022-01-09T14:55:00+05:30Some 2021 Stats2022-01-09T14:55:00+05:302022-01-09T14:55:00+05:30Janithtag:janithl.github.io,2022-01-09:/2022/01/some-2021-stats/<p>2021 was supposed to be the year that the vaccine was introduced to all
and COVID deaths would (mostly) be a thing of the past. Instead, Delta
happened and Sri Lanka (and the world) saw the situation worsen drastically.
<a href="https://srilankac19memorial.org/">We lost many invaluable lives to the virus.</a></p>
<p>Here are some …</p><p>2021 was supposed to be the year that the vaccine was introduced to all
and COVID deaths would (mostly) be a thing of the past. Instead, Delta
happened and Sri Lanka (and the world) saw the situation worsen drastically.
<a href="https://srilankac19memorial.org/">We lost many invaluable lives to the virus.</a></p>
<p>Here are some 2021 personal stats:</p>
<h3>Transport</h3>
<p>In 2018, I took 556 bus rides. <a href="https://janithl.github.io/2020/01/some-2019-stats/">In 2019, I took 265.</a> <a href="https://janithl.github.io/2021/01/some-2020-stats/">In 2020, I took 15.</a></p>
<p>In 2021, I took <strong>none</strong>. It would've been irresponsible for me to<sup id="fnref:1"><a class="footnote-ref" href="#fn:1">1</a></sup>.
I've only taken 8 tuk/taxi rides in all of 2021, and 5 of these happened
in the last two months of the year when case numbers subsided. There's
really no point making a graph for just 8 rides so I will skip it, along
with the year-on-year comparison.</p>
<h3>The Blog</h3>
<p>I only published 7 posts in 2021, down from 16 in 2020 and 18 in 2019.
Given the circumstances this year, I am happy with this output.</p>
<p><img alt="Post Counts from 2009 to 2021" src="https://janithl.github.io/images/2021-2009-post-counts.png"></p>
<h3>Art/Music</h3>
<p>On <a href="https://www.instagram.com/chithrapotha/">Chithrapotha, I managed only 36 posts this year</a>, and a lot of
them were WIP from <a href="https://janithl.github.io/2021/03/paramitha/">my animated short</a>. I really should get around to
posting more and stop trying to innovate so much and try new things in
every single piece<sup id="fnref:2"><a class="footnote-ref" href="#fn:2">2</a></sup>. Sometimes we need to do things just for fun and
I need to return to the place of fun and relaxation that made me pick up
painting in the first place.</p>
<p><img alt="Chithrapotha" src="https://janithl.github.io/images/2021-chithrapotha.jpg"></p>
<p>On SoundCloud <a href="https://soundcloud.com/janith-leanage/sets/2k21">I managed 7 tracks this year</a>, which is down from
<a href="https://soundcloud.com/janith-leanage/sets/2k20">8 in 2020</a> and <a href="https://soundcloud.com/janith-leanage/sets/2k19">18 in 2019</a>. The big addition this year has been
a MIDI-enabled keyboard that I got at the end of October and which has
opened up new sonic possibilities. Here's to a hope of more exiting
music in 2022!</p>
<h3>Spotify/Last.fm</h3>
<p>Spotify finally became available in Sri Lanka in 2021! This has seen
my <a href="https://www.last.fm/user/JanithL">Last.fm scrobbles</a> increase from 123 and 207 in 2019 and 2020,
to a massive 1335 in 2021.</p>
<p><img alt="Last.fm Artists and Albums" src="https://janithl.github.io/images/2021-lastfm-1.jpg"></p>
<p>My listening peaked in May and then dropped off:</p>
<p><img alt="Last.fm Scrobbles" src="https://janithl.github.io/images/2021-lastfm-2.jpg"></p>
<p>Mostly listening to rock and pop in the evenings:</p>
<p><img alt="Last.fm Genres" src="https://janithl.github.io/images/2021-lastfm-3.jpg"></p>
<h3>Anime</h3>
<p>I didn't watch much 2021 anime in 2021 (because holy shit there's a
whole backlog), but out of the shows that I watched, <a href="https://myanimelist.net/anime/49738/Heike_Monogatari">Heike Monogatari</a>,
<a href="https://myanimelist.net/anime/42897/Horimiya">Horimiya</a>, and <a href="https://myanimelist.net/anime/38474/Yuru_Camp%E2%96%B3_Season_2">the second season of Yuru Camp</a> deserve
mentions for being standout hits. Especially Heike, I believe,
deserves more audience awareness and critical acclaim than it got.
It is yet another Naoko Yamada masterclass in visual storytelling,
and her directorial debut for an outfit other than Kyoto Animation.</p>
<p>The best 2021 movie I managed to catch was <a href="https://myanimelist.net/anime/40787/Josee_to_Tora_to_Sakana-tachi">Josee to Tora to Sakana-tachi</a>,
a heart-warming tale of a sheltered girl meeting love and seeing
the world. I also enjoyed the simple storyline and striking art
style of <a href="https://myanimelist.net/anime/39175/Cider_no_You_ni_Kotoba_ga_Wakiagaru">Cider no You ni Kotoba ga Wakiagaru</a>. <a href="https://myanimelist.net/anime/49357/Star_Wars__Visions">Star Wars: Visions</a>
also deserves a mention for showing us the Star Wars universe
through the eyes of the best studios in anime.</p>
<h3>Books</h3>
<p><img alt="Goodreads Year in Books" src="https://janithl.github.io/images/2021-books.jpg"></p>
<p><a href="https://www.goodreads.com/user/year_in_books/2021">According to Goodreads I have only read 2 books this year</a>, the
second and third books in Isaac Asimov's Foundation trilogy. I have
a whole stack of books remaining from my pandemic Big Bad Wolf haul
that I need to get through.</p>
<p class="text-center text-muted">* * *</p>
<p>So, that's been my 2021 in numbers. It had a lot of downs and downs,
but hopefully 2022 is the year we emerge from this scourge and return
to some semblance of normalcy<sup id="fnref:3"><a class="footnote-ref" href="#fn:3">3</a></sup>. Cheers!</p>
<div class="footnote">
<hr>
<ol>
<li id="fn:1">
<p>Even with this abundance of caution and never stepping out of
the house, I managed to catch the dreaded 'rona during the Delta wave in July <a class="footnote-backref" href="#fnref:1" title="Jump back to footnote 1 in the text">↩</a></p>
</li>
<li id="fn:2">
<p>Thanks to this <a href="https://www.youtube.com/watch?v=4E3511ZiiJ8">Chelsea Lang</a> video for giving me perspective <a class="footnote-backref" href="#fnref:2" title="Jump back to footnote 2 in the text">↩</a></p>
</li>
<li id="fn:3">
<p>Ajith Nivard Cabraal laughs heartily <a class="footnote-backref" href="#fnref:3" title="Jump back to footnote 3 in the text">↩</a></p>
</li>
</ol>
</div>Remove shadows and uneven lighting from photographs of writing on paper2021-12-09T19:15:00+05:302021-12-09T19:15:00+05:30Janithtag:janithl.github.io,2021-12-09:/2021/12/remove-shadows-and-uneven-lighting/<p>This is mostly a note to self. You know how you often have photographs
of notes or forms that you need to print out, and there's a shadow or
uneven lighting across the image which makes the print look bad?</p>
<p><img alt="Initial image" src="https://janithl.github.io/images/shadow-removal/photo-1.jpg"></p>
<p>These are the steps I take to make something like …</p><p>This is mostly a note to self. You know how you often have photographs
of notes or forms that you need to print out, and there's a shadow or
uneven lighting across the image which makes the print look bad?</p>
<p><img alt="Initial image" src="https://janithl.github.io/images/shadow-removal/photo-1.jpg"></p>
<p>These are the steps I take to make something like this friendlier for a
black-and-white printer. I am using the amazing online editor
<a href="https://www.photopea.com/">Photopea</a>, but most image editors can handle this.</p>
<h3>Initial image adjustments</h3>
<p>First, desaturate the image. Since we're going to print it out in b&w anyway,
it doesn't matter. Bump up the contrast and brightness a bit too.</p>
<p><img alt="Desaturated image" src="https://janithl.github.io/images/shadow-removal/photo-2.jpg"></p>
<p>If the editor has a way to warp transformation or something similar, you can
use it to straighten out the image a little bit.</p>
<p><img alt="Warped image" src="https://janithl.github.io/images/shadow-removal/photo-3.jpg"></p>
<h3>Duplicating the layer</h3>
<p>Now, duplicate the image layer. Invert the colours and apply a Gaussian
blur (I used about 7 pixels as the blur value)</p>
<p><img alt="Blurred image" src="https://janithl.github.io/images/shadow-removal/photo-4.jpg"></p>
<p>We can then change the layer mode from "normal" to "colour dodge"</p>
<p><img alt="Layer mode screen shot" src="https://janithl.github.io/images/shadow-removal/screenshot-1.png"></p>
<p><img alt="Colour Dodge applied" src="https://janithl.github.io/images/shadow-removal/photo-5.jpg"></p>
<h3>Final adjustments</h3>
<p>Then with some level adjustment, we can get the final output to look evenly
lit and appropriate for printing.</p>
<p><img alt="Level adjustment screen shot" src="https://janithl.github.io/images/shadow-removal/screenshot-2.png"></p>
<p><img alt="Level adjusted image" src="https://janithl.github.io/images/shadow-removal/photo-6.jpg"></p>
<hr>
<p>This is simply what worked for me, but there must be tons of other, <em>better</em> ways
of doing this. Play around with the level adjustment, drop the bumping of
brightness and contrast at the start, and you might get something that works
best for the photographs of notes that you have.</p>useMemo vs useEffect and useState2021-07-20T08:48:00+05:302021-07-20T08:48:00+05:30Janithtag:janithl.github.io,2021-07-20:/2021/07/usememo-vs-useeffect-and-usestate/<p>Since the advent of React Hooks, there have been a few hook-related
anti-patterns that have popped up. To be fair, these existed before
hooks as well, but in different forms. The use of derived state is
one of the most pervasive of these. As the React blog pointed out
way …</p><p>Since the advent of React Hooks, there have been a few hook-related
anti-patterns that have popped up. To be fair, these existed before
hooks as well, but in different forms. The use of derived state is
one of the most pervasive of these. As the React blog pointed out
way back in 2018, <a href="https://reactjs.org/blog/2018/06/07/you-probably-dont-need-derived-state.html"><em>"You Probably Don't Need Derived State"</em></a>.</p>
<p>In a hooks-based application, it may look something like this:</p>
<div class="highlight"><pre><span></span><code><span class="kr">const</span> <span class="nx">MyComponent</span> <span class="o">=</span> <span class="p">({</span> <span class="nx">initialValue</span> <span class="p">})</span> <span class="p">=></span> <span class="p">{</span>
<span class="kr">const</span> <span class="p">[</span><span class="nx">value</span><span class="p">,</span> <span class="nx">setValue</span><span class="p">]</span> <span class="o">=</span> <span class="nx">useState</span><span class="p">();</span>
<span class="nx">useEffect</span><span class="p">(()</span> <span class="p">=></span> <span class="p">{</span>
<span class="kr">const</span> <span class="nx">derivedValue</span> <span class="o">=</span> <span class="nx">expensiveTransform</span><span class="p">(</span><span class="nx">initialValue</span><span class="p">);</span>
<span class="nx">setValue</span><span class="p">(</span><span class="nx">derivedValue</span><span class="p">);</span>
<span class="p">},</span> <span class="p">[</span><span class="nx">initialValue</span><span class="p">]);</span>
<span class="p">...</span>
<span class="p">}</span>
</code></pre></div>
<p>There are two varieties of this: one where <code>value</code> is updated by the
user inside the component, and another where <code>value</code> is used but not
updated.</p>
<p>For the first type, consider how any update of <code>initialValue</code> will
overwrite the changes made by the user in the state. Do you really
want this to happen? <a href="https://reactjs.org/blog/2018/06/07/you-probably-dont-need-derived-state.html">The blog post I linked above</a> lays out a few
alternatives.</p>
<p>For the second type, there is <strong>no need</strong> to put things in state anyway
if you don't plan on updating it. You can simply assign it to a constant:</p>
<div class="highlight"><pre><span></span><code><span class="kr">const</span> <span class="nx">MyComponent</span> <span class="o">=</span> <span class="p">({</span> <span class="nx">initialValue</span> <span class="p">})</span> <span class="p">=></span> <span class="p">{</span>
<span class="kr">const</span> <span class="nx">value</span> <span class="o">=</span> <span class="nx">expensiveTransform</span><span class="p">(</span><span class="nx">initialValue</span><span class="p">);</span>
<span class="p">...</span>
<span class="p">}</span>
</code></pre></div>
<p>Or, if you're worried about the <code>expensiveTransform()</code> and wish to avoid
unnecessarily calling it, you can use memoization:</p>
<div class="highlight"><pre><span></span><code><span class="kr">const</span> <span class="nx">MyComponent</span> <span class="o">=</span> <span class="p">({</span> <span class="nx">initialValue</span> <span class="p">})</span> <span class="p">=></span> <span class="p">{</span>
<span class="kr">const</span> <span class="nx">value</span> <span class="o">=</span> <span class="nx">useMemo</span><span class="p">(</span>
<span class="p">()</span> <span class="p">=></span> <span class="nx">expensiveTransform</span><span class="p">(</span><span class="nx">initialValue</span><span class="p">),</span>
<span class="p">[</span><span class="nx">initialValue</span><span class="p">]</span>
<span class="p">);</span>
<span class="p">...</span>
<span class="p">}</span>
</code></pre></div>
<p>Simple, and saves you the trouble of dealing with unnecessary state.</p>On Bunny Girl Senpai2021-07-18T23:35:00+05:302021-07-18T23:35:00+05:30Janithtag:janithl.github.io,2021-07-18:/2021/07/on-bunny-girl-senpai/<p>This weekend, I did something I had never done before: binge an
<a href="https://en.wikipedia.org/wiki/Rascal_Does_Not_Dream_of_Bunny_Girl_Senpai#Anime">entire 13-episode anime</a> AND <a href="https://en.wikipedia.org/wiki/Rascal_Does_Not_Dream_of_a_Dreaming_Girl">its movie</a>. I usually like to
consume media at a much slower pace and sit with what I’ve just
watched in an episode, but two things colluded in this case to make
me …</p><p>This weekend, I did something I had never done before: binge an
<a href="https://en.wikipedia.org/wiki/Rascal_Does_Not_Dream_of_Bunny_Girl_Senpai#Anime">entire 13-episode anime</a> AND <a href="https://en.wikipedia.org/wiki/Rascal_Does_Not_Dream_of_a_Dreaming_Girl">its movie</a>. I usually like to
consume media at a much slower pace and sit with what I’ve just
watched in an episode, but two things colluded in this case to make
me buckle my usual habit: my weekdays are packed (making me wait
till next weekend to finish the series), and the story was just so
good that it kept me hooked wanting to see the next episode of the
arc.</p>
<p>This is not meant to be a review. You will find much better-written
reviews by people with far more anime expertise than I do.</p>
<p>Instead, let’s talk about why I related so much with the themes of this
show. I think the overarching theme that ran through many of its arcs
is that we all hold on to bad decisions or unfortunate circumstances
from the past, and it prevents us from moving forward with our lives.</p>
<p>I love the idea of alternate timelines which branch off from the different
decisions that we make. It’s a bit comforting to think that we do have free
will and a world of possibilities exist in front of us. Certainly a far
more uplifting than the idea of fatalism.</p>
<p>This liking of alternate timelines also leads me down endless computational
time spent agonising over what could’ve been. There are a few train-wrecks
that were inevitable, but I still fantasise about ways to have avoided.
There are the people, there are the circumstances, and there’s how you
dealt with them. It’s a never-ending Rubik's cube of possible arrangements
and rearrangements!</p>
<p>So, anyway, my point (if there is any) is that in addition to having anxiety
about your future life and career, you can also have endless fun thinking
about all the ways the past could’ve been different too. Just get creative
with it, and I promise you a never-ending supply of sleepless nights!</p>An Update2021-07-16T23:05:00+05:302021-07-16T23:05:00+05:30Janithtag:janithl.github.io,2021-07-16:/2021/07/an-update/<p>I am alive and... <em>well?</em> I don’t know much about quantifying wellness—
but in the age of a pandemic—I feel lucky to be healthy. There hasn’t
been much activity in this blog, not just because I have been busy (work
really took over life in quarantine), but …</p><p>I am alive and... <em>well?</em> I don’t know much about quantifying wellness—
but in the age of a pandemic—I feel lucky to be healthy. There hasn’t
been much activity in this blog, not just because I have been busy (work
really took over life in quarantine), but because I have had a lot to
say but no way to say it.</p>
<p>Pandy life has upended a lot of what we take for granted, and made us
reevaluate a lot of what we considered foundational to our being in the
pre-Covid era. Human connections and the directions of our lives and how
we spend “social” time is among them. Now, don’t get me wrong, I still
love my friends, but this time apart without any face-to-face contact (I
last saw them in October! <strong>It’s been 8 months!</strong>) has been difficult for
everyone. It also made me consider what friendships entail and how far
we are willing to go to maintain friendships.</p>
<p>I was also suddenly very aware of how small my social circle is. Now, my
intentional limiting of social media usage was not much of a concern
pre-pandemic, but as the weeks of social distancing turned into months
I started regretting my choices just a little less. However, seeing the
toxicity on most platforms these days also made me realise why I decided
to cut the cord when I did.</p>
<p>This period of forced introspection (hah, as if I needed an excuse to look
inward) has also made me more and more aware of the central conflict in my
life: that between the <em>deen</em> and the <em>dunya</em>. The <em>lokottara</em> versus the
<em>laukika</em>. Do I really want my hopeless romanticism to finally culminate
in the life of a householder—with wife and children in tow—or do I want
to make the best of (what I honestly believe) is an infinitesimally rare
opportunity to break the cycle of samsara?</p>
<p>I know this post is disjointed and sounds like the ramblings of an
<em>ummattaka</em> (because <em>සබ්බේ සත්තා උම්මත්තකෝ</em>, right?), but I need this as a
waypoint to look back at someday and convince myself that whatever choice
I made here was correct.</p>
<p>And till that day, happy journeying to you all.</p>On the making of "Paramitha"2021-03-15T07:40:00+05:302021-03-15T07:40:00+05:30Janithtag:janithl.github.io,2021-03-15:/2021/03/paramitha/<iframe width="640" height="360" src="https://www.youtube.com/embed/mX2w9W4xIc4"
frameborder="0" allowfullscreen></iframe>
<p>One week ago, on 7 March, I released my animated short <em>Paramitha</em>.
I stared working on it in early February and just as I expected
it took ~4 weeks of work to finish. I used <a href="https://krita.org/en/">Krita</a> for the
drawing and frame-by-frame animations, and <a href="https://www.synfig.org">Synfig Studio</a> for
things like parallax.</p>
<p>The …</p><iframe width="640" height="360" src="https://www.youtube.com/embed/mX2w9W4xIc4"
frameborder="0" allowfullscreen></iframe>
<p>One week ago, on 7 March, I released my animated short <em>Paramitha</em>.
I stared working on it in early February and just as I expected
it took ~4 weeks of work to finish. I used <a href="https://krita.org/en/">Krita</a> for the
drawing and frame-by-frame animations, and <a href="https://www.synfig.org">Synfig Studio</a> for
things like parallax.</p>
<p>The story and setting were inspired by a random piece I did a
while back (I think I just liked the background!)</p>
<p><img alt="Storyboard" src="https://janithl.github.io/images/poya-girl.jpg"></p>
<p class="text-center"><a href="https://www.instagram.com/p/CJZ5yHHhnqW/">Original Post on Instagram</a></p>
<h3>Storyboard and Animation</h3>
<p>I first started with a storyboard, and then animated it to get an
idea of the timing and "beats":</p>
<p><img alt="Storyboard" src="https://janithl.github.io/images/storyboard.jpg"></p>
<p>Very rough storyboard animation:</p>
<iframe width="640" height="360" src="https://www.youtube.com/embed/PMPHFazRt9g"
frameborder="0" allowfullscreen></iframe>
<p>I did a lot of rough renders to explore ideas and get a feel for my
capabilities as an animator. This was my first short and I didn't want
to bite off more than I could chew.</p>
<iframe width="640" height="360" src="https://www.youtube.com/embed/89_ar23BNUw"
frameborder="0" allowfullscreen></iframe>
<p>The walk cycles were a major part of the animation. I do wish I could've
spent a little bit more time on them, as they were animated on fours and
would've looked much better if animated on twos.</p>
<iframe width="640" height="360" src="https://www.youtube.com/embed/eRpo2q4h6p0"
frameborder="0" allowfullscreen></iframe>
<p>I deviated from the storyboard somewhat by adding two additional
shots that were inspired by seeing how reflections were animated,
and the idea of a "journey" was used in anime. So, the bus scene
came into existence:</p>
<iframe width="640" height="360" src="https://www.youtube.com/embed/OYJzla1ju5I"
frameborder="0" allowfullscreen></iframe>
<h3>Parallax</h3>
<p>For parallax shots, which I employed a lot, the scene would broken
down into multiple semi-transparent layers in Krita and exported as
PNGs, which I would then animate in Synfig Studio. This allowed me
to make the layers closer to the camera move faster, giving the
illusion of depth in a scene.</p>
<p><img alt="Parallax" src="https://janithl.github.io/images/parallax.jpg"></p>
<h3>Sound</h3>
<p>Finally, in the final two days of production (a weekend) I worked on
the sound design and making a theme. <a href="https://www.audacityteam.org">Audacity</a> was a great help
during this. I wanted a female voice for the Buddhist chant (to fit the
character), but running short of time and people I could ask, I created
a chorus of voices chanting by recording it myself. For the theme, I
created a very simple droning, Eastern-inspired guitar and bass piece
in D major and C major.</p>
<iframe width="100%" height="300" scrolling="no" frameborder="no" allow="autoplay" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/994887208&color=%23ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true&visual=true"></iframe>
<div style="font-size: 10px; color: #cccccc;line-break: anywhere;word-break: normal;overflow: hidden;white-space: nowrap;text-overflow: ellipsis; font-family: Interstate,Lucida Grande,Lucida Sans Unicode,Lucida Sans,Garuda,Verdana,Tahoma,sans-serif;font-weight: 100;"><a href="https://soundcloud.com/janith-leanage" title="Jan" target="_blank" style="color: #cccccc; text-decoration: none;">Jan</a> · <a href="https://soundcloud.com/janith-leanage/paramitha-theme" title=""පාරමිතා" තේමා ගීතය | "Paramitha" Theme" target="_blank" style="color: #cccccc; text-decoration: none;">"පාරමිතා" තේමා ගීතය | "Paramitha" Theme</a></div>
<p>For the bird sounds, which added a lot of ambiance, I used two recordings:
<a href="https://en.wikipedia.org/wiki/File:Psittacula_krameri_-_Rose-ringed_Parakeet_XC474519.mp3">a recording of Rose-ringed Parakeet sounds by Marie-Lan Taÿ Pamart</a>,
and <a href="https://en.wikipedia.org/wiki/File:CommonMynaCalls.ogg">a recording of Common Mynas by L. Shyamal</a>. Both these birds are
commonly found in Sri Lanka.</p>
<p>And that's how it was done. Given how it was my first time making
something, and the fact that I had to learn so much on the job, I'm
very happy with how it turned out. The film and music are released
under a <a href="https://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 license
(CC BY-SA 4.0)</a>, so everyone can use and build up on it!</p>Better Halved2021-01-28T18:30:00+05:302021-01-28T18:30:00+05:30Janithtag:janithl.github.io,2021-01-28:/2021/01/better-halved/<p>Sometimes</p>
<p>I wonder if I am</p>
<p>A shard of glass</p>
<p>Safely disposed</p>
<p>Away from any exposed flesh</p>
<p>A burning ember separated</p>
<p>From dry cotton</p>
<p>It wishes it gets to know</p>
<p><em>A little too intimately</em></p>
<p>For a fleeting second</p>
<p>A malignant tumour</p>
<p>Discovered early</p>
<p>Before it could cut short</p>
<p>A mother's …</p><p>Sometimes</p>
<p>I wonder if I am</p>
<p>A shard of glass</p>
<p>Safely disposed</p>
<p>Away from any exposed flesh</p>
<p>A burning ember separated</p>
<p>From dry cotton</p>
<p>It wishes it gets to know</p>
<p><em>A little too intimately</em></p>
<p>For a fleeting second</p>
<p>A malignant tumour</p>
<p>Discovered early</p>
<p>Before it could cut short</p>
<p>A mother's warmth</p>
<p> </p>
<p>Is feeling a little incomplete</p>
<p>Really that bad</p>
<p>Is it such a tragedy</p>
<p>To wander the Earth yearning</p>
<p>For your missing half</p>
<p>To complete you</p>
<p>To complete what?</p>
<p>Maybe the little sadnesses</p>
<p><em>Sometimes</em></p>
<p>Are a bit deserved</p>Some 2020 Stats2021-01-01T10:55:00+05:302021-01-01T10:55:00+05:30Janithtag:janithl.github.io,2021-01-01:/2021/01/some-2020-stats/<p>There no getting around the fact that 2020 was defined by the pandemic. With that
in mind, some personal stats:</p>
<h3>Transport</h3>
<p>In 2018, I took 556 bus rides. <a href="https://janithl.github.io/2020/01/some-2019-stats/">In 2019, I took 265.</a></p>
<p>In 2020, I took 15. Not a typo. 14 rides in January and a solitary ride in …</p><p>There no getting around the fact that 2020 was defined by the pandemic. With that
in mind, some personal stats:</p>
<h3>Transport</h3>
<p>In 2018, I took 556 bus rides. <a href="https://janithl.github.io/2020/01/some-2019-stats/">In 2019, I took 265.</a></p>
<p>In 2020, I took 15. Not a typo. 14 rides in January and a solitary ride in February.
With the threat of Covid rising (even before the government decided to finally
lockdown in March), I didn’t risk taking cramped public transport. Sadly, I also
understand that working from home and taking a PickMe are not privileges everyone
has access to.</p>
<p>A breakdown of all rides taken in 2020 clearly reflect the two waves/lockdowns we
had this year in Sri Lanka:</p>
<p><img alt="Transport Modes in 2020" src="https://janithl.github.io/images/2020-transport.png"></p>
<p>These are the ride counts and average fares for 2020 in comparison to 2019:</p>
<table>
<thead>
<tr>
<th>Type</th>
<th align="right">Count (2019)</th>
<th align="right">Avg (2019)</th>
<th align="right">Count (2020)</th>
<th align="right">Avg (2020)</th>
<th align="right">Count Diff</th>
<th align="right">Avg Diff</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Bus</strong></td>
<td align="right">265</td>
<td align="right">21.91</td>
<td align="right">15</td>
<td align="right">27.53</td>
<td align="right">-250</td>
<td align="right">5.62</td>
</tr>
<tr>
<td><strong>PickMe</strong></td>
<td align="right">245</td>
<td align="right">394.35</td>
<td align="right">102</td>
<td align="right">349.25</td>
<td align="right">-143</td>
<td align="right">-45.10</td>
</tr>
<tr>
<td><strong>Tuk</strong></td>
<td align="right">29</td>
<td align="right">356.21</td>
<td align="right">12</td>
<td align="right">256.83</td>
<td align="right">-17</td>
<td align="right">-99.38</td>
</tr>
<tr>
<td><strong>Uber</strong></td>
<td align="right">5</td>
<td align="right">500.00</td>
<td align="right">1</td>
<td align="right">50.00</td>
<td align="right">-4</td>
<td align="right">-450.00</td>
</tr>
<tr>
<td><strong>Total</strong></td>
<td align="right"><strong>544</strong></td>
<td align="right"></td>
<td align="right"><strong>130</strong></td>
<td align="right"></td>
<td align="right"><strong>-414</strong></td>
<td align="right"></td>
</tr>
</tbody>
</table>
<h3>The Blog</h3>
<p>I published 16 posts in 2020, down from 18 in 2019. It’s still not hitting my ideal
of 24 (posting twice a month), but I’ll take it:</p>
<p><img alt="Posts per Month in 2020" src="https://janithl.github.io/images/2020-posts-per-month.png"></p>
<p><img alt="Post Counts from 2009 to 2020" src="https://janithl.github.io/images/2020-2009-post-counts.png"></p>
<h3>Art/Music</h3>
<p><a href="https://www.instagram.com/chithrapotha/">Chithrapotha is rolling on</a>, with 55 posts this year. This is nowhere near the 27
I posted in just over a month when I started it, but I put more effort to finish
pieces now and can never finish them at a rate of one-a-day like I used to.</p>
<p><img alt="Chithrapotha" src="https://janithl.github.io/images/2020-chithrapotha.jpg"></p>
<p>On SoundCloud <a href="https://soundcloud.com/janith-leanage/sets/2k20">I only managed 8 tracks this year</a> (down from <a href="https://soundcloud.com/janith-leanage/sets/2k19">18 in 2019</a>),
mostly due to my recording setup getting fudged by an OS upgrade back in June.
Hopefully, with the new year—and planned hardware upgrades—I’ll be back to recording
a ton of tracks that have piled up on my phone’s voice recording app.</p>
<p class="text-center text-muted">* * *</p>
<p>So, those are my 2020 stats. <a href="https://janithl.github.io/2020/10/clearing-the-slate/">It’s not been a great year</a>, but I’m well aware that
things could’ve been much worse—and I’m grateful for good health and still having all
my loved ones with me.</p>
<p>I sincerely hope 2021 will be a good year for you and yours!</p>
<script>
window.onload = function() {
$('table').addClass('table table-bordered table-condensed');
}
</script>Pizza Dough: What I've Learned2020-12-31T10:05:00+05:302020-12-31T10:05:00+05:30Janithtag:janithl.github.io,2020-12-31:/2020/12/pizza-dough-what-ive-learned/<p>Watching the <a href="https://www.youtube.com/watch?v=SDpCzJw2xm4">Adam Ragusea New York-style pizza dough recipe</a> inspired me to make
pizza at home, something that I never thought I was capable of. Now, about 3 batches
of pizza later, I think I’ve got most of the big details sorted out. Credit also to
<a href="https://www.youtube.com/watch?v=J_3v7DEkjsk">Andrew Rea for …</a></p><p>Watching the <a href="https://www.youtube.com/watch?v=SDpCzJw2xm4">Adam Ragusea New York-style pizza dough recipe</a> inspired me to make
pizza at home, something that I never thought I was capable of. Now, about 3 batches
of pizza later, I think I’ve got most of the big details sorted out. Credit also to
<a href="https://www.youtube.com/watch?v=J_3v7DEkjsk">Andrew Rea for his pan pizza recipe</a> which really helped me with kneading and
shaping techniques.</p>
<p>The prep time is about 3 hours, and I don’t do overnight refrigerator rises (I plan
to, one day, when I’m more patient and can remember to mix the dough the night before
I want the pizza)</p>
<h3>Flour</h3>
<p>I use the regular wheat flour, 150g per pizza. I usually make 3–4 pizzas so it’s
usually 450g or 600g. I don’t have a scale, so I use a measuring cup, sue me!</p>
<h3>Water, sugar and yeast</h3>
<p>I first take 100ml of water, mix it with half a packet of dry yeast (about 7.5g),
and 2 tablespoons of sugar. Mix well and let it activate for at least 30 minutes
(but longer is better). This will foam up and overtop your container so make sure
you put it on a large enough jar or something.</p>
<h3>Hydration</h3>
<p>I’m currently going for 60% hydration. This results in a very sticky dough but I
really like the taste and crunchy fluffiness of the final product.</p>
<p>60% hydration means you add 60% of your flour weight in water. For example if you
have 100g of flour, you add 60g (or 60ml–isn’t SI lovely!) of water. For 600g of
flour, this means adding 360ml of water.</p>
<p>But, <strong>remember that you already added 100ml to the yeast mixture</strong>. So do make
sure to take that into account. You can just top up the yeast mixture with 260ml
of water and add the whole shebang to the flour in a large mixing bowl. Add a
tablespoon of salt and two tablespoons of olive oil (I usually substitute with
<em>pol thel</em> because I am not made out of money).</p>
<p>Mix, mix, mix. You can check <a href="https://www.youtube.com/watch?v=n1O3uHPCOLA">Babish for ways to knead without breaking your back</a>.
I used to knead with my hands, but now I just use the mixer attachment in my
immersion blender and small bursts to get the thing kneaded.</p>
<p>Let it rest for 2 hours with a wet cloth on top of the bowl. This step is called
the <strong>bulk ferment</strong>.</p>
<h3>Shaping</h3>
<p>After letting your dough rise, break it into 3 or 4 parts. I really eyeball this and
don’t really care about accuracy at this point.</p>
<p>Now, the tricky part of actual shaping. The dough is sticky af and will stick to
anything, and I am currently experimenting with <s>oil paper sheets cut into circles</s>,
<a href="https://www.youtube.com/watch?v=3ZEGG1mb3Rc">like what Adam Ragusea does sometimes</a>. <strong>Update:</strong> The oil paper sticks like glue
to the batter (hey, <em>paappa</em> and <em>sau kola</em> in essence), so a better alternative I have
found is aluminium foil! Comes right off when the pizza cools.</p>
<p>You drop the dough balls into a bowl of flour, and dust your fingers with flour as
well. Drop the balls onto the oil paper and taking care not to deflate the edge (cornice)
use your fingers to push down and flatten the middle. Doing this and expanding the
pizza to your required size is the least fun part of the whole process for me, and I
have not perfected it at all. After you’re done making a fool of yourself, let it rest
and rise for another 1 hour.</p>
<h3>Sauce</h3>
<p>Now is a good time to get started on the sauce. I just chop up one onion (or two), and
smash a clove or two of garlic. I mix in about 2 tomatoes per pizza, so for 4 you’d need
8 tomatoes. It’s a good idea to drop the tomatoes in a hot water bath and peel off the
skins if that’s your thing. People also remove the seeds. I do neither of these things
because I am lazy and I don’t want to throw stuff away. Drop everything into a pan (onions
and garlic first) with oil, add water and tomato sauce as desired, and mix well over
medium heat. Once it looks good season with salt and pepper, and then put everything in a
jar and use an immersion blender to mix it all in.</p>
<h3>Cheese</h3>
<p>Don’t get pre-shredded motz. Shred your own motz. American YouTubers swear by adjectives
(“low moisture”, “full fat”), but we don’t really have much variety here right? Get whatever
mozzarella you can and just shred it into a bowl.</p>
<h3>Other toppings</h3>
<p>I’ve tried olives, sausages, and bacon. They all work well.</p>
<h3>Baking</h3>
<p>Pre-heat your oven to 200°C. Apply the sauce first, then the cheese, then drop any other
toppings. Brush your crust with some oil if you want things to look fancy. Slide your oil
paper’d pizza onto a baking pan to bake<sup id="fnref:1"><a class="footnote-ref" href="#fn:1">1</a></sup>. Your cook time will depend on your oven and
other factors I guess, but for me it’s usually between 15–20 minutes. I know it’s done when
the toppings are getting burnt and the crust starts looking brown (if the crust is still
white I’d advice keeping it in for a bit more). <s>The oil paper should come right off now that
the pizza is baked.</s> <strong>Update:</strong> It doesn't.</p>
<p>Keep experimenting, and I’m sure you’ll find better ways of doing things. For example if
you want a more burnt bottom you can try a small trick I do and use a <em>roti pan</em> on the
stove to burn the bottom (this can happen before you put it in the oven).</p>
<div class="footnote">
<hr>
<ol>
<li id="fn:1">
<p>Does anyone have pizza stones or pizza steels here? If you have one you can use that. <a class="footnote-backref" href="#fnref:1" title="Jump back to footnote 1 in the text">↩</a></p>
</li>
</ol>
</div>On Intolerance (of Intolerance)2020-12-20T22:45:00+05:302020-12-20T22:45:00+05:30Janithtag:janithl.github.io,2020-12-20:/2020/12/on-intolerance-of-intolerance/<p>I’m sure everyone at this point has read about the <a href="https://en.wikipedia.org/wiki/Paradox_of_tolerance"><em>paradox of tolerance</em></a>. It’s
a pretty common sense argument and there are many historial examples that are often
held up, one of the most popular being the rise of the Nazi party in the liberal
democracy of the …</p><p>I’m sure everyone at this point has read about the <a href="https://en.wikipedia.org/wiki/Paradox_of_tolerance"><em>paradox of tolerance</em></a>. It’s
a pretty common sense argument and there are many historial examples that are often
held up, one of the most popular being the rise of the Nazi party in the liberal
democracy of the Weimar Republic.</p>
<p>A problem that I've see cropping up recently (first in online communities, but soon
evolving to have offline consequences) is with the <em>definition of intolerance</em>—and
the actions the self-proclaimed ‘defenders’ of tolerance take to guard it.</p>
<p>One example from a few years back was the <em>Sinha-le</em> stickers, and the <em>Colombo liberal</em>
reaction to it. Without even considering the origins of the sticker campaign, or
motivations of those who chose to brand their vehicles with said sticker, a counter-campaign
was launched to take photographs, identify owners of the vehicles, and basically notify
their employees (with the ultimate intention of getting them fired, of course). Now, the
obvious moral issues of doxxing aside, this was one of the first instances I observed
the troubling phenomenon of online vigilantism, and what later came to be known as
<em>cancel culture</em>.</p>
<p>Now, many years later, cancel culture seems to be here to stay. It has led to a situation
which I’ve only experienced previously due to the looming threat of violence from a repressive
surveillance state: <em>self-censorship</em>. Netizens, people who used to risk their necks to
speak out against injustice being perpetrated by nation states, were now treating certain
subjects as off-limits, lest they be branded <em>“-phobes”</em> and cancelled. It is truly an
unexpected low-intensity reign of terror, and unlike state actors where there might be
<em>some</em> legal recourse/FR petition/habeas corpus/international pressure to give you at
least an iota of relief, in this case mobs accountable to no one and run by shadowy teenagers
seem to mete out justice after kangaroo trials. It sort of feels like the <em>JVP days</em> are here
again.</p>
<p>So, what’s a society to do to emerge out of this mess and reclaim our right to discourse and
divergent viewpoints? I honestly don’t know, but remember that an insurgency can only survive
as long as the wider populace supports it. For far too long we’ve allowed <em>important online public spaces</em>
to be run by social media firms milking our emotions for ad revenue. They have, in turn, given
us skewed elections, body image issues, FOMO, and free reign for online bullies. This fight is
well and truly lost, <strong>unless</strong> we take back our spaces. We will need to demand that the firms
for whom we create so much value give us—the community—the tools to curate, moderate, and monitor
those spaces<sup id="fnref:1"><a class="footnote-ref" href="#fn:1">1</a></sup>. We will need tougher regulations while guaranteeing freedom of expression, a tough
balancing act whenever governments (especially in our little corner of the world) get involved.</p>
<p>But, an even more pressing need will be for us as a society to come to terms with what
<strong>is and isn’t intolerant speech</strong>. We will have to grow up and tolerate dissenting views, and
not call for heads to roll whenever viewpoints that make us clutch our pearls come up on our feeds.</p>
<p>I used to believe technology could help alleviate societal problems, but I now realise that
technology is merely a <em>megaphone</em>—the voice and the words that come out of it will ultimately always
be <em>your own</em>.</p>
<div class="footnote">
<hr>
<ol>
<li id="fn:1">
<p>I would talk about solutions like <a href="https://joinmastodon.org">Mastodon</a>, but I really think that the convenience and network effect of, say, Facebook’s multi-network empire will take decades to dismantle. <a class="footnote-backref" href="#fnref:1" title="Jump back to footnote 1 in the text">↩</a></p>
</li>
</ol>
</div>On Foundation2020-10-31T20:05:00+05:302020-10-31T20:05:00+05:30Janithtag:janithl.github.io,2020-10-31:/2020/10/on-foundation/<p>I finished Isaac Asimov's seminal work, the first book of the <a href="https://en.wikipedia.org/wiki/Foundation_series">Foundation trilogy</a>,
yesterday. This is <a href="https://www.goodreads.com/review/show/3621843372">my short review</a> that I added on Goodreads:</p>
<hr>
<p>I think it's a bit harsh to rate this book using modern standards when it was
written in the 1940s. Yes, it's not as fast paced …</p><p>I finished Isaac Asimov's seminal work, the first book of the <a href="https://en.wikipedia.org/wiki/Foundation_series">Foundation trilogy</a>,
yesterday. This is <a href="https://www.goodreads.com/review/show/3621843372">my short review</a> that I added on Goodreads:</p>
<hr>
<p>I think it's a bit harsh to rate this book using modern standards when it was
written in the 1940s. Yes, it's not as fast paced or as expansive as modern SciFi,
and there is a woeful lack of female characters (only one gets a speaking part).
But modern SciFi didn't exist when Asimov wrote this, and so much of it even to
this day draws from the vein Asimov struck (the parallels with the Star Wars universe
a few decades later is notable, for example).</p>
<p>Instead, it might be a good idea to look at where Asimov himself drew inspiration
from: Edward Gibbon's <a href="https://en.wikipedia.org/wiki/The_History_of_the_Decline_and_Fall_of_the_Roman_Empire"><em>The History of the Decline and Fall of the Roman Empire</em></a>.
Basically, we can class the work as a <em>space history</em>, concerning how vast empires
decay, how the people living in the midst of such empires experience this fall much
more differently than the people living in the peripheries, and how opportunists
come for the scraps. One wonders how Asimov predicted so well the work of the oligarchs
and pocket dictators after the fall of his native Soviet Union, and fifty years before
the fact.</p>
<p>What I found strikingly modern though are its takes on religion as a means of social
control, ivory tower academics who were unconcerned with all but dogma while the Rome
that sustained their work burned around them, and how societies tend to reject
science and technology it doesn't understand-a theme that reverberates well in
today's post-Covid world.</p>Links: What I've Been Watching2020-10-23T21:38:00+05:302020-10-23T21:38:00+05:30Janithtag:janithl.github.io,2020-10-23:/2020/10/links-what-ive-been-watching/<p>Here's a small recap of what I've been watching on the ol' YouTube.</p>
<h3>Practical Engineering</h3>
<iframe width="640" height="360" src="https://www.youtube.com/embed/aspPJ2Wcaig"
frameborder="0" allowfullscreen></iframe>
<p><a href="https://www.youtube.com/c/PracticalEngineeringChannel">Grady Hillhouse</a> just has the most calming presence on screen, and he
explains complex engineering concepts with simple practical setups. His series’
on <a href="https://www.youtube.com/watch?v=UOHURuAf5iY&list=PLTZM4MrZKfW90PdaBFt70BLTbz1bTF6Mn">concrete</a>, <a href="https://www.youtube.com/watch?v=7tjf8HWiR3Y&list=PLTZM4MrZKfW_XJht-K7a9_egIsFqze0nQ">hydraulics</a>, and <a href="https://www.youtube.com/watch?v=v1BMWczn7JM&list=PLTZM4MrZKfW-ftqKGSbO-DwDiOGqNmq53">the power grid</a> are not only
information-packed but witty …</p><p>Here's a small recap of what I've been watching on the ol' YouTube.</p>
<h3>Practical Engineering</h3>
<iframe width="640" height="360" src="https://www.youtube.com/embed/aspPJ2Wcaig"
frameborder="0" allowfullscreen></iframe>
<p><a href="https://www.youtube.com/c/PracticalEngineeringChannel">Grady Hillhouse</a> just has the most calming presence on screen, and he
explains complex engineering concepts with simple practical setups. His series’
on <a href="https://www.youtube.com/watch?v=UOHURuAf5iY&list=PLTZM4MrZKfW90PdaBFt70BLTbz1bTF6Mn">concrete</a>, <a href="https://www.youtube.com/watch?v=7tjf8HWiR3Y&list=PLTZM4MrZKfW_XJht-K7a9_egIsFqze0nQ">hydraulics</a>, and <a href="https://www.youtube.com/watch?v=v1BMWczn7JM&list=PLTZM4MrZKfW-ftqKGSbO-DwDiOGqNmq53">the power grid</a> are not only
information-packed but witty as well.</p>
<h4>See Also:</h4>
<p><a href="https://www.youtube.com/c/TechnologyConnections"><strong>Technology Connections</strong></a>: The old faithful when you want to learn way
too much about anything from <a href="https://www.youtube.com/watch?v=zeOw5MZWq24">Christmas lights</a> to <a href="https://www.youtube.com/watch?v=KfuARMCyTvg">VHS tapes</a>.</p>
<p><a href="https://www.youtube.com/c/CityBeautiful"><strong>City Beautiful</strong></a>: The channel that city-design-obsessed teenage me would’ve
love to have had growing up. He covers everything from <a href="https://www.youtube.com/watch?v=JGVBv7svKLo">Soviet city design</a>,
to <a href="https://www.youtube.com/watch?v=P8dmVUrNt38">Vancouverism</a>.</p>
<h3>Scott Manly</h3>
<iframe width="640" height="360" src="https://www.youtube.com/embed/aa4ATJGRqA0"
frameborder="0" allowfullscreen></iframe>
<p><a href="https://www.youtube.com/c/szyzyg">This man</a> has single-handedly reignited (like an Agena upper stage) my long-lost
passion for rocketry and space exploration. He covers everything from the history
of <a href="https://www.youtube.com/watch?v=KzGsWw47sMY">the Soyuz</a> to the <a href="https://www.youtube.com/watch?v=XxDZYuAZxSc">latest SpaceX breakthroughs</a>.</p>
<h4>See Also:</h4>
<p><a href="https://www.youtube.com/c/CphSuborbitals"><strong>Copenhagen Suborbitals</strong></a>: If DIY rockets are your thing, check out this private
European setup attempting to send a human into orbit!</p>
<h3>Johnny Harris</h3>
<iframe width="640" height="360" src="https://www.youtube.com/embed/OwqVtZn5df8"
frameborder="0" allowfullscreen></iframe>
<p><a href="https://www.youtube.com/watch?v=wILAAYhKQnY">Vox’s Borders might be cancelled</a>, but that won’t stop Johnny from talking about a
border dispute <a href="https://www.youtube.com/watch?v=ROIK9_zh5Ts">between the US and Canada</a>. Or <a href="https://www.youtube.com/watch?v=YeAxxMZf1O4">Switzerland’s explosive neutrality</a>.
Or just <a href="https://www.youtube.com/watch?v=XVvFRE6yNPk"><em>the</em> most amazing international breakfasts</a>.</p>
<h4>See Also:</h4>
<p><a href="https://www.youtube.com/c/IzHarris"><strong>His lovely wife Iz</strong></a>: She makes videos for Eater, and <a href="https://www.youtube.com/watch?v=TtJM83Fe8ro&list=PLUeEVLHfB5-TN5emEqMdsZbI5qqSj0nYS">her series on Taiwan</a>
was just breathtakingly good.</p>
<h3>Rick Beato</h3>
<iframe width="640" height="360" src="https://www.youtube.com/embed/XZYDDX1DHDU"
frameborder="0" allowfullscreen></iframe>
<p><a href="https://www.youtube.com/c/RickBeato">The OG music producer YouTuber</a>. Today, he has <a href="https://www.youtube.com/watch?v=jqAqvIYxEuA">an amazing interview up with Steve Jordan</a>.
His <a href="https://www.youtube.com/watch?v=ScRG40_7zb0&list=PLW0NGgv1qnfzb1klL6Vw9B0aiM7ryfXV_"><em>What Makes This Song Great</em> series</a> has got me in trouble in the past because I
paid more attention to it than the other people in my life.</p>
<h4>See Also:</h4>
<p><a href="https://www.youtube.com/c/AdamNeely"><strong>Adam Neely</strong></a>: His <a href="https://www.youtube.com/watch?v=OFWCbGzxofU">video on <em>The Girl From Impanema</em></a> is just an instant classic.</p>
<p><a href="https://www.youtube.com/c/12tonevideos"><strong>12Tone</strong></a>: One of my longest subs. I wake up every Saturday awaiting a breakdown of
<a href="https://www.youtube.com/watch?v=GPHpKS04NJI">what makes Uptown Funk so catchy</a>, or why the <a href="https://www.youtube.com/watch?v=L5eN83w0ssc">Yamaha E-Piano tone</a> stand out so much.</p>
<iframe width="640" height="360" src="https://www.youtube.com/embed/qhxtrC-b-FI"
frameborder="0" allowfullscreen></iframe>
<p><a href="https://www.youtube.com/c/KeenOnKeys"><strong>Keen on Keys</strong></a>: This is such a great channel that deserves a whole post of its own.
Check out the amazing <a href="https://www.youtube.com/watch?v=yUWMkJyEBQQ">PortaSound PS-3 video</a>, or the <a href="https://www.youtube.com/watch?v=LsYdsmaTFZs">one on the HS-200/HS-500</a>, or
the <a href="https://www.youtube.com/watch?v=4zpjGXH4umQ">Casio MT-40/MT-41 video</a>. Such an <a href="https://soundcloud.com/user-229361059">amazing musician</a>, and videos with
professional-level production quality.</p>
<hr>
<p>And so, those are my favourite subscriptions at the moment. I find myself watching YouTube
more now that I work from home and I upgraded my data plan. This has (predictably) led to
less time for longer-form video content, which honestly I am okay with.</p>Clearing The Slate2020-10-09T08:40:00+05:302020-10-09T08:40:00+05:30Janithtag:janithl.github.io,2020-10-09:/2020/10/clearing-the-slate/<p>I like blank slates, and I like closure.</p>
<p>My JIRA board at work has a bunch of stubborn tickets that won't go
away. This seems to mirror life in general, in that the peace that I
seek, of finally finishing what I've been working on, seems to be
drifting further …</p><p>I like blank slates, and I like closure.</p>
<p>My JIRA board at work has a bunch of stubborn tickets that won't go
away. This seems to mirror life in general, in that the peace that I
seek, of finally finishing what I've been working on, seems to be
drifting further away the more I run towards it.</p>
<p>It's been a crazy year, and this is the fourth draft of a post that I've
been writing since the middle of August. Just like the music and paintings
I've been working on, I kept hitting a wall where what I wanted to say, and
what I was capable of saying diverged. I'm just tired at this point. I've
tried to be proactive in a year in which that sort of thing just wasn't
meant to be. Talk about a bad <em>nekatha</em>.</p>
<p>It's time to take a deep breath, lie down, and take a well-deserved rest.</p>Falling in Love2020-07-25T08:40:00+05:302020-07-25T08:40:00+05:30Janithtag:janithl.github.io,2020-07-25:/2020/07/falling-in-love/<p>you fall in love</p>
<p>over a phone call</p>
<p>in the backseat of the cinema</p>
<p>reading whatsapps at 1 am</p>
<p>at a candle lit dinner</p>
<p>or when you're the first to hear about their day</p>
<p> </p>
<p>you fall in love</p>
<p>every time you work out</p>
<p>or take a good shower</p>
<p>sit down …</p><p>you fall in love</p>
<p>over a phone call</p>
<p>in the backseat of the cinema</p>
<p>reading whatsapps at 1 am</p>
<p>at a candle lit dinner</p>
<p>or when you're the first to hear about their day</p>
<p> </p>
<p>you fall in love</p>
<p>every time you work out</p>
<p>or take a good shower</p>
<p>sit down to write a new song</p>
<p>or learn something new</p>
<p>and not because someone asked you to</p>
<p> </p>
<p>is one really any better than the other?</p>
<p>can the first even exist in a void?</p>Tagged Template Literals are Awesome!2020-07-05T07:20:00+05:302020-07-05T07:20:00+05:30Janithtag:janithl.github.io,2020-07-05:/2020/07/js-template-literals/<p>You will often need to implement text that looks like this:</p>
<p><img alt="Highlighted Text" src="https://janithl.github.io/images/highlighted-text.png"></p>
<p>Now, it's fairly simple enough to do in HTML, but when you do it in React Native
it looks a bit gnarly:</p>
<div class="highlight"><pre><span></span><code><Text style={styles.text}>
You’re going to <Text style={styles.highlighted}>send a message</Text> to …</code></pre></div><p>You will often need to implement text that looks like this:</p>
<p><img alt="Highlighted Text" src="https://janithl.github.io/images/highlighted-text.png"></p>
<p>Now, it's fairly simple enough to do in HTML, but when you do it in React Native
it looks a bit gnarly:</p>
<div class="highlight"><pre><span></span><code><Text style={styles.text}>
You’re going to <Text style={styles.highlighted}>send a message</Text> to{" "}
<Text style={styles.highlighted}>Pingpong</Text>. Please confirm?
</Text>
</code></pre></div>
<p>Now, I prefer to keep strings like this in a separate file in React Native, to make
the frequent requests for text changes contained to a single file. But a complex
template string like this was impossible to store that way, until...</p>
<h3>Enter Tagged Template Literals</h3>
<p><a href="https://www.taniarascia.com/understanding-template-literals/">This post by Tania Rascia</a> opened my eyes to the power of <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals">Tagged Template Literals</a>
in JS. Seeing this example blew my mind:</p>
<div class="highlight"><pre><span></span><code><span class="kd">function</span> <span class="nx">bold</span><span class="p">(</span><span class="nx">strings</span><span class="p">,</span> <span class="p">...</span><span class="nx">expressions</span><span class="p">)</span> <span class="p">{</span>
<span class="kd">let</span> <span class="nx">finalString</span> <span class="o">=</span> <span class="s2">""</span><span class="p">;</span>
<span class="c1">// Loop through all expressions</span>
<span class="nx">expressions</span><span class="p">.</span><span class="nx">forEach</span><span class="p">((</span><span class="nx">value</span><span class="p">,</span> <span class="nx">i</span><span class="p">)</span> <span class="p">=></span> <span class="p">{</span>
<span class="nx">finalString</span> <span class="o">+=</span> <span class="sb">`</span><span class="si">${</span><span class="nx">strings</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span><span class="si">}</span><span class="sb"><strong></span><span class="si">${</span><span class="nx">value</span><span class="si">}</span><span class="sb"></strong>`</span><span class="p">;</span>
<span class="p">});</span>
<span class="c1">// Add the last string literal</span>
<span class="nx">finalString</span> <span class="o">+=</span> <span class="nx">strings</span><span class="p">[</span><span class="nx">strings</span><span class="p">.</span><span class="nx">length</span> <span class="o">-</span> <span class="mi">1</span><span class="p">];</span>
<span class="k">return</span> <span class="nx">finalString</span><span class="p">;</span>
<span class="p">}</span>
<span class="kr">const</span> <span class="nx">string</span> <span class="o">=</span> <span class="nx">bold</span><span class="sb">`This is a string with </span><span class="si">${</span><span class="kc">true</span><span class="si">}</span><span class="sb"> and </span><span class="si">${</span><span class="kc">false</span><span class="si">}</span><span class="sb"> and </span><span class="si">${</span><span class="mi">100</span><span class="si">}</span><span class="sb"> interpolated inside.`</span><span class="p">;</span>
<span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">string</span><span class="p">);</span>
</code></pre></div>
<p>Okay, with a quick few tweaks we can definitely apply this to React Native, right?</p>
<h3>Highlighting Text in React Native</h3>
<div class="highlight"><pre><span></span><code>const highlightText = (baseStyle, highlightStyle) => (strings, ...values) => (
<Text style={baseStyle}>
{strings.map((string, index) => (
<>
{string}
<Text style={highlightStyle}>
{values[index]}
</Text>
</>
))}
</Text>
);
</code></pre></div>
<p>Note I am using a higher order function so that I can pass in custom styles. We can also
pass in other stuff like entire components, if that is the requirement.</p>
<p>Now, we could store the Tagged Template Literal and use it wherever in our JSX.</p>
<div class="highlight"><pre><span></span><code>const action = "send a message";
const user = "Pingpong";
const description = highlightText(
styles.text,
styles.highlight
)`You’re going to ${action} to ${user}. Please confirm?`;
// in the render method
<Text>{description}</Text>;
</code></pre></div>
<p>Aaand, we're done! 🎉</p>
<hr>
<p><strong>Edit:</strong> Many of you will rightly wonder if <code>action</code>, <code>user</code>, and <code>styles</code> will need
to be defined in the same file as the Template Literal. No, we can simply make it a
function and pass these values direct from the component, like so:</p>
<div class="highlight"><pre><span></span><code>const description = (user, action, styles) => highlightText(
styles.text,
styles.highlight
)`You’re going to ${action} to ${user}. Please confirm?`;
// in the render method
<Text>{description('Pingpong', 'Send a message', styles)}</Text>;
</code></pre></div>
<p>Pretty cool, right?</p>Building Flagitect2020-06-28T09:55:00+05:302020-06-28T09:55:00+05:30Janithtag:janithl.github.io,2020-06-28:/2020/06/building-flagitect/<p><a href="https://play.google.com/store/apps/details?id=com.flagitect">Flagitect just hit version 1.2.0</a>, and so this is a brief introduction
into the technical aspects of how the app is structured.</p>
<p><img alt="Flagitect v1.2.0" src="https://janithl.github.io/images/flagitect-1.2.0.jpg"></p>
<h3>Stack</h3>
<p>The app is written in React Native (currently version 0.62). There is no navigation
library in use, as the app only needs some modals …</p><p><a href="https://play.google.com/store/apps/details?id=com.flagitect">Flagitect just hit version 1.2.0</a>, and so this is a brief introduction
into the technical aspects of how the app is structured.</p>
<p><img alt="Flagitect v1.2.0" src="https://janithl.github.io/images/flagitect-1.2.0.jpg"></p>
<h3>Stack</h3>
<p>The app is written in React Native (currently version 0.62). There is no navigation
library in use, as the app only needs some modals in the UI at the moment. The editor
uses <a href="https://github.com/react-native-community/react-native-svg">react-native-svg</a> to render the flags. <a href="https://github.com/joltup/rn-fetch-blob">rn-fetch-blob</a> is used to save
the various output files (as a PNG raster or SVG vector inside an HTML) to device storage.</p>
<h3>State Management</h3>
<p>State is managed using a <a href="https://reactjs.org/docs/hooks-reference.html#usereducer">single <code>useReducer</code> hook</a> near the root of the component
tree. The store is currently divided into 3 parts with their own reducer functions:
flag, ui, and charges. I found this approach had most of the advantages of Redux (since
the component tree was shallow and I didn't need to use the Context API) when it came to
composing the state and reducers. I use two <code>useEffect</code> hooks to store the state in
device storage<sup id="fnref:1"><a class="footnote-ref" href="#fn:1">1</a></sup> whenever it changes, and load it from storage at app start.</p>
<h3>Components</h3>
<p>There is your standard <code>Header</code>, <code>Footer</code>, <code>Menu</code> etc. components, and a bunch
of <code>renderSomething</code> components that render either charges or divisions. Most of the
action happens inside the <code>Editor</code> component, and we're using SVG—a fantastic language
that really should get more love—for the design and layout of shapes and designs. I
used a bunch of SVG features such as <a href="https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Patterns">patterns</a> and <a href="https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform">transform</a> to enable various
rendering needs.</p>
<h3>Finally</h3>
<p><a href="https://github.com/janithl/Flagitect">Flagitect is completely free and open source (MIT licensed)</a>, and I'd love for
people using it to submit issues and PRs, or even fork it and make things better. I
found that Google Play was lacking when it came to flag design apps, and so I created
Flagitect in the hope that amateur vexillologists like myself would find it useful. ☺️</p>
<div class="footnote">
<hr>
<ol>
<li id="fn:1">
<p>For this, I'm using <a href="https://github.com/react-native-community/async-storage">React Native Async Storage</a> as this functionality has been spun off from the React Native core. <a class="footnote-backref" href="#fnref:1" title="Jump back to footnote 1 in the text">↩</a></p>
</li>
</ol>
</div>Late Night: A Timeline2020-05-29T21:50:00+05:302020-05-29T21:50:00+05:30Janithtag:janithl.github.io,2020-05-29:/2020/05/late-night-a-timeline/<p>I created this little timeline graphic as a crutch for my non-American self trying
to navigate the complex history, culture, and inter-network rivalries of American
Late Night TV shows.</p>
<p><img alt="Late Night Timeline" src="https://janithl.github.io/images/late-night-timeline.png"></p>
<p>There are some shows that should be mentioned but aren’t, because they weren’t on
the big three:</p>
<ol>
<li><a href="https://en.wikipedia.org/wiki/The_Late_Show_(1986_talk_show)">The Late …</a></li></ol><p>I created this little timeline graphic as a crutch for my non-American self trying
to navigate the complex history, culture, and inter-network rivalries of American
Late Night TV shows.</p>
<p><img alt="Late Night Timeline" src="https://janithl.github.io/images/late-night-timeline.png"></p>
<p>There are some shows that should be mentioned but aren’t, because they weren’t on
the big three:</p>
<ol>
<li><a href="https://en.wikipedia.org/wiki/The_Late_Show_(1986_talk_show)">The Late Show</a>/<a href="https://en.wikipedia.org/wiki/The_Joan_Rivers_Show">The Joan Rivers Show</a></li>
<li><a href="https://en.wikipedia.org/wiki/The_Arsenio_Hall_Show">The Arsenio Hall Show</a></li>
<li><a href="https://en.wikipedia.org/wiki/The_Jon_Stewart_Show">The Jon Stewart Show</a> on MTV</li>
<li>The various syndicated versions of <a href="https://en.wikipedia.org/wiki/The_Dick_Cavett_Show">The Dick Cavett Show</a></li>
<li><a href="https://en.wikipedia.org/wiki/The_Daily_Show">The Daily Show</a> and <a href="https://en.wikipedia.org/wiki/The_Colbert_Report">The Colbert Report</a> on Comedy Central (Stewart says
Letterman called them the “cable twins”)</li>
<li><a href="https://en.wikipedia.org/wiki/Conan_(talk_show)">Conan</a> on TBS (my current favourite)</li>
</ol>Cheng Xin2020-05-15T20:40:00+05:302020-05-15T20:40:00+05:30Janithtag:janithl.github.io,2020-05-15:/2020/05/cheng-xin/<p><img alt="Cheng Xin" src="https://janithl.github.io/images/cheng-xin.jpg"></p>
<p class="text-center">Cheng Xin in space</p>
<p>I recently finished <a href="https://en.wikipedia.org/wiki/Death%27s_End">the last book</a> in Liu Cixin's masterpiece trilogy, and
created this little piece in Krita.</p>
<p>Cheng Xin's name translates to <em>sincerity</em>. This single character gets so much
flak from fans of the trilogy, and gets hated far more than even genuine
villains. But …</p><p><img alt="Cheng Xin" src="https://janithl.github.io/images/cheng-xin.jpg"></p>
<p class="text-center">Cheng Xin in space</p>
<p>I recently finished <a href="https://en.wikipedia.org/wiki/Death%27s_End">the last book</a> in Liu Cixin's masterpiece trilogy, and
created this little piece in Krita.</p>
<p>Cheng Xin's name translates to <em>sincerity</em>. This single character gets so much
flak from fans of the trilogy, and gets hated far more than even genuine
villains. But everything she did, she did out of a sense of duty, out of genuine
love. She never used her vast riches or power for personal gain, but to save others.</p>
<p><strong>P.S.</strong> There <em>wouldn't be a staircase project</em> without her genius. Or intelligence
encoded inside fairy tales if she didn't risk her life to fetch it without a moment's
hesitation. Or even food for Yun Tianming. 🤷🏽♀️</p>To Exist2020-03-03T20:45:00+05:302020-03-03T20:45:00+05:30Janithtag:janithl.github.io,2020-03-03:/2020/03/to-exist/<p>Am I doomed</p>
<p>To an existence</p>
<p>Where you</p>
<p>You, you, <em>and you</em></p>
<p>(Yes, I know you're all the same—</p>
<p>though it took me a while to catch on)</p>
<p>Will be near enough to see</p>
<p>But never to hold?</p>
<p>Always tantalisingly close</p>
<p>But no cigar?</p>
<p>To check up on</p>
<p>After a …</p><p>Am I doomed</p>
<p>To an existence</p>
<p>Where you</p>
<p>You, you, <em>and you</em></p>
<p>(Yes, I know you're all the same—</p>
<p>though it took me a while to catch on)</p>
<p>Will be near enough to see</p>
<p>But never to hold?</p>
<p>Always tantalisingly close</p>
<p>But no cigar?</p>
<p>To check up on</p>
<p>After a hard day</p>
<p>To celebrate your wins</p>
<p>(Not that you'll ever know)</p>
<p>Applaud, be proud of,</p>
<p>Have imaginary conversations with</p>
<p>Late into the night</p>
<p>Am I doomed</p>
<p>To <em>exist</em>?</p>Chats with the Dead2020-02-23T01:00:00+05:302020-02-23T01:00:00+05:30Janithtag:janithl.github.io,2020-02-23:/2020/02/chats-with-the-dead/<p><img alt="Jaki, Maali, and DD" src="https://janithl.github.io/images/chats-with-the-dead.jpg"></p>
<p class="text-center">Jaki, Maali, and DD on one of their vacations Down South circa late 1980s.</p>
<p>I finished Shehan Karunatilaka's <a href="https://www.goodreads.com/book/show/51122892-chats-with-the-dead">Chats with the Dead</a> last week, and it was
incredible. As <a href="https://twitter.com/ThimalG">Thimal</a> puts it about Jaki, "how can a character say so little
but still be so amazing?".</p>
<p>This Krita piece took …</p><p><img alt="Jaki, Maali, and DD" src="https://janithl.github.io/images/chats-with-the-dead.jpg"></p>
<p class="text-center">Jaki, Maali, and DD on one of their vacations Down South circa late 1980s.</p>
<p>I finished Shehan Karunatilaka's <a href="https://www.goodreads.com/book/show/51122892-chats-with-the-dead">Chats with the Dead</a> last week, and it was
incredible. As <a href="https://twitter.com/ThimalG">Thimal</a> puts it about Jaki, "how can a character say so little
but still be so amazing?".</p>
<p>This Krita piece took all day to finish, and could still do with more polish... but
I'm sleepy.</p>
<p>I'm also appending my review on Goodreads here:</p>
<blockquote>
<p>I have been fascinated with Sri Lanka in the 80s. It was, in my reading, a bookend
in history, ending the bell-bottomed idealism 60s and 70s, and dawning Sri Lanka into
the horrors of war and insurrection... a history that would grow even more violent
well into the 90s and 00s. What little scraps I could find of its written history
I would mop up, because these things were never taught at school and never discussed
by the elders (who'd much rather forget).</p>
<p>While Maali (and his privileged set of friends) is the canvas through which we explore
this reality, it is really a story of all that we lost; the young family that mourns
their murdered university lecturer/human rights advocate mother, the families that
left everything behind and ran-and still didn't make it, the thousands of kids who
disappeared overnight because their political leanings were suspect.</p>
<p>Chats with the Dead is a start of a conversation that Sri Lanka has to have regarding
its past. It has been 30+ years since the brutal end of the Second JVP Insurrection,
and books like these and films like <a href="https://en.wikipedia.org/wiki/Paangshu">Visakesa Chandrasekaram's Paangshu</a> serve as
an important bridge that passes on these lessons (and the fact that justice was never
done) to a younger generation.</p>
<p>P.S. I have been a fan of Shehan's since Chinaman, and I think this is a worthy
successor. Other than touching on conflict and race relations though, I think the
books have little in common, and that's a good thing. Chats with the Dead should be
judged on its own merits as a standalone book.</p>
</blockquote>The Rooftop2020-02-21T01:55:00+05:302020-02-21T01:55:00+05:30Janithtag:janithl.github.io,2020-02-21:/2020/02/the-rooftop/<p>It was pretty good weather for an otherwise sweltering January, as they lay
perched on the rooftop balcony overlooking the suburbs.</p>
<p>"You smoke?", she asked pointing the pack at him. Toying momentarily with the
idea of changing his entire personality to fit in (as he often does), he
finally resigned …</p><p>It was pretty good weather for an otherwise sweltering January, as they lay
perched on the rooftop balcony overlooking the suburbs.</p>
<p>"You smoke?", she asked pointing the pack at him. Toying momentarily with the
idea of changing his entire personality to fit in (as he often does), he
finally resigned to a quiet "no, thanks". He hoped it didn't come out as some
sort of value judgement, but she had moved on to flicking the Bic lighter and
trying to keep the flame alive, paying no attention to the drama in his head.
She took two drags as the embers matched the colour of the setting sun.</p>
<p>"Don't you feel like we've fallen short?", she asked as the street below
slowly filled up with the occupants of their office building leaving for
their homes.</p>
<p>"I guess we have. I guess this isn't what our parents had in mind."</p>
<p>She took a look at her toes as she took another drag, and silence descended
on them. He didn't really mind silences, but he also didn't have a rapport
with her yet.</p>
<p>"No plans to hop on a boat?"</p>
<p>"Not at least until I'm done with college, no. And even then, I quite like it
here."</p>
<p>"Ah yes, the comfortable prison of the familiar and the known", he thought—and
wisely kept to himself.</p>
<p>"And you? Big shot computer man? Can't you earn way more over there?"</p>
<p>He could, he said. Maybe next year. It's the lie he told all his relatives,
being as much a prisoner as she was.</p>
<p>For a chance meeting that happened because of a dare, this evening was going
pretty well, he thought.</p>
<p class="text-center text-muted">* * *</p>
<p>"Machang you always give talk but you <em>never. follow. through.</em> Always close.
Always no cigar."</p>
<p>"Don't harass him, he's clearly still not over you know who."</p>
<p>"What nonsense men, I'm perfectly over her"</p>
<p>"Prove it"</p>
<p>"Come on, I'm not 15 any more no?"</p>
<p>"If you ask her out I will quit ciggies for a month."</p>
<p>"What?"</p>
<p>"Pinky promise. See? I'm not hung up about how adult I am."</p>
<p class="text-center text-muted">* * *</p>
<p>It was honestly the weirdest couple of minutes of his life. A diehard introvert
who was just short of wearing "INFP" in bold lettering on his t-shirt every day
(and that too for fear of attracting too much attention—much preferring
monochromatic clothes), he barged into her office and asked if it was the meeting
room, knowing fully well from his 2 years working in this building that it wasn't.
She said that it wasn't, and in her usual cheery and helpful manner assisted him
to find his 'intended' destination on the other side of the floor. He thanked her
and they exchanged names. Three days later, and a couple of 'totally unexpected'
moments bumping into each other on elevators and stairwells, they were on this
rooftop sharing tobacco smoke.</p>
<p>"They should have Google Calendars for the meeting rooms."</p>
<p>"Oh yeah, that would sort a lot of the messes out", he replied, and he knew what
the next line was going to be.</p>
<p>"You guys would block out most of it anyway".</p>
<p>He looked apologetic, and then they both laughed.</p>
<p>"They should also maybe add floor maps so people don't get lost...". Her lips were
curling into a mischievous smile, and her deep brown eyes glistened.</p>
<p>"Ye... yeah they should."</p>
<p>"I mean, three days ago I saw a man I've seen use the second floor meeting room at
least half a dozen times suddenly lose his bearings and walk into an office on the
other side of the building." She was pointedly avoiding your gaze.</p>
<p>"I..."</p>
<p>She took another drag, and smoke escaped her smiling teeth as she looked over the
coconut tree tops turning orange red with the sun.</p>
<p>"You really sure you don't want a smoke?"</p>
<hr>
<p>I just finished reading <a href="https://penguin.co.in/book/uncategorized/chats-with-the-dead/">'Chats with the Dead'</a> and it was incredible and I
need a Jaki in my life. 😭</p>Links: January Tunes2020-02-07T21:50:00+05:302020-02-07T21:50:00+05:30Janithtag:janithl.github.io,2020-02-07:/2020/02/links-january-tunes/<p>2020 has been an interesting year musically, so here are some of my
favourite music this year.</p>
<h3>Theo Katzman</h3>
<iframe width="640" height="360" src="https://www.youtube.com/embed/4xsfOuLM2J8"
frameborder="0" allowfullscreen></iframe>
<p>Vulf wunderkind Theo's album, "Modern Johnny Sings: Songs in the Age
of Vibe", has been the talk of the town.</p>
<h3>Cory Wong</h3>
<p>Speaking of Vulf alum, Cory's album "Elevator Music for …</p><p>2020 has been an interesting year musically, so here are some of my
favourite music this year.</p>
<h3>Theo Katzman</h3>
<iframe width="640" height="360" src="https://www.youtube.com/embed/4xsfOuLM2J8"
frameborder="0" allowfullscreen></iframe>
<p>Vulf wunderkind Theo's album, "Modern Johnny Sings: Songs in the Age
of Vibe", has been the talk of the town.</p>
<h3>Cory Wong</h3>
<p>Speaking of Vulf alum, Cory's album "Elevator Music for an Elevated Mood"
is also the talk of the town, with bangers such as <a href="https://www.youtube.com/watch?v=jJXy21fphYo">"Team Sports"</a>.
There's also this crazy collab with Dave Koz<sup id="fnref:1"><a class="footnote-ref" href="#fn:1">1</a></sup>:</p>
<iframe width="640" height="360" src="https://www.youtube.com/embed/_mCJBzcyHEk"
frameborder="0" allowfullscreen></iframe>
<p>Cory comments on the video:</p>
<blockquote>
<p>"Dave, can u sit in a directors chair for this one?"</p>
<p>"What?"</p>
<p>"Yea they've got a directors chair...can u sit in it"</p>
<p>"Wait, what song?"</p>
<p>"Read this chart, you'll know exactly what to do...i'll take the solo"</p>
<p>"Why aren't you wearing shoes"</p>
<p>"Alright we got the 2200 grit sandpaper out, Koz is in the building..."</p>
<p>TAKE 1 RELEASED ON ALBUM</p>
</blockquote>
<p>It blows my mind how good these session regulars/legends are.</p>
<h3>Ryan Lerman/Scary Pockets/Stories/Pomplamoose</h3>
<p>Ryan has been putting out a ton of music both from the Scary Pockets
channel as well as the new Stories series. There's this amazing Bieber
cover featuring Antwaun Stanley:</p>
<iframe width="640" height="360" src="https://www.youtube.com/embed/dATGquiB05g"
frameborder="0" allowfullscreen></iframe>
<p>A cool as fuck 'Kill Bill' inspired collaboration with Larry Goldings
(featuring Sam Wilkes on the Fender Whistle):</p>
<iframe width="640" height="360" src="https://www.youtube.com/embed/4yg_XjYju_s"
frameborder="0" allowfullscreen></iframe>
<p>Plenty of cool featured artists on Stories including
<a href="https://www.youtube.com/watch?v=Idrdp_3LctM">Arlissa covering John Mayer</a>, and <a href="https://www.youtube.com/watch?v=D5Hbcf_2Rac">Nataly Dawn covering MGMT</a>. Nataly
has also been recording an album of French language covers, including the
following iconic tune:</p>
<iframe width="640" height="360" src="https://www.youtube.com/embed/7B4CLQGxHmI"
frameborder="0" allowfullscreen></iframe>
<h3>Reina Del Cid/Josh Turner</h3>
<p>Reina did an amazing collab with British singer-songwriter Mary Spender:</p>
<iframe width="640" height="360" src="https://www.youtube.com/embed/sj2gSmZqjSU"
frameborder="0" allowfullscreen></iframe>
<p>Josh collaborated with his SO Kelly Oden, for the cutest video of the new year:</p>
<iframe width="640" height="360" src="https://www.youtube.com/embed/UC0wv3p05Wc"
frameborder="0" allowfullscreen></iframe>
<p>Just aww! :')</p>
<h3>And, finally</h3>
<p>This doesn't count as a 'tune', but it would be criminal to leave this off
the list—Paul Davids and Samurai "Sammy G" Guitarist collab to blow our minds:</p>
<iframe width="640" height="360" src="https://www.youtube.com/embed/Uvjf0uUGsVg"
frameborder="0" allowfullscreen></iframe>
<div class="footnote">
<hr>
<ol>
<li id="fn:1">
<p>A lot of Sri Lankans would know him from "Dave Koz Radio Show" fame. <a class="footnote-backref" href="#fnref:1" title="Jump back to footnote 1 in the text">↩</a></p>
</li>
</ol>
</div>My 2020 guide to rewriting a piece-of-shit codebase2020-01-31T15:32:00+05:302020-01-31T15:32:00+05:30Janithtag:janithl.github.io,2020-01-31:/2020/01/refactor-blues/<p><img alt="Soptair Enjiniya" src="https://janithl.github.io/images/engineering-meme.jpg"></p>
<p class="text-center">Meme by
<a href="https://www.facebook.com/JusticeForTharindu/photos/a.594439464358595/806533719815834/?type=3&theater">Justice For Tharindu</a>
</p>
<p><strong>First, you need to make up your mind.</strong> If you take this project on you <em>must</em>
proactively try to make things better. How to do this will depend on a number of
factors and the support of the stakeholders, but you must <em>actively try</em> to …</p><p><img alt="Soptair Enjiniya" src="https://janithl.github.io/images/engineering-meme.jpg"></p>
<p class="text-center">Meme by
<a href="https://www.facebook.com/JusticeForTharindu/photos/a.594439464358595/806533719815834/?type=3&theater">Justice For Tharindu</a>
</p>
<p><strong>First, you need to make up your mind.</strong> If you take this project on you <em>must</em>
proactively try to make things better. How to do this will depend on a number of
factors and the support of the stakeholders, but you must <em>actively try</em> to make
the codebase a <em>better place</em>, or you'd come to the end of your 2 or whatever
years looking after this garbage dump and not have anything good to show for it.</p>
<p><strong>Understand the system.</strong> Learning the codebase might take time, but try to
figure out what the overarching concepts, the business logic, and what users
actually want to achieve. What users <em>want</em> to do with the system and what the
system <em>currently does</em> might be misaligned, so porting the thing with warts
and all into a shiny new shell might not make sense. Use that misalignment, make
it a chance to drive a wedge between the client and his software, and...</p>
<p><strong>Try to get the stakeholders onboard.</strong> Try to make a point about how the
shittiness of the current system is costing them customers and money. Businesses
usually care about reputation and the bottom line, so you have to make your case
in lingo they understand. Show them the numbers, show them how it could all be
better.</p>
<p><strong>Break down the system into parts.</strong> Moving everything wholesale into the new
system is not going to be practical in most cases. See where you can start
porting right now, and get to work. Things that could be services<sup id="fnref:1"><a class="footnote-ref" href="#fn:1">1</a></sup> on their
own, like reporting, exports, and external integrations, are good places to
start.</p>
<p><strong>Write tests.</strong> If I could go back in time and teach my older self anything,
it's the value of writing tests first before getting down to implementations.
This one thing will make your code more reliable and add value. In the case of
a rewrite, this is even more straightforward: the user journeys are already
concrete and you can easily write test cases for them to guide the new
implementation.</p>
<p><strong>Get your team excited.</strong> This has gone on long enough and I know you guys are
fatigued, but we can work together and make life less shit for ourselves and
our users. Try to understand their concerns and misgivings, but also don't
compromise in your quest to <em>make the world a better place</em>. They'll thank you
later.</p>
<p class="text-center text-muted">* * *</p>
<p>I always learn these lessons too late, when the chance for me to <em>act</em> on
them has already passed. But hey, maybe it'll come in handy someday.</p>
<div class="footnote">
<hr>
<ol>
<li id="fn:1">
<p>I don't really mean <em>microservices</em> here, though you could go for it if that makes sense for you. <a class="footnote-backref" href="#fnref:1" title="Jump back to footnote 1 in the text">↩</a></p>
</li>
</ol>
</div>Some 2019 Stats2020-01-01T22:15:00+05:302020-01-01T22:15:00+05:30Janithtag:janithl.github.io,2020-01-01:/2020/01/some-2019-stats/<h3>The Blog</h3>
<p>I've written 18 blog posts in 2019, which is below the target I set at the start
of the year (two blog posts a month, for a total of 24), but it's progress.</p>
<p><img alt="Posts per month" src="https://janithl.github.io/images/posts-per-month.png"></p>
<p>In comparison, <a href="https://janithl.github.io/2018/06/some-things-i-wish-i-knew-as-a-young-startup-dev/">I wrote only 1 post in 2018</a>. 🙈</p>
<p><img alt="Posts per year, 2009 - 2019" src="https://janithl.github.io/images/blogposts-2009-2019.png"></p>
<h3>Transport</h3>
<p>I've taken 265 bus rides …</p><h3>The Blog</h3>
<p>I've written 18 blog posts in 2019, which is below the target I set at the start
of the year (two blog posts a month, for a total of 24), but it's progress.</p>
<p><img alt="Posts per month" src="https://janithl.github.io/images/posts-per-month.png"></p>
<p>In comparison, <a href="https://janithl.github.io/2018/06/some-things-i-wish-i-knew-as-a-young-startup-dev/">I wrote only 1 post in 2018</a>. 🙈</p>
<p><img alt="Posts per year, 2009 - 2019" src="https://janithl.github.io/images/blogposts-2009-2019.png"></p>
<h3>Transport</h3>
<p>I've taken 265 bus rides in 2019, down from 556 in 2018. There is a dramatic
reduction in bus rides after the Easter Attacks in April.</p>
<p><img alt="Bus journeys by month" src="https://janithl.github.io/images/bus-journeys-by-month.png"></p>
<p>After April, I switched to tuks as my primary mode of commuting to work in the
morning, only taking the bus in the evening during my commute home.</p>
<p><img alt="Bus journeys by time of day" src="https://janithl.github.io/images/bus-journeys-by-time-of-day.png"></p>
<table>
<thead>
<tr>
<th>Month</th>
<th align="right">Morning</th>
<th align="right">Afternoon</th>
<th align="right">Evening</th>
</tr>
</thead>
<tbody>
<tr>
<td>January</td>
<td align="right">27</td>
<td align="right">0</td>
<td align="right">20</td>
</tr>
<tr>
<td>February</td>
<td align="right">36</td>
<td align="right">0</td>
<td align="right">17</td>
</tr>
<tr>
<td>March</td>
<td align="right">28</td>
<td align="right">2</td>
<td align="right">15</td>
</tr>
<tr>
<td>April</td>
<td align="right">6</td>
<td align="right">1</td>
<td align="right">9</td>
</tr>
<tr>
<td>May</td>
<td align="right">0</td>
<td align="right">2</td>
<td align="right">0</td>
</tr>
<tr>
<td>June</td>
<td align="right">0</td>
<td align="right">0</td>
<td align="right">12</td>
</tr>
<tr>
<td>July</td>
<td align="right">2</td>
<td align="right">0</td>
<td align="right">16</td>
</tr>
<tr>
<td>August</td>
<td align="right">0</td>
<td align="right">0</td>
<td align="right">11</td>
</tr>
<tr>
<td>September</td>
<td align="right">9</td>
<td align="right">0</td>
<td align="right">13</td>
</tr>
<tr>
<td>October</td>
<td align="right">1</td>
<td align="right">2</td>
<td align="right">14</td>
</tr>
<tr>
<td>November</td>
<td align="right">3</td>
<td align="right">0</td>
<td align="right">7</td>
</tr>
<tr>
<td>December</td>
<td align="right">1</td>
<td align="right">1</td>
<td align="right">10</td>
</tr>
<tr>
<td><strong>Total</strong></td>
<td align="right"><strong>113</strong></td>
<td align="right"><strong>8</strong></td>
<td align="right"><strong>144</strong></td>
</tr>
</tbody>
</table>
<p>Tuks have picked up the slack, with 245 PickMe rides<sup id="fnref:1"><a class="footnote-ref" href="#fn:1">1</a></sup>, 29 rides on YOGO and
normal metered tuks, and 5 rides on shared Ubers<sup id="fnref:2"><a class="footnote-ref" href="#fn:2">2</a></sup> throughout the year.</p>
<p><img alt="Taxi journeys by time of day" src="https://janithl.github.io/images/taxi-journeys-by-time-of-day.png"></p>
<table>
<thead>
<tr>
<th>Month</th>
<th align="right">Morning</th>
<th align="right">Afternoon</th>
<th align="right">Evening</th>
</tr>
</thead>
<tbody>
<tr>
<td>January</td>
<td align="right">7</td>
<td align="right">3</td>
<td align="right">8</td>
</tr>
<tr>
<td>February</td>
<td align="right">4</td>
<td align="right">0</td>
<td align="right">3</td>
</tr>
<tr>
<td>March</td>
<td align="right">7</td>
<td align="right">4</td>
<td align="right">9</td>
</tr>
<tr>
<td>April</td>
<td align="right">8</td>
<td align="right">1</td>
<td align="right">1</td>
</tr>
<tr>
<td>May</td>
<td align="right">8</td>
<td align="right">3</td>
<td align="right">9</td>
</tr>
<tr>
<td>June</td>
<td align="right">18</td>
<td align="right">2</td>
<td align="right">9</td>
</tr>
<tr>
<td>July</td>
<td align="right">23</td>
<td align="right">5</td>
<td align="right">8</td>
</tr>
<tr>
<td>August</td>
<td align="right">21</td>
<td align="right">1</td>
<td align="right">5</td>
</tr>
<tr>
<td>September</td>
<td align="right">12</td>
<td align="right">1</td>
<td align="right">4</td>
</tr>
<tr>
<td>October</td>
<td align="right">20</td>
<td align="right">5</td>
<td align="right">6</td>
</tr>
<tr>
<td>November</td>
<td align="right">17</td>
<td align="right">3</td>
<td align="right">9</td>
</tr>
<tr>
<td>December</td>
<td align="right">18</td>
<td align="right">5</td>
<td align="right">12</td>
</tr>
<tr>
<td><strong>Total</strong></td>
<td align="right"><strong>163</strong></td>
<td align="right"><strong>33</strong></td>
<td align="right"><strong>83</strong></td>
</tr>
</tbody>
</table>
<p>While initially driven by post-Easter attack paranoia, environmental factors have
also been a concern especially with the increase in average temperatures. Although
still a firm believer in public transport, I no longer wanted to turn up at work a
sweaty mess. Let's hope A/C buses start rolling out on the 138 route soon<sup id="fnref:3"><a class="footnote-ref" href="#fn:3">3</a></sup>. 🙏🏽</p>
<p>These are the ride counts and average fares for 2019 in comparison to 2018:</p>
<table>
<thead>
<tr>
<th>Type</th>
<th align="right">Count (2018)</th>
<th align="right">Avg (2018)</th>
<th align="right">Count (2019)</th>
<th align="right">Avg (2019)</th>
<th align="right">Count Diff</th>
<th align="right">Avg Diff</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Bus</strong></td>
<td align="right">556</td>
<td align="right">19.84</td>
<td align="right">265</td>
<td align="right">21.91</td>
<td align="right">-291</td>
<td align="right">+2.07</td>
</tr>
<tr>
<td><strong>PickMe</strong></td>
<td align="right">153</td>
<td align="right">424.08</td>
<td align="right">245</td>
<td align="right">394.35</td>
<td align="right">+92</td>
<td align="right">-29.73</td>
</tr>
<tr>
<td><strong>Tuk</strong></td>
<td align="right">12</td>
<td align="right">142.08</td>
<td align="right">29</td>
<td align="right">356.21</td>
<td align="right">+17</td>
<td align="right">+214.12</td>
</tr>
<tr>
<td><strong>Uber</strong></td>
<td align="right">3</td>
<td align="right">233.33</td>
<td align="right">5</td>
<td align="right">500.00</td>
<td align="right">+2</td>
<td align="right">+266.67</td>
</tr>
<tr>
<td><strong>Total</strong></td>
<td align="right"><strong>724</strong></td>
<td align="right"></td>
<td align="right"><strong>544</strong></td>
<td align="right"></td>
<td align="right"><strong>-180</strong></td>
<td align="right"></td>
</tr>
</tbody>
</table>
<p>Huh, never realised I'd taken 180 less journeys in total this year. Must be all the
sleeping in on weekends. 🙈</p>
<h3>Other Expenses</h3>
<p>I've bought food 247 times in 2019, up from 200 times in 2018. The average order
value has gone up slightly, from 572 LKR to 600 LKR. I've bought clothing 4 times,
up from just 2 times in 2018.</p>
<p>I've made 16 purchases on AliExpress this year, up from 5 purchases last year. The
average order value has stayed roughly the same.</p>
<h3>Social Media</h3>
<p>I've been on a bit of a hiatus from Twitter and Instagram, with only 6
images posted on my IG this year (and none since June). But I did start
<a href="https://www.instagram.com/chithrapotha/">an Instagram purely for my illustrations</a> and I've managed to post about 29
posts in the space of a month.</p>
<p><img alt="Chithrapotha" src="https://janithl.github.io/images/chithrapotha.jpg"></p>
<p>Drawing more and putting it out there is a goal that I want to work towards
in 2020. I've also uploaded 18 song snippets to my SoundCloud, and plan to upload
longer and more developed pieces in 2020 (fingers crossed!)</p>
<p class="text-center text-muted">* * *</p>
<p>And so, those are some of my stats for the year. How has 2019 been for you
and how do you plan to spend your 2020?</p>
<script>
window.onload = function() {
$('table').addClass('table table-bordered table-condensed');
}
</script>
<div class="footnote">
<hr>
<ol>
<li id="fn:1">
<p>Up from 153 in 2018. <a class="footnote-backref" href="#fnref:1" title="Jump back to footnote 1 in the text">↩</a></p>
</li>
<li id="fn:2">
<p>I still don't have an Uber account, and don't plan on getting one. <a class="footnote-backref" href="#fnref:2" title="Jump back to footnote 2 in the text">↩</a></p>
</li>
<li id="fn:3">
<p>And eventually we can all take the Kelani Valley railway, which is <a href="https://twitter.com/nuuuwan/status/1203260223378604033">currently incredibly under-utilised</a>. <a class="footnote-backref" href="#fnref:3" title="Jump back to footnote 3 in the text">↩</a></p>
</li>
</ol>
</div>On Liberalism in the 2010s2019-12-31T08:35:00+05:302019-12-31T08:35:00+05:30Janithtag:janithl.github.io,2019-12-31:/2019/12/on-liberalism-in-the-2010s/<p><a href="https://www.reddit.com/r/PropagandaPosters/comments/e9lwve/labour_clears_the_way_uk_labour_party_poster_1910/"><img alt="Labour Poster" src="https://janithl.github.io/images/labour-poster.jpg"></a></p>
<p class="text-center">Yes, but can Liberals batter down doors anymore?</p>
<p>Last night, dealing with a bought of insomnia, <a href="https://www.theguardian.com/commentisfree/2019/dec/29/lesson-in-boris-johnson-jolliness-liberal-miserabilsm-is-a-turn-off">I read this important take on BoJo</a>
(not to be confused with BoJack) and the conservative wave sweeping across not just the
UK but most of the world. While there might be a few …</p><p><a href="https://www.reddit.com/r/PropagandaPosters/comments/e9lwve/labour_clears_the_way_uk_labour_party_poster_1910/"><img alt="Labour Poster" src="https://janithl.github.io/images/labour-poster.jpg"></a></p>
<p class="text-center">Yes, but can Liberals batter down doors anymore?</p>
<p>Last night, dealing with a bought of insomnia, <a href="https://www.theguardian.com/commentisfree/2019/dec/29/lesson-in-boris-johnson-jolliness-liberal-miserabilsm-is-a-turn-off">I read this important take on BoJo</a>
(not to be confused with BoJack) and the conservative wave sweeping across not just the
UK but most of the world. While there might be a few points of contention, I think
overall it was a good state of the union on liberalism and what I like to think is a
bit of a disease among educated liberals: the refusal and lack of confidence in pushing
our agenda.</p>
<p class="text-center text-muted">* * *</p>
<p>Born at the tail end of the Berlin Wall and the Soviet Union, my generation was very
liberal and expected the generations that followed us to be even more so. The online
communities where we came of age were incredibly inclusive, liberal, and <em>"woke"</em>. And
yet, woke culture itself overextended and exposed the flanks, leading to the almost
<em>unthinkable</em> scenario of an incredibly right-leaning younger generation, and the liberal
and free thinking communities of our youth turned to the right as a reaction to the
seeming <em>authoritarianism of the new left</em>.</p>
<p>The <em>yoofs</em> were also very much multiculturally aware, having grown up with access to
different <em>lived experiences</em> via the internet, and very much sensitive to what it saw as
liberal intolerances of differing opinions, as well as seeming mollycoddling of the more
bigoted minorities within minorities. To the kids growing up on Gangam Style, it was no
longer western values at stake but an overarching global value structure<sup id="fnref:1"><a class="footnote-ref" href="#fn:1">1</a></sup> which was
threatened not by the traditional scapegoat of crusty and rich old conservatives<sup id="fnref:2"><a class="footnote-ref" href="#fn:2">2</a></sup>, but
by increasingly intolerant, tone deaf, preachy ivory tower PC liberals. </p>
<p class="text-center text-muted">* * *</p>
<p>Long story short: Even though there is a lot of hope left in the world and its youth (in
the form of e.g. Greta Thunberg, CAA protestors in Indian universities, and the younger
remain voters at the Brexit polls), it is still disheartening to see some in such an educated
and informed generation turn towards reactionism over progressivism.</p>
<p>For the libs, it is time to regroup and look inward. We must reflect on the past decade, the
victories (MARRIAGE EQUALITY!) and the bitter defeats, and consider what we value the most,
what our core inviolable principles are. Lines might have to be drawn where our usual support
for personal preferences and freedoms infringe on the rights of the other and the collective<sup id="fnref:3"><a class="footnote-ref" href="#fn:3">3</a></sup>.
It is time to raise those voices in battle cries, as the rich keep becoming richer, and use
their money and influence to sow division among the working man to further their own ends. We
don't have much time—the greed of our race has set the planet on fire. The rich will burrow
underneath and survive, but what of us poor proles? </p>
<p class="text-center text-muted">* * *</p>
<p>It is time to step away from books and back into society. It's time to make welfare great again,
fight for unionisation and the rights of the worker and the downtrodden. Come to the understanding
that humanity isn't perfect, but that we must struggle to make this planet and our society better,
more equitable and more inclusive.</p>
<p>It's time to bring back civil discourse, please, and thank you. No one likes being talked down to,
or being called racist because they were simply well-meaning but ignorant. Bring back the humanity,
bring back the fight, bring back Travellers on the Discovery Channel. Shout from the rooftops
<em>how awesome science is</em>, and how excited we are about exploring outer space, reforesting our
planet, or curing disease. Stand against bigotry, while also acknowledging that bigotry is bigotry
regardless of the source. <a href="https://www.youtube.com/watch?v=V3U6rRK9ul0">As the great Imtiaz Bakeer Markar once said</a>:</p>
<blockquote>
<p>Think not in terms of <em>who</em> is right and who is wrong, but <em>what</em> is right and what is wrong.</p>
</blockquote>
<div class="footnote">
<hr>
<ol>
<li id="fn:1">
<p>I would argue this dates back to enlightenment thinking and classical liberalism. <a class="footnote-backref" href="#fnref:1" title="Jump back to footnote 1 in the text">↩</a></p>
</li>
<li id="fn:2">
<p>Still very much the actual villain—see Prince Andrew. <a class="footnote-backref" href="#fnref:2" title="Jump back to footnote 2 in the text">↩</a></p>
</li>
<li id="fn:3">
<p>I personally do not believe it is a zero sum game. Living in a republic is based on a
social contract, and some individualistic excesses might have to be forgone in the service of cohesion. <a class="footnote-backref" href="#fnref:3" title="Jump back to footnote 3 in the text">↩</a></p>
</li>
</ol>
</div>