teleren/devto huggingface dataset:
Semantic HTML
Tags: html, frontend, css, developer
Published: 2023-09-04 03:49:59

Semantic HTML is a coding practice that involves using HTML elements not just for their presentational qualities but for their underlying meaning and purpose. Leveraging semantic HTML can greatly benefit your website's accessibility, search engine optimization (SEO), and overall structure. Here's why it's important and how to use it effectively :

1- Accessibility : Semantic HTML improves accessibility by providing meaningful structure and context to web content. Screen readers and assistive technologies rely on these semantic elements to understand and navigate web pages effectively.

2- SEO (Search Engine Optimization) : Search engines like Google and Bing use semantic HTML to better understand the content and structure of your web page. Using semantic elements can positively impact your site's search engine ranking.

3- Key Semantic Elements : 

- <header> : Represents the introductory content or a set of navigational links at the top of a web page.
- <nav> : Defines a section with navigation links, typically for site menus.
- <main> : Represents the main content of the document. Use it once per page.
- <section> : Defines a thematic grouping of content within a document.
- <article> : Represents a self-contained composition in a document, such as a blog post, news article, or forum post.
- <aside> : Contains content that is tangentially related to the content around it, like sidebars or advertisements.
- <footer> : Represents the footer of a section or the whole page, often containing copyright information, contact details, etc.

4- Heading Elements : Use "<h1>" for the main heading of your page. Subsequent headings should follow a logical hierarchy, such as "<h2>", "<h3>", etc., to represent sub-sections.
Avoid skipping heading levels, as this can confuse both users and search engines.

5- Semantic Inline Elements : Elements like "<em>" (emphasis) and "<strong>" (strong importance) should be used for their semantic meaning rather than purely for styling. Screen readers interpret these elements accordingly.

6- ARIA Roles : Use ARIA (Accessible Rich Internet Applications) roles to enhance the semantics of non-semantic elements like "<div>" and "<span>" when building complex web applications.

7- Validation : Always validate your HTML code using a tool like the W3C Markup Validation Service to ensure your markup adheres to HTML standards.

8- Stay Updated : Stay informed about evolving HTML standards and best practices to ensure your code remains semantic and accessible.

```
<! - Semantic Inline Elements -->
<p>Use <em>emphasis</em> when needed, and <strong>
strong importance‹/strong> when necessary.‹/p>
<! -- ARIA Roles
<div role="button" tabindex="'0"'›Click me</div>
```

Semantic HTML not only makes your web content more accessible and SEO-friendly but also contributes to better code maintainability and readability. By using these elements thoughtfully, you're not only improving the user experience but also future-proofing your web projects.
Exploring JMeter: A Simple Guide to Its Basic Components
Tags: testing, jmeter, softwareengineering, tutorial
Published: 2023-09-04 04:20:36

When it comes to using JMeter, you might have heard about its various components like “elements,” “thread groups,” “samplers,” “listeners,” and “configurations.” In this article, we’ll break down these elements into simpler terms and explain their roles in JMeter.

**1. Elements — The Building Blocks:**

In JMeter, different parts or building blocks are referred to as “elements.”
Think of these elements as the ingredients you need to create a recipe.
They are essential for defining the behavior of your performance tests.

**2. Thread Groups — Simulating Users:**

A fundamental element in JMeter is the “Thread Group.”
Thread groups represent collections of virtual users, where each user corresponds to a thread.
If you set up 100 threads in a Thread Group, JMeter will simulate 100 users.
Each user in a Thread Group sends requests and receives responses from the target system.

**3. Samplers — Sending Requests:**
Samplers are like the types of requests you can make in JMeter.
They include various protocols like FTP, HTTP, JDBC, etc.
Samplers define what kind of actions JMeter should perform during the test, such as sending an HTTP request to a web server.

**4. Listeners — Collecting Test Results:**

