teleren/devto huggingface dataset:
Javascript Currying and partials
Tags: javascript, currying, partials, closures
Published: 2021-12-13 14:47:46

Currying and partials have become the common interview questions for Javascript nowadays. These are very important to functional programming. While underlying concepts is common in both of then there are some differences as well

## Currying

Currying is pattern in which a function which takes multiple arguments is transformed into series of function which takes one argument and produce the same result.

`sum(2,3)` is transformed to `sum(2)(3)`

To achieve this we need to have curry function which takes any function as an argument and transform into a curried function.

Though it may look complex the underlying logic is simple and easy to understand if you know about Javascript closures. We need to compare the number of arguments which is passed to the curried function with that of function signature. As long as it is lesser than that of function signature, We need to return a closure which will have reference to earlier arguments like this:

```
function curry(func){
  return function curried(...args){
    if(args.length >= func.length){
       return func.apply(this,args)
    }else{
       return function(...args2){
         return curried.apply(this,args.concat(args2))
       }
    }
  }
}
```

```
function sum(a, b, c){return a+b+c}

sum(1,2,3) //6

let c1 = curry(sum);

c1(1,2,3) //6
c1(1)(2)(3)  //6

```

## Partials

A partials function takes a function and return a function which takes fewer arguments.Some arguments are kind of attached to it internally. This is also implemented through closures and are similar to currying

Lets us assume we have function which multiply two number

`function multiply(a,b){return a * b} `

We can use the multiply function to create a Square of a number.

```
function createSquarePartial(fn){
  return function(args){
    return fn(args,args)
  }
}
```
We can then use it to transform the multiply function to take a single argument and return the square of it.

```
var getSquare = createSquarePartial(multiply)
getSquare(5) // 25
``` 
Thus we can see getSquare takes a single argument and return the square of the number using the multiply function.
To Blockchain or not to Blockchain
Tags: blockchain
Published: 2021-12-13 14:36:51

I just completed my course on **Ethereum** and **blockchain** to climb the Web3.0 hype train. I did a small project on the same and here is the git link: 

{% github subramanya4shenoy/ethwork %}

## What I understood:

It looked blockchain and solidity might require few more years to catch up with developers and make things easier to integrate.

**Solidy** is still in version 0.8.x .

All the code looks like Boiler plates and templates.

Once deployed in main net there is a gas price to be payed (real money ~ Ether ~ crypto) which is a setback. Money gets deducted for each transaction. Even though the fee is less it doesn't makes any sense to deploy a test project in main net. Just the way a regular/pet projects we host, it will never be possible.

Currently, we use blockchain to a 'producer to consumer chained process'. Or a system which runs 100% autonomously without any user interventions. Best example of this is Currencies. Currencies are mined automatically and circulated and all the flow and transactions are kept in the network. each currency is nothing but a hash string. but this string is uniq and cannot be recreated (decoded). So, every entity say, currency or NFT is nothing but a hash string. The value of this increase/decreases via trading. As many hash strings (or many coins) get mined it will be very difficult to mine more coins (or the hash string) so there is a fee which goes towards mining (it will go to a miner who finds the hash). Also, once found this particular hash will be updated throughout the network and even then a small fee is payed. Both of these fee included is called as gas fee. This gas fee can be charged to the owner who requests for the new key.

Based on the top points, The industry in which these features are required is Banking transactions and currency related. So there are hand full of companies/projects which flaunt about using block chains for this. Those are called as deFi = decentralised Finance.

Just like deFi, we do see lot of other projects too.. like, deSo = decentralised Social etc.. But I do not see any actual use of blockchains in them. They are probably using token system (deFI) inside their projects and the front cover is always a regular Web2.0  social networking sites.

Currently, I don't see any practical use of blockchains in our regular projects or activities. I might be wrong (I hope). If you know anywhere blockchains implemented differently or some of the project if you can suggest me that will help me to change my perspective.
How to build a Quality Culture in our team
Tags: qualityassurance, bdd, atdd, sbe
Published: 2021-12-13 14:36:22

This is one of my favorites questions, and actually, is one of the hardest one to achieve, we should keep in mind these two premises: 

1. Quality is not a one person job/responsibility
2. We don’t have only one Quality approach for a project, it changes based on the phase

