teleren/devto huggingface dataset:
4 Consensus Protocols in Blockchain
Tags: blockchain, ethereum
Published: 2022-03-02 15:29:47

*In  short, we'll go cover 4 types of Consensus Protocols:*
- *Proof-of-Work*
- *Proof-of-Stake* 
- *Delegated-Proof-of-Stake*
- *Proof-of-Authority*

One of the promises of the blockchain is that it's a 'trustless system'. 
Anyone in the community can join and participate in the network of nodes that verify transactions on the blockchain.

Consensus protocols are the varied methods blockchains use to achieve a trustless system.

## What's a blockchain?

![alt](https://www.logicsolutions.com/wp-content/uploads/2018/04/Blockchain-Consensus-Mechanisms.jpg)

A blockchain is a network spread across multiple nodes. Each node can verify transactions made on the network, and then commit those transactions to the final state of the blockchain.

Anyone can submit info to the network.
So it's important to have rules in place that everyone can use to decide what info to commit to the network.

## How do they work?

![blockchain](https://bigstep.com/assets/images/blog/blockchain-on-bare-metal-servers-part-1-cover.jpg)

The consensus protocol at the heart of a blockchain gives a specific method for verifying whether a transaction is true or not.

All nodes on the network must agree on the state of the network, following the protocol to do so.

Consensus also:

- Prevent a single entity from taking control
- Trust users without a controlling third-party 
- Prevents Double spending, where someone creates their own version of the network to take control and spend the same coins multiple times

## Common types of consensus protocols:

### PoW (Proof-of-Work)

'Miners' earn rewards for solving computational problems that validate blocks and add them to the network.
This method has been criticized for being heavily energy-intensive and slow to process transactions.

Ex: Bitcoin, Ethereum1

### PoS (Proof-of-Stake)

'Forgers' stake(loan) money in the network, with the next verifier getting chosen in a lottery fashion. Having a bigger stake means having a higher chance of being chosen to validate.
They are rewarded for correct validations and punished for wrong ones by losing some of their Stake.

Ex: Ethereum2, Solana

### DPoS (Delegated PoS)

Similar to PoS, except stakeholders can vote on who validates the next block

Ex: Cardano, EOS, Tron

### PoA (Proof-of-Authority)

Predetermined block validators, who are public and held accountable for their actions.
Most Testnets use this method. Since testnets are for testing and developing code, they don't need a fully decentralized network, just the blockchain tech. 

Ex: Rinkeby(Ethereum-Testnet)

## Conclusion

![consensus](https://devopedia.org/images/article/71/5658.1522506087.jpg)

Consensus protocols, like the rest of blockchain tech, are constantly evolving to address the challenges in bringing about a Web3 future.

There are other interesting ones, like Proof-of-burning, or Elapsed-Time (PoET)

What other protocols have you heard?
Tell me below!

This thread was a summary of the contents in this article: https://decrypt.co/resources/consensus-protocols-what-are-they-guide-how-to-explainer
Nevertheless, Amy Coded in 2022
Tags: wecoded
Published: 2022-03-02 15:10:01

Hey there folks!

I'm Amy. I'm 22, have just landed my first job after uni and for the first time in a long time I feel like things are truly starting to go my way! 

I had a tough time at uni, dealign with mental health and direct discrimination due to being a woman studying Computer Science. I tried to leave my university better than I found, helping to create the Women in Tech group and supporting the efforts of staff and other students to increase the gender diversity within the department.

I find a lot of women struggle to see how they can start making a difference, so I thought I'd share some of the ways I feel I've helped:
- Just being a woman in tech!
- Apply to be part of organisations/schemes (during my time at uni I have been a [GitHub Campus Expert](https://githubcampus.expert) and an [MLH Coach](https://mlh.io) Organisations such as these tend to put you more in the spotlight, giving more people an opportunity to see you)
- Get involved in the hackathon scene (in general it's a really welcoming and accepting community, and if you are no longer a student see if your company can sponsor a local hackathon and send you along to the event)
- Amplify and support the women around you
- Talk about the difficulties faced by women in tech
Today I learned some stuff about .NET Core configuration
Tags: dotnet, configuration
Published: 2022-03-02 15:01:14

If we make any changes to `appsettings.json` file, the `IConfiguration` object will get updated on runtime.

But `IOptions<MyClass>` wont get updated like that so you need to use `IOptionsMonitor<MyClass>` or `IOptionsSnapshot<MyClass>`. (All three of them are from the same namespace `Microsoft.Extensions.Options`)

`IOptionsMonitor<MyClass>` is singleton, so any mutation you make to this object will persist throughout the life of the application.

`IOptionsSnapshot<MyClass>` is scoped, so any mutation you make to this object will be thrown out when the request finishes its life.

I learned this from Nick Chapsas in YouTube. [URL](https://www.youtube.com/watch?v=J0EVd5HbtUY)
Keep coding.
Dealing with IDE reformatting (VSCode) Vue templates breaking white space preservation
Published: 2022-03-02 14:53:38

I've been recently losing my mind with eslint and Vetur both reformatting blocks that need to not have any whitespace, and finally came up with a much better solution.

A simple re-usable single file component:

```
<template>
    <div class="preserve">{{ content }}</div>
</template>

<script>
export default {
    props: ["content"],
};
</script>
```

Simply use this component, without any worry about line length forcing it to break to a new line
5 Irresistible Reasons To Choose Cross-Platform App Development
Tags: android, ios, hybridapp, appdevelopment
Published: 2022-03-02 14:51:44

The last few years have been extraordinary for cross-platform app development. Thanks to an increased user base well supported by cheap internet and advanced technology. Nowadays, more and more people are making their presence online, which opens the pandora box for app development. Thus, whether it is android app development or iOS app development, the demand is high. 

Since the device could be a laptop, mobile phone, or even tablet. Hence, the need for developing cross-platform apps is paramount. 

## What Is Cross-Platform App Development?
Cross-platform app development means developing apps that run across the devices on any technology. It doesn’t matter if the user is on Android or iOS. An app developed on cross-platform frameworks supports all. Due to this, the demand for **[flutter app development services](https://www.etelligens.com/technology/flutter-app-development-services-company/)** is on the rise. 

In case you don't know, Flutter is a cross-platform development framework. IT companies understand this situation very well and are pushing towards cross-platform frameworks.

## Lowers The Development Cost
Cross-platform software development follows the write once, run everywhere philosophy. Reusable codes and Agile app development procedures and technologies can reduce the development cost. Thus, cross-platform app development is the most cost-effective way to develop an app that runs across platforms. 

## Speeds Up The Development Process

Instead of writing different scripts for each platform, a single script can be deployed for app development. This drastically reduces development time and time to market, which benefits everyone involved, from the development team through marketing. 

## Quick & Automatic Updates 

Updates are simple and convenient since cross-platform apps are web-based. Users do not need to download several upgrades, which require maintaining and supporting different versions of apps. All clients get access to the most up-to-date version of the app, which improves performance.

## Brand Building

It takes a lot more time and works to ensure that your iOS and Android apps have the same appearance and feel. **[Cross-platform app development](https://www.etelligens.com/technology/react-native-app-development/)** helps in developing a consistent brand image and experience by leveraging the same UI/UX components that may deliver a native app-like experience.

Best Tools For Cross-Platform App Development

•	Flutter
•	Xamarin 
•	React Native
•	Appcelerator
•	Sencha Touch

## Bottomline
Developing apps for each platform is exhausting, time-taking, and costly. Cross-platform app development solves this problem by allowing the same script that runs for each platform. Businesses benefit a lot from cross-platform apps, as stated above. So, if you want a website for your business, go with top development companies like Etelligens. Besides Android app development and iOS app development, the company offers Flutter app development services.
The Differences between Web2.0 and Web3.0.
Tags: blockchain, nestcoin, blockgame, javascript
Published: 2022-03-02 14:41:38

I know you've been pondering on what exactly is Web2 and Web3. I will briefly share you what exactly is the differences between the both. Straight to the point.

### What's the difference between Web2 and Web3?

*Web2*  is that version of the internet that most of us know today, interaction between products(applications) and users. It's dominated by companies who render services(paid or free). In Web2 you can only read and write. It came with the creation of social media(and the companies that own those platforms).

On the other side, *Web3* is a decentralized application that runs on a blockchain. It's dominated by everybody. This Web3 gives everyone access to participate as a user and as a builder without monetizing your personal data. In Web3 you can read, write and own digital assets - their own piece of web.

It means no more having to remember a million passwords, thanks to a more unified internet ecosystem
that's owned and maintained by users via blockchain transactions. This means you'll be able to share
your content - and potentially earn money off of it.
Now, Blockchain is not Web3, it's just one of the it's expression.

Thanks to [Blockgames](https://blockgames.gg/), [Nestcoin](https://nestcoin.com/), and [Zuriteam](https://zuri.team/).
How to use minitest/mock to mock any instance
Tags: ruby, testing
Published: 2022-03-02 14:27:31

`stub_any_instance` is a very helpful utility in common mocking frameworks. minitest/mock does not provide this but its very simple to provide a similar effect.

Mocking/Stubbing arbitrary instances of classes is very helpful in testing. In ruby it's easy to do this even without  using some sort of dependency injection.

## Let's do it!

Lets assume we have a `Fetcher` class that needs an instance of `ApiClient`

```ruby
class Fetcher
  def fetch_data
    ApiClient.new.get("https://service.com/api/data")
  end
end
```

We start by creating a mock and setting the relevant expectations like always.

```ruby
mock_api_client = Minitest::Mock.new
mock_api_client.expect(:get, {data: "return-data"}, ["https://service.com/api/data"])
```

Now we need to make this mock the instance that some class would instantiate by stubbing the class method `.new`

```ruby
ApiClient.stub(:new, mock_api_client) do
  result = Fetcher.new.fetch_data
  assert_equal {data: "return-data"}, result
end
```

The mock/stub combination would be active during the duration of the block.
Importância da Linguagem Haskell
Tags: haskell, functional, programming
Published: 2022-03-02 14:23:49

A Linguagem Haskell, criada em 1990, já possuia soluções para lidar com a Avaliação preguiçosa, Imutabilidade e Efeitos colaterais. 
Por ex: Em Haskell não é possível modificar uma lista, apenas é possível gerar uma nova lista com os valores transformados.

A Linguagem Haskell tem uma curva de aprendizado muito grande. Normalmente é usada para fins acadêmicos, razão pela qual há poucos projectos na Indústria de Software.

Embora a Linguagem Haskell seja pouco usada em projectos do mundo real, é importante estudar para entender a origem de conceitos amplamente usdados nas linguagens do mercado.

Conceitos como Lazy Evaluation, Lambda Expression, List Comprehension, Map, Filter, Reduce, Monads, Foldr e outros, têm resolvido problemas computacionais(Side Effect e Mutability) encontrados nas Linguagens Imperativas e Orientadas a Objectos.
Nos últimos, em Linguagens como: Javascript, Python, C#, Java, Kotlin, etc, têm surgido novas features baseadas nos conceitos de Linguagens Funcionais.


**Algumas features da linguagem Haskell**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kf972gq9ptv7fn2y05g4.jpg)
Diagramas essenciais UML
Tags: uml, modelling, softeng
Published: 2022-03-02 14:20:54

A UML possui diversos de diagramas, divididos em grupos com o objectivo de modelar um software. Os diagramas são agrupados em  diagramas estruturais,  diagramas interativos e diagramas comportamentais.

Os diagramas ajudam a prever alguns cenários do software e corrigí-los antes da implementação.
Neste universo de diagramas, podemos destacar alguns diagramas para representar aspectos importantes do software.

**Diagrama de Caso de Uso**: Representa os actores do sistema e seus casos de uso. Na prática, cada actor representa um perfil de usuário e cada caso de uso representa uma funcionalidade.

**Diagrama de Actividades:** Representa a interação do actor com o Sistema. Este diagrama é essencial pra visualizar o estímulo do usuário e a resposta do sistema. A lógica envolvida numa funcionalidade também pode ser representada neste diagrama.

**Diagrama de Classes:** Representa as classes do sistema, seus atributos,  suas operações e os relacionamentos entre elas. Este diagrama é essencial para visualizar a estrutura do software. O diagrama pode ser o espelho do modelo lógico da base de dados.

**Diagrama de Componentes:** Representa a interligação entre os componentes do sistema. Este diagrama também pode ser usado para representar a arquitectura do Sistema.

**Exemplo: **Sistema de Inscrição para um concurso público.  Neste exemplo, vamos modelar o sistema usando os diagramas citados. 

**Diagrama de Caso de uso**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m6loi9b172znsem29c2h.jpg)

**Diagrama de Actividades**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pcyrxdfn1fiowm7p1huw.jpg)

**Diagrama de Classes**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6ot44f4z5xisgnhn8heb.jpg)

**Arquitectura de Software**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cdf61v4i4vc2ssugyed7.jpg)
How to fix this problem: export 'FlyToInterpolator' (imported as 'r') was not found in 'react-map-gl'
Published: 2022-03-02 14:16:22


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b5v1upp7qorjdml5g8nc.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gn7c2s2ws2eqlwocmg6c.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6ohy90p2lul1qs34l5wb.png)
Documentação de Software
Tags: document, software, database
Published: 2022-03-02 14:15:40

Na medida que o software cresce, torna-se mais difícil ententer, manter e detectar erros. Grande parte destas questões é superada quando há uma documentação do sofware.

Ao contrário do que pensamos, a documentação de um software não é o código. Tendo em conta que existem milhares de linguagens de programação, o código pode não ser percebido por desenvolvedores de outras linguagens. 

Devemos considerar que os Gestores ou Clientes não precisam ler exaustivamente cada linha de código para entender o software. A documentação deve ser percebida até para os não desenvolvedores.

A documentação não precisa ser complexa, muito formal ou focada em muitos detalhes desnecessários. Apenas precisamos documentar os aspectos que facilitam a compreensão do Software, tanto para os desenvolvedores quanto para os outros envolvidos.

As imagens abaixo apresentam uma sugestão simples para documentação de um software.

**Documentação**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qkbttam7txhyq6pzug3s.jpg)

**Documentação do Software**

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

**Documentação da Base de Dados**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5hnno2w294h8gxvk3f2c.jpg)
Paracetamol.js💊| #68 Explica este código JavaScript
Tags: javascript, spanish, webdev, beginners
Published: 2022-03-02 14:12:43

## **Explica este código JavaScript**

```js
const banda = {
  id:1,
  nombre: "Radiohead",
  "tipo de musica": "Rock",
  albunes: ["Pablo Honey", "Ok Computer", "In Rainbows"]
};

banda.vocalista = undefined;
console.log("vocalista" in banda);
delete banda["tipo de musica"];
console.log("tipo de musica" in banda);
```

A. `false`, `false`
B. `true`, `false`
C. `false`, `true`
D. `undefined`, `true`

Respuesta en el primer comentario.

---
Golang Oracle DB Example
Tags: go, oracle, database
Published: 2022-03-02 14:12:42

This is a small example of connect and use Oracle DB in Golang

Check out at: 
https://github.com/captain-corgi/golang-oracledb-example

Materials
Tutorals:

https://www.oracletutorial.com/

Driver:

https://github.com/sijms/go-ora

Custom Dialector for GORM references from:

https://github.com/CengSin/oracle

Gorm (With my oracle custom dialector):

https://gorm.io/

Note
Container Database: Username: SYS

Role: SYSDBA

Password: Oradoc_db1

Host: localhost

SID: ORCLCDB
Pluggable Database: Username: SYS

Role: SYSDBA

Password: Oradoc_db1

Host: localhost

Service Name: ORCLPDB1.localdomain
The download page (with details and > comments) is here:

https://hub.docker.com/_/oracle-database-enterprise-edition
Módulos de um Software
Tags: modulos, software, packages, modules
Published: 2022-03-02 14:11:40

Módulos são conjuntos ou agrupamentos de funcionalidades bem organizadas de um software com o objectivo de resolver um problema.  Um software é composto por um ou mais módulos.

É importante desenvolver os módulos de maneira independente. A alteração de um módulo não deve alterar o desempenho de todo o sistema. Um sistema bem modularizado é um sistema onde cada módulo faz apenas uma tarefa bem definida.

Documentar os principais módulos do sistema podem ajudar a compreender o Sistema em partes. Compreender cada módulo,  ajuda a fatiar o sistema em pequenos sistemas, distribuir em equipas de desenvolvimento, faclitando a manutenção do Sistema.


Na implementação do Sistema, cada módulo pode ser representada por uma pasta ou pacote.
Cada pasta pode ter classes, protótipos, traits, structs, funções ou procedimentos , desde que faça o agrupamento de funcionalidades relacionadas. A separação dos módulos não depende da Linguagem de Programação.


**Exemplo:** Identificar os principais módulos de um Sistema de Gestão para uma Universidade.
As imagens seguintes, explicam o problema.

**Módulos**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fbcy03ww76c230i737vy.jpg)

**Descrição dos Módulos**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jg3sfle3sfftsv8umnb5.jpg)

