teleren/devto huggingface dataset:
Microservices Communication Pattern
Tags: microservices, pattern, asynchronous, synchronous
Published: 2022-03-09 19:47:54

Microservice is a single application in a suite of small services. Each microservice communicates via a lightweight protocol e.g HTTP, Message Queues. In accordance with the database per service pattern, each of them has its own database. They need to communicate in order to access others data.


Basically, there are two patterns that microservices can use to talk to each other. 

## Synchronous Communication  

In this communication, a microservice communicates via another microservice's API endpoint and waits for its response. The call will be blocked until the response is received. It's easy to understand and implement but it comes with its own drawbacks e.g high latency, downtime, etc.

## Asynchronous Communication 

A microservice sends a message to another microservice via a message queue and does not wait for the response. It's a non-blocking call. There are a lot of benefits of implementing the asynchronous pattern. Let's discuss some of them here.

### Benefits of using Asynchronous Communication


#### Reduced Coupling

A sender does not need to know about the receiver interface. They can communicate via standard message queues. It increases decoupling in code.

#### Multiple Subscribers

In asynchronous communication, microservices communicate via message queues. The message can be consumed by multiple subscribers using the publisher/subscribers model.

#### Failure Isolation

When a microservice goes down, the other microservices can do their work and write messages onto the queue. The failed microservice can read them whenever it will be up and running. The message queues ensure fault tolerance and message reliability.

#### Responsiveness

Response time will be reduced much if we do the bare minimum work synchronously in the HTTP call sent by the client and do the rest asynchronously and notify the client about the updates.. 

### Drawbacks of Asynchronous Communication

#### Coupling with Message Infrastructure

Since we use message queues a lot in asynchronous communication, there is a high chance that our code can be coupled with message infrastructure. 

#### Complexity

Handling asynchronous messages is quite complex. We need to deal with duplicated messages and make the request idempotent. We must identify the cost of consuming multiple messages. There are multiple patterns of handling messages e.g at least one message, at most one message, and only one message.

#### Transaction Management

Dealing with transactions in asynchronous communication is a huge topic to discuss on its own. What if something fails in the transaction then how we can revert the transaction.

To conclude, there is always a tradeoff when we use any pattern. We must identify systems requirements and choose based on them. 

