teleren/devto huggingface dataset:
Novidade do GitHub Universe.
Published: 2022-11-09 22:07:55

Tive a honra de ir na sede do GitHub Brasil que através do convite da  🪐Pachi Parra e pude acompanhar as novidades do GitHub Universe.

O GitHub vê o momento como um ponto de virada e acredita que é hora de uma nova experiência de desenvolvimento.

Abaixo algumas novidades:

1. Negócios em vez do trabalho agitado: o GitHub Copilot para empresas ajuda a aumentar a produtividade do desenvolvedor em 55% com sugestões de código baseadas em IA.

2. Um experimento do GitHub Next: “Hey, GitHub!” permite a interação baseada em voz com o GitHub Copilot, permitindo os benefícios de uma ferramenta de pair-programming com IA e reduzindo a necessidade de um teclado.

3. Pronto quando você estiver: agora, pessoas desenvolvedoras individuais receberão até 60 horas de Codespaces gratuitamente todos os meses para começar a construir em segundos.

4. Navegação aprimorada: a pesquisa de código e a visualização de código permitem que você pesquise, navegue e entenda o código rapidamente, diretamente do GitHub.com.

5. Planeje e acompanhe seu trabalho, no mesmo lugar em que você o constrói.

Seu amigo de organizações: roadmap permite ficar de olho no tempo e no progresso do seu trabalho e compartilhar com qualquer pessoa.

Markdown reimaginado: as listas de tarefas decompõem issues, convertem tarefas em issues, visualizam relações no GitHub Projects e muito mais, tudo em uma nova interface.

6. Projects no bolso: GitHub Projects Mobile traz o poder do GitHub para a palma da sua mão, permitindo que você contribua e colabore de qualquer lugar.

7. Enterprise na nuvem: com o GitHub Enterprise Cloud, há garantia de acesso aos recursos mais recentes assim que são lançados.

8. Executando com o melhor: os executores hospedados no GitHub oferecem acesso a recursos de computação mais poderosos, intervalos de IP fixos e maior simultaneidade para workflows.

9. Migração de CI/CD facilitada: o GitHub Actions Importer coloca você em funcionamento mais rapidamente ao planejar e executar migrações de sua antiga ferramenta de CI/CD para o GitHub Actions.

10. Benefícios aprimorados: administradores da organização agora têm tokens de acesso pessoal (PATs), junto com as pessoas desenvolvedoras, permitindo controle granular sobre permissões e acesso ao repositório.

11. Clicando em tokens: ativar dados do token de autenticação em seu log de auditoria empresarial para exibir eventos de log de auditoria.

12. Revolucionando o desenvolvimento de software da Internet das Coisas (IoT): as ferramentas de desenvolvimento da Arm estão disponíveis nativamente no GitHub Actions.

13. #Segurança em Ruby: o suporte do CodeQL para Ruby agora está disponível por padrão na verificação de código do GitHub.com, CodeQL CLI e na extensão CodeQL para VS Code.


Fonte: GitHub Blog.
https://lnkd.in/dzD2muAm
TDD e BDD: o que é? qual a diferença?
Tags: webdev, beginners, testing, programming
Published: 2022-11-09 21:59:31

## O que é TDD?