Listeners are responsible for displaying the results of your performance tests.
They show you what happened during the test execution.
Examples of listeners include Graph Result, View Result Tree, Table Result, and Log Viewer.
These provide visual and textual representations of your test data.

**5. Configuration — Setting Up Defaults:**

Configuration elements are used to define default variables and settings for your test plan.
They help you streamline your testing process by applying common configurations to multiple elements.
For instance, you can set up default variables for HTTP requests to be used across different samplers.



In summary, JMeter is a powerful tool for testing the performance of web applications, APIs, and more. Understanding these basic components — elements, thread groups, samplers, listeners, and configurations — is essential to create effective performance tests. Elements define the actions, thread groups simulate users, samplers send requests, listeners display results, and configurations help you set up defaults for your tests. With this knowledge, you can start exploring and harnessing the full potential of JMeter for your testing needs.
😱 Most Common Vulnerabilities in Solidity: In Deep Part 1
Tags: solidity, vulnerabilities, tutorial
Published: 2023-09-04 04:19:17

Learn about  Reentrancy , Incorrect Calculations 🧮,  Oracle Failure/Manipulation 🧙‍♂️,  Weak Access Control 🔐, and  Frontrunning Attacks 🏃‍♂️

Read the article at ➡️:
https://medium.com/buildbear/most-common-vulnerabilities-in-solidity-in-deep-part-1-587cc7e99845
Write better comments in VS Code
Tags: webdev, vscode, programming, extensions
Published: 2023-09-04 03:53:17

During development, we often add comments to our code as notes. 
These can include testing technologies, identifying areas for improvement, waiting for backend data or receiving feedback from mentors, often commenting like this:

```javascript
form.addEventListener("submit", function (e) {
    e.preventDefault();

    // Validate email required
    // TODO: Improve the add class 'has-error' by using toggle
    if (txtEmail.value === "") {
      if (!txtEmail.classList.contains("has-error")) {
        txtEmail.classList.add("has-error");
      }
      spErrorMessage.innerText = "Email is required";
      spErrorMessage.style.display = "block";
      return;
    }

    // Validate email syntax
    // TODO: Improve the add class 'has-error' by using toggle
    let regex = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
    if (regex.test(txtEmail.value) === false) {
      if (!txtEmail.classList.contains("has-error")) {
        txtEmail.classList.add("has-error");
      }
      spErrorMessage.innerText = "Valid email required";
      spErrorMessage.style.display = "block";
      return;
    }

    // If success then show popup success
    // Delete this and replace with new function
    showPopup();
  });
});
```
As you can see, all the comments have the same color. Imagine these comments in a pile of code 😱. It would be difficult to determine which comment describes which part of the code. This could lead to mistakes or confusion. The [Better Comments](https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments) extension was created to address this issue.
 
## [Better Comments Extension](https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments)

This extension will highlight special comments, allowing you to easily distinguish them from other comments

![Image of code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jzsqxa26cyrv33o8coly.png)

If the default color of the extension matches the color of your code editor, you can easily configure the color.

In addition, this extension also helps you to classify and write comments more organized and controlled.

![Image of code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a0gwvj0gsn6dyqjoblzr.png)

Currently, this extension supports almost all programming languages. Give it a try and let me know your thoughts in the comments.
Thank you for reading my article, and have a great day! 🥰
SSH Key's
Tags: javascript, beginners, programming, tutorial
Published: 2023-09-04 03:34:58

This week I learned how to how to set up my SSH key. To set up the SSH key you have to type "ls -al ~/.ssn" to check if there is an existing SSH key. Once you do that you can either set up an SSH key if you don't have one or you can create a new one. Look for public SSH key's id_rsa.pub,id_ecdsa.pub, id_ed25519.pub if you see those you can skip generating another SSH key. if you don't have one you will see an error. To create a new SSH key type "ssh-keygen -t ed25519 -c "your_email@example.com". This will create a new SSH and prompt you to choose a file to save it in press enter. In the next promt type a password that you would remember.
Having issue to setup the virtual env in the with python package virtualenv.
Tags: beginners, python, productivity, devops
Published: 2023-09-04 03:11:00

