teleren/devto huggingface dataset:
Node.js/Express RestAPIs Example - POST/GET/PUT/DELETE requests
Tags: node, express, restapi
Published: 2021-04-09 16:11:02

https://grokonez.com/node-js/nodejs-restapis-how-to-create-nodejs-express-restapis-post-get-put-delete-requests

Node.js/Express RestAPIs Example - POST/GET/PUT/DELETE requests

In the tutorial, we're gonna look at way to create NodeJs/Express RestAPIs with Post/Get/Put/Delete requests.

Related posts:
- <a href="https://grokonez.com/node-js/how-to-setup-node-express-development-environment">How to setup Node/Express development environment</a>

<!--more-->
<h2>Overview</h2>
<h3>Demo</h3>
<iframe width="853" height="480" src="https://www.youtube.com/embed/cw43v48rqEY?rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
<h3>Goal</h3>
We create a NodeJs/Express RestAPIs project that has structure as below:

<img src="https://grokonez.com/wp-content/uploads/2018/04/nodejs-express-restapis-project-structure.png" alt="nodejs express - restapis - project structure" width="481" height="182" class="alignnone size-full wp-image-11557" />
<pre><code class="language-javascript">
/nodejs-restapi
	/app
		/controllers
			customer.controller.js
		/routes
			customer.routes.js
	/node-modules
	package.json
	package-lock.json
	server.js
</code></pre>

The project create a set of Rest-APIs for POST/GET/UPDATE/DELETE APIs:
<ul>
<li><code>/api/customers</code> - GET all customers</li>
<li><code>/api/customers/:id</code> - GET a customer by Id</li>
<li><code>'/api/customers</code> - POST a customer</li>
<li><code>/api/customers/update/:id</code> - UPDATE a customer by Id</li>
<li><code>/api/customers/delete/:id</code> - DELETE a customer by Id</li>
</ul>
<h2>Setup NodeJs/Express project</h2>


More at: 

https://grokonez.com/node-js/nodejs-restapis-how-to-create-nodejs-express-restapis-post-get-put-delete-requests
Fiction Reading for Software Engineers
Published: 2021-04-09 15:58:45

My favorite line in the Harry Potter movies is zombie Dumbledore towards the end:

> Of course it's happening inside your head, Harry. Why should that mean that it's not real?

Software engineering is primarily a people problem. Software engineering also happens entirely in your head.

When you read good fiction books you begin to build the muscle of creating a good story in your head. You can build out worlds and mental models more easily. Same for playing games like D&D.

Bring this skill and habit to engineering in how you think and communicate the non-fiction reality in terms that pulls others in and captures their imagination and in the end creates clarity and cohesion.
DevOps Mentoring
Published: 2021-04-09 15:58:01

I recently have been looking at mentoring and what I can bring to the table.  
I would really appreciate it if you could tell me your opinions and maybe share this blog post with people in your network.  

- Are you interested in learning DevOps?
- Do you have any notions of DevOps? 
- How do you see DevOps?
- What subjects are you the most interested in?

Thank you for your answer!
Introduction to AWS Graviton2 Processor
Tags: aws
Published: 2021-04-09 15:51:50

Amazon has stepped up for its custom chips. Annapurna Labs which was acquired by Amazon in 2015 is a microelectronics company that has helped amazon develop its own custom chips. These chips deliver high power and provide efficient solutions. Amazon had developed its Nitro card systems in 2017 which were secure and efficient. It provided Hypervisor, network, storage, and security features. Then AWS came up with AWS Inferencia which provides Machine Learning acceleration capabilities. Finally, now amazon has released AWS Graviton2 which is its most powerful and efficient processor which is now powering EC2 instances. AWS Graviton2 processor is designed by AWS utilizing Arm Neoverse N1 cores. It is manufactured using a 7nm technology with a transistor count of 30 Billion. It is Arm v8.2 compliant with 64 cores. It has a large 64KB L1 caches and 1MB L2 cache/vCPU with Dual-SIMD units with Instructions to accelerate ML inference int8, fp16, and 8x DDR4 3200 channels with no LUMA concerns. Every core sees the same path to memory and other cores. The point to the above numbers says in English that the Graviton2 based EC2 instances provide 4x compute cores, 7x performance, and 5x faster memory vs its 1st Generation. The EC2 instances which are Graviton2 powered are M6g, R6g, C6g, T4g, C6gn, and some others. The main benefit of using this is 40% price/performance vs comparable instances. Many AWS services are now available using this including Amazon ElastiCache, Amazon EMR, Amazon RDS, and many more coming. Graviton2 also provides CPU power efficiency with higher density, lower costs, and a lower carbon footprint and increases CPU efficiency by 3x. In software support, many Linux distributions now support graviton2 and have support in docker and Kubernetes.
A short story about web apis
Tags: discuss, webdev
Published: 2021-04-09 15:46:48

