teleren/devto huggingface dataset:
Mastering API Data Validation in Strapi: A Practical Guide
Tags: api, strapi, node
Published: 2024-02-02 07:22:04

> Validating the data received from an API request is a critical aspect to consider when building robust and scalable applications. API (Application Programming Interface) acts as an intermediary that enables data to be shared between various software applications. Certifying the data shared through APIs is important as it handles errors and guarantees data integrity and consistency. This tutorial demonstrates the need for API data validation by building a blog application.

## What is API data validation?
API data validation is a way of verifying that the data being exchanged meets the laid down criteria. To explain further, the purpose of API data validation is to confirm that the data sent is in the proper format and that the responses received are as expected. 

It is often implemented using various validation libraries and frameworks like [Joi](https://joi.dev/), [Yup](https://www.npmjs.com/package/yup), [AJV](https://ajv.js.org/), and https://www.npmjs.com/package/class-validator, which provide proper ways to define validation rules and handle validation errors.

## Importance of API data validation
In software development, data validation plays a crucial role and we will discuss its key importance in this section.

- Prevents errors:
By rigorously inspecting the data sent and the responses received, API data validation drastically reduces the amount of errors in the software.
- Protects against malicious attacks:
Data validation ensures that the data received adheres to the outlined guidelines, thus protecting the application. The risk of exploitation is reduced by rejecting malicious data that could harm the application.
- Enhances long-lasting performance:
Preventing errors and safeguarding against malicious attacks, API data validation enhances the application's performance and guarantees a durable application.
The pivotal role of API data validation in software development makes its importance obvious.

> Link to the full article: [Mastering API Data Validation in Strapi: A Practical Guide](https://strapi.io/blog/api-data-validation-in-strapi)
Task 1
Published: 2024-01-24 12:10:31

The Software testing is similar to determining whether or not a computer program is ready to be used. It's the same as checking to see that there are no errors or problems before people start using it. The goal of this is to ensure that the program performs as it is intended to and does not make any mistakes. Testing happens in several steps while making the program, going from minor items to the full thing. There are a variety of tests that can be used to examine different components and determine whether or not they are compatible with one another and whether or not they are simple to use. Correcting errors at an earlier time is preferable because it is less complicated. The programme is tested to ensure that it works properly, is quick, and is secure. In the same way, it is similar to ensuring that an automobile works smoothly before people start driving it. When it comes to the modern method of creating software, continuous testing is an essential component in order to guarantee that the software will continue to function properly even after being updated. Generally speaking, software testing is an absolute necessity in order to ensure that programmes are of high quality and do not cause problems for users.

Manual testing and automated testing are the two methods that are utilised in software testing. In manual testing, we verify by hand whether the software is proper or fits client needs without errors, but in automated testing, a script is used to perform the test, making it more dependable and effective than human testing. Therefore, we must be informed about software testing.


The aim of testing is to verify that the software product is given to the user with no errors in the written code and in good quality, preventing any faults from arising.
A short tutorial on how to render html inside html in Angular
Published: 2024-02-02 07:17:17

In this tutorial, you will learn 
- how to render html inside html in angular
- The use of sanitizer in rendering html in angular.

In Angular, you can render HTML within an HTML tag using the `innerHTML` property. You can bind the HTML content to a variable and then use this variable within the HTML tag. Here's an example:

In your component.ts file:

```typescript
import { Component } from '@angular/core';

@Component({
  selector: 'app-example',
  template: `
    <div [innerHTML]="htmlContent"></div>
  `
})
export class ExampleComponent {
  htmlContent = '<p>This is the rendered HTML content</p>';
}
```

By using the `innerHTML` property binding, you can render HTML content within the specified HTML tag in Angular. Always be cautious with this approach especially if the HTML comes from an untrusted source to avoid cross-site scripting (XSS) vulnerabilities.

In Angular, you can use the DomSanitizer service to sanitize and securely render HTML content. This is crucial for preventing cross-site scripting (XSS) vulnerabilities when rendering user-provided or untrusted HTML. Here's how you can use the `DomSanitizer`

First, you need to `import DomSanitizer from '@angular/platform-browser'` in your component file.

```typescript
import { Component } from '@angular/core';
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';

@Component({
  selector: 'app-example',
  template: `
    <div [innerHtml]="sanitizedHtml"></div>
  `
})
export class ExampleComponent {
  sanitizedHtml: SafeHtml;

  constructor(private sanitizer: DomSanitizer) {
    const untrustedHtml = '<script>alert("This is a malicious script!")</script>';
    this.sanitizedHtml = this.sanitizer.bypassSecurityTrustHtml(untrustedHtml);
  }
}
```

In this example, we import `DomSanitizer` and `SafeHtml`. We then inject `DomSanitizer` into the component's constructor. We use `bypassSecurityTrustHtml()` method of `DomSanitizer` to securely render the untrusted HTML by bypassing Angular's built-in security. Finally, we bind the sanitized HTML to the `innerHtml` property of a HTML tag within the component's template.

By using `DomSanitizer`, you can mitigate the risk of XSS attacks when rendering untrusted HTML in your Angular application. Always be careful when dealing with untrusted HTML and consider other security measures as well.

  It is highly recommended to sanitize your HTML while rendering to keep it protected.
If you find this helpful, please drop your comment
Useful Visual Studio Code Extensions
Tags: vscode, coding, extensions, productivity
Published: 2024-02-02 07:15:00

---
title: Useful Visual Studio Code Extensions
published: true
description: 
tags: vscode, coding, extensions, productivity
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n2pv3xgxkq97vqhzqu69.png
published_at: 2024-02-02 12:45 +0530
---


![Live share extension](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mr6u1bfd2553bojd4qu8.png)![Better comments extension](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1zavq23yblxqreec3csr.png)![Code snap extension](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2660i60jpjww24oc11nv.png)![vscode-icons extension](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nqv05o65l5yyrvlipzfc.png)![vscode-pets extension](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d6fy4i6jhulkhxv5bta5.png)


Hey fellow stranger, thank you for reading till the end 🙂 . I create one such post everyday. Follow me if you like these and want to read them daily! 
Follow me on:
{% cta https://www.instagram.com/_ameybhavsar/ %}  instagram.com/_ameybhavsar {% endcta %}
{% cta  https://twitter.com/_ameybhavsar %}  𝕏 twitter.com/_ameybhavsar {% endcta %}
{%embed https://dev.to/ameybhavsar %}
What’s polymorphism ? How it’s implemented by the complier?
Tags: cpp, polymorphism, compiler
Published: 2024-02-02 07:13:56

Polymorphism, in the context of object oriented programming, refer to the ability of objects to take on multiple forms. This is achieved through two main mechanism : Compile Time polymorphism and Run time polymorphism.

###Compile-Time Polymorphism (Method Overloading):

> How it work:

- Determined at Compile time.
- also known as Static Polymorphism.
- Implemented using function overloading and operator overloading.

```
class MathOperations
{
  public:
      int add(int a, int b)
      { return a+b; }
      int add(double a, double b)
      { return a+b; }
};

int main()
{
  MathOperations math;
  int result1 = math.add(9+8);
  int result2 = math.add(9.78,45.76);
  
  return EXIT_SUCCESS;
}
```

> How it is implemented:

- During compilation, the compiler resolves the function calls based on the provided arguments.
- The generated machine code instructions to call the appropriate function based on the types and number of arguments.

###Run-Time Polymorphism (Method Overloading):

> How it work

- Determined at runtime.
- Also known as dynamic polymorphism.
- Implemented using virtual functions and inheritance.

```
#include <iostream>
class Shape
{
  public:
    virtual void draw() const = 0; //pure function
};

class Circle: public Shape
{
  public:
    void draw const override()
    {
      std::cout<<"Drawing a Circle \n";
    }
};

class Square:public Shape
{
  public:
    void draw const override()
    {
      std::cout<<"Drawing an Square \n";
    }
};

int main()
{
  Shape* shapes[] = {new Circle(), new Square()};
  for(const Shape* shape : shapes)
  {
    shape->draw(); // runtime calls to functions
  } 
  
  return EXIT_SUCCESS;
}
```

> How it is implemented:

- Virtual functions are implemented using a mechanism call as virtual function table.
- The vtable is a table of function pointers associated, with each class that has virtual functions.
- When a class has a virtual function, the compiler adds a pointer to the vtable in the object memory layout.
- The vtable contains pointers to the actual implementations of the virtual functions in the class or tis subclass.
- During runtime, the correct function is called based on the dynamic type of the object.

###Key points

- For a every class there is only one vtable.
- For a every object there is only one vptr.
- so if there are 10 object of class A then there is 1 vtable and 10 vptr pointers.
- Lets say there is class A (having two function draw() and Fun() ) and class B is child of A, and overload only virtual function draw(), then below is the representation.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f21udy01lapytjb7so54.png)
Who is Senior Software Developer ?
Tags: seniorsoftwaredeveloper
Published: 2024-02-02 06:59:20

A senior software developer is an experienced professional in the field of software development who typically has a deep understanding of programming languages, software architecture, and system design. Their role involves not only writing code but also taking a lead in various aspects of the software development lifecycle.

#### Key characteristics of a senior software developer include:


#### Experience
: They usually have several years of experience in software development, gaining expertise in a variety of projects and technologies.

#### Leadership
: Senior developers often take on leadership roles within development teams. They may guide junior developers, make technical decisions, and contribute to project planning.

#### Problem Solving
: They are adept at solving complex problems and finding efficient and effective solutions. They may be involved in troubleshooting and debugging challenging issues.

#### Technical Skills
: They possess advanced skills in programming languages, frameworks, and tools relevant to their field. They stay updated with industry trends and emerging technologies.

#### Architecture and Design
: Senior developers are involved in designing software systems and making high-level architecture decisions. They understand how different components of a system interact.

#### Code Reviews
: They actively participate in code reviews to ensure the quality, maintainability, and adherence to coding standards of the codebase.

#### Collaboration
: Senior developers often collaborate with cross-functional teams, including product managers, designers, and quality assurance professionals, to deliver successful software projects.
kusto trendlines
Tags: kusto, appinsights
Published: 2024-02-02 06:45:49

I recently stumbled upon an example for how to include "trendlines" in kusto queries that might be handy.

```
exceptions
| where timestamp > ago(90d)
| summarize c = log(count()) by bin(timestamp, 1d)
| as hint.materialized=true T
| extend _perc_25 = toscalar(T | summarize percentile(c, 25)),
         _perc_50 = toscalar(T | summarize percentile(c, 50)),
         _perc_75 = toscalar(T | summarize percentile(c, 75))
| render timechart
```
.NET 8 Features: Explore Performance Improvements and Language Enhancements
Tags: csharp
Published: 2024-02-02 06:44:07

Title: C# .NET 8 Features: Explore Performance Improvements and Language Enhancements

Introduction:

With the release of C# .NET 8, developers can now delve into a plethora of exciting new features that bring performance improvements and language enhancements to their coding experiences. From powerful asynchronous streaming to nullable reference types and more, let's explore some of the notable additions in C# .NET 8, accompanied by code examples.

1. Async Streams:

One of the most awaited features in C# .NET 8 is the introduction of asynchronous streams. This feature allows developers to easily work with collections that generate their values asynchronously. Here's an example:

```csharp
public async Task ConsumeStreamAsync()
{
   await foreach(var item in GetAsyncStream())
   {
       // Process the item asynchronously
   }
}

public async IAsyncEnumerable<int> GetAsyncStream()
{
   for (int i = 0; i < 10; i++)
   {
       await Task.Delay(100);
       yield return i;
   }
}
```

2. Nullable Reference Types:

The introduction of nullable reference types aims to aid in the elimination of null reference exception-related errors. Prior to C# .NET 8, reference types were implicitly non-nullable. However, with the new feature, developers can indicate whether a reference type is expected to be nullable or not. Here's an example:

```csharp
public static string? GetOptionalString()
{
   return Environment.GetEnvironmentVariable("optionalValue");
}
```

3. Pattern Matching:

C# .NET 8 also brings enhancements to pattern matching, making it even more powerful and expressive. It helps simplify code and enables developers to handle different cases more effectively. Here's an example using switch statements with pattern matching:

```csharp
object item = GetItem();

switch (item)
{
   case int i:
       Console.WriteLine($"Integer: {i}");
       break;
   case string s:
       Console.WriteLine($"String: {s}");
       break;
   case null:
       Console.WriteLine("Null value");
       break;
   default:
       Console.WriteLine("Unknown item");
       break;
}
```

Conclusion:

C# .NET 8 offers developers a range of new features and enhancements, enabling them to write cleaner, more efficient, and less error-prone code. Asynchronous streams simplify working with asynchronously generated collections, nullable reference types reduce null reference-related issues, and pattern matching enhances code clarity. These features are just a fraction of what C# .NET 8 brings to the table, making it an exciting update for developers working on the .NET platform. So go ahead and explore these features, experiment with the code examples, and boost your productivity with C# .NET 8. Happy coding!
Azure Developer Certification (AZ-204): A practice Scenario #3
Tags: azure, certification, exam
Published: 2024-02-02 06:35:29

In this blog article, we delve into **practical scenario** faced by a dev team as they navigate the challenges of processing large videos withing a budget-friendly cloud solution.

_The company you are working at provides a digital asset management **SaaS** solution. You are trying to find more cost effective ways to process large videos. You know some things about **Durable Functions** and you think it could be a solution._

_Will this problem be solved by using Durable Functions?_

Photo by <a href="https://unsplash.com/@benmullins?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash">Ben Mullins</a> on <a href="https://unsplash.com/photos/person-using-pencil-oXV3bzR7jxI?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash">Unsplash</a>
  
P.S.

I would love hearing from our tech-savvy community! Have insights, tips, or burning questions? Don't keep them to yourself! Drop your thoughts in the comments below. Let's spark a conversation and learn from each other's experiences in the dynamic world of Azure migration.
Linton Quadros - Founder of EIF Business School
Published: 2024-02-02 06:33:34

Linton Quadros, born on May 20, 1968, in Portland, Oregon, hails from a family with a legacy of business acumen, dedicated to seeking continual progress and innovative opportunities. From a young age, he exhibited a keen interest in business and investment. Through diligent study and research, he earned a Bachelor's degree in Business Management during his university years. This educational journey provided him with a deep understanding of economics and finance, laying a solid foundation for his future investment endeavors.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ga2fr18m7w8dfqcxab5l.jpg)
In 2011, Linton Quadros founded the Excellence & Innovation Fortune Business School (EIF Business School). Over a decade of effort has earned the institution a prestigious reputation in the industry, cultivating numerous outstanding financial professionals, and its student body surpassed 100,000 people in 2022.

During this period of growth and development, Linton Quadros, with his solid trading skills and charismatic personality, attracted many professionals. Building on the foundation of quantitative trading models, his team created the exceptional investment tool - AI Robotics Profit 4.0.

Moreover, Linton Quadros and EIF Business School seized the opportunity presented by the cryptocurrency market's Initial Coin Offerings (ICOs), successfully launching EIF tokens. The success of EIF tokens played a crucial role in the enhancement of the AI Robotics Profit 4.0 investment system.
The Relationship between 3D Scanners and 3D Modeling
Published: 2024-02-02 06:12:46

In recent years, the combination of 3D scanning technology and 3D modeling has revolutionized various industries, from manufacturing to entertainment. This article delves into the relationship between 3D scanners and 3D modeling, exploring how these technologies work together to create accurate and detailed digital representations of real-world objects.

Understanding 3D Scanning:
A 3D scanner is a device that captures the physical geometry of an object and converts it into a digital 3D model. Using a variety of techniques such as structured light, laser, or photogrammetry, 3D scanners capture millions of data points on the object's surface to create a point cloud. This point cloud serves as the foundation for generating a detailed 3D model.

The Role of 3D Modeling:
3D modeling involves creating a virtual representation of an object or environment using specialized software. It allows designers and artists to manipulate the shape, texture, and appearance of objects in a digital space. 3D modeling software provides a range of tools and features to sculpt, texture, and refine the model, resulting in a realistic and visually appealing representation.

Integration of 3D Scanning and 3D Modeling:
The integration of 3D scanning and 3D modeling offers numerous benefits. By using a [3D scanner](https://www.revopoint3d.com/) to capture the physical object's geometry, the resulting 3D model can closely resemble the real-world counterpart. This accuracy is particularly valuable in industries such as automotive design, architecture, and medical imaging, where precise measurements and details are crucial.

Workflow and Process:
The workflow typically involves three main steps: data acquisition, processing, and modeling. Firstly, the 3D scanner captures the object, generating a point cloud or mesh data. This raw data is then processed using specialized software to clean up noise, fill gaps, and optimize the mesh. Finally, the processed data is imported into a 3D modeling software, where artists or designers can further refine and enhance the model.

Applications:
The combination of 3D scanning and 3D modeling has found applications across various industries. In manufacturing, it allows for rapid prototyping and quality control by creating accurate digital representations of physical objects. In entertainment, it enables the creation of realistic characters and environments for movies, video games, and virtual reality experiences. Additionally, in fields like archaeology and forensics, 3D scanning and modeling aid in preserving and documenting artifacts and crime scenes.

The relationship between 3D scanners and 3D modeling is symbiotic, with each technology complementing the other's strengths. 3D scanning provides the precise physical data necessary to create accurate digital models, while 3D modeling software enables manipulation, refinement, and visualization of these scanned objects. As technology continues to advance, the integration of 3D scanning and 3D modeling will undoubtedly unlock even more possibilities, driving innovation across various industries.
Prime Packers and Movers
Tags: primepackersandmoverscompany, bestpackersandmoversservices
Published: 2024-02-02 06:02:36

You are relocating from one place to another, and you are searching for a shifting company that will benefit your budget. Now you have come to the right place,an experienced company, [Prime   Packers and Movers Company](https://primemoverspackers.in/)offers the best house shifting services in Pune. We have best experienced employees in this field by packing, shifting, loading, and unloading goods moving from one place to another. We assure you that your goods will be relocated safely and securely from one location to another. We prioritize customer satisfaction and are happy to provide our best services. We are providing you with documentation for the claim process. You can trust in our team; your satisfaction is our top priority.
React JS Development Company - Nimble AppGenie
Tags: reactjsdevelopment, reactjsdevelopmentcompany
Published: 2024-02-02 05:59:38

Nimble AppGenie is a top [ReactJS Development Company](
https://www.nimbleappgenie.com/services/web-development/reactjs) that helps you develop ReactJS websites and apps innovatively. With our ReactJS Development services, we are here to help you convert your idea into working web applications and websites. Hire ReactJS Developers if you want to create feature-rich web and app solutions.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8ey6ndayks2udopuhu1d.jpg)