Let’s say you’ve developed a project in JS and want to share it with the world, whether it's a simple project which draws a circle (okay, this might not be the package you want to publish) or a complex one which you want to be used by thousands of developers like Jquery, you can publish them on NPM.
We’ll have 3 parts to this:
So, you have your project. You want it to be in a package-ready format to publish when you’re ready. …
As the COVID-19 outbreak rages on, a good look at the outbreak would help. And when I saw a video by 3b1b on simulating epidemics, I tried to recreate what he did. So lets get started.
Since we need to put our graphics somewhere, we create a canvas in HTML and initialize it in JS.
Your browser does not support the canvas.
And our JS:
var cv = document.getElementById("canvas")
var c = cv.getContext("2d") …
Originally published at https://dev.to on January 3, 2021.
A couple of months ago I had the idea to create a programming language. Yeah, crazy right?! Okay, but in all seriousness, learning to create programming languages helps you better understand computers.
“If you don’t know how compilers work, then you don’t know how computers work. If you’re not 100% sure whether you know how compilers work, then you don’t know how they work.”
— Steve Yegge
So, I went along googling “how to create a programming language” and “creating a programming language.” You see, the problem here is that there are not too many proper tutorials that help you create a programming language, especially for beginners. I literally was about to switch my search engine to DuckDuckGo or even Bing! Now, I did find a couple of different resources, so I’ll share them with you now, so you don’t have to go through the long time it took me. …
Twitch, Visual Studio Code, WhatsApp, and Microsoft Teams, just to name a few, are all apps that are created with Electron. But why use it? What is it? What makes it better than another framework? And finally, of course, how do you use it? Let’s dive in deep with Electron to answer these questions.
Today, we are going to code a simple differential privacy algorithm with python. So, lets get started!
Differential privacy is really simple. Let’s say, I have a data set of info about people which I want to publish, but still keep their data private. That’s where differential privacy comes in. It takes your data, and alters it in a way that will keep overall facts about your data in the same area (with more complex algorithms you can alter how close you want it to be) while keeping individuals data private.
Okay, let’s get to the details of how we are going to alter this data. We want to start simple, so we’ll code the Random Response mechanism. This is the most simple mechanism for differential privacy. It flips a coin, if it is heads, then it keeps the same value. If it is tails, it flips it again, and if it is heads, it returns true, and if tails, then it returns false. Now, again, as I said before, this is a very simple algorithm so it only works with zeros and ones or
false . …