Thank you so much for the reading. Please checkout my [blog](http://www.wasinaseer.com) for more content.

References:
- https://docs.microsoft.com/en-us/azure/architecture/microservices/design/interservice-communication
- https://www.enterpriseintegrationpatterns.com/ramblings/18_starbucks.html
Mulheres e a tecnologia
Tags: wecoded, beginners, womenintech
Published: 2022-03-09 19:44:28

Sabemos que apenas cerca de 5 a 10 % são mulheres no ambiente de tecnologia e programação, isso acaba afastando muitas mulheres por ser um ambiente "masculino", mas lugar de mulher é onde ela quiser, afinal mulheres são ótimas em resolver problemas!
How to find outgoing IP addresses on your Linux machine.
Tags: linux, webdev, tutorial, beginners
Published: 2022-03-09 19:42:00

Here is a small post to help you find the outgoing IP address of you Linux machine.

1. To find the outgoing internal IP address only

```bash
ip route get 8.8.8.8 | head -1 | gawk '{ print $7 }'
```

2. To find the outgoing internal IP address along with the interface name.

```bash
ip route get 8.8.8.8 | head -1 | gawk '{ print $5,$7 }'
```

3. In the case that your machine is connected to the internet, to find the outgoing external IP Address.

```bash
curl ifconfig.me
```
Next.JS Tutorial: Build ECommerce Like Amazon By Next & Sanity
Tags: nextjs, sanity, react
Published: 2022-03-09 19:36:03

Hello and Welcome to my coding course to build an ecommerce website like amazon from scratch . In this course You will learn the essential tools and skills to design, develop and deploy a fully-function website like amazon using Next js framework and Sanity content platform

{% embed https://youtu.be/FcRWgWQale4 %}

👉 Website Demo: https://sanity-amazona.vercel.app/
👉 Source Code: https://github.com/basir/sanity-amazona
👉 Contact Instructor: basir.jafarzadeh@gmail.com

🔥 Get Sanity with the boosted free plan: https://www.sanity.io/codingwithbasir

☂ Course Page With Q/A: https://codingwithbasir.com/p/free-nextjs-sanity-ecommerce

My name is Basir and I’ll be your instructor in this course. I have 17 years of coding experience in international companies like ROI Vision in Montreal,
and now I am a coding instructor with more than 50 thousands students around the world.

I designed this course for anyone seeking to develop a fully-functional ecommerce website like amazon. By the end of this course you’ll be able to design a responsive web site, implement a user-friendly frontend and build a scalable backend. Also you can deploy the website on cloud servers and connect it to payment gateways for online payment.

You need to open a code editor along with me and start coding throughout this course.
I teach you:

- Creating functional components by React
- Defining different screens using next js 
- Using React hooks to handle form inputs and fetch backend api
- Managing and monitoring application state by React Context
- Handling shopping cart using reducers and cookies
- Building backend web api by node and sanity framework.
- Handling authentication and authorization using JsonWebToken 
- Managing e-commerce admin dashboard using Sanity studio

Also you will learn how to use online services like
- PayPal for payment, Velcro for deployment and Sanity as structured data platform.

I have used the latest version of react, next and other package in this course and I keep the update regularly.

I designed this course for web developers and entrepreneurs.

If you are or want to a web developer, take this course to become a professional web developer, have a great project in your portfolio and get a job in 22 million job opportunities around the world.

If you are a entrepreneurs, take this course to to launch your startup and sell your products and services using this fully-functional ecommerce website and earn money from your idea.

The only requirement for this course is having basic knowledge on React js 

Feel free to take a look at the course preview and enroll if it is along with your ambitions.
Want to improve Developer Tools in Microsoft Edge? File an issue on Github
Tags: developertools, edge, github
Published: 2022-03-09 19:35:50

---
title: Want to improve Developer Tools in Microsoft Edge? File an issue on Github
published: true
description: There's a new GitHub repository dedicated to collecting ideas, bugs and feature requests for the Developer Tools of Microsoft Edge
tags: developertools,edge,github
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/028tb7ydpcyggfqj1moy.png
---

Today we released a new [GitHub repository for the Developer Tools in Microsoft Edge](https://github.com/MicrosoftEdge/DevTools) where you can [file issues](https://github.com/MicrosoftEdge/DevTools/issues/new/choose) about problems, bugs and feattures you would like to see. You can also [view the list of existing issues](https://github.com/MicrosoftEdge/DevTools/issues/) and add your comments. 

There's an official blog post on the [Microsoft Edge blog](https://blogs.windows.com/msedgedev/2022/03/09/improving-devtools-together-announcing-the-new-edge-devtools-feedback-repository/) but here's why I am excited about this.

* When I joined Microsoft, I really wanted to keep everything I do open source and allow people to contribute. This is a big step to make the Developer Tools more open. 
* I spend about an hour a day triaging the feedback we get in Developer Tools via the feedback icon in the tools themselves. Of the ~400 items I get in my shift, about 5-10 are on topic. Others are about the browser all-up, or just about all kind of things people want to do on the web. This should focus it much better. We still keep the other feedback channels open, but I do like the idea to talk to developers first and foremost when it comes to Developer Tools.
Why You Should Use Python if __name__ == "__main__"?
Tags: python, programming, tutorial
Published: 2022-03-09 18:45:40

{% embed https://youtu.be/l3aRTwWanOE %}

Have you ever wondered that Python doesn't have a main function but people are using `if __name__ == __main__:` in their code? 
Checkout my latest Youtube video and this blog article to find it out why:
[https://k0nze.dev/posts/python-name-main/](https://k0nze.dev/posts/python-name-main/)
React.js tips for better performance. Part 1
Tags: react, reactnative, javascript
Published: 2022-03-09 18:42:30

**1) Avoid using the index as a key for the map**
**2) Analyzing and optimizing Webpack Bundle Bloat**
**3) Using Immutable Data Structures**
**4) Use React.Fragments**
<br />


**1) Avoid using the index as a key for the map**
               We often see index being used as a key when rendering a list. But using the key as the index may show your app incorrect data as it is being used to identify DOM elements. Whenever you push or remove an item from the list if the key is the same as before, React assumes that the DOM element represents the same component, it is always advisable to use a unique property like id as a key.

 