Developing a WEB API !!. Initially, I can say I know how to do this or at least I know the basics, but this time I wanted to know some history, who first used the WEB APIS  and who gave this name to it, how it developed, and what drove these big companies To use WEB APIS 

This story to my knowledge starts in 2000  with salesforce They wanted to change how people work on the Internet. In addition, they wanted to enter another interface that machines understand and communicate with as well. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/omvaw60ph4i4zod2r4he.JPG)

It was not more than a year Ebay say's I'm here, They launched their own API under the name EBay application programming interface,  but it was not available to everyone

 Ebay and Salesforce is not alone here  , a two years later Amazon and flicker did the same

But What About Facebook and Twitter !! , they have launched their own web apis  because of the people who use the web crawler and web scrapper on their pages or those who create a rogue web apis,
same thing happened to google map apis.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dinbagsmxfrb9imixqea.JPG)

Amazon was not the first, but it made a step that will lead us later to the world of cloud computing, Amazon launched the S3, through this service everyone will be able to store or extract any amount of data.

WEb Apis now is a big business , in mars 2010 twitter was serving 
70,000  call Every Second, and in mars 2017 , 1000 million users access their banking accounts from mobiles and of course, these phones or applications connect to a web api somewhere

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ca0qmkrjr0ozfz88s2ks.JPG)

After reading some history, I began to ask about how to successfully develop the API and what are the stages that I must perform,  I found some blogs they were  talking about what they call the API lifecycle and this is what I will talk about in the next post :) 