`PS C:\Users\Aayush\Desktop\New folder> testServer\Scripts\activate
testServer\Scripts\activate : File C:\Users\KIIT\Desktop\New folder\testServer\Scripts\Activate.ps1 cannot 
be loaded because running scripts is disabled on this system. For more information, see 
about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ testServer\Scripts\activate
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess `
 
The error message you're encountering is related to the PowerShell execution policy on your system, which restricts the execution of scripts for security reasons. You can resolve this issue by changing the execution policy to allow script execution. Here's how you can do it:

1. **Open PowerShell as an Administrator**: To change the execution policy, you'll need administrative privileges. Right-click on the PowerShell icon in the Start menu and choose "Run as administrator."

2. **Check the Current Execution Policy**: Before making any changes, you can check the current execution policy using the following command:
   
   ```powershell
   Get-ExecutionPolicy
   ```

   It will likely return "Restricted."

3. **Change Execution Policy**: To change the execution policy, you can use the following command:

   ```powershell
   Set-ExecutionPolicy RemoteSigned
   ```

   The "RemoteSigned" execution policy allows local scripts to run without requiring them to be digitally signed, which is suitable for most development environments.

4. **Confirm the Change**: PowerShell will ask for confirmation when you change the execution policy. Type "Y" and press Enter to confirm the change.

5. **Run Your Virtual Environment Activation Script**: After changing the execution policy, you should be able to activate your virtual environment without any issues. Use the same activation command you were trying earlier:

   ```powershell
   .\testServer\Scripts\activate
   ```

Now, your virtual environment should activate without any errors related to the execution policy.

Remember that changing the execution policy makes your system slightly less secure, so be cautious about running scripts from untrusted sources. If you're done with your development work, you can later reset the execution policy to its previous state using the `Set-ExecutionPolicy` command with the appropriate policy (e.g., "Restricted" for maximum security).
Droid Local: Your source for mobile gaming news
Published: 2023-09-04 02:45:26

Hello, I'm an independent mobile game developer who loves to engage in conversations and share news about this exciting universe. That's why I created my blog, '[Droid Local](https://droidlocal.com/),' a website dedicated to sharing news about mobile games and their development.

As a passionate developer, I've always been fascinated by the world of mobile gaming. It's a dynamic and ever-evolving industry with so much creativity and innovation. With 'Droid Local,' I aim to create a platform where fellow enthusiasts, developers, and gamers can come together to stay updated on the latest trends, releases, and insights in the world of mobile gaming.

On 'Droid Local,' you can expect to find a diverse range of content, including news articles, reviews, and behind-the-scenes glimpses into the game development process. Whether you're an aspiring game developer looking for inspiration or a dedicated gamer seeking information on upcoming titles, 'Droid Local' has something for everyone.

I believe that sharing knowledge and fostering a sense of community is essential in this field, and I'm excited to embark on this journey with you all. Together, we can explore the vibrant world of mobile gaming, celebrate its successes, and dive deep into the challenges and triumphs of game development.

Thank you for joining me on this adventure, and I look forward to engaging with you through 'Droid Local' as we explore the fascinating realm of mobile games together.
Update: Binacy announces the launch of its own NFT-Marketplace!
Tags: nft, cryptocurrency
Published: 2023-09-04 02:19:36

Today we are excited to announce the launch of Binacy's proprietary NFT- Marketplace. 

What's in store for you?

Binacy NFT-Marketplace promises:
   * Opportunities for Creators: Artists and authors can showcase their talent and successfully monetize their digital creations on our platform.

   * Bidding and Auctions: Participate in NFT's convenient bidding and auctions in a secure environment.

   * Exclusive partnerships: Expect exclusive collaborations with renowned artists, celebrities and influencers.

  * User-friendly interface: We've designed a simple and intuitive interface suitable for beginners and experienced collectors alike.