What does this mean? Basically, the first one talks about keep the stakeholders (internal and externals) aware that the quality of the project relies on the whole team, and to achieve this, we can do it keeping a good communication to avoid misunderstanding on the system behavior as well as preventing defect in the code (this also could affect functionality), some techniques that can help us with this are:

- Acceptance test-driven Development (ATDD): this approach is related with Test-driven Development (TDD) but is more focused on the stories, as TDD creates tests for the units to confirm that we are doing the things right, ATDD is defining automated test scenarios before the development to confirm that we are doing the right thing.

- Behavior-driven Development (BDD): the main difference with ATDD is that BDD focuses on the behavior of the feature using the Given-When-Then structure to keep a common language between the team, and ATDD focuses on capturing the accurate requirements when included the stakeholders in its definition.

- Specification by example (SBE): the main approach of this is capturing and illustrate the requirements using realistic examples instead of abstracts statements.

The main objective of these three approaches is to have a collaborative definition of the requirements and the business understanding inside the team, with this, we will avoid misunderstandings and will keep everyone focused on objectives, also this help us to we achieve the second approach, because as the quality change based on the phase on the project, we will let the team know the main quality approach for each phase, of course we always have a general objective for the overall quality like, talking about a online clothes store, the main objective will always be let the people buy our clothes online, but what happen if we want to add some offers for the Christmas season? We will have a new main quality objective of adding the offers to the page, right? What about when Christmas season finish? The approach will change to, remove the offers to avoid any issue with out customers, and so on.
Let vs Var in JS
Tags: javascript, beginners, tutorial, webdev
Published: 2021-12-13 14:23:28

Yeah 🤓. Today we **must** starting learning more about how really _JS_ works. It should be really strange but don't worry about that, I will try to make it really clear and understandable to make sure that you have just understood it 🥰

First of all, we should **understand** 🙀 what is exactly a variable, a _variable_ is a container when you can save whichever data you need, think in a **container**, you can save a data inside it and make sure that it will be safe 🤓. The main point is that it will be safe until your program die, let's doing an example:

```js
var myName = "Manu"
console.log(myName);
``` 

As you can see above, we have just made a _brief_ example where we have saved up my name into a value 🤝, but **STOP**, saving data inside `var` is really dangerous, it hasn't had any scope, the data can change whenever you want, imagine that this data need to be always the same, it means isn't able to change it, then I introduce you `constants`, let's see an example:

```js
const myName = "Antonio",
```

This is exactly what a constant looks like, his value will never change, you can be sure of that. But then, 😵‍💫

## What are the different between `var` and `const`?.

The const will never **mutate** 😇. This is the key.

Nevertheless, there are another way to get a `variable` in JS, and it's the best approach to make your `vars` more secure, it's a pleasure to meet you `let`, let's see an example: 

```js
let myAge = 20;
console.log(myAge);
```

## What is exactly that 🤓?

Apparently it's the same meaning that `var`, it's able to mutate and re-asign a new value, but `let` is `block-scope`, it means understand what is exactly a scope, then if you declare it inside an if it won't never mutate 🤕, let's see an example:

```js
if (true) {
  var myName = "Manu";
}
myName = "Antonio";
```

In this code, we can mutate the value from the `var` because `var` doesn't understand why it shouldn't mutate, however look at the following example: 

```js
if (true) {
  let myName = "Manu";
}
myName = "Antonio";
```

Oh **shit** 💩!!!, it gets an error because `let` understand that you have just declared inside an `if` scope, then why did you want to mutate this value? Here, you can see clearly which is the difference between `let` and `vars`.

I hope you have just _understood_ ☺️ why using a var is a good practice when you are writing your code. If you have any question please don't hesitate to write a comment 😙, it will be a pleasure to help you.
Backface filter blur is not applying to fullscreen.
Tags: css, beginners, html, design
Published: 2021-12-13 14:21:59

I am trying to give my backgroung blur effect using backdrop filter, but it is not applying to the whole screen. It leaves the bottom part of the screen.

