teleren/devto huggingface dataset:
Finding a bug after writing a test, an example
Tags: webdev, react, javascript, testing
Published: 2022-11-30 15:56:04

Photo by <a href="https://unsplash.com/@alanemery?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Alan Emery</a> on <a href="https://unsplash.com/s/photos/code-bug?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>

In almost every Sprint, at work, I try to reserve some space for solving tech debt and doing some refactoring. A part of resolving this debt is making integration tests. And sometimes it happens that those tests find some unknown bug. That's what happened a few days ago. As usual, the names of the methods and variables are just an example.

The page I was writing the tests on is a simple one. Some text, three buttons, and nothing more. Yet, it has some hooks as well, defining the logic of those buttons (opening another URL, submitting the form, etc).

I started writing the tests in the usual way, using React Testing Library. Checking the rendering and the behavior of the page by clicking on the different buttons. When I was writing the test for one of the three buttons, however, it forced me to let me think: is this button always visible? Why?

```js
{showButton && (
   <Button onClick={onApplyClick}>
      DO THING
   </Button>
 )}
```

I checked the hooks and found out that it would render only when another property was true, or present. So why it was always there?

```js
  showButton: !!secondaryProp,
```

I followed the source of that property and I came across the point where its data was fetched from the (easy-peasy) store, and then it was set as an initial value of 0, instead of being undefined.

```js
const initialState: IState = {
  ...
  secondaryProp: 0,
```

The type of that property was just "number", instead of "number?". So it was always true.

```js
export interface IState {
  secondaryProp: number
```

To fix it, I changed the type and set the initial values as undefined. 

Re-checking that property I saw that another value was dependent on it being present or not. So in another hook, I had to redefine the behavior in case the prop was falsy.

```js
const newUrl = secondaryProp && `${FETCHED_URL}/prop=${secondaryProp}`

const onClick = () => {
    if (!newUrl) {
      return
    }

    window.open(newUrl)
  }
```

So that's an interesting case of how making tests helps you reflect on what the behavior, and the logic of the methods and components, should be.

Thank you for reading! Let's connect on [Twitter](https://twitter.com/AlexBuaiscia) or [Mastodon](@alex_@uiuxdev.social)!
Tailwind is a Leaky Abstraction by Jake Lazaroff
Tags: tailwindcss
Published: 2022-11-30 15:48:34