**2)  Analyzing and optimizing Webpack Bundle Bloat**
              If you use are using Webpack, you should check and analyze your application bundle to remove the plugins or modules that aren’t needed. You can consider using Webpack Bundle Analyzer, which helps you to visualize the size of webpack output files with an interactive zoomable treemap, I love it

 

**3) Using Immutable Data Structures**
                There is a lot to learn about Immutable Data Structures, Data immutability comes from the functional programming world. I will strongly recommend you to read about "Data immutability" as there is a lot to talk about.

 
**4) Use React.Fragments**
                I asked myself why use React Fragment when I could just use div, bcos I'm curious and passionate about web performance, made some research, and I discover div created additional HTML element wrappers, so div is slightly lower in performance.
Technical Essential Day Webinar AWS 7-3-22
Tags: aws, beginners
Published: 2022-03-09 18:37:00

Heya All, 

I attended Technical Essentials Day webinar yesterday hosted by AWSome technical trainers Thomas and Bart, and listing the key take away topics from the session below. If you find it helpful feel free to hit a like. Deep dive to each topic by following links listed in the post. 


## IAM - Identity and Access Management
 
https://aws.amazon.com/iam/

## VPC - Virtual Private Cloud

https://aws.amazon.com/vpc/

## EC2 family and pricing models - Elastic Compute Cloud
 
https://aws.amazon.com/ec2/

## Security

Securing your EC2 instances by applying NACLs on subnet level and Security Groups on instance level.

https://aws.amazon.com/vpc/features/

## Databases

Relational, Key Value, In-Memory, Document, Wide Column, Graph, Time Series, Ledger databases. 

https://aws.amazon.com/products/databases/


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

## Storage

Object store, File store, Block and Instance stores.

https://aws.amazon.com/products/storage/


## Monitor - Amazon Cloud watch 

https://aws.amazon.com/cloudwatch/


## Load Balancing - Elastic Load Balancers

https://aws.amazon.com/elasticloadbalancing/


## Scale - Auto Scaling of the EC2 Instances
 
https://docs.aws.amazon.com/autoscaling/




_NOTE: All Resources listed in the post are authentic public resources provided by AWS._ 



Hope it helps. Cheers!
Python e commerce library
Tags: python, programming
Published: 2022-03-09 18:00:15

Check following python top 10 library for Ecommerce
Saleor is an open-source ecommerce platform built with Python, GraphQL, Django and React. Its goal is to deliver dynamic, speedy and personalized shopping solutions and help you create beautiful online stores. Saleor’s most impressive features include offline shopping for PWAs, a focus on user experience, advanced payment and tax options that can integrate any payment method, and excellent SEO and analytics features.
https://pythonslearning.com/2022/03/the-best-10-python-libraries-for-e-commerce.html
Nextless.js on Product Hunt 🚀 Full-stack React SaaS Boilerplate
Tags: javascript, aws, showdev, react
Published: 2022-03-09 17:47:20

---
title: Nextless.js on Product Hunt 🚀 Full-stack React SaaS Boilerplate
published: true
description: React SaaS Starter kit hosted with AWS built with Next.js and TypeScript styled with Tailwind CSS. Subscription payment with Stripe.
tags: javascript, aws, showdev, react
cover_image: https://creativedesignsguru.com/assets/images/themes/next-js-saas-starter-kit.jpg
---

Today, I’m existed to share an awesome news with you: Nextless.js is on Product Hunt. The perfect full-stack React SaaS Boilerplate to build faster your SaaS product and help you earn your 1st MRR.

Something I was working in the last 8 months by including everything you need to start your SaaS using Next.js:

🚀 Email authentication & Social login
🚀 Built-in React components: Landing Page and User Dashboard
🚀 Form & Error management
🚀 Infrastructure as code
🚀 Developer experience with type checking (TypeScript), linter (ESLint), code formatter (Prettier)
🚀 Code example & Documentation
🚀 Stripe Subscription Payment
🚀 100% Serverless: highly scalable, no server management, pay-as-you-go pricing, etc...

