teleren/devto huggingface dataset:
DynamoDB pricing in simple terms
Published: 2020-10-22 15:58:20

I was doing some analysis on DynamoDB pricing and wanted to share it with you all.
DynamoDB has two modes of billing: the first is a capacity-based mode (RCU/WCU), the second one is a pay-per-request payment mode.
These modes have very different pricing mechanisms, and it is important to understand the differences.

**Provisioned Capacity**

In this mode, the price based on your desired throughput in KB/s, RCU (read capacity unit) stands for 4KB/sec, and WCU (write capacity unit) stands for 1KB/sec.
So when you think about how much WCU/RCU your application requires, you need to understand what it is your maximum throughput at any given time (your highest spike) and not how much traffic you have overall.
To demonstrate this difference see the two graphs below. In both of them, we need to write 5KB of data but in the left graph we have a peak where all 5KB is written at once, and on the right-hand side, we have an even distribution of 1KB/s.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/m7dep8uttbiaevdcdy5b.png)
To accommodate the first scenario you will need to buy 5 WCU and for a right-hand scenario you need just 1 WCU, so it will be five times cheaper.
This leads to situations where even low traffic application needs to overcommit on WCUs to accommodate occasional peaks in traffic.
The payment has a resolution of one hour, so if your application has predictive daily variability, it’s possible to write a smart scheduling mechanism to adjust your WCU capacity according to the time of day to accommodate this variability.
AWS provides some rudimentary auto-scheduling implementation that can adjust your capacity based on previous traffic patterns, but it’s not very responsive, and I don’t recommend relying on it for more critical applications.
In this mode tables and their indexes can have a different capacity so it is possible to have a less expensive bill for some operations that you are ok with doing over more extended periods.

**On-Demand pay per request mode**

This is a simpler model to understand, in this mode throughput is not important at all, your bill is based on the total numbers of requests instead. So for the graphs above you will pay the same for both scenarios. And if your DB not used at all, you pay zero, which is very useful for testing and dev environments.
So if you have situations where the total number of requests is relatively small, but the variance in throughput is high, it will be way cheaper to use the per request mode.
Below you can find a small calculator where you can play with the numbers:
https://docs.google.com/spreadsheets/d/10Y_cMZF3JAeH5z2F7qsVVAw3qSEGL5cOQ_sFNOq2kPk/edit?usp=sharing

If you have any question, please feel free to ask, DynamoDB pricing it’s an overly complex subject in my opinion, and I am hoping I didn’t miss anything, so please tell me if you found something you believe isn’t accurate
Quick guide to Python formatting in VS Code
Tags: vscode, python, prettier, formatting
Published: 2020-10-22 15:46:11

