teleren/devto huggingface dataset:
O que é e para o que serve autenticação?
Published: 2023-01-17 05:21:46

Autenticação é o processo de validação a identidade de um usuário em uma aplicação. Este protocolo envia as credenciais do cliente solicitando a conexão com o servidor de acesso remoto em texto simples ou forma criptografada. O servidor então sabe se pode conceder acesso a esse cliente ou não.
Em termos mais simples, a autenticação pergunta a cada usuário: "quem é você?" e verifica sua resposta.
Quando um usuário se registra para uma conta, ele deve criar um ID e uma chave exclusivos que permitirão que ele acesse sua conta posteriormente.
O processo de autenticação do usuário é o que vai fornecer aos usuários acesso às suas próprias contas enquanto bloqueia o acesso de qualquer usuário não autenticado.

Compreender a autenticação do usuário é crucial porque é uma etapa fundamental no processo que impede que usuários não autorizados obtenham acesso a informações confidenciais. Um processo de autenticação reforçado garante que o usuário A tenha acesso apenas às informações de que precisa e não possa ver as informações confidenciais do usuário B.
Uma das formas mais comuns no mercado de autenticação é o JWT, porem existem outros como "Token based Authentication","Session based Authentication","Basic Authentication".

**JWT**

JWT (JSON web token) é uma ferramenta que define uma maneira de transmitir informações seguras entre partes. Essas informações podem ser verificadas e confiáveis, pois são assinadas digitalmente. JWT é composto por três partes:

- Cabeçalho
- Conteúdo (ou payload) 
- Assinatura


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


JWT é utilizado para autenticação e autorização em aplicações web e mobile. Ele permite que o cliente envie informações de autenticação para o servidor em cada solicitação, sem precisar armazenar sessões ou cookies no lado do cliente. Isso é geralmente chamado de "stateless authentication". Além disso, JWT pode ser usado para transmitir informações de forma segura entre diferentes aplicações ou serviços, como microsserviços.

Um exemplo de uso de JWT é quando um usuário faz login em um aplicativo web. Após a autenticação ser bem-sucedida, o servidor emite um JWT contendo informações do usuário, como seu ID e permissões. Esse JWT é enviado de volta para o cliente e armazenado em seu lado. Em cada solicitação subsequente, o cliente envia esse JWT para o servidor, que pode verificar a validade do token e extrair as informações do usuário para autorizar a ação requisitada.

JWT é uma boa escolha quando se tem uma aplicação onde não é necessário armazenar sessão no servidor, e quando se deseja compartilhar informações de forma segura entre diferentes aplicações ou serviços. No entanto, é importante lembrar que JWT não deve ser usado para armazenar informações sensíveis, porque ele pode ser facilmente decodificado e lido por qualquer pessoa que tenha acesso a ele.
VS Code vs Atom!
Tags: vscode, atom, codenewbie, beginners
Published: 2023-01-17 05:18:23

Both Visual Studio Code (VS Code) and Atom are popular text editors that are widely used by developers. The choice between the two will depend on your specific needs and preferences. Here are some key differences between the two:

VS Code is developed and maintained by Microsoft, while Atom is developed and maintained by GitHub.

VS Code has a slightly larger user base and is considered to be more popular among developers.

VS Code has better performance and is considered to be more stable than Atom.

VS Code has built-in support for debugging and integrated development environments (IDE) features.

Atom is more customizable and has a larger number of available packages and themes.

Atom has a simpler user interface which is considered to be less cluttered than VS Code.

VS Code has better support for TypeScript and has a more robust extension ecosystem.

Ultimately, the choice between VS Code and Atom will depend on your personal preferences and the specific needs of your project. You can try both and see which one works best for you and your workflow.

PS-I started with Atom because it was simpler, Now I use 
Visual Studio Code for all my projects.
Need to use shellcheck with .zsh and or #!/bin/zsh scripts? [SC1071]
Tags: tutorial, bash, zsh
Published: 2023-01-17 05:16:13