Estrutura dos módulos
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/78scup2wb2cw3sodhpmy.jpg)
#Event – Lo mejor de Visual Studio @Code Day 2022 💻🖥️💻
Tags: englishpost, event, spanishpost, visualstudiocode
Published: 2022-03-03 14:04:59

---
title: #Event – Lo mejor de Visual Studio @Code Day 2022 💻🖥️💻
published: true
date: 2022-03-02 14:10:35 UTC
tags: EnglishPost,Event,SpanishPost,VisualStudioCode
canonical_url: 
---

![Lo mejor de Visual Studio Code Day 2022](https://brunocapuano.files.wordpress.com/2022/03/image.png?w=600)

Buenas !

El 3 de Marzo, el equipo y la comunidad de Visual Studio Code organiza un evento en vivo para usuarios de Visual Studio Code. Presentarán novedades, es una gran oportunidad para conocer al equipo que trabaja en Visual Studio Code todos los días.

El 16 de Marzo, en esa sesión repasaremos estas novedades y hablaremos con expertos de la comunidad LATAM sobre las mismas.

## Registro: [Lo mejor de Visual Studio Code Day 2022](https://www.meetup.com/Microsoft-Reactor-Toronto/events/284247540/)

Los esperamos!

#### Presentadores

- **Bruno Capuano** currently works as a Sr. Cloud Advocate at Microsoft focused on empowering the Toronto area to build awesome things with Azure. Bruno was a Microsoft MVP for 14 years and has over 20 years of experience as a software developer and loves to tinker with electronics. He lives in a small town near Toronto with his wife and two adorable kids.
- **Cristian Moreno Zuluaga** is a Fullstack Javascript Engineer and Microsot MVP. On a daily basis he uses: JavaScript (ES6), N[ode.js](http://ode.js), React, CSS (inJS), GraphQL, just to name the most important bits. He help others learn by doing through articles, videos, and courses about Javascript, React, and the static web.
- **Denny Perez** – Software QA Analyst. Events and communities coordinator. Python community enthusiast. Diversity and inclusion advocate.
- **Andres Pineda** – Software Developer with a passion for Mobile Technologies. He is part of different developer communities where he collaborates in different ways (coding, mentoring, hosting events, speaking, etc). In his free time, he enjoys working out, playing a video game, or just chilling out watching a tv show.
- **Sandra Seminario** – I’m a software developer, like to share new staff related with software development and general and focus on working backend skills.
- **Carla Marcela Florida Román** – Carla es una apasionada de la Inteligencia Artificial (IA), participa activamente en comunidades locales e internacionales de Machine Learning y Data Science, Actualmente es Microsoft learn student ambassador en el nivel más alto que es gold, fue premiada con la prestigiosa beca Grace Hopper Celebration el año 2017 y 2020. Actualmente dirige su propia academia de enseñanza a niños y participa como investigadora asociada en el Instituto de Inteligencia Artificial (IIC) de la UPB.

Happy coding!

Greetings

El Bruno

* * *