<?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 Boris Dedejski on Medium]]></title>
        <description><![CDATA[Stories by Boris Dedejski on Medium]]></description>
        <link>https://medium.com/@borisdedejski?source=rss-1be0efad860e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*KGbV3n0hstLV3fyc9zugOw.png</url>
            <title>Stories by Boris Dedejski on Medium</title>
            <link>https://medium.com/@borisdedejski?source=rss-1be0efad860e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 21:51:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@borisdedejski/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[Transforming notes into knowledge using a digital whiteboard]]></title>
            <link>https://medium.com/@borisdedejski/transforming-notes-into-knowledge-using-a-digital-whiteboard-25d842eeb6aa?source=rss-1be0efad860e------2</link>
            <guid isPermaLink="false">https://medium.com/p/25d842eeb6aa</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[notes]]></category>
            <category><![CDATA[diagrams]]></category>
            <category><![CDATA[engineering]]></category>
            <dc:creator><![CDATA[Boris Dedejski]]></dc:creator>
            <pubDate>Tue, 16 Jan 2024 16:54:10 GMT</pubDate>
            <atom:updated>2024-01-16T16:54:10.547Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>In the world of software development, where daily updates and learning are the norm, a typical day for a developer involves more than just coding.</p><p>From problem approach investigations, upgrading your knowledge with learning a new framework, working on multiple topics at the same time, improving your algorithmic skills, etc. the amount of knowledge that should be acquired can be substantial.</p><p>Recently, I discovered a reliable home for this knowledge, a handbook that I use to easily switch topics and remind myself about some cool learnings.</p><h3>The Daily Juggle</h3><p>Navigating through coding tasks, investigations, courses, and updates, developers find themselves in a constant dance of acquiring new knowledge.</p><p>Questions arise:</p><blockquote>I am learning a new framework on the side, but I do not use it on a daily basis, how do I make sure I keep my knowledge of it polished?</blockquote><blockquote>I have learnt a very cool thing about how React updates the DOM, but as I do not use this on a daily basis I might forget it, how can I make sure I do not?</blockquote><blockquote>I am working on a very importnat topic now, but I am going on vacation and will be back in 2 weeks. How do I make sure that I can get back on it smoothly?</blockquote><p>Well, a very simple yet powerful old method ➡️ <strong>NOTES. <br></strong>The good news is, today they are digital and can easily be kept and stored in one place.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*gJDSzuQv6G20Xzc4cqwibQ.gif" /><figcaption>notes, notes, notes</figcaption></figure><h3>How have Notes helped me organize my knowledge?</h3><p>I’ve got something interesting to share — I’m part of the team over at Cacoo, a fantastic diagramming software. Naturally, being in this space, the idea struck me to leverage our software for my needs.</p><p>In my downtime, I’ve been diving into the vast ocean of algorithmic knowledge, courtesy of one of the most incredible courses out there — AlgoExpert. This course is a goldmine, covering a lot of topics from different areas from Algorithms, Code challenges to Advanced JavaScript, React, and a host of other fascinating topics.</p><p>Here’s the kicker: amidst this treasure trove of information, I found myself occasionally saying: <em>‘I have just learned how chromium-based browsers work, but how do I ensure this knowledge sticks, especially when it’s not something I encounter to question myself daily?’</em></p><p>Then there were those moments when I stumbled upon sleek solutions in algorithms, thinking, <em>‘This could be a game-changer in a feature I’m currently working on.’</em></p><p>That’s when I decided it was time to bring some order to the chaos.</p><p>So, I started organizing.</p><p>And here’s a sneak peek into what that looked like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kfw2UJb0vDMyDfHN2f4_tA.png" /><figcaption>Taking notes of a course that I am following</figcaption></figure><p>or when you zoom out</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TTBLGsKL_V0sd8WHLSmTyw.png" /></figure><p>Yes, lots of easily accessible and organized information.</p><h3>Usage examples</h3><p>On a daily basis, I do not work with <strong>proxies</strong> all the time, but when I encounter it, my notes are here to save me, it is so easy to refresh your knowledge and jump straight back into it when looking at these notes.</p><p>I am currently taking a course in a library that I want to adopt in my future projects, but this is not something I do on a daily basis. I frequently go back and forth on it depending on my sparetime. I would sometimes work 3 days consecutively on it and sometimes I would not touch it in weeks. Thanks to the notes, it’s always easy to jump back.</p><p>Sneak peek of what it looks like</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*_Mc5zM07LPPUZiUV9BZF4g.png" /><figcaption>Course notes sneak peak</figcaption></figure><h3>Conclusion</h3><p>As I wrap up, organized notes has been a game-changer in my learning journey. It’s not just about gathering info; it’s about making it a part of my toolkit.</p><p>In the world where chaos is constant, structured notes become a compass, ensuring our learnings stay with us, ready to guide us through each challenge.</p><p>Hope you find the article insightful, and happy learning!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25d842eeb6aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rounding numbers on X decimal places in Javascript]]></title>
            <link>https://medium.com/@borisdedejski/rounding-numbers-on-x-decimal-places-in-javascript-5a4bc26e4149?source=rss-1be0efad860e------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a4bc26e4149</guid>
            <dc:creator><![CDATA[Boris Dedejski]]></dc:creator>
            <pubDate>Sun, 12 Sep 2021 15:42:35 GMT</pubDate>
            <atom:updated>2021-09-12T15:45:58.183Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/347/1*aUgmdEtgmyojpp0qqmHkvA.jpeg" /></figure><p>Rounding decimal numbers in javascript is pretty straightforward, you can just easily use the Math.round or Math.ceiland your problem is solved right? <br>- NO!<br>And if you are reading this you probably know what I am talking about.</p><p>While in ideal world the integrated Math should solve your problem right away you should definitely take a closer look on how Javascript rounds the numbers. Just using the classic Math might not be sufficient for all of your edge cases, and you might need to improve it at some point.</p><p>You need to be aware that there are existing rounding errors in Javascript, by that I mean that: <br><strong>0.1+0.2 ≠0.3 </strong>in Javascript world.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fWGvjzEAPuanXEraiCE7ow.png" /></figure><p>There is also a good medium article which explains why 0.1+0.2 is not 0.3, you can check it out <a href="https://javascript.plainenglish.io/why-0-1-0-2-0-3-in-javascript-d7e218224a72">here</a>, but I am not gonna take a deep dive in it.</p><blockquote>Now that we saw that there are specific rounding errors, lets see what this can lead to and how it can affect your software?</blockquote><p>Since this is a big topic and you can read a lot about decimal numbers, mantisas, representations in javascript etc. I will keep it up short and I will jump up with an example.</p><p><strong>Issue:</strong> Let’s say the decimal numbers in your app need to be rounded on 2 decimals points, and therefore if the fractional portion is exactly <strong>OR</strong> 0.5, the number needs to be rounded to the next highest integer in the direction of +<em>∞. We are searching for a method that will round both correctly, since we can get either of those (and similar) from an imagined endpoint.</em></p><p>Test: 1234.745 <br>Expected result after rounding on 2: 1234.75</p><p>First lets go with the standard approach, multiply it by 100 and then divide by 100 in order to round it on 2 decimals:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*L4Td2i-LAZ90vTwCUFWqAA.png" /></figure><p>not what we wanted, we want a result of 1234.75, so Math.round <strong>won’t</strong> solve the problem in this case.</p><p>We can’t use Math.ceil to approach this solution either, because of the reason 0.1+0.2 I mentioned above, it will fail for the number 300.000002 (and other similar numbers)</p><p>If we use Math.ceil , it will work for the number 1234.745 but will fail in multiple other scenarios (and we search for a solution that works for both and more) see the example below.</p><p>Example: <br>Test: 300.000002 <br>Expected result after rounding on 2: 300.00</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/997/1*W7-2xIIcLJE260EseKAAeg.png" /></figure><p>How would you come up with a single solution that will work for both and similar numbers as above?</p><p><strong>Solution</strong></p><p>Luckily, you can use exponential notation when rounding to a certain number of decimals in Javascript to get the most “optimal” result.</p><p>Why? — Javascript interprets exponential numbers differently.</p><p>We can represent the hundreds for example 1e1=1, 1e2=100, 1e3=1000 and so on.</p><p>Then from here we can see that it is already different.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*nQ_tBG_MNEdlNGxBcDcTBA.png" /></figure><p>1130.745 * 100 is different than 1130.745e2 and it basically means the same.</p><p>Therefore, the rounding error won’t happen if you represent your numbers exponentially.</p><p>Let’s now try using exponential notation and try to come up with a solution who will work in the both cases mentioned above.</p><p>Tip: You can use e2,e3,e4.. depending on how many decimals you want to round</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UK0smll1MWshbDTjm6vA4Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*LAL0iMfVjRjezuv1y3BLYA.gif" /></figure><p>Awesome, our rounding is correct!<br>- We just improved the Math.roundwhile just representing the numbers in their exponential notation.</p><p>📑 Thanks for reading, and be careful with numbers.<br>Happy coding! 💻</p><p>Related useful resources:<br><a href="https://gist.github.com/djD-REK/068cba3d430cf7abfddfd32a5d7903c3">https://gist.github.com/djD-REK/068cba3d430cf7abfddfd32a5d7903c3</a><br><a href="https://techfunda.com/howto/820/exponential-format">https://techfunda.com/howto/820/exponential-format</a><br><a href="https://floating-point-gui.de/">https://floating-point-gui.de/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a4bc26e4149" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Next.js, MobX and TypeScript boilerplate for beginners]]></title>
            <link>https://medium.com/@borisdedejski/next-js-mobx-and-typescript-boilerplate-for-beginners-9e28ac190f7d?source=rss-1be0efad860e------2</link>
            <guid isPermaLink="false">https://medium.com/p/9e28ac190f7d</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[mobx]]></category>
            <dc:creator><![CDATA[Boris Dedejski]]></dc:creator>
            <pubDate>Sun, 29 Mar 2020 21:50:36 GMT</pubDate>
            <atom:updated>2020-03-31T18:32:41.388Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/465/1*36Z4DeAmmpGaKXKDiC3MlA.png" /></figure><p>In this article I would like to show you how you can setup your new project with Next.js, MobX and TypeScript in 5 minutes.</p><blockquote><em>Step 1. Setup Next.js with TypeScript</em></blockquote><p>First we need to setup our project with typescript so we will use the boilerplate with-typescript from the creator of Next.js — <em>Zeit</em>.<br><a href="https://github.com/zeit/next.js/tree/canary/examples/with-typescript">https://github.com/zeit/next.js/tree/canary/examples/with-typescript</a></p><p>Open new terminal and navigate to the folder that you want to initialize your application and type:</p><p>yarn create next-app --example with-typescript myapp</p><p>Once finished, navigate to myapp and run yarn run dev .<br>Our Next.js app is now running and it is configured with TypeScript.</p><blockquote><em>Step 2. Add MobX</em></blockquote><p>yarn add mobx mobx-react</p><p>Second thing we need to do is to add MobX to our current application. But… yes, pages in SSR applications are rendered only once so with the current setup, observer component won’t observe the store changes and this is not the behavior that we want right?</p><p>Let’s do some extra things in order to make the store-component relation work as it should.</p><p>At the root of your project create folder /stores and in it define a store. <br>I will name it DataStore.tsx</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/291/1*O7ESB00rgdXFZKhmIlUqIw.png" /><figcaption>DataStore.tsx</figcaption></figure><p>Now lets add the following code in our <strong>DataStore</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/39700630489e923d36fe1aae57043348/href">https://medium.com/media/39700630489e923d36fe1aae57043348/href</a></iframe><p>TypeScript will complain about experimentalDecorators , go to tsconfig.json and in compilerOptions set experimentalDecorators: true</p><p>To use the decorators we also need to create .babelrc file in the root of our project and paste the following code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3cf6f6dc7a22114f9b3357d9a538f289/href">https://medium.com/media/3cf6f6dc7a22114f9b3357d9a538f289/href</a></iframe><p>then run:<br> yarn add @babel/plugin-proposal-decorators and we are good to go.</p><p>We created our first store, congrats!! Now lets create the component that will provide this store to our components the SSR workaround.</p><p>Go in the /pages folder and create file _app.js .</p><p>This file will be in JS because it is SSR workaround and I don’t want to use TS there. If you want to use .ts the result will be the same.</p><p>Copy the following code in _app.js</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6da0205cbb9a5f7ff729f999a312f5d4/href">https://medium.com/media/6da0205cbb9a5f7ff729f999a312f5d4/href</a></iframe><ul><li>In state we define our stores like dataStore: new DataStore()</li><li>In getDerivedStateFromProps we hydrate the serialized state so if we have new store we will need to hydrate it as well.</li></ul><p>Okay, we are ready now.</p><p>Go to /pages/index.tsx and paste the following code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a48143fc1afd43a6cd44e3da1ec43dec/href">https://medium.com/media/a48143fc1afd43a6cd44e3da1ec43dec/href</a></iframe><ul><li>We inject the store we created previously with inject(“dataStore”)</li><li>We make the component to be observer with observer</li></ul><p>Awesome !!!<br>Our component and store are now connected.</p><p>Happy coding !!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e28ac190f7d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>