teleren/devto huggingface dataset:
Brief touch on map() , filter() and reduce() methods
Tags: javascript, webdev, react, programming
Published: 2021-01-11 11:48:17

These are a few methods that are highly used in development and knowing these is a must. So let's begin!
# Map:

The `map()` method creates a new array from an existing one and applies the function to each one of the elements of the first array.

eg. 

```jsx
const numbers = [1, 2, 3, 4];
const doubled = numbers.map(item => item * 2);
console.log(doubled); // [2, 4, 6, 8]
```

# Filter:

The `filter()` method returns the values based on the conditional statement. It checks the condition for each element of the array and if the condition is true is returns it otherwise not. 

eg.

```jsx
const numbers = [4, 7, 12, 3];
const evens = numbers.filter(item => item % 2 === 0);
console.log(evens); // [4, 12]
```

```jsx
const students = [
  { name: 'abc', attendance: 96 },
  { name: 'mno', attendance: 60 },
  { name: 'def', attendance: 89 },
  { name: 'jkl', attendance: 65 },
  { name: 'xyz', attendance: 40 }
];

const eligibleStudent = students.filter(student => student.attendance >= 75);
return eligibleStudent; // [ { name: 'abc', grade: 96 }, { name: 'def', grade: 89}]
```

# Reduce:

The `reduce()` method reduces the array to a single value, executing the provided function on each element of the array.

**syntax:**

```jsx
array.reduce(function(total, currentValue, currentIndex, arr), initialValue)
```

Total (The initialValue, or the previously returned value of the function) and currentValue (value of the current element) are required parameters.  InitialValue is optional, it sets the initial value of the array. If no initialValue is supplied, the first element in the array will be used as the initial. Calling reduce() on an empty array without an initialValue will throw a TypeError.

e.g.

```jsx
const euros = [29.76, 41.85, 46.5];
const sum = euros.reduce((total, amount) => total + amount); 
console.log(sum)  // 118.11
```

```jsx
var pilots = [
  {
    id: 10,
    name: "Poe Dameron",
    years: 14,
  },
  {
    id: 2,
    name: "Temmin 'Snap' Wexley",
    years: 30,
  },
  {
    id: 41,
    name: "Tallissan Lintra",
    years: 16,
  },
  {
    id: 99,
    name: "Ello Asty",
    years: 22,
  }
];

const totalYears = pilots.reduce((acc, pilot) => acc + pilot.years, 0); 
console.log(totalYears) //82
```

That's it for this topic. If you learned something, share it with your dev friends. Follow me on [Twitter](https://twitter.com/aidevv_in) for daily tweets about development and tech stuff. Happy coding 👨‍💻❤.
VS Code - REST Client - WSL
Tags: vscode, wsl, rest, postman
Published: 2021-01-11 11:44:09