You've followed [Microsoft's tutorial on setting up Python in VS Code](https://code.visualstudio.com/docs/python/editing) but formatting is just not working? It might be that other extensions are interfering with your Python formatter.

If you use VS Code mostly for web development, you most likely also use **Prettier** for formatting. I'm talking about Prettier as an extension, not as a package. Check if you have the following configuration in your settings:

(Open VS Code, hit `Ctrl + Shift + P` on Windows / `Cmd + Shift + P` on MacOS to open the Command Palette and search for "Settings", check both "Workspace" and "User" settings). 

# Prettier does not work with Python 
```json
"editor.defaultFormatter": "esbenp.prettier-vscode"
```

If you find this config in your settings, **you've found the reason why `autopep8`, `black` or `yapf` are not working** - The above configuration will choose Prettier to format Python, which is not supported. In your settings, make sure you override the default formatter for python like so:

```json
  "[python]": {
    "editor.defaultFormatter": null
  }
```

And don't forget to install and select the actual formatter that you want (just like in the official docs).

```json
  "python.formatting.provider": "black",
  "python.formatting.blackArgs": ["--line-length", "120"]
```
# Override default formatter
You can either overwrite `editor.defaultFormatter` just for your workspace or globally for your user. Also, it doesn't matter whether you're using a global Python installation or a virtual environment.

I prefer applying this configuration to my user settings - this way, I can easily start a Python project and will get formatting out of the box based on my user settings. No need to create dedicated workspace settings for every single project and override the formatter over and over. Here's the relevant config from my settings:

```json
{
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "[python]": {
    "editor.defaultFormatter": null
  },
  "python.formatting.blackArgs": ["--line-length", "120"],
  "python.formatting.provider": "black",
}
```
Originally posted on my personal website and blog, [eric.film](https://eric.film/blog/quick-guide-to-python-formatting-in-vscode).


Preview picture by [@fidpad on unsplash](https://unsplash.com/@fidpad).
7 Innovative GitHub personal readmes’
Tags: github, devops, coding, programmer
Published: 2020-10-22 15:56:32

---
title: 7 Innovative GitHub personal readmes’
published: true
date: 2020-10-22 15:40:26 UTC
tags: github,devops,coding,programmer
canonical_url: https://certifriedit.com/7-innovative-github-personal-readmes/
---

[![](https://cdn-images-1.medium.com/max/2600/1*Mg6x1L0e65xU62o3Gph2Og.jpeg)](https://medium.com/certifried-it/7-innovative-github-personal-readmes-34c42c94c0cd?source=rss-bf1ef9317cf6------2)

In May, GitHub quietly released a new feature allowing users to create and display a ‘personal readme’ on the front of their profiles…

[Continue reading on CertiFried IT »](https://medium.com/certifried-it/7-innovative-github-personal-readmes-34c42c94c0cd?source=rss-bf1ef9317cf6------2)
Reach Router scroll top fix - my 2nd npm package!
Tags: showdev
Published: 2020-10-22 15:35:16

I did a lot of projects with NextJS and recently had to do one with `create-react-app` again.
So I quickly remembered how tedious it was to fiddle around with [React-Router](https://reactrouter.com/) and searched for an alternative.

[Reach Router](https://reach.tech/router/) seemed like a good alternative. I quickly noticed one problem:

## The problem to solve
When using Reach Router, the [accessibility](https://reach.tech/router/accessibility) features are turned on by default. 
The official docs say:
> Focus Management
Whenever the content of a page changes in response to a user interaction, the focus should be moved to that content; otherwise, users on assistive devices have to search around the page to find what changed–yuck! Without the help of a router, managing focus on route transitions requires a lot effort and knowledge on your part.

> Reach Router provides out-of-the-box focus management so your apps are significantly more accessible without you breaking a sweat.

> When the location changes, the top-most part of your application that changed is identified and focus is moved to it.

In my case, after scrolling to the bottom at one page and navigating to another page, the newly loaded page will be scrolled to the same distance as the previous, if the content is longer than the viewport height.
This can be disabled by setting `primary={false}` at the `Router` component of Reach, but this would also disable the accessibility features.

## The solution
I got inspired by a couple of Stackoverflow answers but none of them were using React hooks and none could be implemented quickly enough for me.
So I took the time and wrote a solution using hooks.
It consisted of 2 parts:
```js
// new component OnRouteChangeWorker.js
import React, { useEffect, useRef } from "react";

const OnRouteChangeWorker = props => {
	const locationRef = useRef("");
	useEffect(() => {
		if (props.location.pathname !== locationRef.current) {
			locationRef.current = props.location.pathname;
			props.action();
		}
	});

	return null;
};

export default OnRouteChangeWorker;
```

```js
// in App.js - global entry file
import { Location, Router } from "@reach/router";
import OnRouteChangeWorker from "./components/OnRouteChangeWorker";

// ...
function App() {
  return (
    <div>
        <Router>
          <HomePage path="/" />
          <ImpressumPage path="terms" />
          <PrivacyPage path="privacy" />
        </Router>
        <OnRouteChange
          action={() => {
            window.scrollTo(0, 0);
          }}
        />
      </div>
  );
// ...
```

{% github DarkSmile92/reach-router-scroll-top %}



## Why a npm package?
I wanted to archive the following:
- do something in Typescript 
- learn how to publish a npm package myself
- provide this solution for others to quickly integrate into their projects
A great Experience Overall! 😊
Tags: hactoberfest, github, git
Published: 2020-10-22 15:22:53

I'm a 16 y/o beginner, and this fest was my first platform to put my efforts. I learnt how GitHub works, how the developers unite to work on a project and it for sure gave me my first experience.

I pulled 6 requests during this fest, 2 of them merged and I'm happy for it. I made a C++ script shorter with no change in output, corrected some grammatical mistakes and anybody willing to work further on them can just pull more requests if you see any bugs or find any mistakes.


I will wait for next Hactoberfest so I can have fun participating again...

Thank you @DigitalOcean and #hacktoberfest for such a great platform!
FREE Training Session & Certification - Kubernetes and Serverless Deployment Basics
Tags: alibabacloud
Published: 2020-10-22 15:19:16

Looking for training sessions and certifications on cloud computing for free? Here is a chance. With this special online campaign, Alibaba Cloud will offer training sessions and certifications for free for a limited time.

Certification: Kubernetes and Serverless Deployment Basics

Exam link: the exam link will be availble here on Oct 23

How to get the certification?

Step 1. Watch the training sessions below to prepare for the exam (please register an Alibaba Cloud account first if you do not have one):
1. A Demo of How to Use Function Compute HTTP Trigger: https://edu.alibabacloud.com/course/221
2. Live Demo - Implement Blue-Green Deployment with K8s: https://edu.alibabacloud.com/course/160

(Please note, there is no live training, and you can watch the online training materials anytime.)

Step 2. Take the exam with the exam link during the event time.

Step 3. If you pass the exam, you will get the certification.

After getting the certification, you are encouraged to share your learning on Quora by answering the following questions:
https://www.quora.com/What-is-Alibaba-Cloud-Function-Compute-2
https://www.quora.com/How-can-the-Alibaba-cloud-function-compute-help-with-serverless-computing
https://www.quora.com/What-is-blue-green-deployment-with-container-service-in-Alibaba-cloud

You can also submit your post to the Alibaba Cloud Community Influencer program to get free credits: https://www.alibabacloud.com/campaign/community-influencer
Any help with MySQL?
Tags: mysql, database, help, advise
Published: 2020-10-22 15:10:54

Hi, community
I need your assistance in MySQL databases query to retrieve some data.

In the attached photo, there are 2 sets of tables that I am retrieving data from it using inner join statement.

I can add data and retrieve it nicely.

The problem arises when I ADD more than one row of data from the same user, I think my query just only one set of a row from the second table.

I will have everything in terms of the post content except the data from the second table, the field I want return only one row all the field for that user. 


My query statement 
------------------------------------------------------------------
SELECT * FROM tbl_samples_post 
		INNER JOIN tbl_twitter_user ON tbl_twitter_user.user_id = tbl_samples_post.user_id 
		LEFT JOIN tbl_follow ON tbl_follow.sender_id = tbl_samples_post.user_id 
		RIGHT JOIN recording ON recording.user_id = tbl_samples_post.user_id
		WHERE tbl_follow.receiver_id = '".$_SESSION["user_id"]."' OR tbl_samples_post.user_id = '".$_SESSION["user_id"]."' 
		GROUP BY tbl_samples_post.post_id
		ORDER BY tbl_samples_post.post_id DESC

                        --end--
------------------------------------------------------------------
JavaScript Programming Problem
Tags: javascript, codenewbie, coding, interview
Published: 2020-10-22 15:08:10

# JavaScript Programming Problems Series
I am going to start a Programming test series where i will share commonly asked interview questions and their solutions for JavaScript developers. 

##  Problem # 1 
### Replace With Alphabet Position
 you are given a string, replace every letter with its's position in the alphabet, if the string has a value which is not an alphabet then ignore it. The Output should also be a String telling about the position of Alphabet.

## Solution

``` 
function alphabetPosition(str){
str = str.split("");
  const position =[];
  const alpha = "abcdefghijklmnopqrstuvwxyz";
  for(let wo of str) {
    if (alpha.indexOf(wo)>=0) {
    position.push(alpha.indexOf(wo)+1, " ")
    } 
  }
  return position.join("")
}
alphabetPosition("21a dsz")
```
So happy that I get to help others...
Tags: codenewbie, 100daysofcode, go, community
Published: 2020-10-22 14:48:59

Probably one of the coolest pieces of feedback I've received. Thank you so much! I'm incredibly grateful that I've been able to be a part of your journey.

Teaching people that coding can be a fun and an amazing career, then receiving comments like this, is what makes me strive to continue doing what I'm doing.

An interview I did on http://azurecrazy.com

![](https://i.imgur.com/f5i9BLO.png)
Schedule Netlify Site's Deployment With Github Actions
Tags: node, githubactions, netlify
Published: 2020-10-22 14:28:28

---
title: Schedule Netlify Site's Deployment With Github Actions
published: true
date: 2020-10-22 14:23:27 UTC
tags: nodejs, githubactions, netlify
canonical_url: https://phongduong.dev/blog/schedule-netlify-site-s-deployment-with-github-actions/
---

I schedule my posts to publish at night. I don't want to manually visit my Netlify site and trigger deploy every night because I sometimes forget to do that. I read [Auto trigger deploys on Netlify tutorial](https://flaviocopes.com/netlify-auto-deploy/) of Flavio Copes but he uses Zapier for automation. I don't want to use a third-party service so I use Github Actions instead. It supports to trigger workflow run at a scheduled time.

There are some ways to build and deploy a Netlify site. You can use CLI to build and deploy or send a `POST` request to the site's build hook. I choose to use build hook.

## Generate Netlify site's build hook

- In site **Setting**, select **Build & deploy** tab from left sidebar
- Select **Build hooks** section in **Continuous Deployment**
- Select **Add build hook**
- Enter **Build hook name**. It will be displayed in the deploy message
- Select the default branch to build
- Click **Save**
- It will generate a unique URL

## Save your build hook as encrypted secret

You don't want everyone to know your build hook and request it continually. This will waste your account's build usage. You need to save it as repo's secrets and retrieve it in the workflow's configuration

- Select repo's **Settings > Secrets**
- Click **New secret**
- Enter secret name
- Paste the build hook URL into **Value**
- Click **Add secret**

## **Create a workflow**

In the **Actions** page of your repo, you set up a new workflow.

Name your file and workflow

Configure `schedule` event and when the workflow runs. In `schedule` event, you specify the `cron` syntax. The workflow will run your `cron` syntax at UTC times

```
┌───────────── minute (0 - 59)
│ ┌───────────── hour (0 - 23)
│ │ ┌───────────── day of the month (1 - 31)
│ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
│ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
│ │ │ │ │
│ │ │ │ │
│ │ │ │ │
* * * * *
```

[Source](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events)

When you are typing the `cron` syntax, you can hover the syntax and see a popup above it. It shows you when the workflow will run

```yaml
on:
  schedule:
    - cron: "0 16 * * 1-5"
```

My workflow will run at 16:00 UTC from Monday to Friday.

In your job's steps, run the following command

```yaml
run: curl -X POST ${{ secrets.{BUILD_HOOK_SECRET_NAME} }}
```

It retrieves the encrypted secret of your build hook from `secrets` context and sends a `POST` request to the build hook.

Commit your workflow configuration. It will run at the time you scheduled. You can check the result of your workflow on the **Actions** page

After the workflow runs, visit **Deploys** page of your Netlify site. You can see your triggered deploy in the deploy list.
Sharing Experience. Our Projects
Tags: testing, startup
Published: 2020-10-22 14:33:28

You have a web application that highlights the company's products and allows to buy them online? Make sure to run proper QA for it.
And here is an example of the similar project we worked on.

TASK: Our team designed tests scenarios for automation, added an opportunity to run tests locally( on user's computer) and remotely (using Browserstack API) as well as conducted tests parameterization using TestNG.

HOW: Acceptance tests automation for the Cart feature with the opportunity to run tests remotely using Selenium and BrowserStack; comprehensive tests results delivery with the help of the Allure report framework.

ENVIRONMENT: Java, TestNG, Selenium 3, Allure, Browserstack.

http://hire-tester.com
Batch Operating System | Operating System - M01 P02
Tags: linux, codenewbie, 100daysofcode, devops
Published: 2020-10-22 14:31:03

**This is a multipart blog article series, and in this series I am going to explain you the concepts of operating system. This article series is divided into multiple modules and this is the first module which consists of 12 articles.**

In this article we will see that what are the types of operating system and mainly focus on **Batch Operating System.**

### Types of operating systems : 
There are in total seven types of operating systems and their names are.
- Batch
- Multiprogrammed
- Multitasking
- Real time OS
- Distributed
- Clustered
- Embedded

### Batch Operating System :
This operating system was mainly used in 1960s and only few companies or organizations have computer systems at that time _(NASA. ISRO)_ 
These organizations use to load their jobs/task on **Punch cards Paper tape/ magnetic tape,** and give it to the operator, then operator use to converts these punch cards into different batches _(that means batches of similar kind, which have similar kind of process.)_ Now we get different batches let say B1, B2, B3 etc. after this these batches were given to CPU.
Now while execution of the process, a scenario may occur in which the process wants to perform some Input/output operation, so in order to do that CPU stop executing that process, until that process completes its I/O operation, but there is a problem that during I/O operation of the process the CPU becomes **Idle** which was the biggest disadvantage of Batch operating system.
This operating system was basically a non-pre-emptive operating system, which means if the CPU starts executing a process it will execute it completely, no other process can be executed by it in the mean time _(in simple words it was unable to do multi-processing, which almost every operating system nowadays is capable of)_. This was all about ***Batch Operating System***

I hope this article was helpful for you. So, if you have any doubts, query or questions regarding this topic/article or just want to share something, then please feel free to contact me.

### 📱 Contact Me

[Twitter](https://twitter.com/r_mishra10),
[LinkedIn](https://www.linkedin.com/in/rahul-mishra-66210b185),
[Telegram](https://t.me/rahul_mishra10),
[Instagram](https://www.instagram.com/rahul_mishra10/?hl=en),

### 📧 Write a mail
<rahulmishra102000@gmail.com>

#### 🚀 Other links

[GitHub](https://github.com/rahulMishra05),
[HackerRank](https://www.hackerrank.com/rahulmishra10201)
SEO and Web Dev - More Interconnected than ever
Tags: seo, google, webmaster
Published: 2020-10-22 14:27:30

As the title says, **SEO and Web Dev are more interconnected than any point in the past**, and it's looking more and more likely that that relation will only get closer with time.

Many "under the hood" factors are playing a stronger role in Google's ranking algorithm for websites. The old methods of ranking, relying on external backlinks, have been abused to the point where policing bad behavior and blackhat methods has become a monumental task.

More and more, Google is weighing two other key areas much more heavily in their criteria for the positioning in the SERPS: 

1) Quality and relevance of content - which through the use of AI Technology, they have gotten quite good at without human intervention 

and 

2) Technical "on site" optimizations, which is what I will be discussing today.

It has been common knowledge, something Google has been very transpaqrent about (one of the few things) that SSL (https) has been a ranking factor since 2013. 

*This ranking factor has only strengthened*, and has been joined by a number of other factors. 

At [SocialSEO](https://seotaskfairy.com), we have been working hard to keep on top of thsee factors and learning the under the hood mechanics that make these work.

These factors include:

- Page speed (sites that take longer than 3 seconds to load will suffer greatly in the SERPS)

- Proper usage of Schema Markup

- Properly Coded Website

- Absence of Adobe Flash (slows down sites and will get your site downgraded bigtime)

- JS/CSS minification

- Image Alt Tags

- Proper placement of Header tags (H1, H2 etc)

- rel=canonical tags

- image optimization

- mobile friendliness

- Internal linking structure

- HTML errors/W3C validation

- URL String

- XML Sitemap

- Site Uptime

- Server Location

Just to name a few. That being said, it will be interesting to see, in the coming years, just how much the landscape will be changing.

Personally, I predeict a whole lot more crossover between SEO and WebDev, and vice versa. All signs certainly seem to point that way.