I don't know why, but the screenshot is not uploading so I am sharing the link to screenshot:
[link](https://drive.google.com/file/d/174ZzN1mfsT0097GRNVYxRGu-prh3cYib/view?usp=sharing)

HTML
```
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="Contact.css"/>
    <script defer src="Contact.js"></script>
    <title>Document</title>
</head>
<body>
    <main id="main">
        <section>
            <h1 id="heading">
                CONTACT US
            </h1>
            <form id="contact" onsubmit="NextPage();return false">
                <input type="text" name="name" placeholder="Name" id="name" required/>
                <input type="email" name="email" placeholder="E-mail" id="email" required/>
                <input type="text" name="sub" placeholder="Subject" id="subject" required/>
                <input type="text" name="mess" placeholder="Your Message" id="message" required/>
                <textarea rows="5" maxlength="300" placeholder="Type your queries here" name="query" id="query"></textarea>
                <button type="submit" name="submit" onclick="NextPage()" id="submit">Submit</button>
            </form>
        </section>
    </main>
</body>
</html>
```

CSS

```
body{
    height: 100%;
    margin: 0;
    display: grid;
    align-items: center;
    justify-items: center;
    background-image: url("Background4.jpg");
    background-size: cover;
    backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}
main{
    padding-top: 10%;
    display: grid;
    align-items: center;
    justify-items: center;
}
section{
    position: relative;
    width: 50%;
    height: 100%;
    display: grid;
    text-align: center;
    align-items: center;
    justify-items: center;
    border: 3px solid red;
    border-radius: 7px;
    background-color: aquamarine;
    padding-bottom: 3%;
}
#heading{
    color: red;
    text-shadow: 50px;
    margin-bottom: 20%;
    font-size: 30px;
    text-decoration: underline;
    font-style: italic;
}
#name, #email{
    width: 42%;
    margin: 1%;
}
#subject{
    width: 90%;
    margin-bottom: 1%;
}
#message{
    width: 90%;
    margin-bottom: 1%;
}
#query{
    width: 90%;
}
#submit{
    width: 30%;
    padding: 2%;
    margin-top: 10%;
    border: 1px dashed red;
    border-radius: 7px;
}
input{
    border: 1px dashed red;
    border-radius: 7px;
}
textarea{
    border: 1px dashed red;
    border-radius: 7px;
    resize: none;
}
```
Empleos en Data y Analytics LATAM — Dic. 2021 - I
Published: 2021-12-13 14:19:03

Te compartimos las ofertas laborales del mes para áreas de Data, Analytics y Cloud 👨‍💻👩‍💻.
✅[Data Analyst- MINSUR (Perú)]
(https://pe.indeed.com/viewjob?jk=d131fe686f1d97e8&tk=1fmq1m5uqu46r800&from=serp&vjs=3)
✅[Data Scientist - Banco Pichincha (Ecuador)]
(https://ec.indeed.com/viewjob?jk=2908a8da9cf3133b&tk=1fmq1mhcku3up800&from=serp&vjs=3)
✅[Data Engineer- PayU (Colombia)]
(https://co.indeed.com/viewjob?jk=2ea763a9a4af4cf1&tk=1fmq1v34vu3in801&from=serp&vjs=3)
✅[Machine Learning Analyst - McKinsey & Company (Chile)]
(https://cl.indeed.com/viewjob?jk=d1afb6751fa77631&tk=1fmq1t9cou566800&from=serp&vjs=3)
✅[Data Analyst - Citi (Mexico)]
(https://mx.indeed.com/viewjob?jk=218ce5e7dc02fff2&tk=1fmq2cmd631j8000&from=serp&vjs=3)
✅[Data Engineer- Aha! (Bolivia)]
(https://www.linkedin.com/jobs/view/2820924547/?alternateChannel=smljob&eBP=CwEAAAF9tCNwJTFoS3n5LSqBmk0a18hVwoqhuhvkBL80Dbf1MZcDOGAbfp2MXA_Jowf83eUF-X-wWLhOhL1Hffep_0mH88ILreYNH3HBi-JkjTsZ2gdB8m6SU22-W65TRti213wBoYJMD8MpyKPT2hOnkGTpwIQMEMlSBQfGMhGvco6Vcsj0FK4foznzmaxHegI_-_h7jXIvl5bxgzYVBv_vzOuKMdX0vwMls81hXfntsb3zZuvrO4Q0c-anbj-u7DFBywiIhkRwg3AjOplABHMydUNjPOo7k4XCcUUCuUfSU1VFF4IYY4Z891rnUOUq8vSpGUL75wJU1E6ZeQ5MOMS1GFpyTve38xG6ba4GGygj9r0YstCCvY9tnc4&refId=CioY3iiaMf2KcveUISQ5dA%3D%3D&trackingId=pphzLvC6HeqXzedVd6mMng%3D%3D)
✅[Data Scientist - JPMorgan Chase Bank, N.A. (Argentina)]
(https://ar.indeed.com/viewjob?jk=43a4853abc011875&tk=1fmq2c58hu3ah800&from=serp&vjs=3)
✅[Machine Learning Analyst - Vidlogs (Venezuela)](https://ve.indeed.com/viewjob?cmp=Vidlogs&t=Full+stack+developer&jk=d1d4fba31bc29fec&q=Machine+Learning&vjs=3)



Aprende, aplica y crece en proyectos de Data y Analytics en Cloud.

Visita nuestra página:
👉🌐 datahack.la
Day 89/100 Sticky
Tags: 100daysofcode, programming, motivation
Published: 2021-12-13 14:18:13

To make something relevant, one must have an idea to make it more functional and stick to that proposal to make it workable and effective. A strategy that makes sense when everything seems not working according to plan and puts out another method to get through the hurdles on the way. After achieving the designated position, one would benefit from the changes ahead because it possesses the role before claiming it to be the actual holder. Often, the highest rank is compost of a mountain of irrelevant ideas and make things work by gaining support on small strategies that are anonymous and unknown to the public. 

![banner](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mxe53kjkpb6e65xym71o.png)

## Position

The default position of an element can be changed by setting its position property. The position property can take one of five values:

- `static` - the default value (it does not need to be specified)
- `relative`
- `absolute`
- `fixed`
- `sticky`

## Sticky

- The `sticky` value is another position value that keeps an element in the document flow as the user scrolls, but *sticks* to a specified position as the page is scrolled further. This is done by using the `sticky` value along with the familiar offset properties, as well as one new one.


## Code Snippets

```
let groceryItem = 'papaya';

switch (groceryItem) {
  case 'tomato':
    console.log('Tomatoes are $0.49');
    break;
  case 'lime':
    console.log('Limes are $1.49');
    break;
  case 'papaya':
    console.log('Papayas are $1.29');
    break;
  default:
    console.log('Invalid item');
    break;
}
```

## [a11y myths](https://a11ymyths.com/)

**Blind people don't watch movies**

> They definitely do. With the help of audio descriptions they can watch and listen to any media content as all other people do. 

[![Resource](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pllsmr77s0usjjrnm6y7.png)](https://www.w3.org/WAI/media/av/description/)
Starting the JS cheatsheet journey
Published: 2021-12-13 14:11:26

For starters I’ll be following the [mozilla JS](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Introduction) developer guide and go through this while trying things out along the way.

 When I say I want to start from the beginning, I really mean “the very beginning!”:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sdxj1vppj8vxgtegrcgc.png)
And a good reminder on declarations and their uses:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wycplce7dgcg4i8cfxk8.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eh7uk9pzjpitwuegtcia.png)
Web Components: Flashcard
Published: 2021-12-13 14:02:52


Our group this semester, we have created many things including a functional and reusable button and a learning objectives card. To wrap up our final project, we have taken on the creation of a flashcard.

###Beginning###

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/goidxst3jkf4jos193e7.PNG)

We were given a starting point of a flashcard, in which our group took the time to dissect this card and break it down into multiple parts. We decided that this flashcard would have an image area, the body that holds the user input, the checking button of the answer, and a retry button.

###The Journey###

Our group spent many weeks figuring out the styling, functionality, and performance of this flashcard.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8cktop634zvsapvyhxm2.PNG)

The above image is our replica of the example flashcard. We made sure to include all possible features and functionality that a flashcard should have if you were to see one out on the web. Below are the checking of the user input and the retry functionality.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pmfuzpzzyu34owzzzayn.PNG)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uqy9dugujmyx8ro6cvl9.PNG)

Our group wanted to display whether or not the user correctly or incorrectly answered the flashcard question, using icons showing a checkmark for correct and a red X for incorrect. We used simple colors for our styling on our flashcard.

###My Role###

My job on this flashcard started out with the creation of the check answer and retry buttons, while also adding their correct functionality when input was included by the user. Using past projects, I was able to go back and figure out how to create something simple, like a small button, and make it look like our example flashcard.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t08m5vx2c63h9zjaovdt.PNG)

Below is some of the checking answer functionality of the check answer button.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l16kb0cur44o3jn3iusr.PNG)

###The End###

If you want to take a more deeper dive into this flashcard creation, our Github (and soon our NPM) will be linked below.

[Github Link](**https://github.com/TheKodingKrab/flash-card**)
Web3 with Refine
Tags: web3, dapps, refine, tutorial
Published: 2021-12-13 13:41:40

---
canonical_url: https://refine.dev/blog/web3-with-refine/
---

## What is Web3

Web 3.0 eliminates intermediates. There’s no centralized database that stores the application state.

In web3, developers don't usually build and deploy applications that run on a single server or that store their data in a single database.
Instead of, Web3 applications run on blockchains, decentralized networks of many peer to peer nodes

Features provided by Web3:
* Verifiable
* Self-governing
* Permissionless
* Stateful
* Trustless
* Native built-in payments
* Anonymity

## What is dApps(Dapps)?
Dapps is short for "Decentralized Applications" and refers to any application that is decentralized in nature, built on a blockchain, and may use tokens for transactions.

Dapps is just like any other software application you use. It could be a website or an app on your phone. What makes a Dapp different than a traditional app is that it's built on a decentralized network, like Ethereum.

Many applications on the logic of dApp have been developed and continue to be developed.

[Here you can browse some dapps](https://ethereum.org/en/dapps/)

We have developed a simple app where you can login with ethereum and send ethereum over the network using Metamask Wallet and **refine**.

This application allows you to login with your web3 wallet and you can also send ethereum over the ethereum network.

This example is simple intro to dApps development  built with web3 and **refine**.

![Login](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ipsay1k4rfk4o4a8d94o.gif)

![Overview](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m5s61v7squ5fbfy7pxjv.gif)
 
You can develop many fast and functional dApps using web3 and **refine**.

[Code Example](https://github.com/pankod/refine/tree/master/examples/web3/ethereumLogin)

[Guide](https://refine.dev/docs/guides-and-concepts/web3/ethereum-signin/)

[Live Code Example](https://codesandbox.io/s/signin-with-ethereum-umho3)
Advent of Code 2021 - day 2
Tags: functional, typescript, adventofcode
Published: 2021-12-13 12:50:12

https://adventofcode.com/2021/day/2

Day 2 appears to be a parsing problem. So given
```
forward 5
down 5
forward 8
up 3
down 8
forward 2
```
We want to increment the X co-ordinate when going forwards and either increment the Y co-ordinate when going up or down.

To solve this, I am first going to map my strings into tuples representing the change in X or Y. So down 5 gets translated into (0, -5). I am also going to create a monoid under sum and fold over my tuple array to get my final change in X and Y.

-- Part 2
This introduces an aim concept. To solve this, I am re-using the tuple mapping from part 1 and I will need a reducing function that takes in a current [horizontal, depth, aim] and a [forward, updown] tuple and produces a new [horizontal', depth', aim'] tuple.  

https://codesandbox.io/s/reverent-fast-ytbx3
⚠️ CRITICAL update for ParseJS/ParseTS! ⚠️
Tags: javascript, typescript, watercooler, bugfix
Published: 2021-12-13 12:46:12

A [new commit](https://github.com/CalinZBaenen/ParseJS/commit/78ec5f7e7addeab9d9eca7c64be6b54025360d57) to the [ParseJS GitHub repository](https://github.com/CalinZBaenen/ParseJS) was made.

It fixes a critical bug related to the output the function returned.

##The intended behavior.
`parse_string` usually returns an array that contains either a length-one-`string` (`char`) or `symbol`.
A symbol is inserted into the returned array IF a symbol is found. - I.e. if you pass the arguments: `"test + test", ["test"]` two `symbol`s containing the description `test` will be inserted.
Otherwise, if a valid token isn't found, it will insert the current character

So, all together, if you pass in `"test + test", ["test"]`, you should (and WILL) get `[Symbol(test), ' ', '+', ' ', Symbol(test)]`.

##The bug.
The bug is that "ghost" characters would be inserted into the output array if a token candidate didn't match the potential token in the string.

##A visual demonstration of the bug.
This is a before and after of the bug fix:
![Before update.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cvimn31jn9qvtozusbzn.png)
![After update.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2pz26ksz0g60d2lejev9.png)



<h1><b><center>Thanks for your attention!<br/>Cheers!</center></b></h1>