Usually, I use [Postman](https://www.postman.com/) for doing REST requests.

But from time to time, Postman takes a long time to start or it crashes.

So I had a look into [VS Code](https://code.visualstudio.com/) with [REST Client](https://marketplace.visualstudio.com/items?itemName=humao.rest-client).

It's straight forward to use it. Please find a short [tutorial] (https://dev.to/techwatching/testing-your-api-with-rest-client-h23) here.



![restclient.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1610285988487/vNMYhKI4p.png)

I'm developing on my laptop and also on a VM.
The VM is required to access systems of the client that are running on-premise or in VNet in the cloud. 

My local machine connects through VPN to VM.
Often, I do need to develop in the VM via RDP. 
By using UnitTests and Mocks it's possible to do this on my local machine.  I just need the repositories.

So, I'm not able to REST Client from my local machine, but I can use [cURL](https://curl.se/).

On my VM (Windows 10), [WSL](https://docs.microsoft.com/en-us/windows/wsl/about) is running.

I connect with *ssh* from my local machine to the VM.

```bash
ssh markusm@10...

```


![restclient-ssh.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1610288117377/Ze0ZtdD4H.png)

Then I execute 
```bash
wsl
```

From VS Code, I _Copy Request as cURL_:

![restclient-copy-curl.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1610286760354/OrWmRokPo.png)

And paste it into my terminal on my local machine.

Curl on WSL:


![restclient-wsl-result.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1610287400440/CIYbSw7xC.png)
First post
Tags: beginners
Published: 2021-01-11 11:26:54

Hello, this is my first time on DEV. I've tried to learn Python once, but lost motivation. Therefore this is my second attempt on tring to learn a programming language. I tought maybe joining this community and writing about my journey would help the process. To start it off, i'm going to share 7 tips on how to learn python. Which i am going to try to follow. (These tips might also be helpful for other beginners like me, feel free to use them :)) 

7 tips on how to learn python:
1. Find motivation (be specific)
2. Learn basic syntax and the fundamentals (use only a few weeks)
3. Focus on solving problems
4. Find a tutorial/course 
5. Build you're own projects
6. Increase the difficulity
7. Code everyday(learn something new everyday)
Have you ever considered to be a YouTuber?
Tags: watercooler, youtube, career
Published: 2021-01-11 11:21:30

---
title: Have you ever considered to be a YouTuber?
published: true
description: 
tags: watercooler, youtube, career
cover_image: https://invoicebus.com/blog/wp-content/uploads/2018/03/vlogging-hdr-850x478.jpg
---
In 2020 I saw a lot of dev people starting their YouTube channels and actively posting new content there.

I also compiled I list of some of my all-time favs: {% link https://dev.to/madza/35-awesome-dev-people-to-follow-in-youtube-48c5 %}

Have you ever considered starting your own dev-related YouTube channel? And what are the reasons behind your decision?

If you already have one, share it in the comments!
Excel file Recovery Tool - Recover Damaged Microsoft Excel files
Tags: excelrecovery, excelrepair, msexcel, excel
Published: 2021-01-11 11:17:02

You should use Excel file Recovery Tool which is multi usage application that can repair corrupted MS excel documents simply without any cost. This software embedded with advanced search option which enable the users to search all excel files in the folder Which from you can select required excel files which you want to recover. After recovery, this software save the recovered data into user specified location without any lost data integrity. It has wide range of advanced and well developed feature which make this software more accurate and effective. It provide free demo version that ensure the users about it features and functions.

Visit here to know more:- https://www.filesrecoverytools.com/excel-file-recovery.html
Survey Page
Tags: surveypage
Published: 2021-01-11 11:15:00

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/4789c87uzkwr3xzz5322.PNG)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/i24zmp05byyjvpubdhzt.PNG)

Hey,
I build a simple survey page using HTML using different types. It's quite interesting. 
More to come.
10 Git aliases that will save time and boost productivity
Tags: beginners, github, programming, productivity
Published: 2021-01-11 11:06:03

Like most software developers, I spend a lot of my time in the terminal writing Git commands such as `status`, `commit` and `push` (you know the drill), but when you actually add up all those keystrokes and realise how many seconds/minutes/hours you spend on writing them, that is exactly what it becomes - a lot of time. 

It was pretty early on in my career that I started looking for ways to reduce the time I spent writing Git commands as it was a simple, repetitive task that was ripe for automation. I was then told about aliases and set about creating my own.

Note: My terminal setup is currently iTerm2 + zsh + Oh My Zsh. Here's a [helpful guide](https://www.freecodecamp.org/news/how-to-configure-your-macos-terminal-with-zsh-like-a-pro-c0ab3f3c1156/) to install this setup on your machine. 

All of my aliases live in the `./zshrc` file at `root` and they follow this syntax:

`alias myalias='echo hello new alias'`

Here is the complete list of all 10 Git aliases that I use on a daily basis: 

```
alias gs='git status'
alias gc='git commit -m'
alias ga='git add'
alias gr='git reset HEAD'
alias m='git checkout master'
alias gd='git diff'
alias greb='git pull --rebase'
alias gp='git push'
alias gch='git checkout'
alias gm='git merge'
```

These aliases save me a ton of time and allow me to focus more on ~~copying/pasting~~ writing code. Shaving off a few seconds from every command really adds up and has definitely boosted my productivity as a whole. 

PS. you can use aliases for any commands in the terminal. For example, another one of my favourites is `alias cl='clear'`.

Aliases are super useful and if you can get into the habit of using them, you will soon feel the benefits!
What screen resolution do you have?
Tags: watercooler, hardware
Published: 2021-01-11 10:58:52

---
title: What screen resolution do you have?
published: true
description: 
tags: watercooler, hardware
cover_image: https://gigabytekingdom.com/wp-content/uploads/2019/01/Best-Laptop-Screen-Resolution-1024x512.jpg?x73984
---
I remember my first laptop was 1366x768 and it was quite a pain to code and do anything productive on it.

Currently, I have a 1920x1080 laptop for over two years and it's been easier to fit multiple apps on the screen and be more productive overall. 

Still, there is room for improvement, as I'm thinking about multiple monitor setup in the future. Also, I'm not really into ultra-wides.

What screen resolution do you have?
Advanced Styling using CSS Pseudo Elements
Tags: css, webdev, beginners, programming
Published: 2021-01-11 10:55:11

This article was originally published on <a href="https://www.lindaojo.com/blog/advanced-styling-using-css-pseudo-elements/">lindaojo.com</a>

Last week, I wrote about <a class="link" href="https://www.lindaojo.com/blog/advanced-styling-using-css-attribute-selectors/" target="_blank">CSS Attribute Selectors</a>. This week, we are moving on to CSS Pseudo Elements.

CSS pseudo-elements are used to style specified parts of an element. When used properly, they can create pretty amazing styles. Let's check them out below.

<h3>::first-letter</h3>

The ::first-letter pseudo-element is used to style the first letter of a text.

<h4 class="mb-5">Example</h4>

{% codepen https://codepen.io/LindaOjo/pen/BaLOZME %}

<h3>::first-line</h3>

The ::first-letter pseudo-element is used to style the first letter of a text.

<h4 class="mb-5">Example</h4>

{% codepen https://codepen.io/LindaOjo/pen/BaLOdpa %}


<h3>::before and ::after</h3>

The ::before pseudo-element can be used to insert some content before the content of an element.

The ::after pseudo-element can be used to insert some content after the content of an element.

<h4 class="mb-5">Example</h4>

{% codepen https://codepen.io/LindaOjo/pen/xxEaLyy %}

<h3>::selection</h3>

The ::selection pseudo-element matches the portion of an element that is selected or by a user.

<h4 class="mb-5">Example</h4>

{% codepen https://codepen.io/LindaOjo/pen/mdrGMoy %}

<h3>::placeholder</h3>

The ::placeholder CSS pseudo-element represents the placeholder text in an "input" or "textarea" element.

<h4 class="mb-5">Example</h4>

{% codepen https://codepen.io/LindaOjo/pen/WNGgZrZ %}


<h3>::marker</h3>

The ::marker CSS pseudo-element selects the marker box of a list item, which typically contains a bullet or number. It works on elements with display set to "list-item", such as the "li" and "summary" elements.

<h4 class="mb-5">Example</h4>

{% codepen https://codepen.io/LindaOjo/pen/LYRJzWY %}

<a href="https://lindaojo.com/articles">Read more articles</a>
React: The Difference Between State and Props
Tags: react, beginners, codenewbie
Published: 2021-01-11 10:53:52

When it comes to React, there are two main ways in which we can store or manage data. This article will explain the difference between the two. This article assumes that have some understanding of the following:

- how React works
- how React is written
- functional components
- React Hooks — specifically useState

First things first, there is nothing particularly special about state and props, they are simply Javascript objects that we use to store, manage, and make use of data in our React components. With that out of the way, we can move onto discussing the difference between the two.

**State**

State is just a piece of data that lives inside of a component. The component is responsible for managing this data.  You can think of state the same way you think of variables inside of a function (hence functional components), where the function is responsible for managing and making use of the variables inside of it. State is optional — we make use of it when we need our component to hold some type of information.

**Props**

Similar to state, props (short for properties) is just another piece of data that we can make use of within a component — the difference being that it is a piece of data that is passed down to a component from another component, rather than the component itself being responsible for creating / maintaining it. You can think of props the same way you think of arguments that you pass to functions.

—-

To better showcase this, please check out the [Repl.it I created](https://repl.it/@antdp425/Difference-Between-State-and-Props) — which includes additional comments within the code. The only files that matter here are App.js and Box.js — this is where you'll find all of the comments I added. I suggest starting with App.js

**TLDR**

**State:** data that lives inside a component

**Props:** data that is passed into another component


As always, refer to the docs for more detail:
[State vs Props](https://reactjs.org/docs/faq-state.html#what-is-the-difference-between-state-and-props)

Feel free to reach out on any of my socials for questions, feedback, or just to connect / say hello 👋.
How I built a COVID-19 newsletter with n8n (in just 5 minutes)
Tags: javascript, automation, covid19, n8n
Published: 2021-01-11 10:51:49

# The idea
My idea was quite simple. I wanted to build a corona newsletter, which sends me a daily email with the latest number of corona cases in my region, so I can keep myself up to date without checking multiple websites every day. To keep the whole project simple I also decided to use the open source workflow automation tool n8n.
# The dataset
The biggest challenge at this whole project was the dataset. A simple method to get the data would be to just scrape the website of the local authorities and filter out the important stuff, but I wanted to challenge myself a little bit and build a tool, which will also work in other regions or countries. So, I started searching for a dataset with daily updates.

A dataset, which looked nice to me, was one provided by the European Union. The only problem with it: It doesn’t receive daily updates 😟.

After searching GitHub for a dataset, I found a, currently quite popular, [repository of the Johns Hopkins University](https://github.com/CSSEGISandData/COVID-19). It provides daily reports from many countries in the world and was thus my choice to go on.
# The workflow
After finding the perfect dataset, I started building my workflow by adding a daily Cron node at 7am GMT, so I can get the latest data (they usually publish updates between 04:45 and 05:15 GMT) 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/x0xekokgvkwj4ktokkmj.png)
After that I add a Function Item node, which formats the current date to the MM-DD-YYYY format, so we can use it as filename. 
```js
const date = new Date(new Date().setDate(new Date().getDate() - 1)).toISOString().split("T")[0].split("-");
item.date = `${date[1]}-${date[2]}-${date[0]}`;
return item;
```
Then I made a HTTP Request to get the file binary from the GitHub raw URL and convert the CSV file into JSON using the Spreadsheet File node.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/pr7hop6djrou3b140swo.png)
The only thing, that’s left now, is to filter out the data of a region and sending it through email.
```js
items[0].json.myVariable = 1;
return items.filter(item => item.json.Combined_Key == "Berlin, Germany");
```
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/52lq58qhq81kugeduy7l.png)
# Final words
Seriously, I never thought it would be that easy to build something powerful like this. Next to the possibility to sending emails, n8n also support lots of other ways like Matrix or Slack, which allows you to send this newsletter to the place where you need it the most. 

If you now want to build this project on your own feel free to use my code (you will find it on [n8n’s website](https://n8n.io/workflows/886) and on [GitHub](https://gist.github.com/alexanderschau/39192f90d99d82704a17420eca3105e2)), but I really recommend you, to build it from scratch, because it’s incredible to build something like this in just 5 minutes 😁.
IRCTC Rail Connect app Top ultimate Advanced Features for Online ticket booking 
Published: 2021-01-11 10:37:37

Indian Railway Catering and Tourism Corp Ltd (IRCTC), which manages the online ticketing of trains, has launched a new IRCTC Rail Connect mobile app for fast and easy rail ticket booking in August 2020. But now you can book an immediate online ticket through Rail Connect App.
Indian Railways has recently upgraded the IRCTC Rail Connect mobile app & added multiple features, which is used for online booking of railway tickets.
Latest Ultimate Features of IRCTC Rail Connect Android Mobile App
1.New Users, Sign-up and activate from App directly.
2.Google Android TalkBack attributes to help visually impaired to book train e-tickets.
3.Optimized Enrollment Flow with the simple two-page process.
4.High-security features of self-assigned PIN to login without entering username and password on each login.
5.Aadhaar Linking facility through a mobile app to avail up to 12 train tickets booking in a month.
6.Check PNR status Chances Probability before and after booking train tickets for waitlisted availability
7.Any PNR Enquiry facility to check the PNR reservation status.
8.Enhanced Dashboard with Integrated Menu Bar.
9.Ask without login for trains, routes, and seat availability.
10.Supports Ladies, Tatkal, Premium Tatkal, Divyangjan, and Lower Berth/Sr. Citizen in addition to General Quota train tickets.
11.Current Reservation train tickets booking facility.
12.Integrated with IRCTC e-wallet for quicker and tension-free transactions.
13.Boarding point change facility.
14.Vikalp scheme gives an option to avail confirmed berth/seat in the alternate train to the waitlisted passengers.
15.Online Reservation Chart & facility.
16.Recover your forgotten user Id through the Forgot User Id facility.
17.Syncing of IRCTC Rail Connect Mobile Apps tickets.
18.Now users can view, cancel, or file TDR of train e-tickets booked by the official website or IRCTC Rail Connect mobile apps and vice-versa.
19.Users can view the status of e-tickets booked through our authorized Online Travel Agents.
20.users can view and cancel old mobile app tickets also. 
The level of all these features will be more advanced compare to other applications, which offer an online ticket booking system. In the most app, the station search entry is still alphabetical, with availability status either not timely or outdated. In add-on, this advanced e-ticketing application features unified booking facilities for lodging and meals.
<b>About the Author:</b> 
<a href="http://yoappstore.com/">Yo App Store</a> is a <a href="http://yoappstore.com/mobile-app-development company.php">Mobile App Development Company</a> offer wide range of Application Services like Android Mobile App Development , <a href="http://yoappstore.com/ecommerce-app-development.php">E-Commerce App Development Services</a> & IOS App Development Services.
<a href="http://yoappstore.com/">Start Your 7 Days Demo</a>
The light decision for React state 👋
Tags: frontend, react, javascript, typescript
Published: 2021-01-11 10:37:22

Reactive state manager for React by 1.34 kilobytes (_based on [reactive-box](https://github.com/betula/reactive-box)_).

[Light](https://bundlephobia.com/result?p=realar), [Fast](https://github.com/betula/reactive-box-performance), and Pretty looked :kissing_heart:

[Realar](https://github.com/betula/realar) targeted to clean code, minimal abstraction, minimal additional functions, modulable architecture, and time of delivery user experience.

You can start development with knows only two functions :wink:

`box`. Reactive value marker. Each reactive value has an immutable state. If the immutable state will update, all React components that depend on It will refresh.

`shared`. One of the primary reasons for using state manager in your application is a shared state accessing, and using shared logic between scattered React components and any place of your code.

```javascript
import React from 'react';
import { box, shared } from 'realar';

class Counter {
  @box value = 0;

  inc = () => this.value += 1;
  dec = () => this.value -= 1;
}

const sharedCounter = () => shared(Counter);

const Count = () => {
  const { value } = sharedCounter();
  return <p>{value}</p>;
};

const Buttons = () => {
  const { inc, dec } = sharedCounter();
  return (
    <>
      <button onClick={inc}>+</button>
      <button onClick={dec}>-</button>
    </>
  );
};

const App = () => (
  <>
    <Count />
    <Buttons />
    <Count />
    <Buttons />
  </>
);

export default App;
```

For best possibilities use [realar babel plugin](https://github.com/betula/babel-plugin-realar), your code will be so beautiful to look like. [See wrapped version on CodeSandbox](https://codesandbox.io/s/realar-counter-k9kmw?file=/src/App.tsx).

The next set of possibilities I will enlighten in the future article!:relieved:

[Realar Github link](https://github.com/betula/realar).

## From the author

Hello everyone who read me! One year ago I decide that Open Source is a necessary part of my [Ikigai](https://en.wikipedia.org/wiki/Ikigai) and I serve by that day. 

I was deep research in React applications state management, more than one year of coding under that, a lot of versions different syntax constructions.., but as result, I took best from exists and packed to minimal performant code :blush:

I will be happy to receive your opinion and thoughts about its library! And what you think, can it help people make their code feeling better?
Different definitions of cloud-native
Tags: cloudnative, kubernetes
Published: 2021-01-11 10:13:00

What does "cloud-native" mean? I recently had a discussion about this, and 2 people were talking about totally different things. Here's my take on the different stances, and why a business opts for one over the other.
https://mark-mccracken.medium.com/different-definitions-of-cloud-native-cf793859e332
Saffron Bahraman
Published: 2021-01-11 10:08:02

Saffron Bahraman là sản phẩm thuộc Bahraman Saffron Company – Một trong những thương hiệu nổi tiếng về Saffron tại Iran và nước láng giềng Dubai có trụ sở tại Iran. Nhụy hoa nghệ tây được tuyển chọn để sản xuất được kiểm soát nghiêm ngặt trong suốt quá trình từ trồng trọt, gieo trồng, thu hoạch đến phân loại và đóng gói thành phẩm, sử dụng phân bón hóa học trong hạn mức cho phép để người dùng cảm nhận được rõ nét nhất về hương vị và hiệu quả khi sử dụng.
From: https://saffronviet.vn/saffron-bahraman-la-gi/