For more detailed information about Nextless.js, check out the [Nextless.js Product Hunt](https://www.producthunt.com/posts/nextless-js) page.

[![Next.js SaaS Starter kit](https://creativedesignsguru.com/assets/images/themes/next-js-saas-starter-kit.jpg)](https://www.producthunt.com/posts/nextless-js)

## More Stories about Nextless.js

If you are interested, I have also shared my story on [how I have build my SaaS](https://creativedesignsguru.com/saas-tech-stack/) using Next.js and Serverless.

Here is the list of all [built-in feature available in Nextless.js](https://creativedesignsguru.com/react-saas-boilerplate/).
100 days of code
Tags: 100daysofcode, python
Published: 2022-03-09 17:44:12

Started the 100 days of code challenge in Python with https://www.udemy.com/share/103IHM3@dk3UYKw-ZUWvopKIHam9UwMdGDI6PkOI4I8leXNlK1WcP8a0LbjXjZsGsJ8_QiPkbw==/
Google Hashcode Qualifications 2022
Tags: google, programming, tutorial, dsa
Published: 2022-03-09 17:23:20

## > Got Global Rank -1636 
Team ByteHogs, All India Rank 450. 
Participants :
 1) Saksham Garg 
 2) Quentin Fortier
 3) Mohit Singh
 4) Vaibhav



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

Whether you’re just a beginner in programming languages or an expert professional, you should consider participating in the **Google HashCode** to showcase your programming skills and also have some fun.

## Preparation Tips

1. Thorough knowledge of any programming language, especially the ones you intend to use to win the competition. Problems are NP - Hard, Basic knowledge of coding wont work :(

2. You can also look and try to solve the problems from past editions of the competitions to give you a better overview of the competition.

3. Networking is important between teammates. You can enter into healthy competitions with your teammates to enhance your programming skills.

4. Since your solution should not be exact , but scores are given on the basis of how accurate your code is. 

5. Work your ass off until the last second. Every solution is graded, but you only get points for the best one.

## Virtual Hub?

Virtual hubs are meetups organised by the participants so that the participants of the same colleges, universities, offices, can meet up virtually and compete as one team for the Online Qualifications.
How to create QR Code Scanner in Flutter?
Published: 2022-03-09 17:20:56

In this post, we'll be using package `barcode_scan2: ^4.2.0` to scan the QR Code.

## Add Package to the Pubspec.yaml

```
dependencies:
  flutter:
    sdk: flutter
  barcode_scan2: ^4.2.0
```

## Allow Access to Camera in Android and IOS

To use the QR Scanner, we have to allow the app to access the camera phone so at first we'll add the code to Android and IOS Folder,

go to:

```
path: android/app/src/main/AndroidManifest.xml
```

and Add this line of code before application

```
...
<uses-permission android:name="android.permission.CAMERA" />
<application ...
```
and Save.

Incase you get the multidex error
please add 

```
path: android/app/src/build.gradle
---------------
defaultConfig {
  ....
  multiDexEnabled true
}

...
...
...

dependencies {
    implementation 'com.android.support:multidex:1.0.3'
}

```

### Now Moving on to the IOS Part

```
path: ios/Runner/Info.plist
```
add these code

```
<dict>
    <key>NSCameraUsageDescription</key>
    <string>Camera permission is required for barcode scanning.</string>
</dict>
```

## Create QR Code Dart
Once you have done that, now create a QRScannerScreen.dart file and add a button in the container or center

```
TextButton(
	child: Text("Scan Now"),
	onPressed: (){
		var result = await BarcodeScanner.scan(); //barcode scanner			
		print(result.type);  // The result type (barcode, cancelled, failed)
		print(result.rawContent); // The barcode content
		print(result.format); // The barcode format (as enum)
		print(result.formatNote);
	}
)
```

Use Barcode: [BarCode Scan 2](https://pub.dev/packages/barcode_scan2)
Updating WebDriver matching with browser automatically using python
Tags: selenium, python, automation, web
Published: 2022-03-09 17:17:13

I had built a web application that need web automation. So I used python Selenium for web automation. The application software was running smoothly and it has only one problem that occurs when my browser(chrome) update automatically and the software stops working. So to keep running, I frequently download the matching version of webdriver and replace the old webdriver. So to automatically download the new webdriver of chrome here are the steps to follow:
import required package

```
from selenium import webdriver
import requests
import wget
import zipfile
import os

```
get Chrome browser version and chrome webdriver version

```
driver = webdriver.Chrome()
browser_version = driver.capabilities['browserVersion']
driver_version = driver.capabilities['chrome']['chromedriverVersion'].split(' ')[0]
print("browser version",browser_version)
print("driver version",driver_version)
```
Then we need to check if the chrome version is matching or not and apply if-else condition

```
if browser_version[0:2] != driver_version[0:2]: 
    
    driver.close()
    driver.quit()

    os.remove(r'chromedriver.exe')
  
    # get the latest chrome driver version number
    url = 'https://chromedriver.storage.googleapis.com/LATEST_RELEASE'
    response = requests.get(url)
    version_number = response.text

    # build the donwload url
    download_url = "https://chromedriver.storage.googleapis.com/" + version_number +"/chromedriver_win32.zip"

    # download the zip file using the url built above
    latest_driver_zip = wget.download(download_url,'chromedriver.zip')
    # extract the zip file
    with zipfile.ZipFile(latest_driver_zip, 'r') as zip_ref:
        zip_ref.extractall() # you can specify the destination folder path here
    # delete the zip file downloaded above
    os.remove(latest_driver_zip)

else:
    print("rock and roll your are good to go")
```
so hereafter I checked the version and using if condition the version isn't matching then I close the running webdriver and quit the webdriver.
Afterwards, using request.get to get the latest version of chrome webdriver.

- Then using wget , I download the zip file.
- lastly, unpack the zip file using zip_ref and remove the zip file. 
Now we are good to go with if the version isn't matching condition. If the version are matching then our web automation will run smoothly without any trouble and there is no need to update the webdriver manually.

So in this way I was able to automatically download the matching version of chrome webdriver.

_Reference:
Automatic download of appropriate chromedriver for Selenium in Python - Stack Overflow_
Day-40 Training at Ryaz : Handling and Logging errors
Tags: javascript, beginners, node, webdev
Published: 2022-03-09 17:15:19

- Date:9/03/2022
- Day:Wednesday

Today, I started at about 10:30 am as I was done with till tenth module and I was to start with eleventh module so, I started with it Handling and logging errors. In the beginner the instructor started with as we have done connections with our mongo db data base so, if for some reason connection is broken so, he advised some of things which can help us to handle errors after this he started with handling the rejected promises and advised some of tips about express error middleware and advised to create function asyncMiddleware and remove try catch blocks and after this the instructor told about handling errors in express Async and also advised some of necessary tips to handle logging errors and errors while logging into Mongo db. this way my day ended up and I got to learn many new things and enhanced my Knowledge.
Python Virtual Enviroments
Tags: python, spanish, beginners, tutorial
Published: 2022-03-09 17:14:22

Los entornos virtuales no es mas que tener control sobre las dependencias de tu proyecto. Si has trabajado con Node.js esto seria el equivalente a la carpeta node_modules (la carpeta donde se almacenaban todas las dependencias de nuestro proyecto) y package.json (donse se guardaban las referencias a las dependencias que necesita nuestro proyecto).

> Pero mejor veámoslo en la practica

Para crear el entorno deberemos ejecutar el paquete venv (Virtual Enviroment). Le diremos a python -m para referirnos a un modulo en este caso a venv y el segundo parametro es el nombre de la carpeta, la cual llamaremos de la misma manera venv.

```bash
python -m venv venv
```

Una vez ejecutado nos deberá crear una carpeta en nuestro entorno de trabajo, ahora solo hace falta activar ese entorno virtual con el siguiente comando:

```bash
.\venv\Scripts\activate
```

Si prestas suficiente atencion, notaras que algo en tu terminal cambio, se agrego la palabra venv.

![venv active](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rqenl4rjm8c3tk8sw69q.png)

Esto significa que ya estas en el entorno virtual, así que ahora ya podemos empezar a instalar nuestros requerimientos en este caso usaremos Flask.

```bash
pip install Flask
```

Y ahora para tener nuestras dependencias listadas usaremos el comando:

```bash
pip freeze > requirements.txt
```

> Para terminar el proceso del venv
> ```bash 
> deactivate
> ```
 
Y listo, terminamos nuestro entorno virtual. Deberia verse algo asi:

![Python Workspace](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/995f6u7ku6lcs0mq2ya4.png) 

Y si prestamos suficiente atención podremos notar que es exactamente el mismo principio de Node.js (En realidad de casi cualquier gestor de paquetes).

![Node Workspace](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c8qqqoi4ng5ynzzcbyo0.png)