teleren/devto huggingface dataset:
Appendix: Sustainability (Software and Architecture Patterns) - AWS Well-Architected Framework Study Guide
Published: 2022-03-15 15:00:27

[Return to Well-Architected Framework Guide](https://dev.to/aidutcher/aws-well-architected-framework-study-guide-introduction-fjg)

[Appendix: Sustainability](https://docs.aws.amazon.com/wellarchitected/latest/framework/a-sustainability.html)

**How do you take advantage of software and architecture patterns to support your sustainability goals?**

- Optimize software and architecture for asynchronous and scheduled jobs
- Remove or refactor workload components with low or no use
- Optimize areas of code that consume the most time or resources
- Optimize impact on customer devices and equipment
- Use software patterns and architectures that best support data access and storage patterns

[Return to Well-Architected Framework Guide](https://dev.to/aidutcher/aws-well-architected-framework-study-guide-introduction-fjg)
How To Run Parallel Tests in MSTest Framework Using Selenium C# | MSTest Tutorial | Part III
Tags: mstest, beginners, tutorial, crossbrowsertesting
Published: 2022-03-15 14:59:48

{% youtube 4ZYvmjqRhm0 %}

Learn to perform cross browser testing in MSTest using Selenium webdriver on the LambdaTest platform.  

[Start FREE Testing](https://accounts.lambdatest.com/register?utm_source=devto&utm_medium=organic&utm_campaign=mar_15&utm_term=sb&utm_content=tutorial_video)
Scale Up Your Selenium Automation Testing With MSTest Framework On Cloud:https://bit.ly/3zNh9lj

In this part of the MSTest Tutorial, Karthik KK (@kartamd) helps you understand how to run the Selenium C# test with the MSTest framework using the LambdaTest platform. This video tutorial also guides you on how to configure your local Selenium tests to run it on LambdaTest platform. By the end of this video, you will also learn how to run the locally hosted application in the LambdaTest platform. 

Also, learn -:
🔸 How to write a test script using MSTest?
🔸 How to write test in MSTest framework using Selenium C#?
🔸 What is Cross Browser Testing, and how to perform it?
🔸 How to use Selenium WebDriver for Cross Browser testing in C# MSTest?
Appendix: Sustainability (User Behavior Patterns) - AWS Well-Architected Framework Study Guide
Published: 2022-03-15 14:58:18

[Return to Well-Architected Framework Guide](https://dev.to/aidutcher/aws-well-architected-framework-study-guide-introduction-fjg)

[Appendix: Sustainability](https://docs.aws.amazon.com/wellarchitected/latest/framework/a-sustainability.html)

**How do you take advantage of user behavior patterns to support your sustainability goals?**

- Scale infrastructure with user load
- Align SLAs with sustainability goals
- Eliminate creation and maintenance of unused assets
- Optimize geographic placement of workloads for user locations
- Optimize team member resources for activities performed

[Return to Well-Architected Framework Guide](https://dev.to/aidutcher/aws-well-architected-framework-study-guide-introduction-fjg)
How To Write Test In MSTest Framework Using Selenium C# | MSTest Tutorial | Part II
Tags: mstest, beginners, tutorial, crossbrowertesting
Published: 2022-03-15 14:58:16

{% youtube LPA5NdRcHfw %}


Learn to write and run your first test script for Selenium automation testing using C# in MSTest framework. 

[Start FREE Testing](https://accounts.lambdatest.com/register?utm_source=devto&utm_medium=organic&utm_campaign=mar_15&utm_term=sb&utm_content=tutorial_video)
Scale Up Your Selenium Automation Testing With MSTest Framework On Cloud:https://bit.ly/3zNh9lj

In this part of MSTest Tutorial, Karthik (@kartamd) helps you understand how to run and write Selenium test using MSTest framework while learning how to write the code within Selenium C#. You will also learn how to initialize attributes of MSTest Framework, such as, “TestMethod”, “TestCleanUp”, and “TestInitialize”. 

You will learn -:
🔸 How to write test in MSTest framework using Selenium C#?
🔸 How do you run MSTest?
🔸 How to create a Microsoft test?
🔸 How to write a MSTest case?
🔸 What is the difference between NUnit and MSTest?
Appendix: Sustainability (Region Selection) - AWS Well-Architected Framework Study Guide
Published: 2022-03-15 14:56:14

[Return to Well-Architected Framework Guide](https://dev.to/aidutcher/aws-well-architected-framework-study-guide-introduction-fjg)

[Appendix: Sustainability](https://docs.aws.amazon.com/wellarchitected/latest/framework/a-sustainability.html)

**How do you select Regions to support your sustainability goals?**
- Choose Regions where you will implement your workloads based on both your business requirements and sustainability goals
- Choose Regions near Amazon renewable energy projects
- Choose Regions where the grid has a published carbon intensity that is lower than other locations

[Return to Well-Architected Framework Guide](https://dev.to/aidutcher/aws-well-architected-framework-study-guide-introduction-fjg)
What Is MSTest Framework | Selenium WebDriver C# MSTest | MSTest Tutorial | Part I
Tags: mstest, tutorial, automation, beginners
Published: 2022-03-15 14:56:12

{% youtube svzkphte8uA %}


The Microsoft .NET testing framework, MSTest, is a test framework that comes with Visual Studio. It allows you to perform unit testing for .NET applications.
[Start FREE Testing](https://accounts.lambdatest.com/register?utm_source=devto&utm_medium=organic&utm_campaign=mar_15&utm_term=sb&utm_content=tutorial_video)
Scale Up Your Selenium Automation Testing With MSTest Framework On Cloud:https://bit.ly/3zNh9lj

In this Part of the MSTest Tutorial, Karthik (@kartamd) walks you through the basics of MSTest wherein you learn what is MSTest framework and how to get started with it. Furthermore, you’ll learn about the advantages of MSTest Framework in Selenium C# and how to set up MStest in Visual Studio. Finally, this tutorial video will help you understand how to create a MSTest project within Visual Studio.

You will learn -:
🔸 What is MSTest?
🔸 Is MStest a framework?
🔸 What is Microsoft unit test framework?
🔸 How does MSTest work?
Appendix: Cost Optimization (Optimize Over Time) - AWS Well-Architected Framework Study Guide
Published: 2022-03-15 14:51:57

[Return to Well-Architected Framework Guide](https://dev.to/aidutcher/aws-well-architected-framework-study-guide-introduction-fjg)

[Appendix: Cost Optimization](https://docs.aws.amazon.com/wellarchitected/latest/framework/a-cost-optimization.html)

**How do you evaluate new services?**

- Develop a workload review process
- Review and analyze this workload regularly

[Return to Well-Architected Framework Guide](https://dev.to/aidutcher/aws-well-architected-framework-study-guide-introduction-fjg)
Python challenge_17
Tags: python, beginners, tutorial, programming
Published: 2022-03-15 14:51:55

##Custom zip


- The built-in zip function "zips" two lists. 
- Write your own implementation of this function.

- Define a function named zap. 
- The function takes two parameters, a and b, These are lists.

- Your function should return a list of tuples. 
- Each tuple should contain one item from the a list and one from b.

- You may assume a and b have equal lengths.
- If you don't get it, think of a zipper.

####For example:
```
zap(
    [0, 1, 2, 3],
    [5, 6, 7, 8]
)

Should return:

[
    (0, 5),
    (1, 6),
    (2, 7),
    (3, 8)
]

```

#####Hint

- Use a while loop or a for loop with range to count up an index i. 
- Then use i to access each element in a and b at a time. 
- Create a tuple and append it to a result list that you gradually build up.



#####My solution
```
def zap(a, b):
    zap_list = []
    for i in range(len(a)): 
        zap_list.append((a[i], b[i]))
    return zap_list

print(zap([0, 1, 2, 3], [5, 6, 7, 8]))
```


#####Another solution
```
def zap(a, b):
    result = []
    for i in range(len(a)):
        item_from_a = a[i]
        item_from_b = b[i]
        tup = (item_from_a, item_from_b)
        result.append(tup)
    return result
```

#####concise solution with list comprehensions
```
def zap(a, b):
    return [(a[i], b[i]) for i in range(len(a))]
```

All the best to you.
Appendix: Cost Optimization (Manage Demand and Supply Resources) - AWS Well-Architected Framework Study Guide
Published: 2022-03-15 14:50:20

[Return to Well-Architected Framework Guide](https://dev.to/aidutcher/aws-well-architected-framework-study-guide-introduction-fjg)

[Appendix: Cost Optimization](https://docs.aws.amazon.com/wellarchitected/latest/framework/a-cost-optimization.html)

**How do you manage demand, and supply resources?**

- Perform an analysis on the workload demand
- Implement a buffer or throttle to manage demand
- Supply resources dynamically

[Return to Well-Architected Framework Guide](https://dev.to/aidutcher/aws-well-architected-framework-study-guide-introduction-fjg)
Appendix: Cost Optimization (Cost-Effective Resources) - AWS Well-Architected Framework Study Guide
Published: 2022-03-15 14:48:04

[Return to Well-Architected Framework Guide](https://dev.to/aidutcher/aws-well-architected-framework-study-guide-introduction-fjg)

[Appendix: Cost Optimization](https://docs.aws.amazon.com/wellarchitected/latest/framework/a-cost-optimization.html)

**How do you evaluate cost when you select services?**

- Identify organization requirements for cost
- Analyze all components of this workload
- Perform a thorough analysis of each component
- Select software with cost effective licensing
- Select components of this workload to optimize cost in line with organization priorities
- Perform cost analysis for different usage over time

**How do you meet cost targets when you select resource type, size and number?**
- Perform cost modeling
- Select resource type and size based on data
- Select resource type and size automatically based on metrics

**How do you use pricing models to reduce cost?**

- Perform pricing model analysis
- Implement regions based on cost
- Select third party agreements with cost efficient terms
- Implement pricing models for all components of this workload
- Perform pricing model analysis at the master account level

**How do you plan for data transfer charges?**

- Perform data transfer modeling
- Select components to optimize data transfer cost
- Implement services to reduce data transfer costs

[Return to Well-Architected Framework Guide](https://dev.to/aidutcher/aws-well-architected-framework-study-guide-introduction-fjg)
Appendix: Cost Optimization (Expenditure and Usage Awareness) - AWS Well-Architected Framework Study Guide
Published: 2022-03-15 14:43:23

[Return to Well-Architected Framework Guide](https://dev.to/aidutcher/aws-well-architected-framework-study-guide-introduction-fjg)

[Appendix: Cost Optimization](https://docs.aws.amazon.com/wellarchitected/latest/framework/a-cost-optimization.html)

**How do you govern usage?**

- Develop policies based on your organization requirements
- Implement goals and targets
- Implement an account structure
- Implement groups and roles
- Implement cost controls
- Track project lifecycle

**How do you monitor usage and cost?**

- Configure detailed information sources
- Identify cost attribution categories
- Establish organization metrics
- Configure billing and cost management tools
- Add organization information to cost and usage
- Allocate costs based on workload metrics

**How do you decommission resources?**

- Track resources over their life time
- Implement a decommissioning process
- Decommission resources
- Decommission resources automatically

[Return to Well-Architected Framework Guide](https://dev.to/aidutcher/aws-well-architected-framework-study-guide-introduction-fjg)
Why sequelize?
Tags: node
Published: 2022-03-15 14:42:11

I was using mongoose usually But some developers told me I need to learn SQL database too.

So, I decided to learn MySQL because someone introduced me 'planetscale' which is a MySQL Cloud Database service.
**planetscale link**
https://planetscale.com/

Anyway! We are going to use MySQL and sequelize in this post!
I explained why I use MySQL but What is sequelize now?
sequelize is a Node module that supports ORM(Object Relational Mapping). Shortly, I would say sequelize is an ORM tool.
Ok. But what is ORM?
You know Nodejs handles data from database via object data type.
for example,
```js
const user = {
  email: 'example@example.com',
  password: '123123'
};
```
Since, NodeJS uses objects to deal with data from database in general. But SQL databases use tables and they are different from javascript objects.

But what if javascript objects are transformed to tables?
Then, Node Developers would handle the data with SQL databases easier.
That's what sequelize does!

I will write down some basic sequelize codes.
Then, you may think it is very similar with using mongoose!

db.js
```js
const Sequelize = require('sequelize');
// You should install a database driver!
// for example, if you want to use mysql database then install mysql2 module.
// npm install mysql2
const sequelize = new Sequelize(database_name, username, password, 
  {
    dialect: mysql,
    host: '127.0.0.1'
});

// if you want to test the connection!
// you can use 'authenticate()' method.
(async () => {
  try {
    await sequelize.authenticate();
    console.log('database connection successful');
  } catch (error) {
    console.log('database connection failed');
  }
})();

module.exports = {Sequelize, sequelize}
```
The difference between Sequelize and sequelize is that Sequelize is a sequelize node module itself but sequelize is a connection to a database. Their names follow the convention recommended by the official sequelize document!

user.js
```js
const {sequelize, Sequelize} = require('./db.js');
const User = sequelize.define('User', {
  email: Sequelize.TEXT,
  password: Sequelize.TEXT
},
  {
    timestamps: true
  }
)

// User is now sequelize model!
console.log(sequelize.models.User === User); // true!

module.exports = User;
```

signup.js
```js
const User = require('./user.js');

module.exports = async function(req, res) {
  try {
    const user = User.create({
      email: req.body.email,
      password: req.body.password
    });
    res.send(user);
  } catch (error) {
    res.send(error.message);
  }
}
```

Next time! I will post the comparison between using mongoose, raw query and sequelize!

Thanks for reading my post! If you have some feedbacks, feel free to leave comments! thanks :)
WitchHost
Tags: javascript, react, nextjs, beginners
Published: 2022-03-15 14:36:17

https://github.com/Pedromdsn/WitchHost


# WitchHost site

## A portfolio site, made using the latest technologies.

In the construction of the site, the [React.js](https://reactjs.org/) library was used with the [Next.js](https://nextjs.org/) framework, just with Typescript.
In the styling of the site was used [Tailwindcss](https://tailwindcss.com/).
## Quality:

<div align="center">
<img width="80%" src="https://media.discordapp.net/attachments/657744571395997719/903076458723962920/unknown.png?width=1440&height=519">
<br>
 1) Benchmark test using a share host
</div>

## Preview:

<div align="center">
<img src="https://media.discordapp.net/attachments/657744571395997719/903076242151063602/screencapture-witchhost-cocoblanco-fun-2021-10-28-01_21_44.png?width=738&height=700">
<br>
2) You can check the website <a href="https://witchhost.cocoblanco.fun">here</a>
</div>

## Contact

Discord: !   Pedromdsn#3873

Site: https://pedromdsn.com
Failed to connect to remote vm. connection refused. connection refused: connect
Tags: java
Published: 2022-03-15 13:49:29

Problem :
I am often facing the below error when I want to Debug from my Eclipse IDE.

Message: “Failed to connect to remote VM. Connection Refused”
How can I fix this error?

Solution :
In my case, I had to turn my Windows Firewall off

1- Open your Windows Firewall by just clicking the Start button Picture of the Start button, and then clicking the Control Panel. In your search box, just type firewall, and after that click on Windows Firewall.

2- Now just click on Turn Windows Firewall on or off. The Administrator permission required If you are prompted for the administrator password or the confirmation, type your password or provide the confirmation.

3- Click on Turn off Windows Firewall (not recommended by me) under the each network location that you are trying to stop the protection, and after that click on OK.

Sometimes you need the below steps also

To stop all the Vpn client services (fortiClient ,vpn Client ...)
To stop all the Antivirus Firewall ( exemple Kaspersky => Configuration => Anti-Hacker)
OR

I am using the jboss so the solution to your problem is very simple just restart using the below command :

service jboss-portal restart

Another Solution:
In your debug configuration you'll have to identify the correct port of your server (GF:9009 / Tomcat:8000)

You'll have to place the JVM property of the server to debug

For Glassfish:

Log in to admin-console > Configurations > server-config > JVM-Settings > check DEBUG checkbox > restart server
For Tomcat:

make file debug.bat/.sh (depending on your OS) in %TOMCAT_HOME%/bin directory and write

 set JPDA_ADDRESS=8000
    set JPDA_TRANSPORT=dt_socket
    catalina.bat jpda start
in it.

Afterward, you've made this file begin server by executing debug.bat/.sh.

Currently, you must be able to debug remotely in Eclipse after you fix the required properties in your debug configuration.

In case you're running tomcat in a Win environment as a service you don't have a catalina.bat file in the bin-directory of your tomcat installation.
For setting your server into debug-mode please attempt the following:

Run the Configuration option in Windows Menu or run
%catalina_home%/bin/tomcat6w.exe
In the Java tab, include this line to Java:
I hope this will help you
React+Express (node)+MongoDB Login/Registration Sample App
Tags: react, mongodb, expres, node
Published: 2022-03-15 14:33:23

Hello Developers

Today I am sharing an example application for user login/registration and secure pages like member area for profile and other sections.

You can find this application full source code at following url...
https://bitbucket.org/deepaksinghkushwah/react-express-login/src/master/

Application is divided in 2 parts, frontend is create in react app using "npx create-react-app" and contain login/registration/member area pages. I have used localStorage for handling login session.

Backend is created using NodeJS+Express+MongoDB. All get started information is added in readme file. This application is example application for new developers who want to learn react/express and want a ready to use sample application. 

You need to create .env file in react frontend application with following content...
REACT_APP_SERVER_HOST="http://localhost:5000/api/v1"

This is api url. You can change it in backend and set it in .env file at backend.

There is a seeder for mongodb to populate user table. You can use it with "node seeder.js -i" to import sample data or "node seeder.js -d" to delete user data. Users will be created with "test<1-100>@localhost.com" and password will be "123456". Or you can update seeder as per your need.

Few screenshots....

**Home Page**

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

**After Login**

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

**Registration Page**

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

This may contain bugs so do not use it for production. It's just for showing how login/registration work with react and how to maintain session. 

Hope you like it. Happy Coding.
Configuring NGINX configuration for Sentry self-hosted
Tags: sentry, errortracking
Published: 2022-03-15 14:32:50

This blog is the third post in the Sentry self-hosted [series](https://theappsguy.dev/series/sentry). You will set up the NGINX configuration for your Sentry self-hosted instance in this post. This post will assume you already went over the previous [post](https://dev.to/malekhijazi/configuring-domain-name-for-sentry-self-hosted-1o4o) that explains how to set up your custom subdomain to point to the server with Sentry self-hosted instance installed.

If you did everything correctly, your domain would still not be working as we need to tell NGINX how to redirect to the port Sentry is running on. To do so, you will need to set up the NGINX configuration.

There's an [article](https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-16-04) on the DigitalOcean blog that explains this in detail. However, I will go through the needed steps to set it up.

First, you will need to ssh into the server.

The NGINX configuration directory is usually at `/etc/nginx`. Inside this directory, you will see a few directories/files. We will be using 2 of these directories.

1. `sites-available`: This is where we will configure the available domains.
2. `sites-enabled`: This is where we will configure the enabled domains.

Note: you can have many domains available but not enabled. If a domain is not enabled, it won't be publicly accessible.

We will be creating a new configuration file inside the `sites-available` directory. `cd` into the `sites-available` directory, and you should have a `default` file present in the directory. You can either copy this file into a new file using the below command:

```
sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/sentry.domain.com

```

PS: make sure to change the name of the second file from `sentry.domain.com` to the domain you used in the previous article.

Or you can copy the below code and modify the content:

```
server {
        listen 80 default_server;
        listen [::]:80 default_server;

        root /var/www/sentry.domain.com;
        index index.html index.htm index.nginx-debian.html;

        server_name _;

        location / {
             # this will route to port 9000
            proxy_pass http://localhost:9000;
        }
}

```

Once you're done, save the file.

Now you have your site available, but it is not enabled yet.

We can create symbolic links from the file you just created to the `sites-enabled` directory, which Nginx reads from during startup.

To enable the domain, you will need to use the below command:

```
sudo ln -s /etc/nginx/sites-available/sentry.domain.com /etc/nginx/sites-enabled/

```

PS: don't forget to change the `sentry.domain.com` to the one you used while setting up.

Your site is now enabled, though it won't be working just yet. There's one more step you need to do for it to work. We need to restart NGINX so that the configuration would be applied.

Restart NGINX with the below command:

```
sudo systemctl restart nginx

```

After NGINX restarts, the domain should be working.

Good luck!
Appendix: Cost Optimization (Cloud Financial Management) - AWS Well-Architected Framework Study Guide
Published: 2022-03-15 14:32:15

[Return to Well-Architected Framework Guide](https://dev.to/aidutcher/aws-well-architected-framework-study-guide-introduction-fjg)

[Appendix: Cost Optimization](https://docs.aws.amazon.com/wellarchitected/latest/framework/a-cost-optimization.html)

**How do you implement cloud financial management?**

- Establish a cost optimization function
- Establish a partnership between finance and technology
- Establish cloud budgets and forecasts
- Implement cost awareness in your organizational processes
- Report and notify on cost optimization
- Monitor cost proactively
- Keep up to date with new service releases

[Return to Well-Architected Framework Guide](https://dev.to/aidutcher/aws-well-architected-framework-study-guide-introduction-fjg)