Whether you are an artist, collector or investor, Binacy NFT Marketplace offers a unique experience for its users. Follow our updates, learn more about artists, and discover exclusive NFT releases that will change the way you think about NFT.

 Join the Binacy NFT-Marketplace today!
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qymg8a9jt0d9l4vx7lja.png)
Solving the "Longest Substring Without Repeating Characters" Problem on LeetCode
Tags: java, programming, coding, beginners
Published: 2023-09-04 01:56:14

## Question
Given a string `s`,find the length of the longest **substring**
without repeating characters. Click [here](https://leetcode.com/problems/longest-substring-without-repeating-characters/) to open question in Leetcode

## Question type:
Medium,

**Example 1:**

```
Input: s = "abcabcbb"
Output: 3
Explanation: The answer is "abc", with the length of 3.
```


**Example 2:**

```
Input: s = "bbbbb"
Output: 1
Explanation: The answer is "b", with the length of 1.
```

**Example 3:**

```
Input: s = "pwwkew"
Output: 3
Explanation: The answer is "wke", with the length of 3.
Notice that the answer must be a substring, "pwke" is a subsequence and not a substring.
```

## Approach:

To find the length of the longest substring without repeating characters, we can use a sliding window approach. We'll maintain two pointers, l and r, which represent the left and right ends of the current substring. We'll also use a HashSet to keep track of the characters in the current substring.

Here's the step-by-step explanation of the approach:

Initialize two pointers, l and r, to 0. Initialize a HashSet hs to store characters in the current substring, and maxi to store the maximum length found so far.

Start iterating through the input string s from left to right (increment r):

a. If s.charAt(r) is not in the HashSet hs, it means we can extend the current substring. So, add s.charAt(r) to hs and update maxi to be the maximum of its current value and r - l + 1 (the length of the current substring).

b. If s.charAt(r) is already in hs, it means we have a repeating character. We need to shrink the substring by incrementing l and removing s.charAt(l) from hs until there are no repeating characters. This step ensures that we maintain a substring without repeating characters.

Continue this process until r reaches the end of the string.

Finally, return maxi, which represents the length of the longest substring without repeating characters.

## Java Code:
Here's the Java code that implements the above approach:

```
class Solution {
    public int lengthOfLongestSubstring(String s) {
        HashSet<Character> hs = new HashSet<>();
        int maxi = 0;
        int l = 0;
        
        for (int r = 0; r < s.length(); r++) {
            if (!hs.contains(s.charAt(r))) {
                hs.add(s.charAt(r));
                maxi = Math.max(maxi, r - l + 1);
            } else {
                while (s.charAt(l) != s.charAt(r)) {
                    hs.remove(s.charAt(l));
                    l++;
                }
                hs.remove(s.charAt(l));
                l++;
                hs.add(s.charAt(r));
            }
        }
        
        return maxi;
    }
}
```

## Time Complexity:
The time complexity of this solution is O(N), where N is the length of the input string s. This is because we traverse the string once, and for each character, we perform constant-time operations (addition/removal from HashSet and comparisons). Therefore, the overall time complexity is linear.

Happy coding,
shiva
How-To: Convert Monoliths to Microservices
Tags: monolith, microservices, programming, beginners
Published: 2023-09-04 01:40:00

When a monolithic application becomes too complex to manage, it can be converted to a microservices architecture. This can be a daunting task, but there are <u>a few strategies</u> that can make it easier.

### 1. The Strangler Fig Pattern

The strangler fig pattern is a gradual approach to migrating a monolith to microservices. The idea is to start by extracting a small part of the monolith into a microservice. Once that microservice is stable, you can then extract another part of the monolith and move it to a microservice. This process continues until the entire monolith has been converted to microservices.

The strangler fig pattern has several advantages. It is relatively easy to implement, and it does not cause any disruption to the existing application. It also allows you to gradually migrate the monolith, which can help to reduce the risk of failure.

However, the strangler fig pattern can also be a slow process. It can take several months or even years to completely migrate a monolith to microservices.

### 2. The Lego Strategy

The Lego strategy is another approach to migrating a monolith to microservices. In this approach, you continue to maintain the existing monolithic codebase, but you also start to build new features as microservices. This allows you to gradually introduce microservices into your architecture without having to completely replace the monolith.

The Lego strategy is a good option if you do not want to disrupt the existing application. It is also a good option if you are not sure which parts of the monolith should be converted to microservices.

However, the Lego strategy can also lead to technical debt. As you add more and more microservices, the monolithic codebase can become increasingly complex and difficult to maintain.

### 3. The Nuclear Option

The nuclear option is the most drastic approach to migrating a monolith to microservices. In this approach, you completely replace the monolith with a new microservices architecture. This is the fastest way to migrate to microservices, but it is also the riskiest.

The nuclear option should only be used as a last resort. It is important to carefully consider the risks and benefits of this approach before making a decision.

## Which Strategy is Right for You?

The best strategy for migrating a monolith to microservices will vary depending on the specific application and the needs of the organization. However, the three strategies described above can provide a good starting point for making a decision.

Here are some additional factors to consider when choosing a strategy:

- The size and complexity of the application
- The urgency of the migration
- The budget available for the migration
- The skills and experience of the team

## Wrap-Up!

Ultimately, the best way to migrate a monolith to microservices is to carefully consider all of the factors involved and choose the strategy that is right for the specific application.


I hope this is helpful! :hugs:
How to create a DataFrame that consists of a list of DataFrames and corresponding Name using Python
Tags: python, programming, softwaredevelopment, opensource
Published: 2023-09-04 01:25:12

Hello polymaths, 
The above-mentioned task is important to know for most of the Python Developers working in the Data Field. Imagine, you have several Excel files (or) CSV files (or) a single Excel file with multiple sheets etc. and you want to compute a logic that considers the entire data for calculation -> Obviously, you have to append each file and its corresponding Name to a separate DataFrame that consists of a list of DataFrames to obtain the Output.

**Step 1**
Create an empty list to append the names of each DataFrame.

**Step 2**
Create an empty list to append the data related to each DataFrame.

**Step 3**
Make use of loop concepts to iterate through each DataFrame. 

**Step 4**
Perform Data Cleaning, Transformations etc. if necessary and finally append the data to the previously created empty lists.

**Step 5**
Create a new DataFrame and assign the data parameter with the above two lists.

_**Sample Code:-**_

```python

# Import necessary Libraries
import pandas as pd;

ef=pd.ExcelFile("path/input.xlsx") # Load the Excel File

dataframes=[]; # Empty List to append the data of each File
names=[]; # Empty List to append the name of each File

# Iterate through all the sheets within the Excel object
for i in ef.sheet_names:
    df=ef.parse(i); # Store the data as a DataFrame from each sheet
    df_name=i; # Store the name of the DataFrame from each sheet
    
    # Perform Data Cleaning and Tranformations, if necessary #

    dataframes.append(df);
    names.append(df_name);

df_final=pd.DataFrame(data={"Name":names, "DataFrame":dataframes}); # Create the Final DataFrame

```  

**Done**
Class Attributes in Python
Published: 2023-09-04 01:19:28

In this phase, we learned to code with Python. One thing we covered was class attributes; a variable that is associated with a class rather than with an instance (or object) of the class. Class attributes are defined inside the class and are accessible to all instances of the class, providing a way to store data that is shared among a class. Storing data as class attributes can be more memory-efficient than storing the same data in each instance, especially when working with a large number of objects. Class attributes can make code more readable by explicitly showing that a property is the same for all instances. This improves code comprehension and reduces the chances of errors, making it an essential aspect of coding with Python.