TDD (**Test Driven Development**) é o desenvolvimento de software orientado a testes, essa técnica é uma das mais usadas por desenvolvedores. O TDD foi descoberto em 2003 pelo engenheiro de software [Kent Beck](https://pt.wikipedia.org/wiki/Kent_Beck), que também criou o **eXtreme programming** (no qual TDD é um dos pilares fundamentais), o TDD inverte o ciclo de desenvolvimento da aplicação, onde você segue o seguinte padrão:

- crie um teste e se certifique de que falhe.
- crie um código que passará pelo teste.
- refatore o código recém criado, aprimorando-o ao máximo.

Repetindo o processo do começo ao fim do desenvolvimento da aplicação.

## O que é BDD?

BDD (**Behavior Driven Development**) é o desenvolvimento de software orientado a comportamentos, uma técnica de desenvolvimento ágil criada em 2003 por Dan North como uma resposta ao TDD, e é visto como uma extensão do mesmo. No BDD você também inverte o ciclo de desenvolvimento, seguindo o mesmo padrão do TDD:

- crie um teste e se certifique de que falhe.
- crie um código que passará pelo teste.
- refatore o código recém criado, aprimorando-o ao máximo.

## Mas então qual a diferença entre TDD e BDD?

Pode parecer que os dois são a mesma coisa, mas o **BDD** é uma extensão do **TDD**, voltado para negócios e não apenas softwares. Por exemplo: no BDD o desenvolvedor criará testes em um formato compreensível não só para outros desenvolvedores, mas também para analistas. No BDD temos quatro principais processos:

##### 1. Descoberta

Neste processo, o **PO** (Product Owner) apresentará o produto e suas necessidades a nível de negócio, e então o time analisará e discutirá (Utilizando técnicas do BDD), levando em consideração algumas coisas importantes como a experiência do usuário entre outras coisas.

##### 2. Definição

A equipe define suas prioridades, analisando o que o PO apresentou e definindo o que será regra de negócio, o que será implementado e como farão isso.

##### 3. Formalização

O time de desenvolvimento transcreverá tudo que foi levantado pelo PO, utilizando ferramentas de prototipação, como Wireframes (para WEB ou Mobile) e Wiremocks (Para APIs), claro que essas não são necessárias ou são as únicas existentes, mas são as mais utilizadas.

##### 4. Entrega

É quando o time de desenvolvimento apresentará o software para o PO, que, validará a entrega do software, e subirá para produção. 

## Conclusão

O TDD busca aprimorar a qualidade do código, e a longo prazo, a produtividade dos desenvolvedores. O BDD é um “aprimoramento” do TDD, não se limitando apenas ao desenvolvimento de software, mas também definindo todas as fases do desenvolvimento, facilitando a comunicação do time de desenvolvedores com o time de produto, e consequentemente, com o cliente. Ambos visam melhorar o processo de desenvolvimento de uma aplicação, agregando um valor muito grande a qualquer time ou empresa.
About functions in JavaScript,
Published: 2022-11-09 21:46:13

Functions are a key concept in JavaScript. The most important feature of the language is first-class support for functions (first-class citizen functions). In particular:

pass as an argument and return as a result when calling other functions (higher-order functions);
create anonymously and assign as perceptions or properties of objects.
This determines the high expressive power of JavaScript and allows it to be classified as a language that implements the functional programming paradigm (which in itself is very cool for many reasons).

A function in JavaScript is a special type of object that allows you to formalize certain logic of behavior and data processing by means of the language.

To understand how functions work, it is necessary (and sufficient?) to have an idea of ​​the following points:

- ways to declare
- calling methods
- call parameters and arguments 
- Scope and closures 
- anchor object (this)
- return value
- exceptions (throw)
- use as object constructor
- garbage collector

## Function declaration

A function declaration consists of the function keyword and the following parts:

- Function name

- A list of parameters (taken by the function) enclosed in parentheses () and separated by commas.

- Instructions that will be executed after the function is called are enclosed in curly braces { }.
About variables in JavaScript
Published: 2022-11-09 21:33:14


Variables in JavaScript can create sensations - using the words var, let and const used. They perform the same function (combining the detection of a named camera in memory), but they work a little differently.


## Variable declaration, initialization, and scope in JavaScript

Before discussing the difference between var, let and const, let's understand some basic concepts.

JavaScript programs store numbers, combinations, combinations of values, and more complex elements in named memory locations - found. Data from these cells can be used in calculations, displayed and overwritten. Variables are referred to by a unique name, or identifier.

To declare a variable means to introduce a new identifier into the program.

By the release of the ECMAScript 6 standard, variables in JavaScript are only declared using the var keyword.
When the JavaScript interpreter finds another var declaration, it allocates memory space and defaults to the element with the value undefined - that is, "undefined". You can also get undefined by accessing non-existent array elements and object properties.

Referencing an undefined value can lead to unpredictable errors, so it is recommended to give variables an initial value as early as possible - that is, initialize them. This is done using the = operator:
The part of the program in which this or that identifier is available is called the scope of the variable.

Depending on the scope in JavaScript, local (functional scope) and global (global scope) variables are distinguished. Local ones are created inside the function and are available only within it. And global ones are declared outside of functions and are visible at any point in the program. It is in the work with **the scope** that the differences between var and let lie.

How let works and how it differs from var**
Let the keyword be devoid of the shortcomings of its protector. Variables advertised with it cannot be re-declared - the program will generate an error. Let-variables also "float", but in this case, especially valuable before the excitation, you will receive a ReferenceError.

Declaring constants with the const operator
The const keyword is used to create constants. For example, physical and mathematical quantities.

In most cases, using var is enough, but sometimes you need to make sure that your data is safe - it cannot be changed from the outside or changed in principle. In these cases, let and const are indispensable.
Library Vs FrameWork
Tags: library, javascript, webdev, beginners
Published: 2022-11-09 20:59:10

## **LIBRARY**

A library is a collection of prewritten code that can be used to simplify tasks. The term library simply refers to a collection of code that is reused repeatedly. It is essentially a set of pre-defined functions and classes that programmers can use to simplify their work and speed up the development process. So, developers do not have to write code to accomplish specific functionality because the library already includes code for those functionalities.

## **FRAMEWORK**

 A framework is like the foundation upon which developers build applications for specific platforms. It includes reusable pieces of code written to perform common tasks and uses code provided by a developer for custom functionality. The framework may include defined and undefined objects and functions that developers can use to create applications. In that way, we can add significant functionality to the system by using existing code around the structure. 

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


## **Differences Between Them**

<u>**Collection	**</u>

Generally, libraries are a collection of helper modules, objects, classes, functions, message templates, pre-written code, etc.

Frameworks consist of a lot of APIs, compilers, toolsets, support programs, libraries, etc.


<u>**Code Modification**</u>

Codes in libraries are geared toward a particular program or to solve a specific development problem. Therefore, developers must modify library code to meet their needs.

Despite the fact that frameworks generate new codes for developers. These codes cannot be altered or modified later. Unlike libraries, frameworks do not allow users to modify their pre-written codes, so you don’t have to worry about deleting or changing them.

<u>**Performance**</u>

Less code is required to build libraries, which leads to faster loading times and better performance.

Developing a framework requires a lot of coding, which increases loading times and decreases performance.

<u>**Function**</u>

In Library program linking and binding process, they play an important role.

you can build and deploy applications in a standard way as the framework already provides code to perform common tasks and uses code provided by a developer

<u>**Benefits**</u>

Library ()=> {
Good code quality, reusability, and control, enhanced speed and performance of the program, etc.
}


FrameWork ()=> {
Faster programming, support from the community, great support for MVC (Model View Controller) pattern, etc.
}
JavaScript Functions
Published: 2022-11-09 21:09:28

Functions are little code pieces used to do some tasks and make code shorter and more understandable. For example, it is unnecessary to write the same line of code many times. Instead, you can create a function and tell him how often some task is done. 
In JavaScript, to declare a function we use the command


function   Name(){


}

As you can see, the structure is very simple. You can use any name for your function and in {} write your function.

function SayHello(){
   
     console.log("Hello")

}



Additionally, you could mention there are () which means that functions can also take some arguments. 

function Sum(a, b){
   
     console.log(a+b)

}

After creating functions we must call them in our code whenever we want:

function Sum(a, b){
   
     console.log(a+b)

}

Sum(2,3)
Functions in JavaScript
Tags: javascript, beginners
Published: 2022-11-09 21:05:44

Functions are one of the fundamental pieces of JavaScript. A function is a set of statements or a piece of program that performs some task or calculates some values. For that block of code to qualify as a function, it should take some input and return an output.

A function statement consists of the keyword function followed by the name of the function, the parameters of the function in parenthesis (), and JavaScript statements that define the function in curly brackets {}, and the block of code within those curly braces is called the body of the function. For example,

_function sum(a, b) {
   return a + b;
}_

Here the function sum takes two arguments, a and b. The function consists of one statement which says to return the sum (+) of the two arguments.
We just defined a function, but only defining it does not execute the function. It shows what to do when the function Is called. Calling the function performs the statements that are in our function. For example,

_function sum(a, b) {
   return a + b;
}
console.log(sum(2, 3));_

_// this will print 5_

So what we did is the following. We called the function sum by writing it out and gave two arguments, 2 and 3, to our function. So when we console.log it, it will print 2 + 3, which is equal to 5.

**Function scope**
Variables declared in a function cannot be accessed anywhere outside the function because the variable is defined only in the scope of that function. In contrast, a function has access to all variables and functions inside the scope that it is defined. For example,

_const x = 5;
const y = 10;
function multiply() {
   return x * y;
}_
_multiply(); // returns 50_

The constants x and y were defined in the global scope, and the function multiply had access to them; that is why when we called the function, we got x * y = 5 * 10 = 50.
Is RTP and SIP protocol, in a typical voip client, are handled at the same socket or a seperate connection is used?
Tags: help, voip, programming
Published: 2022-11-09 20:55:23

I am thinking of making my own VOIP client in Rust. Therefore, I had a look upon SIP protocol:

[SIP SESSION](https://en.wikipedia.org/wiki/Session_Initiation_Protocol#/media/File:SIP-B2BUA-call-flow.png)

The question is though how I can handle upon a sucessfull login and call acceptance the RTP protocol. The question is on a typical VOIP client is a single socket used for both SIP and RTP or a single socket is used instead?
File Upload from Angular 14 to CodeIgniter Normal API Help me......
Tags: angualar, fileupload, codeigniter, api
Published: 2022-11-09 20:54:26

Hello,
Any one can help me on this please. 
I want to upload user data with a file fileupload from Angular front end version 14 to a CI API. I need to upload the file to upload folder and store the user data to SQL table.
I am not able to do this using ngx drag and drop. would you please any one help me on this. 

i tried fileupload using form action and a direct URL, it is working fine but i am not able to capture the logged in user info. also dont know how to remove the uploaded file and upload a new one.
thanks
Typed Enum Flipping in Typescript
Tags: typescript, beginners, tutorial
Published: 2022-11-09 20:27:19

Ever had a situation where you needed to swap key-value pairs of an enum in typescript and attempts to type it resulted in ugly `Record<string, string>` sort of crutch?

Turns out key remapping that came with v4.1 make it a breeze :)

Suppose we have some rhymes

```typescript
enum Rhymes {
  Money = 'bread and honey',
  Phone = 'dog and bone'
}
```

Key remapping and template literals allow us to write a generic to swap they keys for values:

```typescript
type FlippedRecord<T> = {
  [K in keyof T as `${string & T[K]}`]: K
};
```

So now we can get some type safety while creating flipped enum maps:

```typescript
const reversedEnum: FlippedRecord<typeof Rhymes> = {
  'bread and honey': 'Money',
  'dog and bone': 'Phone'
}
```

It's boombastic, check it out in [playground](https://www.typescriptlang.org/play?#code/PQKhAIEkBtoVwM4BcBOBDJBLA9gO3AGbYrhIAWApuGilgMbRVlJIAOCAXMMACYUBuAOiTZgAIwDudNMCQBPVhR4BaCrjgBbZQWiZWrTLgDmyw8vmKEdFHqTKATHQoBOcCGAAoDxaoAxXfpKAEoUdMQ8ADwAKgB84AC84ADeHuDgANoA0uCG4ADWFHLYBOBR1AjgAAYAJEnINsbgAGSlWQC6AL6VbRzgmR4dANxeaprgQWRyGhQVKWkAsniFCeAA5GIoFGg81Lg7ZEtyqwA0qeAACge4VImrPNhGuztiS6sDXmG4yOCb-BQoCCUAFF1Bpev49IoeCEwihIj5iuNJtMEHFEnM1hstjs0HtwFdCqteqtFtcjqc0ncHk9wC9rkS1pclvYWay2ey3h0gA) :)
Fold Not Only Reduces
Tags: functionalprogrammin, scala, haskell
Published: 2023-01-06 02:58:41

---
title: Fold Not Only Reduces
published: true
date: 2022-11-09 20:15:10 UTC
tags: FunctionalProgrammin,Scala,Haskell
canonical_url: https://brandonrozek.com/blog/fold-not-only-reduces/
---

One misconception when first learning about fold is that it takes a list of elements of a certain type (`List[T]`) and “reduces” it to a single item of type `T`.

This misconception is aided by one of the most common fold examples: summing a list.

Scala Example:

```
List(1, 2, 3, 4, 5).foldLeft(0)((c, n) => c + n)
// Returns 15

```

Haskell Example:

```
foldl (+) 0 [1,2,3,4,5]
-- Returns 15

```

However, let us look more closely at the type signature of `foldLeft` on a list of type `X`.

Haskell:

```
(B -> X -> B) -> B -> [X] -> B

```

Scala:

```
(id: B)(op: (B, X) => B): B

```

There are a few things we can note here:

- The return type is not influenced by the list type `X` at all.
- The return type must match the type of the id of the fold.
- The operation takes two arguments, with the first type matching the id/start (`B`) and the second type matching the type within the list (`X`)

To show an example of how we don’t need to “reduce”, let’s return the elements of a list that’s greater than 5.

Scala Example:

```
List(5, 7, 1, 8, 9, 3).foldLeft(List.empty[Int])((c, n) => if n > 5 then c :+ n else c)
// Returns List(7, 8, 9)

```

Haskell Example:

```
l5 c n if n > 5 then c ++ [n] else c
foldl l5 [] [5, 7, 1, 8, 9, 3]
-- Returns [7,8,9]

```
Functions in JavaScript
Tags: javascript, functions, programming
Published: 2022-11-09 20:03:31

In this blog, we are going to speak about the functions.

## What are functions
Simply put, a function is a piece of code that you can reuse repeatedly rather than having to write it out several times. Programmers can divide a problem into smaller, more manageable parts, each of which can carry out a specific task, using functions.

## How to declare a function in JS

The function keyword is used to define a JavaScript function, which is then followed by the function's name and parentheses ().

Function names may also include underscores, dollar signs, and other characters (same rules as variables).

Names of parameters may be enclosed in parentheses and separated by commas: (parameter1, parameter2, ...)

Curly brackets enclose the code that the function will execute: {}

For example: 

function name(parameter1, parameter2, parameter3) {
  // code to be executed
}

Function parameters are listed inside the parentheses () in the function definition.

Function arguments are the values received by the function when it is invoked.

Inside the function, the arguments (the parameters) behave as local variables.

For example:

function sum(x, y){
    console.log(sum);
}

However, when we write this function it doesn't print anything in the console. To make our function work we should first call our function. To do this, we need to write the function's name, add the symbol (), and, if the function asks for it, write the values we want to pass it inside ().

For example:
function sum(x, y){
    console.log(sum);
}
sum(4,5)//this will print 4+5 which is equal to 9

## Return statement

The return statement ends the function execution and specifies a value to be returned to the function caller.
For example, the following function returns the square of its argument, x, where x is a number.

function square(x) {
  return x * x;
}
const demo = square(3);
// demo will equal 9
Welcome Thread - v199
Tags: welcome
Published: 2022-11-09 19:48:32

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

![A bunch of cartoon handshakes slinkily shaking across a polka-dot screen.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ac7egdc4o34447bj096i.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!**
Pixel art "laboratory" in reactJS (Completed)
Tags: webdev, opensource, react, news
Published: 2022-11-09 19:36:25


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

Check it out now! https://pixa.pics/pixel

 * Low-Level-JavaScript just like asm.js or SIMD.js for blazing efficient color operation
 * Multi-threading (Web Worker)
 * GPU's optimisation (CSS3 Transform+will-change)
 * Fast compression (LZP3 with low-level-javascript over 2/3 weight-loose compression very fast)
 * Serialization using CBOR for efficient savings of typed array pixel matrix
 * Offline Cache & Auto Save (PouchDB)
 * AI Processing (Deepai.org, !remote!)
 * 4 algorithm up-Scaling artwork up to 4-8x as painting (xBRZ, Omniscale, hqNx, EPX)*
 * Vectorized (output an infinitely high definition SVG file) (ImageTracerJS)
 * Color Quantization (RGBQuant + Custom)
 * Always encode well Portable Network Graphics in type of palette (we save 70% of size) (PNGQuant, + OXIPNG)
 * Chunk ("norris") webpack system for dropping script evaluation cost within CPU
 * WASM Hashing function for detecting change in history of editing (XXHash)