If, like me, you find yourself trying to use [shellcheck](https://www.shellcheck.net) to lint `.zsh` files with `#!/bin/zsh` but it keeps telling you:

![A screenshot of the error below.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pqdh1gwvdy76ej2o763m.png)

```
shellcheck: error
error - ShellCheck only supports sh/bash/dash/ksh scripts. 
Sorry! [SC1071]
```

What I was able to do is pass the `--shell=bash` argument to `shellcheck` and then it would lint my files.

In my case this was configured in my SublimeLinter config, like so:

```json
{
    "linters": {
        "shellcheck": {
            "args": [
                "--shell=bash"
            ]
        },
    }
}
```

...just in case you are using Sublime Text!
The role of software documentation in embedded software development
Published: 2023-01-17 05:00:00

Software documentation is an important aspect of software development, and this is especially true in the context of embedded systems. Embedded software is often critical to the operation of a device and may have strict requirements for reliability and performance. In order to meet these requirements, it is important that the software is well-documented, as this can help developers understand how the code works and make informed decisions when modifying or maintaining it.

One of the primary benefits of software documentation is that it helps developers understand the codebase. When working on a complex or unfamiliar codebase, documentation can provide valuable context and background information that helps developers understand how the code works and what it is intended to do. This can be especially important in the context of embedded systems, where the code may be tightly tied to the hardware and may be difficult to understand without proper documentation.

In addition to helping developers understand the code, software documentation can also facilitate collaboration among team members. By providing clear and detailed documentation, developers can ensure that other team members have the necessary information to understand the code and contribute to its development. This is particularly important in the context of embedded systems, as it can be difficult to coordinate the work of multiple developers on a shared codebase.

Software documentation can also help to improve the maintainability of the code. By providing detailed documentation, developers can ensure that the code is easy to modify and maintain over time. This is important in the context of embedded systems, as the code may need to be updated or modified to support new features or hardware platforms.

Overall, software documentation is an essential aspect of embedded software development, as it helps developers understand the codebase, collaborate with team members, and maintain the code over time. By providing clear and detailed documentation, developers can ensure that their code is reliable, efficient, and meets the requirements of the target hardware platform.
TurboC2 Setting Header and Include Locations
Tags: dos, dosbox, turboc2
Published: 2023-02-01 02:33:13

---
title: TurboC2 Setting Header and Include Locations
published: true
date: 2023-01-17 05:00:00 UTC
tags: DOS,DOS,DOSBox,TurboC2
canonical_url: https://tyrel.dev/blog/2023/01/turboc2-setting-header-and-include-locations.html
---

This weekend I purchased a book from this seller on Craigslist - ["Advanced MS-DOS Programming: The Microsoft Guide for Assembly Language and C Programmers"](https://www.librarything.com/work/178384) and before opening it, I wanted to get a C environment running.

I found a copy of [TurboC2 on Archive.org](https://archive.org/details/msdos_borland_turbo_c_2.01) and tossed that into my DOS Box install. I wrote a "Hello world" and pressed compile and it couldn't include "stdio.h", what the heck?

It seems that the Archive.org copy of Turbo C 2 ships with configuration that sets where the Includes and Lib directories to <tt><span>C:\TC</span></tt>. I keep all my programs in <tt><span>C:\PROGS</span></tt> so of course it can't find any header files for me!

To fix this you can either move your TurboC install to <tt><span>C:\TC</span></tt>, which feels wrong to me, or you could configure it in the options properly.

## Steps

- Go to the Directories entry in the Options Menu.
- You can see the default provided configuration directories
- Fill out your appropriate directories for all three of the options.
- Make sure all three are configured properly.
- Then you can save your config, so you only have to do this once.

## The Screenshot Way

 ![TurboC with the Options Menu selected and the Directories entry highlighted.](https://tyrel.dev/blog/images/2023/01/dosbox_1_environment_menu.png)

Go to the Directories entry in the Options Menu.

 ![TurboC with a pop up, showing entries of Include Directories, Library Directories, and Turbo C Directory configured to C:\TC\INCLUDE C:\TC\LIB and C:\TC](https://tyrel.dev/blog/images/2023/01/dosbox_2_directories.png)

You can see the default provided configuration directories

 ![TurboC with a pop up, showing C:\PROGS\TC\INCLUDE](https://tyrel.dev/blog/images/2023/01/dosbox_3_directories_edit.png)

Fill out your appropriate directories for all three of the options.

 ![TurboC with a pop up, showing entries of Include Directories, Library Directories, and Turbo C Directory configured to C:\PROGS\TC\INCLUDE C:\PROGS\TC\LIB and C:\PROGS\TC](https://tyrel.dev/blog/images/2023/01/dosbox_4_directories_filled.png)

Make sure all three are configured properly.

 ![TurboC with a popup showing a Save Options location of C:\PROGS\TC\TCCONFIG.TC](https://tyrel.dev/blog/images/2023/01/dosbox_5_save_config.png)

Then you can save your config, so you only have to do this once.

Unfortunately - this file is a binary file. You can't just edit it in a text editor and carry on, so this is the only way I know how to change these locations.

Hopefully this helps anyone else who runs into any include errors with Borland Turbo C 2!
Practical and pragmatic generic aria roles to use
Tags: aria, a11y, html
Published: 2023-01-17 04:58:56

It's sometimes difficult to pick an aria role, because they are defined vaguely.  Because an aria role is often used to define the purpose of a piece of an application, it often doesn't pin down what specifically the role is, the description hems and haws around the purpose, it provides the vague shape of a thing but not the specifics.  Roles are by nature vague.  For example, if a `role=button` were exactly the same as `<button>` it would _actually be redundant_, there would be no point in the role, we would just use `<button>`!  So the role descriptions are often more vague.

This results in some difficulty:  How do we know what roles to use?  For example, try to avoid using `role=button`.  Why?  Because you should use actual `<button>`s, and the actual buttons **get for free** the role=button.

So then what roles are actually, pragmatically useful when otherwise using html5?

Well, as app authors, what we are often doing is setting priority.  We aren't just creating one `<div>` among thousands, it's a `<div role=region>`.  It's not just a `<span>`, it's a `<span role=comment>`.

So what roles are NOT given to us for free by a html5 element like <button> and <a> ( a role=link element), and work well for when we need to make generic elements more specific?

- **`role=region`** is a useful generic role to highlight an area
- **`role=alert`** applies to really high priority, transient things that come up and may go away after, things that elicit a response
- **`role=status`** for status updates, generally where the contents are going to update live
- **`role=comment`** for where it is people writing comment responses
- **`role=note`** for separated text


A huge majority of the remaining roles fall into two "try not to use" categories: 
- Don't use these because the role comes for free from the semantic html5 element: role=button, role=figure, role=code, etc
- Abstract roles (they exist, but are not intended for use with authorship)

## In Summary

I sorted through the aria roles trying to find 2023's most useful generic roles.  For now, these are the most useful roles that I could find for authorship that aren't rendered redundant with other html5 builtins.
10 great thing to know about Martin Luther King
Published: 2023-01-17 04:51:12

1. Martin Luther King Jr. was a civil rights leader in the 1950s and 1960s who fought for the rights of African Americans.

2. He is best known for his role in the advancement of civil rights using nonviolent civil disobedience based on his Christian beliefs.

3. He was the leader of the Civil Rights Movement and was instrumental in the American Civil Rights Movement

4. He led the Montgomery Bus Boycott (1955–1956) and helped found the Southern Christian Leadership Conference (SCLC) in 1957.

5. He was the youngest person to have received the Nobel Peace Prize in 1964.

6. He was assassinated on April 4, 1968, in Memphis, Tennessee

7. He gave many famous speeches including "I Have a Dream" in 1963

8. He was posthumously awarded the Presidential Medal of Freedom and the Congressional Gold Medal.

9. Martin Luther King Jr. Day is a federal holiday in the United States celebrated on the third Monday of January

10. He advocated for nonviolence and civil disobedience as a means of achieving racial equality.
The best new feature in Next.js 13
Tags: javascript, programming
Published: 2023-01-17 04:44:08

**Next.js** is a popular JavaScript framework for building web applications, and its latest version (13.0) brings a number of new features and improvements to the table. In this post, we'll take a look at some of the key features of Next.js 13.0, and how they can benefit developers.

1. First and foremost, Next.js 13.0 introduces support for **ECMAScript **modules (ESM) as the default module format. This means that developers can now use the latest JavaScript features and syntax in their Next.js applications without having to worry about compatibility issues. This feature will make it easier for developers to write more efficient and maintainable code, and will also make it easier to share code between different projects.

2. Another major feature of Next.js 13.0 is the ability to build and export **dynamic websites as static sites**. This means that developers can now take advantage of the performance benefits of static sites, while still being able to build dynamic and interactive web applications. This feature is particularly useful for sites that have a lot of dynamic data, such as e-commerce sites or blogs.

3. Next.js 13.0 also includes a number of **performance improvements, **including faster build times and improved runtime performance. This makes it easier for developers to create high-performing web applications that can handle large amounts of traffic and data. Additionally, the new version of Next.js also adds support for **Webpack 5,** which brings improvements to the way assets are handled, and enables faster and more efficient builds.

4. Another important feature of Next.js 13.0 is the addition of **built-in support for TypeScript. **This means that developers can now use TypeScript to write their Next.js applications, which will help to catch and prevent errors early on in the development process. TypeScript also makes it easier to write more maintainable and scalable code.

5. Finally, Next.js 13.0 includes a number of other improvements and features, such as improved error reporting, **better support for serverless functions**, and support for the latest version of React (17).

All in all, Next.js 13.0 is a great release that brings a number of valuable features and improvements to the framework. With support for ESM as the default module format, improved performance, and built-in support for TypeScript, developers will find it easier than ever to build high-performing and maintainable web applications with Next.js.
926. Flip String to Monotone Increasing
Tags: java, 100daysofcode, algorithms, leetcode
Published: 2023-01-17 04:09:08

**Problem Statement:**

A binary string is monotone increasing if it consists of some number of 0's (possibly none), followed by some number of 1's (also possibly none).

You are given a binary string s. You can flip s[i] changing it from 0 to 1 or from 1 to 0.

Return the minimum number of flips to make s monotone increasing.

 

**Example 1:**
**Input:** s = "00110"
**Output:** 1
**Explanation:** We flip the last digit to get 00111.

**Example 2:**
**Input:** s = "010110"
**Output:** 2
**Explanation:** We flip to get 011111, or alternatively 000111.

**Example 3:**

**Input:** s = "00011000"
**Output:** 2
**Explanation:** We flip to get 00000000.
 

**Constraints:**

- 1 <= s.length <= 105
- s[i] is either '0' or '1'.

**Solution:**

**Code:**
```
class Solution {
    public int minFlipsMonoIncr(String s) {
        int n = s.length();
        int flipCount = 0;
        int oneCount = 0;
        for (int i = 0; i < n; i++) {
            if (s.charAt(i) == '0') {
                if (oneCount == 0)
                    continue;
                flipCount++;
            } else
                oneCount++;
            if (oneCount < flipCount)
                flipCount = oneCount;
        }
        return flipCount;

    }
}
```
**Time Complexity:**
O(N)
**Space Complexity:**
O(1)
What are services in Angular? And how in the world do I use them?
Tags: angular, services, typescript, tutorial
Published: 2023-01-17 02:43:58

Hi folks,

Let's talk about services today. These guys are extremely useful for having code that is streamlined, reusable, and readable.

You might have services for different things, for example: 

- A service that holds all of your API calls.
- A service that holds a bunch of constants, like URLs.
- A service that holds a variable or observable, that other components can subscribe to read and use that data.
- Using Rxjs Behavior Subject, you can even update and subscribe to the same variable in a service through many different components. 


For initial setup, I would create a folder called 'services'.
Then, in your terminal pointed to that folder, you can add the command: 

`ng g s service-name`

Service-name can be whatever you want it to be. Like, 'authentication' or 'api-calls'.  It will end up being called 'service-name.service', so don't name it something like 'authentication-service', or else you'll end up with 'authentication-service.service'.

For today's purpose, let's have a service that has a constant and an API call.

Example: 

```javascript
export class ApiCallService { 

constructor(private http: HttpClient) {}

const url = www.hereisadomainname.com


getDataFromDatabase() {
return this.http.get(this.url + '/data')
}

}
```

Now, you can use these in whatever component you want. 

Ex: 

```javascript
export class YourComponent {
myVariable; 

//The name after private can be whatever you want, you are just assigning the service's name here.
constructor(private service: ApiCallService) {}

// You can see here, that 'service' is targeting our ApiCallService, then we can pull any variable or function directly from the service for our use!
getData() {
this.service.getDataFromDatabase().subscribe(data => console.log(data)
}

ngOnInit() {
//this is going to print the url you have in your service. You could have other data stored, like an array or object. Then you can assign the value to a variable in your component.

console.log(this.service.url)
//or
this.myVariable = this.service.url
}

}
```

Hopefully you can see the usefulness of a service, especially when you have a lot of code that needs to be reused in many different places.

Please leave a comment if you have any Angular tutorial requests! I'd love to see what you want to know. :) 

Thanks for reading,
Julie
Best tools to outsource your IT projects
Tags: career, productivity, programming
Published: 2023-01-17 03:32:05

## Commission Junction
One of the oldest and most popular affiliate marketing networks. It has a large selection of merchants, including software companies, and offers a wide range of tools and resources for affiliates.

## ClickBank
A popular platform for selling digital products, including software and online services. It has a large selection of vendors and offers a variety of commission structures.

## ShareASale
An affiliate marketing network that has been in operation since 2000. It has a large selection of merchants, including software companies, and offers a wide range of tools and resources for affiliates.

## Amazon Associates
Amazon Associates is one of the most popular affiliate programs, It is focused mainly on e-commerce and physical products, it allows associates to promote any product on Amazon and earn a commission for each sale.

## PartnerStack
PartnerStack is another platform that focuses mainly on the SaaS business model and Software as a Service. It is a platform that helps companies run their own referral and affiliate programs.

## DigiStore24
A platform that helps software companies to manage and automate their affiliate programs. It offers the ability to set commissions and recurring revenue share on sales, it’s a good option for the Software as a Service business model.
Xv6 code analysis
Tags: xv6, syscall
Published: 2023-01-17 03:22:56

xv6 is a simple unix, but it also has syscall to fits some demands. I read some part of xv6's code to learn a simple syscall
kernel/defs.h #function in syscall 
kernel/syscall.h #registed syscall
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/di9ylivtqimpoqmpjacx.png)
kernel/syscall.c #syscall entry
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p4wzflzwwm7ro3l3u395.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/505ohgetlp7l502br73s.png)
kernel/sysproc.c #function for syscall, apply what you want to do
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8glokqlaf8dd886ubtty.png)
how process in usermode use syscall? in user/user.h
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hvgdsp2njnzey8vgse2j.png)
or it can't link syscall with function while compiling
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/epn1czrgx80tlnvrman7.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wyn472q6iu1nlpdqyikj.png)
just by name subsitute in perl scripts
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4d767hfjzv0itwol4qqd.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6f16rfef0elnev3zxm6i.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sxngdv7veio7v10e5nwr.png)
how user send the signal of syscall to kernel
set trap function linke to p
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/py7h7p6tdvmwcbeape26.png)
switch user trap to kernele trap

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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r0xgb0r60p8zvs3j712z.png)
process structure
how to detect usercall

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

it is write in assembly code to link syscall and userfunction together.