teleren/devto huggingface dataset:
Regression Testing (Part-1)
Tags: apacheage, postgressql, age
Published: 2023-07-20 22:16:10

**Brief Introduction**

Regression Testing is a type of software testing is the type of testing which verify that recent changes or updates to a software application have no new bugs. This is because new code may bring in new logic that conflict with the existing code. Normally QA teams have a series of regression test cases for important features that they will re-execute each time these code changes occur to save time and maximize test efficiency.

**Why is Regression Testing Important?**
Regression Testing is important for several reasons i.e. overall quality, reliability, and maintainability of software applications. Here are some key reasons why regression testing holds significant importance:

1. Detecting Defects Early
2. Ensuring Software Stability
3. Verifying Fixes of Bugs
4. Supporting Agile Development (https://www.atlassian.com/agile)
5. Facilitating Continuous Integration and Deployment (CI/CD) 
6. Reduces Risks and Costs & Supports Long-Term Maintenance
7. Compliance, Standards & Enhancing Confidence in Code Changes

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

**Regression Testing Tools and Frameworks**
[Selenium:](https://www.browserstack.com/selenium) Selenium is used to run regression tests. Selenium Browser Automation helps run tests on different browsers and find bugs.

[Cypress:](https://browserstack.com/automate/cypress) You can perform [E2E Testing](https://www.browserstack.com/guide/cypress-end-to-end-testing) and Components Testing on Cypress. This helps you run Regression Tests on browsers using Cypress effortlessly.

[Appium:](https://www.browserstack.com/app-automate/appium) It is used to run regression tests on iOS and Android apps. You can check the functionality of the mobile apps using Appium.

[Playwright:](https://www.browserstack.com/automate/playwright)Playwright is used for running regression tests for web applications on different browsers.

[Puppeteer:](https://www.browserstack.com/automate/puppeteer) You can use Playwright to run regression tests for web applications on different browsers.

[BrowserStack App Automate:](https://www.browserstack.com/app-automate) You can integrate different web testing frameworks, like Appium, Espresso, and XCUITest, with BrowserStack App Automate. It helps you run tests on real Android and iOS devices for better accuracy.

**Conclusion:** Regression Testing is a fundamental practice in software development that safeguards against regressions in the quality and reliability of software applications throughout their lifecycle. By catching defects early, ensuring stability, and supporting agile practices, regression testing plays a vital role in delivering high-quality software products to end-users.

**Suggestion to get more information:**
https://katalon.com/resources-center/blog/regression-testing
https://en.wikipedia.org/wiki/Regression_testing


To be Continue...
What occurs when coding in C# from Javascript perspective...
Tags: csharp
Published: 2023-07-20 22:09:36

When you embrace a programming language you have to use it's specific idioms.

But this time I  and want to see what can be accomplish when coding in C# thinking in Javascript...

Let's create a tool which interrogates a Web API

Here is the structure of the application :

![Folders](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/53rzb5semnz2aaqvls3n.png)

TodoRecord.cs

```csharp
namespace RequestApp.Todos
{
    public record class Todo(
        int? Userid = null,
        int? Id = null,
        string? Title = null,
        bool? Completed = null
    );
}
```

TodoRequester.cs

```csharp

using RequestApp.Todos;
using System.Net.Http.Json;

namespace RequestApp
{
    public static class TodoRequester
    {
        const string urlTodo = "https://jsonplaceholder.typicode.com";

        public static Func<Task<List<Todo>>> Request()
        {
            HttpClient client = new() { BaseAddress = new Uri(urlTodo) };

            return async () =>
            {
                var request = await client.GetFromJsonAsync<List<Todo>>("/todos");

                return request ?? new List<Todo>();
            };
        }
    }

}
```

Program.cs

```csharp
namespace RequestApp
{
    static class Program
    {
        private static async Task Main(string[] args)
        {
            var first = await TodoRequester.Request()();

            Console.WriteLine(first.First());

            Console.WriteLine("-------------------");

        }
    }
}
```
Result :

![Result](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m7uvbwfis2bx120x46fl.png)

I would certainly not use this type of code in my team, but for my personnal projects that fits my needs....
Day 4- (Crafting an Adventure with Python) #100DaysOfCode #30DaysOfPython
Published: 2023-07-20 22:07:20

# Crafting an Adventure with Python: Your Epic Story Awaits!

Have you ever envisioned yourself as the hero of an epic adventure, with incredible powers and battling frightening foes? Welcome to your adventure simulator, where we will create a captivating story only for you! In this blog post, we'll look at how Python can help us develop dynamic tales depending on your input and imagination.

## The Adventure Simulator Script

Let's have a look at Python and narrative. The code below is an interactive adventure simulator that prompts you for key details needed to build your adventure story. The script then creates a customized story in which you are central to everything.

# Welcome message and input prompts
_**print**_("Welcome to your adventure simulator. I am going to ask you a bunch of questions and then create an epic story with you as the star!\n")

**_name_** = _input_("What is your name? ")
_**enemy_name**_ = _input_("What is your worst enemy's name? ")
_**superpower**_ = _input_("What is your superpower? ")
_**address**_ = _input_("Where do you live? ")
**_fav_food_** = _input_("What is your favorite food? ")

# Generate and display the adventure story
**_print_**("\n Hello", _**name**_, "! Your ability to", _**superpower**_, "will make sure you never have to look at", **_enemy_name_**, "again. Go eat", **_fav_food_**, "as you walk down the streets of", address, "and use", _**superpower**_, "for good and not evil!")`


## How the Story Unfolds

1. The script begins with a greeting message that welcomes you to the adventure simulator. It notifies you that it will ask you a series of questions in order to generate a unique adventure story based on your responses.

2. The adventure simulator will ask you for your name, your worst enemy's name, your superpower, where you reside, and your favorite dish. These questions are required to personalize the story.

3. When the simulator has collected all of your responses, it will utilize Python's string concatenation to construct a tale based on the information you provided. It then prints out the entire adventure story, making you the hero of an epic tale filled with magic and wonder!


## Conclusion

Using Python's skills to handle user input and string concatenation, we examined the topic of story and adventure simulation. By modifying stories based on user response, we can create new and engaging experiences for consumers. Writing dynamic Python stories, whether for fun or for profit, brings imagination to life and enhances a wide range of real-world applications. So, are you ready to embark on your new adventure? Only your imagination limits your possibilities! Congratulations on your code and story!




Feel like a proper storyteller with the custom storybook that I coded up 📖 ! Day 4 of #Replit100DaysOfCode #100DaysOfCode. Join me on @Replit https://join.replit.com/python
Real-time Oracle
Tags: refinehackathon
Published: 2023-07-20 22:02:35

## What I built
I built a crypto/nft price fetcher it can also be used to search for a particular cryptocurrency or nft data.

### Category Submission: 
Best Overall Project
Most Visually Pleasing
Most Technical Impressive
Best Project built using Material UI as the main UI framework for the refine app.

### App Link
https://dashboardoracle.netlify.app/
### Screenshots 


### Description 
This app get the current price of crypto market and nft market

### Link to Source Code 
https://github.com/Stephenson30/dashboard

### Permissive License 
MIT License

## Background (What made you decide to build this particular app? What inspired you?) 
Highlight various technologies on the way such as typescript material-ui and many more.

I was inspired by the current bear market because this will be a way for people to easily check the market condition

### How I built it (How did you utilize refine? Did you learn something new along the way? Pick up a new skill?) 

### Additional Resources/Info
Thank you for considering my projects.
TIL Blog Day 6 - Ruby Classes
Tags: webdev, beginners, programming, ruby
Published: 2023-07-19 22:27:09

Today I was able to finish the Codecademy Ruby module. It ended with an introduction to classes in Ruby. Before Tech Prep I had studied JavaScript and that was my only exposure to classes. This previous exposure to classes has provided me with a solid foundation for grasping the intricacies of Ruby's class system. 

The biggest difference between Ruby classes and JavaScript classes is that Ruby provides built-in access control for class methods and instance methods using public, private, and protected keywords.

JavaScript, on the other hand, doesn't have built-in access control. Conventionally, developers use naming conventions (like prepending an underscore _) to indicate private members, but these are not strictly enforced by the language itself.

Overall I am liking the simplicity of Ruby. Tomorrow I will tackle the Intro to Ruby modules and keep reading my Ruby book.
Day 787 : Routine
Tags: hiphop, code, coding, lifelongdev
Published: 2023-07-20 21:55:53

_liner notes_:
- Professional : Got up early to attend the group meeting that was Asia time friendly. Right after, I went back to sleep. haha I know myself and I'm not watching the recording. Had our team meeting and got the okay on the updates I've been making. Also got some good feedback on the blog post I'm writing. Spent some time working on the ReadMe for the demo application that will go with the blog post. Then I was asked to make a couple of quick changes to the updates I did. Then I reviewed a PR, but had a bunch of questions and basically went down a rabbit hole with the team discussing things for the rest of the day.

- Personal : Went through some tracks for the radio show. Worked on the selected session form for my side project. I'm realizing that there will be certain data that I'll need to show and then allow the user to decide if they want to edit it if they want to include it in the update. Need to figure that out. Finished the night watching an episode of "Secret Invasion" and a couple of "Never Promiseland".

![Mossy green landscape of Lünersee, Austria with stone mountains in the distance and a brook running through the center of the photo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6nt6f8i8qc1xvo97yyoj.jpg)

Going to pretty much do the same thing as last night. Go through tracks. Figure out the form for session editing and updating. Then will watch a couple of episodes of "Promised Neverland". Getting my nightly routine down.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube N3Wi9T9cRKI %}
Feeling Rich with ChatGPT: A Quirk in AI? 💰
Published: 2023-07-20 21:53:47

Hello, tech enthusiasts and AI aficionados! 🖐️ We're diving into something fun and quirky today. Have you ever wanted to proclaim your wealth to the world, even if it's just in jest? Well, I've got just the thing for you - the 'I am Rich' plugin for ChatGPT! 🎉


![Come on](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mseodiejv5tw9j4pt5h6.gif)



The 'I am Rich' plugin is a delightful little tool that adds a humorous twist to your interactions with ChatGPT. It's simple, yet it's bound to bring a smile to your face 😄. Whenever you type the phrase "I am rich", this plugin responds with a specific image typically associated with wealth or luxury. It's a symbolic nod to your statement, a playful affirmation of your claim.

Now, you might be wondering, "What's the point?" 🤔 Well, isn't it fun to have a little unexpected humor in our daily tech interactions? The 'I am Rich' plugin doesn't have any other functionality beyond this. It's a light-hearted addition to the ChatGPT ecosystem, a reminder that even in the world of AI, there's room for a bit of fun and laughter 😂.

So, the next time you're interacting with ChatGPT, give it a try! Type "I am rich" and see what happens. Who knows? You might just get a kick out of the image that pops up 🎁.

I'd love to hear your thoughts on this quirky plugin. Did it make you chuckle? Did it surprise you? Share your experiences and views in the comments below. After all, the world of tech is as much about community and conversation as it is about code and algorithms.

_Until next time, keep exploring, keep laughing, and remember - even in the virtual world, you can be 'rich'!_ 💎


![cheers](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/umpnbv642ve1wf6jqj3x.jpeg)
Сортування бульбашкою - JavaScript (Bubble Sort)
Tags: javascript, algorithms, programming, tutorial
Published: 2023-07-20 19:57:10

Сортування бульбашкою (Bubble Sort) також іноді називають сортуванням простими обмінами.

Загалом єдиною перевагою цього алгоритму є те, що він простий у реалізації. Сам по собі він не є ефективним, має складність O(n²) і на практиці не використовується. Але знати його не завадить, адже на його основі створено інші складніші й оптимізованіші алгоритми - сортування перемішуванням (Cocktail sort), сортування купою (Heapsort), швидке сортування (Quicksort).

Суть алгоритму в порівнянні пари сусідніх елементів - якщо вони стоять у неправильному порядку, то їх міняють місцями. Щоб впорядкувати таким чином увесь масив завдовжки N, доведеться пройтися по ньому N-1 раз (останній елемент уже буде відсортовано на попередній ітерації, тому для нього прохід не потрібен). Також за кожен прохід у кінець масиву "спливає" при сортуванні за зростанням - найбільше число, за спаданням - найменше. А отже, на наступній ітерації його можна вже не перевіряти.

![Візуалізація алгоритму сортування бульбашкою](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y229m8epsk1piktvgf6f.gif)
_Візуалізація алгоритму сортування бульбашкою_

У першому наближенні алгоритм для сортування за зростанням виглядає так:

```javascript
function bubbleSort(arr) {
    for (var i = 0, endI = arr.length - 1; i < endI; i++) {
        for (var j = 0, endJ = endI - i; j < endJ; j++) {
            if (arr[j] > arr[j + 1]) {
                var swap = arr[j];
                arr[j] = arr[j + 1];
                arr[j + 1] = swap;
            }
        }
    }
    return arr;
}
```

Але в такому вигляді ніяк не враховується, який масив надійшов на вхід, і навіть для вже відсортованого масиву програма повинна буде виконати всі ітерації циклів.

Її можна оптимізувати, додавши прапор, що відстежує перестановку елементів - якщо за черговий прохід масивом не відбулося жодної, значить, масив уже відсортовано. Код тепер матиме такий вигляд:

```javascript
function bubbleSort(arr) {
    for (var i = 0, endI = arr.length - 1; i < endI; i++) {
        var wasSwap = false;
        for (var j = 0, endJ = endI - i; j < endJ; j++) {
            if (arr[j] > arr[j + 1]) {
                var swap = arr[j];
                arr[j] = arr[j + 1];
                arr[j + 1] = swap;
                wasSwap = true;
            }
        }
        if (!wasSwap) break;
    }
    return arr;
}
```

Ну і наостанок перепишемо наш алгоритм на новий синтаксис ES6 і позбудемося додаткової змінної:

```javascript
const bubbleSort = arr => {
    for (let i = 0, endI = arr.length - 1; i < endI; i++) {
        let wasSwap = false;
        for (let j = 0, endJ = endI - i; j < endJ; j++) {
            if (arr[j] > arr[j + 1]) {
                [arr[j], arr[j + 1]] = [arr[j + 1], arr[j]];
                wasSwap = true;
            }
        }
        if (!wasSwap) break;
    }
    return arr;
};
```
Network Hardening Using Amazon Inspector and AWS Systems Manager
Tags: aws, awsrestart, networking, security
Published: 2023-07-20 21:50:44


![Lab screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ksxp7h5cziku9tl2z863.png)
In this lab, you are a new security engineer for AnyCompany, and your task is to identify weak areas in the company's network security and improve its efficiency and optimization. You will be using Amazon Inspector, a tool that runs scans to analyse network configurations like security groups, network ACLs, route tables, and internet gateways to find vulnerabilities in your EC2 instances.

Here are the main steps you'll be performing in the lab:


Task 1: View EC2 instances and add tags

- Tag the BastionServer instance with a "SecurityScan" tag to include it in the Amazon Inspector assessment target.


Task 2: Configure and run Amazon Inspector

- Create an assessment target named "Network-Audit" and specify the BastionServer instance using the "SecurityScan" tag.

- Create an assessment template with the "Network Reachability-1.1" rules package and set the duration to 15 minutes.

- Initiate the assessment run to scan the network configurations for vulnerabilities.


Task 3: Analyse Amazon Inspector findings:

- Review the findings generated by Amazon Inspector, which show potential security issues like open ports reachable from the internet.


Task 4: Update security groups

- Address the high-severity finding by modifying the security group attached to the BastionServer instance.

- Remove the wide-open Telnet port (port 23) and restrict SSH access (port 22) to only your IP address.


Task 5: Replace BastionServer with Systems Manager

- Replace SSH access to the AppServer with Systems Manager's Session Manager, a more secure way to connect to EC2 instances without opening inbound ports or managing SSH keys.


Throughout the lab, I used the AWS Management Console to perform these tasks. At the end of the lab, I have improved network security, closed potential vulnerabilities, and replaced traditional SSH access with Systems Manager for more secure connections.
Understanding useCallback() vs. useMemo() in React.js 🚀
Tags: react, reacthooks, reactjsdevelopment
Published: 2023-07-20 21:18:27

Hello Dev community! Today, I'm excited to share my post, focusing on two essential React hooks - useCallback() and useMemo(). These hooks play a crucial role in optimizing React applications by memoizing functions and values. Let's dive in and explore the differences and use cases for each of them.

**1.useCallback(): The Function Memoizer**

When working with React, you might come across scenarios where a component receives a function as a prop. Every time the component re-renders, the function is created again, even if its dependencies have not changed. This can lead to unnecessary re-renders of child components.

This is where useCallback() comes to the rescue! useCallback() 🎣 memoizes the function so that it is not recreated on each render, but only when its dependencies change. This can help in preventing unwanted re-renders and improving performance.

Here's how you can use **useCallback()**:

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

**2.useMemo(): The Value Memoizer**

On other occasions, you might have expensive computations or complex operations that are repeatedly called within a component. Using useMemo() can save the day!

Similar to useCallback(), useMemo() 🧠 memoizes the result of the computation and returns the memoized value on subsequent renders, as long as its dependencies remain unchanged. This can be particularly helpful in optimizing performance when dealing with computationally-intensive tasks.

Here's how you use **useMemo()**:


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

**So, When to Use Which?**

- Use **useCallback()** 🎣 when you need to memoize a function to prevent unnecessary re-creation, especially when passing the function as a prop to child components.

- Use **useMemo()** 🧠 when you want to memoize the result of an expensive computation or data manipulation to avoid redundant calculations.

**A Word of Caution:**
While **useCallback()** and **useMemo()** can improve performance, excessive or improper use of memoization can lead to unnecessary complexity. Be mindful of their application, especially in small components where the overhead of memoization might outweigh its benefits.

**Conclusion:**
In conclusion, understanding the differences between **useCallback()** and **useMemo()** is essential in optimizing your React applications. By utilizing these hooks wisely, you can efficiently manage functions and computations, resulting in smoother and more performant user interfaces.

I hope this article has shed some light on these two useful React hooks. Happy coding, and feel free to share your thoughts and experiences with useCallback() and useMemo() in the comments below! 🚀

Thank you for reading my first post on Dev.to! If you found it helpful, consider giving it a thumbs-up 👍 and follow me for more React.js insights🤝.
GDB Installation On Ubuntu
Tags: apacheage, ubuntu
Published: 2023-07-20 20:40:48

## Introduction: 
GDB stands for "GNU Debugger." It is a powerful and popular debugger tool used primarily for debugging programs written in various programming languages.
The main purpose of GDB is to help developers find and fix bugs in their programs. It allows them to inspect the running state of a program, control its execution, and examine variables and memory.

## Installation of GDB 

You can easily install GDB on Ubuntu by running the following command on terminal:

## 1. Updating Package Listing:
```
sudo apt update
```

## 2. Installing "GBD"

```
sudo apt install gdb
```

## 3. Installation Confirmation:

```
gdb --version
```
That's it! You have now installed GDB on your Ubuntu system. To use it, simply run it followed by the executable you want to debug, like this:

```
gdb your_executable
```
## Key Feature Of GDB
- Designers can set breakpoints at explicit lines or works in the source code to end the program's execution and assess its state at that point.

- GDB gives different commands to step through the program's execution, including stepping line by line, stepping into functions, and stepping out of functions.

- It allows developers to obtain a backtrace of the program's call stack by identify the sequence of function calls leading to an issue.

- Developers can set breakpoints that trigger just when certain conditions are met, allowing for more fine-grained debugging.

- GDB helps developers to examine the values of variables and data stored in memory during program execution.

- GDB can be used to analyses core dumps generated when a program crashes, aiding in post-mortem debugging.

## GDB package Information:

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

**Conclusion:** GDB is a powerful tool used for debugging, and you should have a good understanding of debugging concepts to use it effectively.

## Recommended Reading:
 https://howtoinstall.co/en/gdb