<?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 Vignesh Karthikeyan on Medium]]></title>
        <description><![CDATA[Stories by Vignesh Karthikeyan on Medium]]></description>
        <link>https://medium.com/@meshugah?source=rss-45c0db0fed36------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*cbr4dRIFZw8y4tv2.</url>
            <title>Stories by Vignesh Karthikeyan on Medium</title>
            <link>https://medium.com/@meshugah?source=rss-45c0db0fed36------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 02:59:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@meshugah/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[TDD is impossible without Inversion of Control and DIP]]></title>
            <link>https://meshugah.medium.com/tdd-is-impossible-without-inversion-of-control-and-dip-5217bf743675?source=rss-45c0db0fed36------2</link>
            <guid isPermaLink="false">https://medium.com/p/5217bf743675</guid>
            <category><![CDATA[tenet-2020]]></category>
            <category><![CDATA[dependency-inversion]]></category>
            <category><![CDATA[inversion-of-control]]></category>
            <category><![CDATA[design-patterns]]></category>
            <dc:creator><![CDATA[Vignesh Karthikeyan]]></dc:creator>
            <pubDate>Sun, 16 May 2021 09:28:06 GMT</pubDate>
            <atom:updated>2021-05-16T09:28:06.992Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YUpcPd5nGe9ATtAg.jpg" /><figcaption>Get it? Inversion 🤧</figcaption></figure><p><a href="https://www.tutorialsteacher.com/ioc">IoC Tutorial</a></p><p><em>“IoC is all about inverting the control. To explain this in layman’s terms, suppose you drive a car to your work place. This means you control the car. The IoC principle suggests to invert the control, meaning that instead of driving the car yourself, you hire a cab, where another person will drive the car. Thus, this is called inversion of the control — from you to the cab driver. You don’t have to drive a car yourself and you can let the driver do the driving so that you can focus on your main work.”</em></p><h4>Dependencies: an overview</h4><p>If you were at any point confusing the terms <strong>dependency</strong> or <strong>dependent</strong>, an easy pointer to help remember: If <strong>A </strong>is dependent on <strong>B, </strong>then <strong>B </strong>is a dependency of <strong>A</strong>. Still confused?! I know I am(linguistics horror) Essentially anything that is required to run <strong>A</strong> is a dependency of <strong>A :).</strong></p><h4>So how is this important for TDD</h4><p>Well you need loosely coupled <strong>things</strong> for TDD to be effective. And how do we get that? <strong>We get <em>everything</em> that is being used in a <em>thing</em> and move it to another <em>method. </em></strong>So that’s deal, See, Inversion of Control is a principle, a paradigm, you can use it anywhere and everywhere. Not just with code :).</p><p>So if you have a data access layer(ex: a mongoose database layer) and a node.js business logic layer. Then you want to seperate out the data access parts in the business logic layer into a seperate class. <strong>Only then can you accurately and precisely separate concerns and then subsequently Test.</strong></p><p>Sometimes i’m wordy, Check the linked article for a great example saying why (and how) your data access is probably tied to your business logic and why you should change it!</p><p>What’s DIP? I’ve got an article on that too!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5217bf743675" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Security in an hour]]></title>
            <link>https://meshugah.medium.com/aws-security-in-an-hour-692a74dd48dc?source=rss-45c0db0fed36------2</link>
            <guid isPermaLink="false">https://medium.com/p/692a74dd48dc</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Vignesh Karthikeyan]]></dc:creator>
            <pubDate>Wed, 19 Aug 2020 19:12:03 GMT</pubDate>
            <atom:updated>2020-08-19T19:24:10.115Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/272/1*VlGlbKpE-hoIvXDAUezTkQ.png" /></figure><p>Easily the fastest way to learn about VPC, IAM, Security Groups, Policy Writing, A visual of the internet gateway, Public and private subnets. Really just everything important with security which is so easy to get lost in on AWS:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F-ObImxw1PmI%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D-ObImxw1PmI&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F-ObImxw1PmI%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/e0c4dd56575ab76257dda8d61a654e68/href">https://medium.com/media/e0c4dd56575ab76257dda8d61a654e68/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=692a74dd48dc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Backend Developer Roadmap]]></title>
            <link>https://meshugah.medium.com/backend-developer-roadmap-f06c3e5c7620?source=rss-45c0db0fed36------2</link>
            <guid isPermaLink="false">https://medium.com/p/f06c3e5c7620</guid>
            <dc:creator><![CDATA[Vignesh Karthikeyan]]></dc:creator>
            <pubDate>Mon, 17 Aug 2020 09:25:48 GMT</pubDate>
            <atom:updated>2020-08-17T09:25:48.861Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JgG4syZyRxkt3e-Tzxxaww.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f06c3e5c7620" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Memoization in Haskell]]></title>
            <link>https://meshugah.medium.com/memoization-in-haskell-ae78e0221abe?source=rss-45c0db0fed36------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae78e0221abe</guid>
            <category><![CDATA[functional-programming]]></category>
            <category><![CDATA[haskell]]></category>
            <category><![CDATA[lambda-calculus]]></category>
            <dc:creator><![CDATA[Vignesh Karthikeyan]]></dc:creator>
            <pubDate>Wed, 15 Jul 2020 06:55:51 GMT</pubDate>
            <atom:updated>2020-07-28T07:02:52.743Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*26c5xNc1WyhXu1vfs2uzvw.jpeg" /></figure><ol><li><strong>How is caching not considered a side-effect(in the context of pure functions)?</strong></li><li><strong>Aren’t all values functions?</strong></li></ol><p>All functions are values but not all values are functions.</p><p>This is really about <em>operational</em> semantics, which are sometimes tricky to talk about in Haskell because Haskell is only defined in terms of its <em>denotational</em> semantics — that is, <em>what</em> value an expression evaluates to, rather than <em>how</em> that evaluation happens. It’s not a side-effect because the “stateful” nature of memoization is still hidden behind the abstraction of purity: while there is some internal state (represented in the partial graph-reduction of the program), there is no way for your program to <em>observe</em> that state in a way that would distinguish it from the non-memoized version. A subtlety here is that these memoization strategies are not actually required to memoize — all that is guaranteed is the result they will give after some unspecified finite amount of time.</p><p>There is no requirement for a Haskell implementation to memoize anything — it could use pure <em>call-by-name</em>, for example, which doesn’t memoize values, instead recomputing everything. Here’s an example of call-by-name.</p><pre>let f x = x * x in f (2 + 2)<br>= (2 + 2) * (2 + 2)<br>= 4 * (2 + 2)<br>= 4 * 4<br>= 16</pre><p>Here 2 + 2 is evaluated twice. Most Haskell implementations (optimizations aside) would create a <em>thunk</em> so that it would be computed at most once (which is called <em>call-by-need</em>). But a call-by-name Haskell implementation that evaluated it twice would be technically conforming. Because Haskell is pure, there will be no difference in the result computed. In the real world though, this strategy ends up being much too expensive to be practical.</p><p>As for the choice not to memoize functions the logic is the same. It is perfectly conforming for a compiler to aggressively memoize every function, using something like <a href="https://en.wikipedia.org/wiki/Lambda_calculus#Optimal_reduction">optimal evaluation</a>. Haskell’s purity means that there will be no difference in the result if this evaluation strategy were chosen. But again, in real-world applications, memoizing every function like this ends up taking a lot of memory, and the overhead of an optimal evaluator is too high to give good practical performance.</p><p>A Haskell compiler could also choose to memoize some functions but not others in order to maximize performance. This would be great — my understanding is that it is not really known how to do this reliably. It is very hard for a compiler to tell in advance which computations will be cheap and which will be expensive, and which computations will probably be reused and which will not.</p><p>So a balance is chosen, in which values, whose evaluated forms are usually smaller than their thunks, are memoized; whereas functions, whose memoized forms are usually larger than their definitions (since they need a whole memo <em>table</em>), are not. And then we get some techniques like those in the article to switch back and forth between these representations, according to our own judgment as programmers.</p><h3>References:</h3><p><a href="https://stackoverflow.com/users/33796/luqui">User luqui</a></p><p>Context:</p><p><a href="https://stackoverflow.com/questions/62734019/memoization-in-haskell">Memoization in Haskell</a></p><p>More Context:</p><p><a href="https://kseo.github.io/posts/2017-01-14-memoization-in-hasekll.html">https://medium.com/r/?url=https%3A%2F%2Fkseo.github.io%2Fposts%2F2017-01-14-memoization-in-hasekll.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae78e0221abe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ZKSnarks on Ethereum: (Part 1)All right, so what’s a Snark?]]></title>
            <link>https://meshugah.medium.com/zksnarks-on-ethereum-part-1-all-right-so-whats-a-snark-178da2ab38b?source=rss-45c0db0fed36------2</link>
            <guid isPermaLink="false">https://medium.com/p/178da2ab38b</guid>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[zksnark]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <dc:creator><![CDATA[Vignesh Karthikeyan]]></dc:creator>
            <pubDate>Tue, 11 Dec 2018 18:26:50 GMT</pubDate>
            <atom:updated>2018-12-11T18:26:50.508Z</atom:updated>
            <content:encoded><![CDATA[<p>This is the first segment of a multi-part series of articles describing how to go about implement ZKSnarks using the Ethereum protocol. So, for the uninitiated, what are ZKSnarks?</p><p>So let’s start off Wikipedia’s description of what a <a href="https://en.wikipedia.org/wiki/Non-interactive_zero-knowledge_proof">Non-interactive zero-knowledge proof</a> is:</p><blockquote>“<strong>Non-interactive zero-knowledge proofs</strong> are a variant of <a href="https://en.wikipedia.org/wiki/Zero-knowledge_proof">zero-knowledge proofs</a> in which no interaction is necessary between prover and verifier.<strong>”</strong></blockquote><p>If that still sounds foreign; zero-knowledge proofs let you validate the truth of something without revealing how you came to learn about that truth, as the prover, and without sharing the content of this truth with the verifier.</p><h4>How do zero-knowledge proofs work?</h4><p>The easiest way to explain the process of zero-knowledge proofs is with a non-digital analogy, this is with a fair amount of detail removed but still keeps the central idea intact.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/488/1*ayo0HPHGPQx6jEF5uMysoA.jpeg" /><figcaption>I wish I could make this up, it’s candy roulette!</figcaption></figure><p>Ever Heard of these? The premise is that you and another person with a penchant for some weirdness in their life spin the wheel of (mis)fortune and you and eat the color of bean that the wheel lands on. But here’s the kicker. One of them tastes good and the other <strong>downright awful</strong>. I mean, just look at these:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*j3Ggov8wMnc0icQ3jf_Wkg.jpeg" /><figcaption>Ever wanted eating dog food to be socially acceptable? Well here’s your chance</figcaption></figure><p>So let’s say you have a same-color pair of these, the Toothpaste and Berry Blue(I think the easiest to stomach if it goes wrong), and you, The Prover in this example, know which one is which. Now you hand these over to your friend, the Verifier and he switches these around. The Verifier now has the choice to swap them or keep the beans in the same hand and show them to you. The Prover’s job is to pick the same bean everytime the Verifier shows them.</p><p>This is similar to the case of an actual ZKSnark transaction as there is <em>no data being transferred</em>(the true nature of the jellybean) but a hash of the data being used instead(the deceiving color). The experiment can be repeated over and over to guarantee the required mathematical certainty required for the application.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=178da2ab38b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>