[Jake Lazaroff makes convincing arguments against using Tailwind CSS.](https://jakelazaroff.com/words/tailwind-is-a-leaky-abstraction/).

My main concern was always how unreadable the HTML became, regardless of whether I added line breaks between the class names or not.

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

<https://jakelazaroff.com/words/tailwind-is-a-leaky-abstraction/>
Elasticsearch vs Splunk - Which tool to choose for Log Management?
Published: 2022-11-30 15:47:54

Elasticsearch vs Splunk - Which tool to choose for Log Management?

The answer to this question depends on the specific needs of the organization. Splunk is a purpose-built tool for log management, while Elasticsearch can be used to store and search logs in an unstructured format. Splunk is usually the preferred choice for organizations that need to store, analyze and report on large volumes of structured log data. Elasticsearch, on the other hand, is a better choice for organizations that need to store and search unstructured log data.
Monoliths vs Microservices vs Serverless
Published: 2022-11-30 15:42:37


Microservices Architecture
Microservices are an alternative to the monolithic architecture.

Microservices are an alternative to the monolithic architecture. Instead of having all the features in one codebase, microservices are made up of individual components that each handle a specific part of the application. For example, in our online store example, you could have one microservice that handles checkout, another that handles payments, another that handles inventory management and another that handles order updates.

The advantage of microservices is that they are easier to scale and adapt to changing requirements. Because each microservice is independent of the others, it can be modified, updated or replaced without affecting the rest of the application. This makes it much easier to add new features or make changes to existing ones without needing to rewrite the entire codebase.

However, microservices also come with their own set of challenges. For one, they require more complex interactions between the different components which can make them harder to debug and maintain. Additionally, microservices are more expensive to deploy and manage since each one needs to be separately deployed, monitored and managed.

Serverless Architecture
Serverless architectures are a type of microservices architecture.

Serverless architectures are a type of microservices architecture.
Welcome Thread - v202
Tags: welcome
Published: 2022-11-30 15:33:44

---
title: Welcome Thread - v202
published: true
description: Welcome to DEV! A thread of hellos and intros.
tags: welcome
canonical_url: 
---

![Woody from Toy Story saying hello to Buzz. We're seeing it from the pov of Buzz.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/85uzxvx8i5b2pd2jfx1n.gif)

### Welcome to DEV!

1. Leave a comment below to introduce yourself! You can talk about what brought you here, what you're learning, or just a fun fact about yourself.

2. Reply to someone's comment, either with a question or just a hello. 👋 

**Great to have you in the community!**
OWASP API Security Top 10 API5:2019 Broken Function Level Authorization with an Example
Tags: webdev, security, opensource, api
Published: 2022-11-30 15:30:00

A flaw in the design or implementation of an API that allows a user to bypass intended access controls, such as authentication or authorization checks. This can occur when the API does not properly enforce the intended security controls or when it fails to properly check the user's permissions before allowing them to access the API

In this blog, I have explained about the OWASP API Security Top 10 API5:2019 Broken Function Level Authorization with an Example.

{% embed https://blogs.appsecworld.com/2022/11/owasp-api-security-top-10-api5-2019-broken-function-level-authorization.html %}
Final Space - Android Kotlin
Tags: android, kotlin, api, mobile
Published: 2022-11-30 15:29:27

Hi there. Today I want to share the Android App I made with the final space animated series api.

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

## Tech Stack
- Mvvm
- Clean Architecture
- Hilt
- Room
- Network Resource Bound (Cache)
- Coil

You can give me feedback.
[Github Source](https://github.com/hamzaazman/FinalSpace)
Get Certified - Pass the AWS Cloud Practitioner 2022-2023
Tags: cloud, aws, certification
Published: 2022-11-30 15:26:40


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

A certification provides competency, shows commitment, professionalism and most importantly: it motivates you to keep learning and gather knowledge. It's also a great way to get a better job.

Currently AWS is the number 1 cloud provider, and continues  growing. Amazon constantly improves, changes and adds new services and resources to it's cloud platform. 

Every cloud provider has its pros and cons, but let's focus on the positive side of AWS:
1.	AWS provides very strong and fast PaaS capabilities, which in today’s world is a very important part of any cloud infrastructure.
2.	AWS brings to the array an integrated environment for deploying cloud apps, development and testing.
3.	The new design of AWS is intuitive, easy to digest and with a solid security development life-cycle included.
4.	The developer’s tools are amazing, and with a lot of flavors and colors. From an IoT suite to machine learning.

So with all these cool features, sounds like AWS is a very competitive cloud provider, and it's worth it to get certified.

The AWS Cloud Practitioner Exam, is a multi-choice, theoretical exam, and covers the foundations upon AWS designed its cloud platform, from standards to cases of use for the services and/or products available on AWS.

If you're interested in getting the certification, download my  document. This exam covers topics like security, privacy, compliance, general cloud concepts, and basic understanding of pricing and support for several AWS services and resources. Does not matter if you're unfamiliar with AWS, my document will help you out!

>>> DOWNLOAD
https://mega.nz/file/cU1nSJyQ#5bwSdl_VlSbgdHK2oOL7NZU-l9STRmYVQUnTCLMmY2A
Introduction to Java!
Tags: java, beginners, tutorial
Published: 2022-11-30 15:12:02

"JAVA was developed by Sun Microsystems Inc in 1991, later acquired by Oracle Corporation. It was developed by James Gosling and Patrick Naughton. It is a simple programming language.  Writing, compiling and debugging a program is easy in java.  It helps to create modular programs and reusable code."

---

## Welcome to Java.
In this tutorial, you will learn to write "Hello World" program in Java.

A "Hello, World!" is a simple program that outputs `Hello, World!` on the screen. Since it's a very simple program, it's often used to introduce a new programming language to a newbie.

```java
// Your First Program
public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
}
```
Output

```
Hello, World!
```
---

## So how it is works?

- `//Your First Program`   
                                                                                     
In Java, any line starting with `//` is a comment.
Comments are intended for users reading the code to understand the intent and functionality of the program. It is completely ignored by the Java compiler.

- `public class HelloWorld{...}`

In Java, every application begins with a class definition. It is depends on your file name, for example your file name will be `Hello.java` so the class has to be called "Hello".

```java
public class Hello {
    // Class Definition
}
```

- `public static void main(String[] args) {...}`

This is the main method. Every application in Java must contain the main method. The Java compiler starts executing the code from the main method.

```java
public static void main(String[] args) {
    // Main Method
}
```

- `System.out.println("Hello, World!");`

The code above is a print statement. It prints the text `Hello, World!` to standard output (your screen).
CKA tips : 1 - What to do if you mess up the CKA Exam
Published: 2022-11-30 15:07:12

CKA expands to [Certified Kubernetes Administrator](https://training.linuxfoundation.org/certification/certified-kubernetes-administrator-cka/)

I messed up my CKA exam in October 2022. I planned to take the exam from office in my office laptop thinking that I could use the reliable internet and quiet meeting room. I performed system check multiple times, I had admin rights on the system and I was able stop antivirus/firewall also. So I did not expect any issues.

But on the exam day when I launched exam it was giving an error something like "unable to connect to server". I did not have a plan B. I was absent for the exam. I became desperate and could not do anything for few hours after that.

Then I decided to contact the support team and explain my situation. I found only some FAQ documents in all support links. Then after a thorough search I found  the proper channel. I wanted to explain the exact steps to contact LF support team to those who need it. That is the reason for this post. I will explain the ticket opening steps in detail here.

- Login to https://trainingportal.linuxfoundation.org/learn/dashboard

- Click "My LF Profile"

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


- Click "Get Help" > Support

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


- Make sure you click on the "Help Center"

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

- Click "Training & Certification Customer Support Portal"

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


- Select "Exam Session issue" and open the ticket with required details

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


So my advice to those who are planning to attend online exam using "PSI Secure browser" is never use office laptop for examinations. Always use personal devices.
Python Programming Bootcamp #7 - command line arguments (sys.argv), CI
Tags: python, beginners, tutorial
Published: 2022-11-30 14:42:00

---
title: Python Programming Bootcamp #7 - command line arguments (sys.argv), CI
published: true
description: Command line arguments
tags: python, beginners, tutorial
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
published_at: 2022-11-30 14:42 +0000
canonical_url:
series: bootcamp
---

{% youtube 1q7B6ozJXRM %}

00:00 Review of the previous chapter, answering questions raised during the previous video.
00:50 Power of. About forgetting language constructs.
02:50 Check if a string can be converted to a float.
07:45 Solution of the [area of rectangle exercise](https://code-maven.com/slides/python/solution-rectangle).
13:57 Solution of calculator exercise.
20:10 [Command line arguments](https://code-maven.com/slides/python/command-line-arguments)
32:10 Command line arguments - [len](https://code-maven.com/slides/python/command-line-arguments-len)
34:00 Showing [PyPi](https://pypi.org/)
35:03 Command line and exit. Usage. Exit code.
41:25 Continuous Integration systems.
43:20 Exercises: [Rectangle](https://code-maven.com/slides/python/exercise-rectangle-argv), Calculator.
Moz Da Pa Checker
Tags: moz, seo, domain, checker
Published: 2022-11-30 14:41:17

Domain (DA) is a tool developed by Moz. Its score shows the "strength" and affinity of a website in a particular field or industry. It uses a logarithmic scale to score, usually from 0 to 100, which can predict the ranking of a website on search engine results pages (SERPs). The higher the score, the higher the domain weight DA of this website.

Now, you can't confuse the weight of the domain name of the website with the weight of the page, they are different.

However, domain weight (DA) tells us the overall ranking potential of a domain name or website, while page weight (PA) refers to the ranking potential of a single web page.

Both require tools to detect.

## DOMAIN(DA) CHECKER
Smart marketers constantly monitor and improve the weight of their websites, establish a lead, and achieve better rankings on search engine result pages (SERPs). They also pay attention to the weight of competitors' domain names and adopt corresponding countermeasures flexibly.

The domain weight checker provided by DaPachecker.net is the best and most popular tool. People often use it to detect the weight of the Moz domain name of a website. Our domain weight (DA) checker is very interesting to use, it can tell you the accurate domain weight DA score of any website.

It is built on a very reliable platform, and can quickly determine the strength of the specified URL and the possible ranking of the search engine results.

Website: [da pa checker](https://www.dapachecker.net)
AWS Resource Explorer
Tags: aws, devops, kubernetes, security
Published: 2022-11-30 14:40:16

To start using Resource Explorer, I need to turn it on so that it creates and maintains the indexes that will provide fast responses to my search queries. Usually, the administrator of the account is the one taking these steps so that authorized users in that account can start searching.

To run a query, I need a view that gives access to an index. If the view is using an aggregator index, then the query can search across all indexed Regions.

In the [Resource Explorer console](https://console.aws.amazon.com/resource-explorer), I choose Enable Resource Explorer. Then, I select the Quick setup option to have visibility for all supported resources within my account. This option creates local indexes in all Regions and an aggregator index in the selected Region. A default view with a filter that includes all supported resources in the account is also created in the same Region as the aggregator index.

**Setting up and configuring Resource Explorer**

There are two ways to set up Resource Explorer:

- Quick setup

- Advanced setup

**Setting up Resource Explorer using Quick setup**
If you choose the Quick setup option, Resource Explorer does the following:

- Creates an index in every AWS Region in your AWS account.

- Updates the index in the Region you specify to be the aggregator index for the account.

- Creates a default view in the aggregator index Region. This view has no filters so it returns all resources found in the index.

Minimum permissions

To perform the steps in the following procedure, you must have the following permissions:

Action: `resource-explorer-2:*` – Resource: no specific resource `(*)`

Action: `iam:CreateServiceLinkedRole` – Resource: no specific resource `(*)`



**To set up Resource Explorer using Quick setup**
1. Open the AWS Resource Explorer console at https://console.aws.amazon.com/resource-explorer.


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

2. Choose Turn on Resource Explorer.
3. On the Turn on Resource Explorer page, choose Quick setup.
4. Choose which AWS Region you want to contain the aggregator index. You should select the Region that is appropriate for the geographic location for your users.
5. At the bottom of the page, choose Turn on Resource Explorer.
6. On the Progress page, you can monitor each AWS Region as Resource Explorer creates its index. The page displays the status of creating the aggregator index and creating the default view.

**Searching With AWS Resource Explorer**
After resources have been indexed, I choose Proceed to resource search. In the Search criteria, I choose which View to use. Currently, I have the default view selected. Then, I start typing in the Query field to search through the resources in my AWS account across all Regions.

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


For more details - [Resource Explorer](https://docs.aws.amazon.com/resource-explorer/latest/userguide/getting-started-setting-up.html?icmpid=docs_re_console_getting-started-setting-up)

---
How to build the successful software development team
Tags: business, team, management, software
Published: 2022-11-30 14:37:04

How to create a winning digital product? What's the secret to coming up with great products that will ensure the success of your business?
The idea and strong innovator is not always enough. There is also a need of right tech team of software developers and other specialists with strong skills who will build the product, implement and ensure effective operations. Gathering such talents might be a huge challenge, but you’re in a good hands.

How to build a successful software development team? Let us bring you closer to the process. Read the article on [Liki Blog](https://likims.com/blog/how-to-build-the-successful-software-development-team). We'd be happy to help.
+20.000 Developers Rename the Wireless Mouse to Hamster - Help Us!🐹
Tags: beginners, tutorial, programming, productivity
Published: 2022-11-30 14:15:31

The wireless mouse is not only one of the most essential parts of your computer setup but it is also an integral part of your everyday life, but did you know that this amazing piece of technology has been given an incorrect name? We think it’s time for a change!

It may seem like people are just joking around, but many of them insist that they are serious about it and have even [opened a pool on change.org](https://chng.it/RjGpG9cdTJ) — and it’s going great!

![hamster](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wnoh0wslxnq8fdjt4v8k.jpg)

Can we really change the name of the wireless mouse to hamster? Should we? What do you think?

Everything starts from the fact that “wireless” has been added to mouse to refer to its wireless version, but this is not anatomically correct!

![hamster](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/97xthfvh5prfmqxnalia.jpg)

So, why use two words when you can use one? Moreover, we must protect the rights of hamsters:

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

For this reason, it has been proposed to **change the name of these devices from wireless mice, to hamsters**.

It is true that it is practically impossible for the whole world to accept this change (perhaps they are not ready for it) but how funny would it be to make this meme come true?

You can help by voting too! You can find the [poll on change.org](https://chng.it/RjGpG9cdTJ) and vote for the renaming. Let’s all join together to reach the goal of 25,000 signatures! Many people agree:

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

Also good point:

![hamster](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5hez68dmp2bbm1hv6o0g.png)

It’s obviously very important:

![hamster](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3bkzzzeqicjiens2e9p3.png)

The reasons for signing are endless. What’s more, I don’t think we have a solid argument to convince the whole world. So I would like to ask you to think of the ideal argument!

🎁 If you do, comment a screenshot with your argument, **I will give 10$ to the most voted**. Yes, it’s not a big reward but what better way to get 10$ than come up with an ironical argument about why we should rename the wireless mouse to hamster? Let's be serious ;)

[https://chng.it/RjGpG9cdTJ](https://chng.it/RjGpG9cdTJ)

_published with my hamster’s click_ 🐹
Rendering Strategies: which one is best for you?
Tags: react, beginners, javascript
Published: 2022-11-30 13:59:43

{% youtube lvb8WroyL2E %}

How to choose a rendering strategy? Watch a video by our frontend developer Aleksandra about rendering strategies and pros and cons.  

Enjoy! You can also read the article at [Frontend House](https://frontendhouse.com/experts-zone/rendering-strategies-which-one-is-best-for-you-experts-zone-28).