<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Phillip Kigenyi on Medium]]></title>
        <description><![CDATA[Stories by Phillip Kigenyi on Medium]]></description>
        <link>https://medium.com/@phillipkig?source=rss-edcf645529ab------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*VPKvXqeeFn3sLt8cbMdcSQ.jpeg</url>
            <title>Stories by Phillip Kigenyi on Medium</title>
            <link>https://medium.com/@phillipkig?source=rss-edcf645529ab------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 08:05:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@phillipkig/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Reading challenge V in review]]></title>
            <link>https://medium.com/rabbit-hole-adventures/reading-challenge-v-in-review-9ebbe7daf1b5?source=rss-edcf645529ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ebbe7daf1b5</guid>
            <category><![CDATA[mental-models]]></category>
            <category><![CDATA[book-recommendations]]></category>
            <category><![CDATA[readinglist]]></category>
            <category><![CDATA[book-review]]></category>
            <category><![CDATA[reading]]></category>
            <dc:creator><![CDATA[Phillip Kigenyi]]></dc:creator>
            <pubDate>Sat, 27 Dec 2025 14:15:38 GMT</pubDate>
            <atom:updated>2025-12-27T16:57:15.744Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zNH92IN0C3i-DGXu" /><figcaption>Photo by <a href="https://unsplash.com/@anetakpawlik?utm_source=medium&amp;utm_medium=referral">Aneta Pawlik</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>The year often closes with broken resolutions. Luckily for me, 2025 was no such year. Sailing through the 12 books in the <a href="https://www.goodreads.com/readingchallenges/gr/annual/2025/QTFVMEI0SENNVEFHWFgMjAyNQ">reading challenge</a> was no easy feat, I only have God to thank for that.</p><blockquote>Education is what survives when what has been learned has been forgotten<br> — B.F. Skinner</blockquote><p>Guided by B. F. Skinner’s idea that education endures beyond forgotten facts, I have distilled every book into two mental models.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/301/1*bHGtqyLGKVTiI2ueEuzs0w.jpeg" /></figure><h4>Meditations by Marcus Aurelius</h4><ul><li>Virtue is a key tenet of how to live a good life</li><li>Zoom out, everything is fleeting and nothing is immune to entropy.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/308/1*tSLeQXIVIhtnHB7bXMzxAw.jpeg" /></figure><h4>Inner game of Tennis by Timothy Gallwey</h4><ul><li>The conscious mind interferes with learning by judging.</li><li>Attention determines how you learn or perceive.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/308/1*SxzHptmqcro7xuK3CXHyXw.jpeg" /></figure><h4>Hooked by Nir Eyal</h4><ul><li>Most technology is designed with psychology at its core.</li><li>Disrupt the habit by adding friction to the reward process and making access more difficult.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/306/1*DpZH57u8OZ5zf18YAhu_7A.jpeg" /></figure><h4>Why we sleep by Matthew Walker</h4><ul><li>Sleep has a much bigger impact on our lives than we think.</li><li>Sleep is a remedy to most problems.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/301/1*YyGO0bsmeyHZCGGptnRbrA.jpeg" /></figure><h4>The marshmallow test by Walter Mischel</h4><ul><li>Psychological distance in time, space and social aspects determines how well you cope with temptation.</li><li>Self control is the disruption of the automatic response to a trigger.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/305/1*DCks8Rmzllx8BG9fzoP0wQ.jpeg" /></figure><h4>Steve Jobs by Walter Isaacson</h4><ul><li><a href="https://paulgraham.com/cities.html">Environment</a> has a huge role on who one becomes or acts.</li><li>Reality distortion field driven by a set of beliefs; team composition, design, binary way of thinking, etc.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/297/1*Nwl67higbYXHbpFFPoxfjg.jpeg" /></figure><h4>Cosmos by Carl Sagan</h4><ul><li>To be human is to be curious.</li><li>Humans are in awe of the unknown.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*aPrsZdJ_YS6VGSBadgb4Dw.jpeg" /></figure><h4>The coming wave by Mustafa Suleyman</h4><ul><li>Technology progress is inevitable.</li><li>Proactive action is required to combat the negative consequences of technology.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/326/1*ZYdRDBdLlhJ0NncYiRn_wA.jpeg" /></figure><h4>The software engineer’s guidebook by <strong>Gergely Orosz</strong></h4><ul><li>Managing your career is a job in and of itself.</li><li>Be proactive about your career progress through documentation, relationships and visibility.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/322/1*v-5GxnRA9LqcDzLeeILWHA.jpeg" /></figure><h4>Clean architecture by Robert Martin</h4><ul><li><a href="https://en.wikipedia.org/wiki/Separation_of_concerns">Separation of concerns</a>. Separate the business logic from the domain logic.</li><li>Understanding the history of tools gives you insight into how they are best used.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/309/1*a6u3vAKEB4wAiuMfHssXCA.jpeg" /></figure><h4>My life in full by Indra Nooyi</h4><ul><li>Family has a huge impact on you.</li><li>Do more than is required of you.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/307/1*Kcp8KFTeaHXmhQvdq2L8yw.jpeg" /></figure><h4>The culture map by Erin Meyer</h4><ul><li>When in Rome do as the Romans do.</li><li>There is significant nuance in how different cultures approach feedback, trust, communication, etc.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ebbe7daf1b5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rabbit-hole-adventures/reading-challenge-v-in-review-9ebbe7daf1b5">Reading challenge V in review</a> was originally published in <a href="https://medium.com/rabbit-hole-adventures">Rabbit Hole Adventures</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Leetcode from zero: The foundation you need]]></title>
            <link>https://medium.com/dev-scribbles/leetcode-from-zero-the-foundation-you-need-e5573912a0f9?source=rss-edcf645529ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5573912a0f9</guid>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[data-structures-algorithm]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[leetcode]]></category>
            <dc:creator><![CDATA[Phillip Kigenyi]]></dc:creator>
            <pubDate>Tue, 16 Dec 2025 03:29:57 GMT</pubDate>
            <atom:updated>2025-12-22T20:45:34.451Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9oaTOkLO-Bt6dWj5" /><figcaption>Photo by <a href="https://unsplash.com/@jstrippa?utm_source=medium&amp;utm_medium=referral">James Harrison</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>Pre-preparation</h4><p>While you might feel compelled to jump straight into practising leetcode, I find that having a good grasp of the language, tools and testing frameworks pays huge dividends later on. This foundation allows you to focus on solving problems without reinventing the wheel — for example, using bisect to sort.</p><ul><li>Master the <a href="https://github.com/zhiwehu/Python-programming-exercises/blob/master/100%2B%20Python%20challenging%20programming%20exercises%20for%20Python%203.md">language</a> and its <a href="https://realpython.com/products/python-tricks-book/">nuances</a></li><li>Master all the <a href="https://www.geeksforgeeks.org/dsa/sorting-algorithms/">sorting</a> algorithms</li><li>Master the internal apis; <a href="https://docs.python.org/3/library/collections.html#module-collections">collections</a>(deque, Counter, defaultdict, OrderedDict), <a href="https://docs.python.org/3/library/heapq.html">heapq</a>, <a href="https://docs.python.org/3/library/bisect.html">bisect</a></li><li>Practice leetcode crash <a href="https://leetcode.com/explore/">courses</a> ie <a href="https://leetcode.com/explore/featured/card/the-leetcode-beginners-guide/">leetcode beginner’s guide</a>, <a href="https://leetcode.com/explore/featured/card/leetcodes-interview-crash-course-data-structures-and-algorithms/711/backtracking/">DSA</a> and follow starter guides like <a href="https://neetcode.io/roadmap">neetcode.io</a></li></ul><h4>Formulation</h4><p>Before writing your final solution, it is wise to sketch out what the code will look like and how it will behave.</p><ul><li>Figure out the <a href="https://neetcode.io/roadmap">pattern</a>; two pointer, sliding window.</li><li>Start with the most naive implementation possible for-example sorting numbers by hand as you normally would without any prior sorting algorithm knowledge.</li><li>Make a brute force implementation if you are completely stuck for-example bubble sort that has two for-loops, then optimize it.</li></ul><pre>def bubbleSort(arr):<br>    n = len(arr)<br>    for i in range(n):<br>        swapped = False<br>        for j in range(0, n-i-1):<br>            if arr[j] &gt; arr[j+1]:<br>                arr[j], arr[j+1] = arr[j+1], arr[j]<br>                swapped = True<br>        if (swapped == False):<br>            break</pre><ul><li>Translate the manual walk-through into pseudo-code by writing the state of each variable in a table. Take note of when the state of each variable changes. Write the conditional that triggers that particular change for-example in <a href="https://leetcode.com/problems/remove-duplicates-from-sorted-array">remove duplicates</a>(two pointer problem), pis updated whenever a number greater than p-1 is found. Take note of the initial and final variable states, transition of variables and data iterations</li></ul><pre>class Solution:<br>    def removeDuplicates(self, nums: List[int]) -&gt; int:<br>        p = 1<br><br>        for i in range(1, len(nums)):<br>            # p is updated when a greater number is found<br>            if nums[i] &gt; nums[p-1]:<br>                nums[p] = nums[i]<br>                p += 1<br>        return p</pre><h4>Formulation with hints</h4><ul><li>Check the pattern by clicking the <em>Topics </em>tab at the bottom left of the questions panel.</li><li>Read/watch the naive walk-through and try to come up with the algorithm. If that fails, then read the algorithm and translate it into code.</li></ul><h4>Coding</h4><ul><li>Time yourself as you translate the algorithm into code; easy &lt; 10, medium &lt; 15 and hard &lt; 18 minutes max.</li><li>Write the code and test it with the current examples. Note; what is the initial state of each variable 0 or 1; what is the final state len(x)-1or len(x)-2</li><li>Think of edge cases; null, large, small, empty list, check limits of conditionals len(x) or len(x)-1. Sometimes adding a return statement slightly improves the execution speed of the algorithm.</li><li>Test with current examples and submit. If it fails on a new test case, add it to your current test suite and revisit the implementation. Let the failing test guide you.</li><li>Consider the time and space complexity, and think about alternative data structures that might provide gains, even if only marginal.</li><li>Re-implement with internal apis for-example collections(deque, Counter, defaultdict, OrderedDict), heapq, bisect.</li></ul><h4>Submit and compare</h4><ul><li>Compare your solution to others in terms of time and space complexity. What is your ranking? Aim for the 90th percentile. Identify anything you may have missed — for example, a simple edge case.</li><li>Read the editorial for official implementations; walk through and understand each one of them. Re-implement using other techniques.</li><li><a href="https://docs.google.com/spreadsheets/d/1T6_jShpbh3Ez3m_RA1JmUM7i1d6cSyNmuRkGRF-i2Xg/edit?usp=sharing">Bookmark</a> and track the parameters of each attempt; duration, space and time complexity, technique, difficulty level. Be sure to redo with a different technique even if you got it right.</li><li>Take note of patterns you find along the way for-example: Greedy problems usually look like<em> “Find the minimum number of something to do something”</em></li></ul><h4>Resources</h4><p>Here are some of the noteworthy resources that I have found helpful: <a href="https://www.youtube.com/watch?v=GPIuPRqDGG8">Dave Burji</a>, <a href="https://youtube.com/playlist?list=PLI1t_8YX-ApvMthLj56t1Rf-Buio5Y8KL&amp;si=CWqpb8Nahxpf9851">Hackerrank algorithms youtube playlist</a>, <a href="https://www.youtube.com/@NeetCodeIO">Neetcode</a>, <a href="https://docs.google.com/spreadsheets/d/1-wKcV99KtO91dXdPkwmXGTdtyxAfk1mbPXQg81R9sFE/edit?gid=0#gid=0">Sheet templates</a>, <a href="https://leetcode.com/problem-list/oizxjoit/">Blind75</a>, <a href="https://realpython.com/products/python-tricks-book/">Python tricks</a>, <a href="https://www.youtube.com/watch?v=Z_c4byLrNBU">Freecodecamp</a>, <a href="https://www.youtube.com/watch?si=M9EyXw20WV221FFS&amp;v=RBSGKlAvoiM&amp;feature=youtu.be">General DSA</a>, <a href="https://www.coursera.org/specializations/boulder-data-structures-algorithms#courses">Coursera-Foundations of Data Structures and Algorithms Specialization</a>, <a href="https://www.youtube.com/channel/UCmJz2DV1a3yfgrR7GqRtUUA">Back To Back SWE</a></p><h4>Summary</h4><p>While learning leetcode can feel daunting, the key is to become proficient in one of three areas: problem formulation, algorithm design, or translating an algorithm into code. Ultimately mastering leetcode requires consistent practice</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5573912a0f9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dev-scribbles/leetcode-from-zero-the-foundation-you-need-e5573912a0f9">Leetcode from zero: The foundation you need</a> was originally published in <a href="https://medium.com/dev-scribbles">Dev Scribbles</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[iHuman]]></title>
            <link>https://medium.com/rabbit-hole-adventures/ihuman-09c05b437c30?source=rss-edcf645529ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/09c05b437c30</guid>
            <category><![CDATA[biography]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[history]]></category>
            <category><![CDATA[autobiography]]></category>
            <dc:creator><![CDATA[Phillip Kigenyi]]></dc:creator>
            <pubDate>Sat, 30 Aug 2025 17:01:41 GMT</pubDate>
            <atom:updated>2025-12-10T18:11:10.785Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c7_71_zRCCd3zUe3tnAUfw.jpeg" /></figure><h4>Hello, I am Macintosh</h4><p>‘You are special’, a phrase he heard very often from his parents whenever he was puzzled or found himself in trouble due to his eccentric behaviour. From getting bored in math class to playing pranks, Steve Jobs always found himself needing ever more mental stimulation. His childhood curiosity was ever nurtured by his technical dad, his amazing teachers and the mentors he met along the way like Nolan Bushnell, Friedland, Paul Jobs, Regis Mackenna. He was always afforded the confidence to question dogma, a theme which is highlighted throughout his life. On his spiritual quest he explored zen buddism and experimented with LSD.</p><h4><strong>Self</strong></h4><p>Seemingly haunted, he always sought to find himself. With a very open mind, he explored LSD, buddism and travelled to India, which had a strong impact on how he saw the world, greatly dazzled by the use of intuition instead of intellect in solving problems. A quirk that would drive his engineers crazy as he always used his gut, not his mind, to judge the fineness of the finished product.</p><p>Even with devoted parents, a hollow space remained within him, an emptiness rooted in the truth of his adoption. A fissure that would haunt him even in his own personal relationships, an anomaly he tried to hide or mend through rage and his infamous reality distortion field. Perhaps one that actually spurred his creative genius.</p><h4><strong>Building</strong></h4><p>Steve always tinkered with whatever he could through the help of his dad and engineering neigbours. What began as an aimless fascination with hacking would, in time, lead him to cross paths with Woz. The duo shared a lot in common from Bob Dylan to math and computers. Through sleepless nights and financial sacrifices, they built their first products.</p><p>Initially built for hackers, the products became ever more sealed off. Jobs believed in a closed system, while Woz championed an open one, a tension that would echo through Apple’s products for decades.</p><p>‘Necessity is the mother of invention’, a euphemism used one too many times, but not in this case. With only a few transistors at their disposal, Woz found a way of designing logic-gates to work with half the transistors. Another gift of his naïveté would help in the realization of smooth transitions in the GUI designs, a feature the Xerox engineered had deemed impossible. Nothing was impossible within his reality distortion field.</p><h4>Product</h4><p>Steve believed in creating computers that felt friendly and approachable, free from the intimidating aura of their predecessors. Crafted with care and guided by simplicity, he iterated endlessly, compelled by a persistent gut feeling that something was still amiss. Never afraid to hit the rewind button just hours away from product launch.</p><p>From the ninety degrees edge casing, to the colour shades to the gorilla glass, every design decision required a new form of construction or factory redesign. Ever rolling the dice on new technology as they became feasible, he was never crippled by the <a href="https://en.wikipedia.org/wiki/Second_product_syndrome">second-product-syndrome</a> or fear of cannibalism but always <a href="https://en.wikipedia.org/wiki/The_Innovator%27s_Dilemma">disrupting</a> his own flagship products.</p><h4>Beauty inside</h4><p>Steve learned from a very tender age the value of great design from the Echlon houses to the value of polishing the back of a cupboard. The seed of which he further nourished by immersing himself in typography, minimalism and simplicity. Greatly inspired by the Ferrari cars, dieter rams and beautiful Pietra Serena sandstones, he adeptly put to use these influences in everything he designed. From his obsession with the packaging, to every square having rounded corners, to the magnificent glass stair cases in the apple stores.</p><blockquote>A great carpenter isn’t gonna use a lousy wood for the back of the cabinet even though nobody’s gonna see it. — Paul Jobs</blockquote><p>He learned that things impute certain emotions or tastes and people do judge a book by its cover. Never satisfied with his designs, he made ever last minute changes to his products as if paying homage to the saying “A work of art is never finished, only abandoned”.</p><h4>Team</h4><p>Steve firmly believed A-players don’t play well with B-players(bozo) and went to great lengths to recruit them. On assembling his A-team, he believed people were bound by limitations and never took no for an answer, ever pushing the boundary of what was possible through his reality distortion field.</p><p>On his return to Apple, he did away with divisions and had a single profit and loss statement for the whole company. His belief in deep collaboration and no departments extended outwards to even the very position of the restrooms and the circular shape of the new <a href="https://en.wikipedia.org/wiki/Apple_Park">Apple Park</a>, which fostered random encounters, serendipity and creativity.</p><h4><strong>Carrot and stick</strong></h4><p>“This is shit”, direct and brash he was. He saw things in binary as either great or shit and motivated people through fear and praise, deftly using his reality distortion field to bend people to his will.</p><h4>David vs Goliath</h4><p>On assembling his A-team, he then fostered a David vs Goliath mentality, one he would invoke time and again. Believing they were up against some invisible forces of evil(IBM) which if not stopped would engulf the whole computer industry with low quality products. He equally made no compromises with the belief that it was best to build the greatest thing possible than to beat the competition.</p><p>Always stirring waters, he would provoke and irk his teammates so as to spur healthy rivalry. While his reality distortion worked most of the time, his teammates learned just when to push back, working on parallel features as a contingency plan. While he seemed adamant to bend to any ones’ will, he appreciated a renegade attitude if it turns out he was wrong.</p><h4>Personality</h4><p>A board meeting without Steve’s bare-feet on the table would have been an anomaly. He was fond of peculiar habits like walking barefoot, going for weeks on end with only carrots, intermittent fasting to having no furniture.</p><p>On the contrary, he had a knack for showmanship, a large than life attitude in which he believed in controlling his image. Personal branding was front and center. If he was a book, he made sure to have the best cover possible, going to extreme lengths, literally, by visiting Japan to purchase a large sum of turtleneck sweaters from Issey Miyake.</p><blockquote>Sometimes life’s gonna hit you in the head with a brick. Don’t lose faith. — Steve Jobs</blockquote><p>Had the book “<a href="https://en.wikipedia.org/wiki/The_Hero_with_a_Thousand_Faces">The hero with a thousand faces</a>” been written a few decades later, Steve Jobs would have featured as the main character. From being fired from the company he started, to his emptiness from being adopted, he always somehow channeled his demons into amazing products and reinventing himself. With a burn-the-trash mindset, he donated all the old apple tools, always starting from a clean slate. He equally wasn’t scared of cannibalising his own products as if an astute student of the <a href="https://en.wikipedia.org/wiki/The_Innovator%27s_Dilemma">innovator’s dilemma</a>.</p><blockquote>If you live each day as if it was your last, someday you’ll most certainly be right… If today were the last day of my life, would I wanna do what I am about to do today? — Steve Jobs</blockquote><p>A key change in his attitude came from his cancer diagnosis. A catalyst like no other, he sought to a accomplish as much as he could in the little <a href="https://news.stanford.edu/stories/2005/06/youve-got-find-love-jobs-says">time</a> he had left. Achieving far more in the last quarter of his life.</p><h4>Conclusion</h4><p>Steve Jobs’ success seemed destined from the very beginning, a picture Walter Isaacson painted very vividly in his <a href="https://www.goodreads.com/book/show/11084145-steve-jobs">autobiography</a>. Starting from his innate qualities coupled with the right <a href="https://paulgraham.com/cities.html">environment</a>. Born in the right era, surrounded by the right people and with a keen eye for design, all made for success inevitable.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=09c05b437c30" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rabbit-hole-adventures/ihuman-09c05b437c30">iHuman</a> was originally published in <a href="https://medium.com/rabbit-hole-adventures">Rabbit Hole Adventures</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Meditation on Meditations]]></title>
            <link>https://medium.com/rabbit-hole-adventures/a-meditation-on-meditations-c8f01c2fc6f9?source=rss-edcf645529ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/c8f01c2fc6f9</guid>
            <category><![CDATA[self-help]]></category>
            <category><![CDATA[marcus-aurelius]]></category>
            <category><![CDATA[philosophy]]></category>
            <category><![CDATA[stoicism]]></category>
            <dc:creator><![CDATA[Phillip Kigenyi]]></dc:creator>
            <pubDate>Wed, 06 Aug 2025 04:01:43 GMT</pubDate>
            <atom:updated>2025-08-06T12:03:36.867Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Wecow9gkklXp4paA" /><figcaption>Photo by <a href="https://unsplash.com/@samtakespictures?utm_source=medium&amp;utm_medium=referral">Sam Szuchan</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>The unexamined life is not worth living — Socrates</strong></p><p><a href="https://www.goodreads.com/book/show/30659.Meditations">Meditations</a>, a book some say is life changing, while for others, it isn’t as profound as it’s hyped to be. I happened to flip to the first page and, irresistibly, found my way to the last. These are my takeaways:</p><h3>Mentors</h3><p>Curate a list of people that inspire¹ you and learn their qualities. Foremost of them being self control², because most other qualities imminent from this. The nucleus of self control being how one controls his own thoughts³. Humility could equally be next in ranking if not the first.</p><p>As Kobe Bryant would say, <em>go to </em><a href="https://www.youtube.com/shorts/Z6sosfo3A4Q"><em>GOAT mountain</em></a>, its from this mountain that you ought to study and curate your own list of qualities that you would like to emulate, such as wisdom, justice, courage.</p><blockquote>Look beyond you at the gulf of time, and another infinity ahead…</blockquote><h3>Zooming out</h3><p>Thinking on a grand scale profoundly reveals how fleeting and unimportant most things are⁴. Conjuring up images of the <a href="https://www.goodreads.com/book/show/55030.Cosmos">cosmos</a> and the galaxies⁵ and your place within it can have a drastic effect of making one humble⁶.</p><p>The thought of lives past and future, filled with people that you will never know, who in turn will never know of your existence and exist literally in parallel to your life, makes you realize how unimportant the trivialities of daily life really are.</p><blockquote>But the motion of virtue is in none of these: it is something more divine, and advancing by a way hardly observed it goes happily on its road…</blockquote><h3>Virtues</h3><p>One of the greatest virtues being the social aim(good of the community)⁷. This being our ultimate purpose⁸, the benefit of our fellow citizens.</p><p>One ought to live a life with which he shall be content⁹, imbued with elements such as the free spirit, integrity, social conscience and obedience to the Whole(God)¹⁰.</p><p>The long and short of it starts with a clear purpose, which define your virtues. With this formula, one will be able to withstand the challenges of life and develop a stoic mindset.</p><h3>Nature</h3><p>The river flows down hill, the sun rises and sets, the ocean always in constant motion¹¹. Observe how nature dutifully follows this principle, neither complaining nor resisting¹². So should one accept the eventualities of life¹³ — the good and the ugly — for nothing is eternal; everything is in constant flux¹⁴.</p><blockquote>If you live each day as if it were your last, someday you’ll be right. Every morning I looked in the mirror and asked myself: If today were the last day of my life, would I want to do what I do today? — Steve Jobs</blockquote><h3>Mortality</h3><p>Death, the truest thing we know thus far, all else, no matter how solid, eventually reveals itself as but <a href="https://en.wikipedia.org/wiki/Allegory_of_the_cave">shadows</a> on the wall.</p><p>Knowing that nothing is immune to entropy and death¹⁵, frees you from the shackles of the trivialities of the everyday. Most importantly, it brings to the forefront the things that truly matter: virtues, purpose, and the profound question — why am I here¹⁶?</p><blockquote>Turning any obstacle into material for its own use. It is like a fire mastering whatever falls into it…</blockquote><h3>Stoicism</h3><p><a href="https://en.wikipedia.org/wiki/Yin_and_yang">Day and night</a>, hot and cold, sweet and sour¹⁷. Such is the life of man, with its ups as well as its downs. Time wasted complaining¹⁸ is time that could be spent paying attention to the inadvertence of nature(entropy)¹⁹.</p><p>One should strive to stay present, there is no past nor is there is future²⁰. Being here and now, striving to achieve self actualization, the attainment of which cannot happen without obstacles. However those <a href="https://www.goodreads.com/book/show/18668059-the-obstacle-is-the-way">obstacles</a> are the fuel that stokes the flame²¹.</p><p>The realization that no condition is permanent²², and that pain is neither unendurable nor unending²³, forms a mindset for traversing the realities of daily life. Of the realities that have happened before and will happen again in the future²⁴, one is only a crack in a <a href="https://www.youtube.com/watch?v=ScNNfyq3d_w&amp;pp=0gcJCfwAo7VqN5tD">castle of glass</a>.</p><p>Exam the voices of those that influence your emotions²⁵, give empty praises and dictate your actions. Realize that they come short of the self-actualization(virtuous) prototype you strive to achieve.</p><p>With this in mind, one stands well equipped²⁶ to experience life without surprises²⁷, because people are destined to act as their wiring dictates²⁸.</p><h3>Observation</h3><p>The default state of the mind is to judge things as good or bad. With the many merits this may have, it leads to a great deal of rumination especially if most things are judged as bad²⁹. There is a middle ground, one in which things are neutral³⁰, neither good nor bad. Seeing them for what they truly are, just things, devoid of ones’ perception.</p><h3>Mental models</h3><p>The book has a couple of mental models which are invaluable for how one could view the world. The most common was; zooming out to see the bigger picture through the lens of time, mortality and our minuscule nature.</p><ul><li><a href="https://en.wikipedia.org/wiki/Cognitive_reframing">Reframing</a>. View an event or situation with a new perspective</li><li><a href="https://shoukry.org/forest-and-trees-mental-model/">Zoom out</a>. View the current event in the scope of epochs pasts and realize everything is fleeting and all is not immune to entropy</li><li><a href="https://www.interaction-design.org/literature/topics/affordances?srsltid=AfmBOop3bpz4k-1bg2l-haBPcCWAXh6bTfRy9Ju2H4-Gos_2UU4EBP4X">Affordance</a>³¹. Structure of man affords duty³² and suffering³³. What is man’s true purpose?</li></ul><h3>Conclusion</h3><p>While most of the things highlighted in meditations don’t seem profound, the author does a great job of putting things into perspective, like a lens beaming the scattered rays of the sun onto a single point.</p><p>The <a href="https://www.goodreads.com/review/show/6945114895#">book</a> also seemed quite repetitive and came short of sounding like a broken record at times, however, as mundane as its content may appear, just as a matryoshka doll, its shine keeps getting brighter on consequent reads. All in all, it was a worthwhile read and lived up to the reputation of a classic</p><ol><li>Marcus Aurelius, <em>Meditations</em>, trans. Martin Hammond (London: Penguin Classics, 2006), Book 1, Section 1.</li><li>Marcus Aurelius, <em>Meditations</em>, trans. Martin Hammond (London: Penguin Classics, 2006), Book 1, Section 15.</li><li>Marcus Aurelius, <em>Meditations</em>, trans. Martin Hammond (London: Penguin Classics, 2006), Book 11, Section 10.</li><li>Marcus Aurelius, <em>Meditations</em>, trans. Martin Hammond (London: Penguin Classics, 2006), Book 4, Section 50.</li><li>Marcus Aurelius, <em>Meditations</em>, trans. Martin Hammond (London: Penguin Classics, 2006), Books 9.32 and 4.3.</li><li>Marcus Aurelius, <em>Meditations</em>, trans. Martin Hammond (London: Penguin Classics, 2006), Books 10.17 and 5.24.</li><li>Marcus Aurelius, <em>Meditations</em>, trans. Martin Hammond (London: Penguin Classics, 2006), Book 11, Section 21.</li><li>Marcus Aurelius, <em>Meditations</em>, trans. Martin Hammond (London: Penguin Classics, 2006), Book 7, Section 13.</li><li>Marcus Aurelius, <em>Meditations</em>, trans. Martin Hammond (London: Penguin Classics, 2006), Book 3, Section 12.</li><li>Marcus Aurelius, <em>Meditations</em>, trans. Martin Hammond (London: Penguin Classics, 2006), Books 10.1 and 10.6.</li><li>Marcus Aurelius, <em>Meditations</em>, trans. Martin Hammond (London: Penguin Classics, 2006), Book 3, Section 3.</li><li>Marcus Aurelius, <em>Meditations</em>, trans. Martin Hammond (London: Penguin Classics, 2006), Books 11.13, 8.23, and 8.17.</li><li>Marcus Aurelius, <em>Meditations</em>, trans. Martin Hammond (London: Penguin Classics, 2006), Books 11.20 and 11.27.</li><li>Marcus Aurelius, <em>Meditations</em>, trans. Martin Hammond (London: Penguin Classics, 2006), Book 4, Section 4.</li><li>Marcus Aurelius, <em>Meditations</em>, trans. Martin Hammond (London: Penguin Classics, 2006), Book 4, Section 35.</li><li>Marcus Aurelius, <em>Meditations</em>, trans. Martin Hammond (London: Penguin Classics, 2006), Book 8, Section 19.</li><li>Marcus Aurelius, <em>Meditations</em>, trans. Martin Hammond (London: Penguin Classics, 2006), Book 6, Section 46.</li><li>Marcus Aurelius, <em>Meditations</em>, trans. Martin Hammond (London: Penguin Classics, 2006), Book 3, Section 4.</li><li>Marcus Aurelius, <em>Meditations</em>, trans. Martin Hammond (London: Penguin Classics, 2006), Book 3, Section 2.</li><li>Marcus Aurelius, <em>Meditations</em>, trans. Martin Hammond (London: Penguin Classics, 2006), Book 6, Section 32.</li><li>Marcus Aurelius, <em>Meditations</em>, trans. Martin Hammond (London: Penguin Classics, 2006), Book 4, Section 1.</li><li>Marcus Aurelius, <em>Meditations</em>, trans. Martin Hammond (London: Penguin Classics, 2006), Books 5.23 and 4.6.</li><li>Marcus Aurelius, <em>Meditations</em>, trans. Martin Hammond (London: Penguin Classics, 2006), Book 7, Section 64.</li><li>Marcus Aurelius, <em>Meditations</em>, trans. Martin Hammond (London: Penguin Classics, 2006), Book 10, Section 27.</li><li>Marcus Aurelius, <em>Meditations</em>, trans. Martin Hammond (London: Penguin Classics, 2006), Books 9.42, 9.27, 8.52, and 5.3.</li><li>Marcus Aurelius, <em>Meditations</em>, trans. Martin Hammond (London: Penguin Classics, 2006), Book 7, Section 61.</li><li>Marcus Aurelius, <em>Meditations</em>, trans. Martin Hammond (London: Penguin Classics, 2006), Book 7, Section 26.</li><li>Marcus Aurelius, <em>Meditations</em>, trans. Martin Hammond (London: Penguin Classics, 2006), Books 8.5 and 4.26.</li><li>Marcus Aurelius, <em>Meditations</em>, trans. Martin Hammond (London: Penguin Classics, 2006), Books 3.16 and 5.16.</li><li>Marcus Aurelius, <em>Meditations</em>, trans. Martin Hammond (London: Penguin Classics, 2006), Books 5.26 and 4.39.</li><li>Marcus Aurelius, <em>Meditations</em>, trans. Martin Hammond (London: Penguin Classics, 2006), Book 8, Section 1.</li><li>Marcus Aurelius, <em>Meditations</em>, trans. Martin Hammond (London: Penguin Classics, 2006), Books 8.46 and 5.18.</li><li>Marcus Aurelius, <em>Meditations</em>, trans. Martin Hammond (London: Penguin Classics, 2006), Books 9.3, 8.17, and 5.1.</li><li>Marcus Aurelius, <em>Meditations</em>, trans. Martin Hammond (London: Penguin Classics, 2006), Book 6, Section 32</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8f01c2fc6f9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rabbit-hole-adventures/a-meditation-on-meditations-c8f01c2fc6f9">A Meditation on Meditations</a> was originally published in <a href="https://medium.com/rabbit-hole-adventures">Rabbit Hole Adventures</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[1. Microservices foundation]]></title>
            <link>https://medium.com/dev-scribbles/1-microservices-foundation-440db6979a84?source=rss-edcf645529ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/440db6979a84</guid>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[best-practices]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[tutorial]]></category>
            <dc:creator><![CDATA[Phillip Kigenyi]]></dc:creator>
            <pubDate>Thu, 24 Feb 2022 03:25:30 GMT</pubDate>
            <atom:updated>2022-02-24T23:33:24.358Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OyCeH42tCNo42-VdNrL2TQ.jpeg" /><figcaption>Northern Bypass, Uganda by constructionreviewonline.com</figcaption></figure><p>This is part one of the <a href="https://medium.com/dev-scribbles/practical-microservices-series-95226021f268">microservices series</a></p><p>The intent of the series is one for the practical aspects of microservices, however, some <a href="https://martinfowler.com/articles/microservices.html">fundamentals</a> need to be perused.</p><p>Microservices behoves one to take a holistic view of the computer science fundamentals and if possible dig into the history of so many of the tools that developers use, while understanding at a fundamental level why they were invented and acquiring a great sense of what the <a href="https://github.com/katopz/best-practices/blob/master/best-practices-for-building-a-microservice-architecture.md">best practices</a> are.</p><p>At its core, microservices are solving the problem of <strong>modularity. </strong>We’ve all used modularity in one form or another while using the UNIX terminal, importing modules in code or reusing objects in OOP. However, on the microservices level, the main objective is the <strong>independent deployability</strong> of modules or services.</p><blockquote>The main objective is the <strong>independent deployability</strong> of modules or services</blockquote><h3>Loose coupling and strong cohesion</h3><p>While modularity and independent deployment may be the goal of microservices, the oil that runs the machine is <strong>loose coupling</strong>. We’ve all worked on those codebases with the authentication module making calls to the payment module and notification module, with a change in one thing affecting a change in another.</p><p>The best practice is to have loose coupling between modules/services(preferably in monolith before transitioning to microservices) because, without that, all you will build is a <strong>distributed monolith</strong>.</p><p>This really starts with identifying the <a href="https://martinfowler.com/articles/microservices.html#OrganizedAroundBusinessCapabilities">domain boundaries</a> within the project and deftly <a href="https://docs.microsoft.com/en-us/dotnet/architecture/microservices/architect-microservice-container-applications/identify-microservice-domain-model-boundaries">extracting them</a>, a skill that requires some practice and won’t be straightforward. Because it’s from this that you determine the number and size of microservices that you will require</p><p>Like anything in software architecture, loose coupling is a tradeoff that comes with some challenges;</p><ul><li>How to design separate databases for each service?</li><li>How many and how big should the services be?</li><li>How will the services communicate?</li><li>How much should each service expose(interface design)?</li><li>How will the services be tested?</li></ul><p>Loose coupling is only one of the few <a href="https://12factor.net/">principles</a> to keep in mind while designing microservices or software for that matter.</p><h3>Built around teams</h3><p>To even further enforce the separation of services, each <a href="https://medium.com/nick-tune-tech-strategy-blog/domain-services-the-next-small-evolution-of-microservices-f217fc388191">team should own their service</a>/services, with full autonomy to build, test and deploy the service at will without breaking other services(through the use of a well-defined interface)</p><blockquote><em>You cannot build microservices without CI/CD</em></blockquote><h3>CI/CD</h3><p>As a common saying goes, <a href="https://youtu.be/T3l4QYC_9lo"><em>You cannot build microservices without CI/CD</em></a><em>. </em>While this is hard to set up depending on the size and amount of resources available, the benefits are enormous. This ensures that changes can quickly and easily be rolled out, systems are not failing, as well as ensuring communication between services is not broken as this would nullify the essence of using microservices in the first place.</p><h3>Well defined interfaces</h3><p>While microservices encourages a polyglot mindset, the use of multiple tools, languages and techniques can also pose challenges. One needs to start by properly <a href="https://www.oreilly.com/library/view/microservices-up-and/9781492075448/">defining the interface</a>(using swagger of some other tool) of each service, ensuring that the service exposes as little as possible to the outside world(to prevent coupling down the road).</p><p>To further enforce interfaces, you may <a href="https://www.infoq.com/presentations/7-sins-microservices/#mainLogin/">employ code generators</a> and this ensures that each service will be meekly identical. Functional programming languages like Haskell may help in writing code generators or the use of some <a href="https://app.imagine.ai/new">third party tool</a></p><h3>Conclusion</h3><p>Microservices poses many challenges as well as opportunities, like anything software engineering, it&#39;s a trade-off between so many tools, techniques and principles. Hopefully, this provides the first step as you ponder how to implement microservices</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=440db6979a84" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dev-scribbles/1-microservices-foundation-440db6979a84">1. Microservices foundation</a> was originally published in <a href="https://medium.com/dev-scribbles">Dev Scribbles</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Practical Microservices Series]]></title>
            <link>https://medium.com/dev-scribbles/practical-microservices-series-95226021f268?source=rss-edcf645529ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/95226021f268</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[setup-guide]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Phillip Kigenyi]]></dc:creator>
            <pubDate>Fri, 04 Feb 2022 09:12:36 GMT</pubDate>
            <atom:updated>2022-04-01T09:00:39.607Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WJYhauyD-1tv_fle" /><figcaption>Photo by <a href="https://unsplash.com/@markuswinkler?utm_source=medium&amp;utm_medium=referral">Markus Winkler</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Every few years, a new buzzword arrives, sending shockwaves and redefining how the software works or should be built anyway. <a href="https://martinfowler.com/articles/microservices.html">Microservices</a> is no different.</p><p>Like anything tech, starting out on a new tool requires a great deal of reading and tutorials. Only that quality and simplicity is in the least supply. Nevertheless, there is a lot more theory than practical knowledge about the subject(which explains the series)</p><p>For the sake of brevity, I will skip the definitions and setup steps, hoping that the reader will do the homework at their leisure.</p><p>This microservices series is a collection of opinionated instructions on how to build microservices. Hopefully, it drills down to the 1001010101. At the end of this series, we shall have a fully working system of about 3–4 microservices written in python(Django) and javascript(ExpressJS)</p><h3>Flow</h3><ol><li><a href="https://medium.com/dev-scribbles/1-microservices-foundation-440db6979a84">PART ONE</a>: <a href="https://samnewman.io/books/building_microservices_2nd_edition/">Microservices foundation</a>. Here we shall look at the philosophy onto which we shall build the microservice</li><li>Defining the scope/<a href="https://www.oreilly.com/library/view/microservices-up-and/9781492075448/">size of microservice</a>. A very contested topic that leaves many polarized</li><li>Microservice tools. With the hundreds of tools out there, we shall pick a few easy picks to start with.</li><li><a href="https://www.youtube.com/watch?v=NP189MPfR7Q&amp;ab_channel=GOTOConferences">Templating</a> and interfaces in microservices. At its core, the microservices can’t communicate well without standards ie API, interfaces and code generators</li><li><a href="https://microservices.io/patterns/data/database-per-service.html">Database design</a>. While a monolith requires a humongous database, the micros require separate and sandboxed databases which pose data integrity challenges and design. As well choosing between <a href="https://www.baeldung.com/cs/microservices-db-design">SQL and nosql</a></li><li>Docker + Kubernetes + Skaffold. Like an orchestra, microservices require some tools to control and manage the resources</li><li>Communication between services. <a href="https://docs.microsoft.com/en-us/dotnet/architecture/microservices/architect-microservice-container-applications/communication-in-microservice-architecture#:~:text=A%20microservices%2Dbased%20application%20is,across%20multiple%20servers%20or%20hosts.&amp;text=Therefore%2C%20services%20must%20interact%20using,the%20nature%20of%20each%20service.">Asynchronous vs Synchronous</a>, here we shall build and look at both sides of the mirror</li><li><a href="https://www.youtube.com/watch?v=S511BgBs_3E&amp;list=PLdsOZAx8I5umhnn5LLTNJbFgwA3xbycar&amp;index=151&amp;ab_channel=MarkRichards">Logging</a>. Who wouldn&#39;t like to have a quick glance at the green and red screens. Well, logging is critical in such a chaos moving world of microservices</li><li><a href="https://markgituma.medium.com/kubernetes-local-to-production-with-django-6-add-prometheus-grafana-monitoring-with-helm-926fafbe1d">Metrics and monitoring</a>. Reliability is preached over and over again in microservices, but to do so, one needs to keep a close eye on system performance and adjust or automate if need be.</li><li>Testing in microservices. Testing a single service is quite easy, extrapolate that to 20–40 and nothing seems to add up anymore.</li><li>Deployment. From running the code in skaffold to deployment pipelines and Travis</li></ol><p>Like before me, many have written quite interesting series. Please check them out as it will make it much easier to follow along.</p><ul><li><a href="https://www.youtube.com/playlist?list=PLdsOZAx8I5umhnn5LLTNJbFgwA3xbycar">Software architecture monday</a></li><li><a href="https://medium.com/swlh/microservices-architecture-from-a-to-z-7287da1c5d28#f067">Microservices A-Z</a></li><li><a href="https://github.com/katopz/best-practices/blob/master/best-practices-for-building-a-microservice-architecture.md">Katopz: Best practices</a></li><li><a href="https://markgituma.medium.com/kubernetes-local-to-production-with-django-1-introduction-d73adc9ce4b4">Mark Gituma: Microservices Series</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=95226021f268" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dev-scribbles/practical-microservices-series-95226021f268">Practical Microservices Series</a> was originally published in <a href="https://medium.com/dev-scribbles">Dev Scribbles</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NATS streaming server in Django]]></title>
            <link>https://medium.com/dev-scribbles/nats-streaming-in-django-82b3fc12407e?source=rss-edcf645529ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/82b3fc12407e</guid>
            <category><![CDATA[event-driven]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[developer-tools]]></category>
            <dc:creator><![CDATA[Phillip Kigenyi]]></dc:creator>
            <pubDate>Sat, 29 Jan 2022 11:46:39 GMT</pubDate>
            <atom:updated>2022-03-07T08:57:14.777Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oG9tbdKMq6HwYTw9" /><figcaption>Photo by <a href="https://unsplash.com/@redaquamedia?utm_source=medium&amp;utm_medium=referral">Denny Müller</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Like anything microservices, event-driven development is no easy feat. Your microservices have to <a href="https://docs.microsoft.com/en-us/dotnet/architecture/microservices/architect-microservice-container-applications/communication-in-microservice-architecture#:~:text=A%20microservices%2Dbased%20application%20is,across%20multiple%20servers%20or%20hosts.&amp;text=Therefore%2C%20services%20must%20interact%20using,the%20nature%20of%20each%20service.">communicate</a> in some way. While choosing synchronous is the easier route, it leads to a great deal of coupling down the road. In that case, asynchronous communication(events) is the alternative.</p><p>At any rate, if events are chosen, one may have to grapple with the hundreds of event bus options available. That is where NATS comes to the rescue, offering an easier way to start with little overhead.</p><p>NATS Streaming is an extremely performant, lightweight reliable streaming platform built on <a href="https://nats.io/">NATS</a>.</p><p>While implementing NATS in a javascript(ExpressJS) microservice, all was a breeze, with little to no difficulty. Until the focus shifted to python(Django). With its <a href="https://docs.python.org/3/library/asyncio-task.html">async-await</a> more cumbersome than in javascript, a great deal of learning had to be done.</p><p>After hundreds of hours, I finally put it together. The NATS python documentation is quite straightforward, though some things had to be added;</p><ul><li>How to publish the event from any file without rewriting the NATS code everywhere</li><li>Use OOP for reusability and clarity</li><li>How to run the event listener in an infinite thread</li><li>Standardize the response and payload using data classes or interfaces</li><li>Encoding and Decoding of the data</li></ul><h3>Foundation</h3><p>First, we shall create a superclass with the utility functions required</p><ol><li>Install <a href="https://github.com/nats-io/stan.py">NATS streaming library</a> <br>pip install asyncio-nats-streaming</li><li>Start a nats server either remotely or locally docker run -p 4222:4222 nats-streaming:0.17.0</li><li>Create a folder named events in the app directory with <em>event_bus_root.py, event_dataclasses, event_listener.py, and event_publisher.py</em></li><li>Implement the EventBus superclass. This contains the STAN and NATS client which will be reused. Not forgetting the byte encoder and decoder since data must be translated from and to a byte string</li><li>Add the env variables</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/99caeb84262c17733c03ee8e2cce84f9/href">https://medium.com/media/99caeb84262c17733c03ee8e2cce84f9/href</a></iframe><p>3. Create some constants and utility functions to change from snake case to camel(optional) for the other services that use camel ie Java, Javascript</p><p><em>constants.py:</em> Contains <em>queuegroupname</em> which prevents duplicate message delivery and the subjects the service may receive</p><pre>QueueGroupName = &quot;foobar-service&quot;<br><br><br>class EventSubjects:<br>    UserScheduleCreated = &quot;userschedule:created&quot;<br>    SmsNotificationCreated = &quot;smsnotification:created&quot;<br>    UserInfoAvailed = &quot;user:availed&quot;<br>    PaymentCreated = &quot;payment:created&quot;</pre><p><em>utils.py: </em>Contains utility functions that help in standardizing the response and payload</p><pre>def snake_case_dict_to_camel(object_to_change):<br>    changed = {}<br>    for key, value in object_to_change.items():<br>        changed[to_camel_case(key)] = value<br>    return changed<br><br><br>def to_camel_case(snake_str):<br>    components = snake_str.split(&#39;_&#39;)<br>    # We capitalize the first letter of each component except the first one<br>    # with the &#39;title&#39; method and join them together.<br>    return components[0] + &#39;&#39;.join(x.title() for x in components[1:])</pre><h3>Standard Interface</h3><p>One key element of microservices is a well-defined interface. For that matter, we use data classes to enforce the fields required.</p><p>Create a data class named <em>SmsMessage </em>with a custom dict() function to convert to dictionary and camel case. Alternatively, <a href="https://pydantic-docs.helpmanual.io/">pydantic</a> comes with the dict converter as well as validation if required.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c31e066214f87f00dee5652da44a6526/href">https://medium.com/media/c31e066214f87f00dee5652da44a6526/href</a></iframe><h3>Listener</h3><p>This file is created and initialized only once.</p><p>Some things to keep in mind.</p><ul><li>Database queries should be done synchronously using sync_to_async</li><li>There should be only one listener instance that calls run_forever()</li></ul><p>Steps</p><ul><li>Initialize a subscription under the __subscribe function and pass the queuename and message handler</li><li>Create the message handler. In this case a simple __user_schedule_message_handler that picks the user_id from the response and fires off a useravailed event</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f140b0ec38b5f7fd36d90581523c2a9c/href">https://medium.com/media/f140b0ec38b5f7fd36d90581523c2a9c/href</a></iframe><p>Finally, to initialize the listener, one has to start it from a <strong>background thread that is never killed. </strong>While this is trivial in bare python and a terminal, in Django, this has to be initialized without blocking the main thread. To do that, we create a command which is run with <em>nohup</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1b0b835ee66c15208b85c1ee2baea457/href">https://medium.com/media/1b0b835ee66c15208b85c1ee2baea457/href</a></iframe><p>This command can then be run in <strong>run.sh</strong> script or anywhere else</p><pre><strong>#!/bin/bash<br></strong>python manage.py migrate<br>nohup python manage.py register_event_listeners &amp;<br>gunicorn ms_foobar_django.wsgi:application --bind 0.0.0.0:8000 --log-level info --timeout 180 --workers 3</pre><h3>Publisher</h3><p>A standard file that requires no editing. Just use it as is.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dae7d8ef0907f3efdceba00351852e30/href">https://medium.com/media/dae7d8ef0907f3efdceba00351852e30/href</a></iframe><p>To publish an event, all one has to do is initialize an object EventPublisher and pass the subject and data. Whoever has subscribed to the SmsNotificationCreated<em> </em>event will receive the payload</p><pre>from .events.event_publisher import EventPublisher</pre><pre>bus = EventPublisher()<br>bus.run()<br>bus.publish(EventSubjects.SmsNotificationCreated,SmsMessage([phone_number], message).dict())</pre><h3>Conclusion</h3><p>Implementing <a href="https://www.youtube.com/watch?v=STKCRSUsyP0&amp;ab_channel=GOTOConferences">events</a> in microservices is never easy nor straightforward.</p><p>Alternatively, <a href="https://firebase.google.com/">firebase</a> might as well work perfectly if the tracking of events and consistency is not paramount</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82b3fc12407e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dev-scribbles/nats-streaming-in-django-82b3fc12407e">NATS streaming server in Django</a> was originally published in <a href="https://medium.com/dev-scribbles">Dev Scribbles</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Captaincy Of Work]]></title>
            <link>https://phillipkig.medium.com/captaincy-of-work-50960163e7ab?source=rss-edcf645529ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/50960163e7ab</guid>
            <category><![CDATA[work]]></category>
            <category><![CDATA[work-from-home]]></category>
            <category><![CDATA[producitivity]]></category>
            <category><![CDATA[ownership]]></category>
            <dc:creator><![CDATA[Phillip Kigenyi]]></dc:creator>
            <pubDate>Wed, 14 Jul 2021 05:44:09 GMT</pubDate>
            <atom:updated>2021-12-13T09:36:51.373Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F4shsWEnBI7P1pyBEb1PLg.jpeg" /><figcaption><a href="https://static.wikia.nocookie.net/seaofthieves5135/images/6/6f/Stormbeta.jpg/revision/latest?cb=20180428090709">Sea of thieves</a></figcaption></figure><p>Survival of the fittest has always been the adage known to most until, until a crisis hits. Our history is marred with periods that put human ingenuity to the test, from the world wars, the great depression, and the 2008 financial crisis, and for millennia, humans have been on repeat, using the same tactics or tools used by those who came before. However, with the impediments and caveats caused by this <a href="https://en.wikipedia.org/wiki/COVID-19">new crisis</a>(needless to say from 2019 onwards) the need for change in our response has never been greater.</p><p>With millions pushed to work from the comfort and discomfort of their home, one is required to take the <a href="https://fs.blog/2021/02/inner-sense-of-captaincy/">captaincy of work</a>, stay accountable to managers and clients, take care of their mental health and most of all, keep in touch with those they love the most, family.</p><p>While work from home makes most if not all their own captains, mismanagement of any resource, tools, or health can be detrimental. For the start, categorize those that are in your control; planning, time, the room, Internet connection, notifications, furniture, and things that aren’t; noisy environment, distraction from people.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*VTe-p08wvTBlE3lJj3tLAg.jpeg" /><figcaption><a href="https://media.istockphoto.com/photos/to-do-list-on-note-pad-with-coffee-and-pen-on-office-desk-picture-id863607936?k=6&amp;m=863607936&amp;s=612x612&amp;w=0&amp;h=ah7vkAcswYosdcuNZZKaVhmb6P9XSSkozVvhw4K47oM=">Todo list</a></figcaption></figure><p>In your control; start the day with a simple to-do list of the tasks at hand even better still if your company can develop a <a href="https://about.gitlab.com/handbook/">remote work plan</a> for all departments and employees. This shades the burden of disorder that may ensue thereof</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/1*DkF8jUMNZocSrqaiSBxqBA.jpeg" /><figcaption><a href="https://upload.wikimedia.org/wikipedia/commons/thumb/3/34/Il_pomodoro.jpg/440px-Il_pomodoro.jpg">Pomodoro</a></figcaption></figure><p>Time may fly or slow down depending on the <a href="https://fs.blog/2018/03/speed-velocity/">velocity of work</a>, working continuously as it were in the office may not suit most, so working in bursts instead by employing the <a href="https://en.wikipedia.org/wiki/Pomodoro_Technique">Pomodoro technique</a> which recommends having about 40–50 minutes of productive work and 10–15 minutes of relaxation could help decline tasks or offers that will distract one from completing the tasks at hand.</p><p><em>All work with no play makes Phillip a dull boy</em> shouldn’t be forgotten. Beyond those 10 minutes of rejuvenation, take a few more days or hours to call friends and family. Couple that with at least 2 days of workouts at home or jogging and you will wryly at those back pains, red eyes, and mental health issues</p><p>As before in history, our malleability and quick <a href="https://www.monasteriesoftheheart.org/care-creation/life-conversation">response to change</a> are what make us human. This crisis and many more to come only force us to become <a href="https://www.amazon.com/Antifragile-Things-That-Disorder-Incerto/dp/0812979680">antifragile</a> and allow for <a href="https://en.wikipedia.org/wiki/Epigenetics">stronger humans</a> of the future</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=50960163e7ab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The self(Identity)]]></title>
            <link>https://medium.com/rabbit-hole-adventures/the-self-identity-5bccae7f925d?source=rss-edcf645529ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/5bccae7f925d</guid>
            <category><![CDATA[philosophy]]></category>
            <category><![CDATA[self]]></category>
            <category><![CDATA[rebellion]]></category>
            <category><![CDATA[identity]]></category>
            <category><![CDATA[thinking]]></category>
            <dc:creator><![CDATA[Phillip Kigenyi]]></dc:creator>
            <pubDate>Tue, 18 May 2021 16:24:54 GMT</pubDate>
            <atom:updated>2022-06-30T05:25:37.650Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*Xlu57qu_HxSefS5FtzyyyA.jpeg" /><figcaption><a href="https://ndigo.com/2017/04/05/time-look-mirror/black-boy-mirror-500x330/">Boy in the mirror</a></figcaption></figure><p><strong>No one is taken for what he is, but for what others make of him — Arthur Schopenhauer</strong></p><h3><strong>Theme</strong></h3><p>“Who I am” has always eluded me for as far as I can remember. Why does one like this and other that, do this or the other. While the ingredients that make up the self or individuality are numerous, it mostly appears that one&#39;s first encounter with the self is with preferences. “Pass me this, no thanks, that is enough, would you like this?” all make up some of if not all ingredients of individuality in other words the self. Or through an encounter with another who may be of the same or different makeup. Does one realise who they are based on how they differ from others, if so what unique property inclines one to certain preferences or creates artificial differences to stand out, are we involuntarily paying homage to the <a href="https://lesley.edu/article/perception-is-reality-the-looking-glass-self#:~:text=The%20looking%2Dglass%20self%20describes,worth%2C%20values%2C%20and%20behavior.">looking glass self</a> . “I am not who I think I am, I am not who you think I am, I am who I think you think I am”.</p><p>Otherwise, we may as well all be storytellers, shaping ourselves to fit the matrix of which society is made. While this may impel one to look for the mastermind pulling on the marionettes, disappointment lucks in the corner, for one realises that the matrix has hardly any mastermind without but only within. As one participates in the matrix, one is consequently being controlled while he controls as well.</p><p>How does one then claim to know the self or have their own individuality if one is only a mosaic of options which have been presented through their life, obeying, cherry-picking ones that would fit the narrative, omitting and altering those which are hard to hide. “Stand in line, walk like this, wrong way, you have it wrong” are words one is too familiar with. While they are most predominant while one is young, most would be deluded to believe that adulthood brings an end to it. For the desire to conform may have been involuntary while young, one decides to follow in line absurdly when his faculties of reason are mature enough. At what point does one receive the baton of designing their individuality, should we assume every individual has a universal clock for when they fully take over, one needn’t look around to realise how false this is.</p><p>For if the decision to follow inline is by one’s own will, where does that leave the self, or is the self-manifested in the making of these choices through one’s journey. For many have for the most part outsourced their reason to absurdly <a href="https://www.goodreads.com/book/show/6820760-collected-essays-of-arthur-schopenhauer?from_search=true&amp;rating=1">not the best</a></p><p>While phrases like “I know who I am, I like, I dislike, I was designed this way” may fool one to believe the self is as a dead clock, it is more elusive than not. For its very nature eludes the consciousness of its inhabitant, making one into believing that one’s being while all along <a href="https://www.jstor.org/stable/43154946?seq=1">one has been becoming</a>. Never the same while appearing still at the <a href="https://en.wikipedia.org/wiki/Ship_of_Theseus">same time</a>.</p><p>For is the very nature of the self to always evolve rather into what is it, evolving into. As it appears the self evolves by one’s own amount of desire “I think therefore I am” the cause of which one might eventually claim “I am here”.</p><p>As humans, the desire to assert or restate who we are has never been in short supply, for some do it in more subtle ways than not, by how they walk, talk or choose to dress while others are a lot more explicit and may go as far as making it a career. What musicians, scientists, painters, and architects all have in common is one thing, to say as a child “Look what I made, it’s great right” while all along what they really wanted to assert was their identity and circumvent the constant invisibility that is subtle but always present.</p><p>Others may find the confide of the group a <a href="https://www.youtube.com/watch?v=Tz1PNIOQsFs">better reflection</a> and comprehension of the self. Perhaps for security if it were the medieval ages but that is not the case, one chooses the group/tribe because of their abundant supply of understanding and compassion. For men will die to have a hundred if not thousands of followers without ever realising their need for understanding, for one believes, with it, the self is more real, not in the head if not more tangible than if no one saw and heard them as the planets revolve around the sun so he/she does, reaffirming his <a href="http://cogprints.org/266/1/selfctr.htm">center of gravity</a>. It&#39;s for this reason that men might fight any or all who detest or disregard their intellectual prowess</p><p>With these in mind, the self seems to push itself to evolve just for the sake of representing itself as a director might set up the actor for different scenes of the play, each time refining the script, adjusting the light to fit the mood and setting the right score. The self it seems is if not only a work of art which itself is the artist as one who makes up on stage for the next scene as the play is happening, in other words, the hand that is drawing the hand as one might say. Pity to say the least is what one can feel for the youth having to navigate all these options availed explicitly but mostly in subtle ways. Many a teenager(youth) struggles with this cognitive dissonance for a great portion of his/her life, chipping in pieces of other “selfs” to see what fits with great desperation. While we might say they are going through a phase(mostly annotating mode swings and rebellion), the best “youth graduation” message we could say is “welcome cog to the machine”</p><blockquote>I want you to think about the mail for a minute. Stop taking it for granted like some complacent, sleepwalking sheep and really think about it. I promise you, you will find the U.S. mail a worthy object of your contemplation. A piece of paper can cross a continent like we’re passing notes in class. I can send you cookies from the opposite side of the world, and all I have to do is write your name on the box, put some stamps on it, and drop it in. And you see, it only works because every single person along the chain acts like a mindless automaton. I write an address, and they just… obey. No question. No deviation. No pause to contemplate eternity… Or beauty… Or death. Even you, for all your protestations of free will, if a box comes with your name on it, you can’t even imagine doing anything other… Than obey. Well, it’s not your fault. Society made you this way. But you’re a sheep, and you’re living in a world of sheep. And because you’re all sheep… — Manhunt</blockquote><p>Nothing like this quote underpins the oblivion of our minds to the banal and commonplace things. Not only does the author have to beg for your attention, rather literally striving to capture it but also impels you to stay attentive. This not only highlights the default state of mind most but also the knowledge of its presence being scarce. One is then forced to contemplate the simple actions we take for granted and clearly conveys the absurdity of human automatic action like this very keyboard which only echoes the key that is hit, only less accurately. The self appears to form in total oblivion of its inhabitant and the only escape is shut by the constant preaching of “stay in line, obey my command”. As a corollary, William Deresiewicz’s speech vindicates even more strongly the need for an independent mind and self</p><blockquote>Why is it so often that the best people are stuck in the middle and the people who are running things — the leaders — are the mediocrities? Because excellence isn’t usually what gets you up the greasy pole. What gets you up is a talent for maneuvering. Kissing up to the people above you, kicking down to the people below you. Pleasing your teachers, pleasing your superiors, picking a powerful mentor and riding his coattails until it’s time to stab him in the back. Jumping through hoops. Getting along by going along. Being whatever other people want you to be, so that it finally comes to seem that, like the manager of the Central Station, you have nothing inside you at all. Not taking stupid risks like trying to change how things are done or question why they’re done. Just keeping the routine going.</blockquote><blockquote>I tell you this to forewarn you, because I promise you that you will meet these people and you will find yourself in environments where what is rewarded above all is conformity.</blockquote><blockquote>— William Deresiewicz(<a href="https://theamericanscholar.org/solitude-and-leadership/">Solitude and Leadership</a>)</blockquote><p>As it appears, this seems to echo a similar if not exact message of questioning, thinking for one’s self, and rebellion. Crystal perfect examples aren’t necessary to impel one to follow. Throughout history, these have existed rebelling against the system encore et encore Nina Simone, Daudi Chwa, Miles Davis, Steve Jobs(the very examples may contradict many sections of the article however, it’s no more important than the point of rebellion it conveys)</p><p>While society as a whole seems to benefit from this subversion and has seen tremendous economic growth, one can not but ask if all this is a ploy by a handful. Most appear to have free will and freedom which are definitely in short supply, conversely for those who try the <a href="https://www.alaindebotton.com/philosophy/">life of a hippie</a>, life can be difficult if not impossible. As it appears, the economic(and or other) pressure permits few if any to become explorers of their identity. However, to the extent, this hampers the formation of the “true self” one should ponder</p><h3><strong>Black mirror</strong></h3><p>If one is born into a world where each individual knows not the existence of another, locked up in a room they grow until their faculties of reason are ready. How would they identify, as self-sufficient beings who know who they are, as those who make their decisions without interference? If then they met for the first time, would they know themselves or ask the other “who am I”</p><h3><strong>Resolve</strong></h3><p>Not exactly in this order, however, the first step in taking charge of the self is using the eyes of our mind to see <a href="https://fs.blog/great-talks/psychology-human-misjudgment/">all the biases</a> and options availed to us. Scrutiny of some or everything and not succumbing to <a href="https://www.youtube.com/watch?v=8QyVZrV3d3o">hedonic adaptation</a> might be second and lastly, as an artist painting the picture of our “self”, we should stay fully awake and methodical in its creation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5bccae7f925d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rabbit-hole-adventures/the-self-identity-5bccae7f925d">The self(Identity)</a> was originally published in <a href="https://medium.com/rabbit-hole-adventures">Rabbit Hole Adventures</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>