## For Further Exploration : 
- [Architectural Styles and
the Design of Network-based Software Architectures](https://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm)
- [History of apis](https://apievangelist.com/2012/12/20/history-of-apis/)
- [Who invented the apis](https://nordicapis.com/who-invented-the-api/)
How-to Structure a Q&A ML App
Tags: python, deeplearning, machinelearning, datascience
Published: 2021-04-09 15:42:47

{% youtube 4Jmq28RQ3hU %}

I'm planning on doing something different, a series of videos where we work through the steps - from start-to-finish - of (attempting) to build a Q&A web app that answers our questions with Stoic answers.

In this video, I'm outlining the idea and describing the high-level setup that I think we'll need to put together. It should be cool!

We'll be using the Haystack framework for 'Q&A at scale', which using HuggingFace transformers under-the-hood, and the Elasticsearch document store.
Deprecating AppSync Queries
Tags: graphql, aws, appsync
Published: 2021-04-09 15:58:04

---
title: Deprecating AppSync Queries
published: true
date: 2021-04-09 15:36:38 UTC
tags: GraphQL,AWS,AppSync
canonical_url: https://justwriteapps.com/deprecating-appsync-queries
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f6yvi0zneli6kr0b0hn6.png
---

How do you handle the awkward transition phase when you're replacing a query in the backend, but the frontend hasn't been updated to use the new query? The answer is `@deprecated`!

Well, the answer isn't deprecated itself 🤦. You can annotate the old query with `@deprecated` and the schema documentation will be updated to show the query as deprecated and show the provided reason.

```graphql
type Query {
    oldQuery(input: OldInputType): Result! @deprecated(reason: "Use the newQuery")
    newQuery(input: NewInputType): Result!
}

```

Now when you view the schema documentation, you will get a deprecation notice.

![Deprecation Notice](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bi9gclinwopdj9su2emf.png)

The problem with stopping here is there's no indication of this returned to the client.

```json
{
  "data": {
    "oldQuery": {
      "value": "Old query result"
    }
  }
}

```

If you want the client to get this deprecation notice, you can add the following statement to the response resolver template.

```velocity
$util.appendError("oldQuery is deprecated, use newQuery instead", "DEPRECATED")

```

Now when you run the query, you get an error in the results.

```json
{
  "data": {
    "oldQuery": {
      "value": "Old query result"
    }
  },
  "errors": [
    {
      "path": [
        "oldQuery"
      ],
      "data": null,
      "errorType": "DEPRECATED",
      "errorInfo": null,
      "locations": [
        {
          "line": 2,
          "column": 3,
          "sourceName": null
        }
      ],
      "message": "oldQuery is deprecated, use newQuery instead"
    }
  ]
}

```

If you want to experiment with deprecation, or appsync in general, I've created a sample project.

[https://github.com/just-write-apps-blog/deprecated-query](https://github.com/just-write-apps-blog/deprecated-query)
How do you bookmark and take notes?
Tags: help, discuss, programming, watercooler
Published: 2021-04-09 15:31:49

As developers, we encounter a huge amount of information every single day. 

GitHub repositories, dev.to articles, Medium articles, YouTube videos, blog posts on independent websites, courses, documentation of libraries we are using, and the list goes on.

![platform jungle](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3cxdzinxzdierqto2sht.png)
 
We need a **simple** and **efficient** system to bookmark or save interesting stuff. Sometimes we also need to **note down** things we learned.

We have all been there. Google searching a piece of content that we encountered earlier, and not getting that easily, as we forgot the specifics.

**Saving everything in a centralized system, with proper categorization and tagging, can help us find stuff faster.**

There are many ways to do it. Like:
- Using the native **bookmarking** feature of our **browsers**.
- **Platform-specific** ways like *Star* on GitHub or *Save* on dev.to or *Save to Watch Later* on YouTube.
- A **GitHub repository** can be used to store all the notes as markdown files. A bookmark is also a note. All notes are organized into topic-wise sub-folders.
- Using **GitHub issues** to save the content. They are fast to create, and also taggable. GitHub offers a very efficient search across issues.
- A database in a platform like **Notion** is a great choice. You can use [Save to Notion](https://chrome.google.com/webstore/detail/save-to-notion/ldmmifpegigmeammaeckplhnjbbpccmm) browser extension to save content to it.
- Using a **bookmarking software** (most of which are paid) for example :
    - [raindrop.io](https://raindrop.io/),
    - [pocket](https://getpocket.com/) 

    and so on.

-------------

**What system or tools do you use to bookmark and take notes?**

Is it free and open source?

Did you ever change your technique? Are you satisfied with your technique?

What are the pros and cons of the tool/technique you use?

Please answer these questions in the comments. I would love to know how people deal with this thing.
YUM/DNF ile Depo İşlemleri
Tags: yum, repository, linux, management
Published: 2021-04-09 15:29:05

## Depoları Listelemek

Devre dışı bırakılmış depolar dahil, sistem için mevcut tüm depoları listelemek için:


```shell
# yum repolist all
depo id                              depo adı                         durum
rhel-8-for-x86_64-baseos-rpms        Red Hat Enterprise Linux 8 for   etkin
rpmfusion-free-updates               RPM Fusion for EL 8 - Free - U   etkin
rpmfusion-free-updates-testing       RPM Fusion for EL 8 - Free - T   devre dışı
rpmfusion-nonfree-updates            RPM Fusion for EL 8 - Nonfree    etkin
```

## Depolar üzerinde Yum-Utils ile işlem yapmak

Başta yum utils'i kuralım:

```shell
# yum install -y yum-utils
```

Bu bize `yum-config-manager` adında bir komut satırı yapısı sağlamaktadır.
Bunu kullanarak depoları aktifleştirebilir ve deaktive edebiliriz.

```shell
# yum-config-manager --enable <repo-id>
# yum-config-manager --disable <repo-id>
```

### Depoyu aktifleştirmek

```shell
# yum-config-manager --enable rpmfusion-free-updates-testing
```

### Depoyu deaktifleştirmek

```shell
# yum-config-manager --disable rpmfusion-free-updates-testing
```

## Paket bazlı depo işlemleri

Paket kurma kaldırma ve yükseltme işlemlerinde depoları `--enablerepo=<repoid>` komutu ile yönetebiliriz. Bu kısa süreli olarak depoyu aktifleştirecektir.


```shell
# yum install kernel-ml --enablerepo=elrepo-kernel
```

## Depoları Elle Yönetmek

Sisteminize kurulu olan bütün depolar `/etc/yum.repos.d` klasörü altında bulunmaktadır. Burada bulunan dosyalarda depolar şu şekilde görünmektedir.

```
[rpmfusion-free-updates]
    name=RPM Fusion for EL 8 - Free - Updates
    #baseurl=http://download1.rpmfusion.org/free/el/updates/8/$basearch/
    mirrorlist=http://mirrors.rpmfusion.org/mirrorlist?repo=free-el-updates-released-8&arch=$basearch
    enabled=1
    gpgcheck=1
```

buradaki `enabled` parametresi 1 ise açıktı 0 ise kapalıdır.

## Subscription Manager ile yönetmek (sadece RHEL)

`subscription-manager` abonelik yöneticisi, yalnızca `redhat.repo` dosyasındaki depoları etkinleştirmek ve devre dışı bırakmak için kullanılır. RHEL'de bunun bulunmasının sebebi lisans kontrollerini yapmaktır:

### Depoları listelemek

Mevcut depoların bir listesini görmek için:
```shell
# subscription-manager repos --list
```

### Depoları aktifleştirmek

RHEL spesifik bir depoyu aktifleştirmek için:

```shell
# subscription-manager repos --enable=rhel-8-for-x86_64-baseos-rpms
```

### Depoları deaktifleştirmek

RHEL spesifik bir depoyu deaktifleştirmek için:

```shell
# subscription-manager repos --disable=rhel-8-for-x86_64-baseos-rpms
```

## Bütün Depoları Aktifleştirmek

```shell
# yum-config-manager --enablerepo=*
```

RHEL spesifik depolar için

```shell
# subscription-manager repos --enable=*
```

## Bütün Depoları Deaktifleştirmek

```shell
# yum-config-manager --disablerepo=*
```

RHEL spesifik depolar için

```shell
# subscription-manager repos --disable=*
```
Calling All Devs!! 
Published: 2021-04-09 15:25:13

Figment.io is looking for devs to contribute to our Learn Pathways. Here is a list of tutorials we are looking for, https://docs.google.com/document/d/1kLBWbEygrVQcFNoMLpCtH7Dxk674FI6Dmegg4J3rSCM/edit?usp=sharing , You can also submit ideas not covered as well and get paid. Tutorials are paying 500 right now. Submit at ideas at datahub@figment.io or visit learn.figment.io for more information.
Shapediver 3D configurator
Tags: javascript, shapediver, design
Published: 2021-04-09 15:22:07

![SHAPEDIVER 3D CONFIGURATOR](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e91b8yzhr3h79ri4f9zf.JPG)

This is a 3d configurator that I created for automatic coating layout.

**[https://codepen.io/pvilarim/pen/dyMwzLL](https://codepen.io/pvilarim/pen/dyMwzLL)**
How to Start a Next.Js Project.
Published: 2021-04-09 15:00:53

Next.Js is a server-side rendered React framework that offers a lot of benefits over the traditional client-side rendered applications. While many of these benefits were covered in this previous article, this will serve as a tutorial for those looking to get started with a Next.js project. 

In order to get started with the Next.js project, we first need to initialize the project.

{% gist https://gist.github.com/ChrisDemahy/35cc1729f09028d2a2313116b3dcfa19 %}

The command-line tool will prompt you for the name of the application. In this example, we can just name it 'counter-example'. This will create the scaffold of a next.js app that we can use as our blank canvas. Next will give us a basic structure with three folders, public, styles, and pages. The public folder will contain any non-javascript static assets such as images. Styles will contain, well, styles. Next.js has support for SCSS and LESS as well as CSS. Lastly we have the pages folder, where we will store our components that represent pages in our application. 

Each component in the pages folder will become a route in your app, so if you have "pages/users.jsx" it will become example.com/users.
Go: a Short Introduction
Tags: go
Published: 2021-04-09 14:42:01

[Go](https://golang.org/) is an exciting new programming language that makes it easy to build simple, reliable, and efficient software. It's fun to write, it runs blazingly fast, and it has built-in tools to help you work with other languages. Go is a tool you will use for the rest of your career.

Go compiles quickly to machine code yet has the convenience of garbage collection and the power of run-time reflection. Its [concurrency](https://golangr.com/goroutines/) mechanisms make it easy to write programs that get the most out of multicore and networked machines, while its novel type system enables flexible and modular program construction.

The Go programming language was released publicly in November 2009.  Go is fast. Go compiles fast and runs fast. Programs built with Go are statically linked, making them load time and space efficient.

It’s fun to write and easy to read.

Go is open source and many programmers use it as their daily driver. It has powerful tooling and an enthusiastic community.

## Why Golang?

Go is the perfect balance of fast and productive. It's pragmatic but not restrained.

It is fun to use!

* Simple syntax for [variable](https://golangr.com/variables/) declarations, assignment statements, [control-flow](https://golangr.com/if/) statements, and more.
* Full Unicode support.
* Built-in concurrency features and fast performance.
* The same syntax and tools can be used for writing servers, clients, and command-line tools.
* Full compatibility with existing C libraries.
* Easy deployment: one binary that works everywhere (Linux, Mac OS X, Windows, Plan 9, BSD…).
* Full support for versioning and quality assurance via the "go test" tool.
The useEffect Cheatsheet
Tags: react, javascript, beginners, career
Published: 2021-04-09 14:59:18

When I started ReactJS, I really enjoyed my first steps, component, props and many fun things about react. One of that features was `useEffect`; it was fun but complicated for me while I struggled to learn it. 

Now I want to share my mental model in this small cheat sheet to help you learn `useEffect` better or own a better mental model. 

## Philosophy

> `useEffect` is not a lifecycle hook. It's a mechanism for synchronizing side-effects (`fetch`, `setTimeout`, ...) with the state of your app. [EpicReact.dev](https://epicreact.dev/myths-about-useeffect)

The main goal is not using `useEffect` for the component lifecycle but using it to do stuff when state-changes (re-renders).

```jsx
useEffect(() => {
  // A: run whenever the deps changes
  return {
	  // B: Optional, runs before 1, we call this the clean-up function
  }
}, deps); // deps is Optional too
```

`useEffect`'s running steps:

- 1: Run A
- 2: Wait for new state changes (component re-renders)
- 3: If the `deps` changed
    - Run B to cleanup the previous render's side-effects
    - Go to 2

## Dependencies

- **No dependency**: the side-effect function (A) will run on every state-change (re-render)

```jsx
useEffect(() => {
  // I depend on everything, I'll run on every re-render
}); 
```

- **Empty Array**: There's nothing to listen to its changes, so it'll run the side-effect function just one time at the state initialization (first render)

```jsx
useEffect(() => {
  // I depend on nothing, I'll run just one time
}, []);
```

- **Non-Empty Array**: The side-effect function runs on every dependency changes (at least one of the dependencies)

```jsx
useEffect(() => {
  // I depend on state1, state2 and prop1
  // I'll run on every change of these dependencies
}, [state1, state2, prop1]);
```

## Each Render Has Its Own Effects

I really love the "[Each Render has its own Effects](https://overreacted.io/a-complete-guide-to-useeffect/#each-render-has-its-own-effects)" title; I think almost all hooks rely on that title. We should note that every render has its own function body and its own values. The same goes for the side-effect function; check this.

```jsx
useEffect(() => {
  console.log(count)
}, [count]);
```

let's do some fake state changes and see what happens to the side-effect function.

```jsx
// in the first render, `count` is 0
// The side-effect function is going to be like this
() => {
  console.log(0)
}
// assume we change `count` to 1 (setCount(1)), next render is like that
() => {
  console.log(1)
}
// and so on...
```

That's how `useEffect` works around dependencies.
- [PDF](https://github.com/Aslemammad/Cheatsheets/blob/master/useEffect.pdf) on GitHub

I hope you enjoyed this Cheatsheet. Don't forget to share and send reactions to my article. If you wanted to tell me something, tell me on [Twitter](https://twitter.com/aslemammadam) or mention me anywhere else, You can even subscribe to my [newsletter](https://bugged.dev/newsletter) and follow me on [Github](https://github.com/Aslemammad).
Windows Terminal - The end of multiple terminal windows
Published: 2021-04-09 14:51:58

These last days, I was tired to had 5 PowerShell terminals in differents windows to do what I need.

And I discover it.

**Windows Terminal**

---

Oh damn, I just so happy to discover it! Until I search for it, I've never heard about it!

So now, I can have multiple PowerShell terminals in the same windows with tabs! 

![](https://mobilesyrup.com/wp-content/uploads/2019/06/windows-terminal.jpg)

---

## Links
Go check the links if you are curious/interested for!

- Windows Store : https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701
- GitHub Project : https://github.com/microsoft/terminal
- Official documentation : https://docs.microsoft.com/en-us/windows/terminal/

---

## Customization

Windows Terminal can be customized! So if you want to change the colors, just go to the official documentation, they have an entire section about it!

https://docs.microsoft.com/en-us/windows/terminal/customize-settings/color-schemes

If you check in depth the official documentation, you will also have a lot of elements to understand how to use the tool, customize actions...

---

I hope it will help you!

*Don't hesitate to give some feedback to help me to improve my writing skills. Thanks!*
Python finite automata library
Tags: python, programming, computerscience
Published: 2021-04-09 14:51:52

Hello! I'm a systems engineer student, actually I'm working on a Python library implementing the automatas and some of the basic functions, some of the functions is to visualize the automata (DFA or NFA) I would really appreciate your feedback and ideas!.

GitHub repository: [Automathon Github](https://github.com/rohaquinlop/automathon)
Pypi Project Page: [Automathon PyPi](https://pypi.org/project/automathon/)

Thanks for having the time to read my post!