teleren/devto huggingface dataset:
Coding for social impact
Tags: beginners, programming, react, codenewbie
Published: 2021-11-03 13:51:03

Hi there,

We are FreshSight, a student-run consultancy based in the University of Edinburgh. Our mission is to help third sector companies improve their business and create social impact.

We are currently researching the demand of the upskilling and recruiting services in the tech sector. We would love to hear your opinions whether you are launching your tech career or are an experienced professional.

We appreciate your busy schedule, but it would also greatly help us if you could fill out the following survey which will take under 2 minutes.

For people with less than 5 years of experience in the tech sector:
https://edinburgh.eu.qualtrics.com/jfe/form/SV_agfzofBsHJhx6se 

For people with more than 5 years of experience in the tech sector:
https://edinburgh.eu.qualtrics.com/jfe/form/SV_aVQv54Z9SJvqkGq 

Please do not hesitate to contact us at research@freshsight.com if you have any concerns or need any more information.

Best wishes,
FreshSight team
If The Code Works, Don't Touch It !
Tags: webdev, beginners, programming, productivity
Published: 2021-11-03 13:33:27

This is a repost with little modifications of a post originally in my blog.
[zairiaimen.com](https://zairiaimen.com/programming/if-the-code-works-dont-fix-it/03/10/)
If you don't want to read the post, you can also watch the video version of it :
{% youtube C9jWzFrrn4Q %}

The sentence “if the code works, don’t fix it” is sometimes taken as a rule by newbie developers. Though most of the times it works, i Personally think it is just an excuse from lazy developers.
What is even a bigger problem are people who learn frameworks without learning the basic concepts which causes them to write spaghetti code, and when they see this "Rule" they think it's something everyone does.

## Why You Should Fix Your/The Code

- Becomes more readable by other 
- Improve the code 
- having testable 
- having extensible code

## When To Not Touch The Code

- New To The Job
- Not Experienced Enough With The Technology
- A Part Of the Code That Won't Change Over Time
- Usage Of Open/Close Principle ( Add New Features Without Removing The old Ones )

## How To Fix 

- Read The Code Multiple Times Until You Understand It ( We All Know that our old code can only be understood by GOD but still give it a try )
- Separate Logic From State / UI Management
- Use Design Pattern To Turn The Logic Into Small Testable and Extensible Pieces.
Cannot find name 'Bugsnag'
Tags: webdev, vue, typescript, javascript
Published: 2021-11-03 13:28:07

---
title: "Cannot find name 'Bugsnag'"
published: true
description: When you get started with Bugsnag using TypeScript, you might end up with the following error: "Cannot find name 'Bugsnag'". Let's see how to fix it.
tags: webdev, vuejs, typescript, js
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vyg9bgrli8wylabagfkc.png
---

When you get started with Bugsnag, they have a handy guide to help you make sure errors are well reported to their monitoring tool. In [Mailmeteor](https://mailmeteor.com), we are using Bugsnag to make sure our tools are robust and bug-free.

But recently, when initializing a new TypeScript project on Bugsnag, I end up having this error: `Cannot find name 'Bugsnag'` (which might also be seen as `Bugsnag is not defined`).

![Cannot find name 'Bugsnag'](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vyg9bgrli8wylabagfkc.png)

## Quick fix

Just add `import Bugsnag from '@bugsnag/js'`. The type error is gone :-)
Little drops on C# Interview questions - Structs x Classes
Tags: csharp, dotnet, career, beginners
Published: 2021-11-03 13:18:00

Little drops on C# Interview Questions series
The intention behind this series is to answer with a little bit of context or examples of some of the most common C# interview questions.

Hey friends long time no see but continuing our series on class x structs

## Structs
Struts are value-type variables stored on the stack as we talked about in [Part 1](https://dev.to/ypedroo/little-drops-on-c-interview-questions-stack-x-heap-e9b) of this series and by consequence having faster retrieval, structs cannot be inherited.
## Classes
Classes are as we say the blueprint of an object(which is a class instantiated) storing it on the heap, we can use a default constructor and we can use inheritance.
## When to use each
Classes are an overall blueprint for objects to be used and manipulated throughout the application, like domain objects.
Structs are data structures best suited for small primary data that is not intended to be modified after being created, like coordinates or other fixed data that you might need.
## Disclaimer
As @daviholandas said the structs can be allocated on the heap if its referenced by a reference type.
## Wrapping up
struct and classes can have constructors, constants, fields, methods, properties, indexers, operators, events and nested types.
struct and classes can implement interfaces.
struct does not support destructor or default constructor(parameterless).
Structs that does not support inheritance
members of structs cannot be specified as abstract, sealed, virtual, or protected.
## References
[Entenda finalmente a diferença entre struct e class — C#](https://medium.com/@alexandre.malavasi/entenda-finalmente-a-diferen%C3%A7a-entre-struct-e-class-c-db1e34a96d50)
[Docs](https://docs.microsoft.com/en-us/dotnet/csharp/fundamentals/types/classesus/dotnet/csharp/fundamentals/types/classes)
Automatizando a publicação de artigos no dev.to com github actions
Tags: github, actions
Published: 2021-11-03 13:11:04

# Automatizando publicações de artigos no dev.to com github actions

Recentemente decidi começar a escrever sobre problemas que encontro diariamente no desenvolvimento e as soluções encontradas. 

Entre as opções de plataformas de publicação, uma que eu gosto bastante é a [dev.to](https://dev.to/about) por alguns motivos: 

* É uma comunidade de desenvolvedores
* É construída com base em software open source ([Forem](https://forem.com))
* Não custa nada para quem escreve e nem para quem lê.

Eu já tinha alguns assuntos para começar a tratar aqui, mas resolvi organizar as postagens em uma plataforma centralizada, onde eu poderia de qualquer lugar, escrever, pensar, unir material e manter os dados em um local que eu sempre tenha acesso. Como nem tudo são flores no mundo open-source, não posso confiar que meus posts no dev.to ficarão lá para sempre.

Então, parti da ideia de criar um repositório no github para guardar meus artigos.

E já que os artigos ficariam no github, porque não automatizar a tarefa de publicação usando o github actions?

Ok, primeira coisa a ser verificada. O dev.to tem alguma API? 
- Tem! [DEV API](https://developers.forem.com/api)

Vamos precisar de três operações dessa API.

1. [Criar artigo](https://developers.forem.com/api#operation/createArticle)
2. [Editar artigo](https://developers.forem.com/api#operation/updateArticle)
3. [Obter dados de um artigo pelo seu ID](https://developers.forem.com/api#operation/getArticleById)


Então, precisamos ter um usuário registrado na plataforma. Como você é um desenvolvedor safo, não vou me preocupar com estas [instruções](https://dev.to/enter?state=new-user), ok?

Após logar no dev.to, acesse as [configurações da conta](https://dev.to/settings/account) e crie uma API key. Guarde essa chave para usarmos em seguida.

No próximo post, vamos configurar o repositório que usaremos para guardar os artigos e que automatizará a formatação e publicação.
Is it possible and/or bad practice to send hooks as props?
Tags: react
Published: 2021-11-03 12:51:34

Consider we have the `usePost` custom hook. The hook calls an API and returns a post.

```typescript
const usePost = () => {
  const [post, setPost] = useState();
  fetch('my-api/posts/1')
    .then(response => response.json())
    .then(json => setPost(json));
  return post;
}
```

We also have the `Post` component, which simply renders the post title.

```typescript
function Post() {
  const post = usePost();
  return <div>{post?.title}</div>
}
```

Now I'd like to test the post component. I would like the test to not make any API calls. It is possible to achieve this with jest by using their mocks.

```typescript
import { render } from '@testing-library/react';
import usePost from './usePost';
import Post from './Post'

jest.mock('./usePost');

const mockedUsePost = usePost as Jest.Mock;

it('shows the post title', async () => {
  const post = { title: 'My post' }
  mockedUsePost.mockImplementation(() => post);
  const { findByText } = render(<Post />)
  
  expect(await findByText(/My post/)).toBeInTheDocument();
})
```

**However** I don't like this approach. I do not want to rely on jest mocks to test my components. I would like to instead create an inline mock implementation of the hook which I pass as a prop.

```typescript
import { render } from '@testing-library/react';
import usePost from './usePost';
import Post from './Post'

it('shows the post title', async () => {
  const post = { title: 'My post' }
  const useMockedPost = () => post
  const { findByText } = render(<Post usePost={useMockedPost} />)
  
  expect(await findByText(/My post/)).toBeInTheDocument();
})
```

Is there any negative side effects of doing so? Is it bad practice doing so?

I've extensively searched the web for answers but haven't found anything really helpful.

I'm thinking it **might** violate one of the hook rules. Namely it says "Don’t call Hooks inside loops, conditions, or nested functions.". One could argue that it is called in a condition as the component may be conditionally rendered. I would argue this will not be a problem since we never change the hook again during runtime.
Weather.io is the first app in google play store created by xtaapp for free in a few minutes with Html , Css , Javascript
Tags: html, css, javascript, webdev
Published: 2021-11-03 12:45:54

I am happy to present weather.io 

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

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

weather.io created by 
A talented developer Yash Waghmare 
Just with his Html , CSS and Javascript files, He used our service to convert this web app code to an android app . 

xtaapp check it : 
https://xtaapp.com

he uploaded the project files , app logo , email and last thing is app name , and waited for 5 minutes to get his apk , app bundle and google play key for free 

We decided to take a random group of generated apps every day and publish it for free in a shared account on google play store. 

Yash Waghmare's weather.io app is now live on google play store 
https://play.google.com/store/apps/details?id=com.urlgapp.app1635785018853

You can also do this easily 
converting your Html , Css and Js code to an android app 
Get started now its for free !! 

https://xtaapp.com

We believe That Your Skills Will Change The World 

Thank you .
Elixir em Produção com Willian Frantz (Trybe) e Letícia Silva
Tags: elixir, beam
Published: 2021-11-03 12:43:34

Saiu o novo episódio do podcast Elixir em Foco!
Escute no [Anchor](https://anchor.fm/elixiremfoco/episodes/Elixir-em-Produo-com-Willian-Frantz-Trybe-e-Letcia-Silva-e195av1), no [Spotify](https://open.spotify.com/episode/6NFKzUppTEjxvtUzrhlXlL?si=84EdQSHOS42eh0oF3AQdaA) ou até mesmo no YouTube:
{% youtube _RhiTll1v48 %}

Willian Frantz está aqui no DevTo em {% user wlsf %}

Letícia Silva está aqui no DevTo em {% user dii_lua %}
Select Right Aurora DB Instance 😎
Tags: aws, devops, database, architecture
Published: 2021-11-03 12:39:04

##The Factors

1. Back of envelope calculation for storage required (based on inputs from product requirements) . Aurora scales automatically so less of an issue.



2. Read scaling -  Back of envelope no calculation for # of reads per sec -  can be handled by adding read replicas.

3. Write scaling -  In single-primary mode - there is a single writer DB . This can be the main factor for choosing the db instance. 

4. Estimate the number of write connections needed per second . and pick the db instance based on the connection limits (keeping a factor for connection pooling) -

5. Also a guesstimate for the working set of data needed to be pulled into the memory for things like sorting/filtering etc will be a factor. The limits are mentioned in the above page.

6. This can only be a starting point . You should prioritise perf testing at a time your app is relatively stable to benchmark semi-realworld load.  More often than not perf is constraint than storage.
(also benchmark reports in aws are highly optimistic, you mostly will not be able to achieve these results in your environment)
  [AWS](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.Managing.html#AuroraPostgreSQL.Managing.MaxConnections)

--------------------------------------------------


### *An example of how we approached (Simplified)*


####Back of the envelope calculation for storage

Assuming we will have total 10,00,000 users .
Each user record in DB will have - at max 10 fields.
Each field = max 1 kb (1000char) => Each User record = 10kb
So Total storage needed = 10,00,000 kb = 10 GB

####Read/Write Ratio/concurrency

The DB will be read heavy database. A customer will change password may be once a month but login multiple times.

DocumentDB tops out at a maximum database size of 64TB and 4,500 concurrent connections per instance. DocumentDB supports a single primary node for writes and up to 15 replicas within a single Amazon region.That means with 15 replicas DocumentDB can handle 15 * 4500(max) = 67500 concurrent connection.That means some connections will be waiting in the connection pool.However , these limits may be adjusted - we need to check with AWS.

--------------------------------------------------
HTML Semântico: o que é, para que serve e porque utilizar no seu código
Tags: html, programming, webdev
Published: 2021-11-03 12:31:31

Se você trabalha ou pretende trabalhar com desenvolvimento web, com certeza, já ouviu falar sobre o HTML. Essa linguagem de marcação é uma das mais conhecidas e, em muitos casos, é o primeiro contato de quem busca entrar na área de TI.

A escrita dessa linguagem, quando comparada a outras que são voltadas para programação, é mais simples de ser lida e escrita, uma vez que ela não precisa ter conhecimentos de lógica de programação.

Apesar disso, criar um bom HTML pode ser uma tarefa bem difícil, uma vez ele precisa ser bem organizado e funcional. Quando falamos em criar um bom HTML, em muitos casos, estamos falando da sua semântica, e sobre isso que quero explicar nesse artigo.

## O que é HTML Semântico?

HTML semântico é quando o código HTML está descritivo, utilizando tags que são consideradas semânticas. Isso deixa o código mais organizado e de fácil manutenção. Além disso, os próprios buscadores (Google, Bing, Duck Duck Go, etc.) costumam indexar melhor as utilizam essas tags nos momentos certos.

Hoje, o HTML contem diversas tags que são consideradas semânticas, mas isso não é uma regra para todas, uma vez que existem tags mais genéricas. Essas tags são consideradas não semânticas e tem um papel mais generalistas no código.

## Tags semânticas

Dentre as tags que são consideradas semânticas, algumas aparecem com mais frequência no código do que outras. Normalmente essas tags são voltadas para conteúdos como textos, formulários ou, simplesmente, para separar a página por partes. Confira algumas tags HTML que são consideradas semânticas:

- article
- h1
- p
- header
- main
- footer
- form
- table
- section

Em resumo, essas tags servem para identificar uma parte do código, uma vez que elas podem se referir a uma cabeçalho, com header, ou um rodapé, com footer, por exemplo.

Você também pode ver a documentação da W3Schools para pegar mais tags que são semânticas [clicando aqui](https://www.w3schools.com/html/html5_semantic_elements.asp).

## Tags não semânticas

Como já foi explicado, algumas tags são consideradas não semânticas. Essas tags não tem um objetivo claro no código e isso pode dificultar a compreensão do conteúdo caso sejam usadas em excesso pela pessoa programadora.

No HTML, as tags div e span são consideradas as marcações não semânticas. O div, por exemplo, pode significar qualquer coisa, uma vez que representa somente uma divisão da página, podendo ser um botão, um formulário ou qualquer outro elemento.

Apesar dessas tags não serem semânticas, é possível sim utilizar elas no código. Em muitos casos, você precisará de uma div ou de um span porque não há uma solução própria para descrever uma parte da página. Isso pode acontecer com frequência dependendo da página, mas o ideal é que seu código tenha o mínimo dessas tags.

## Conclusão

Se você chegou até aqui, espero que tenha entendido um pouco sobre como funciona o HTML semântico e porque ele é tão importante.

Caso você queira deixar um feedback sobre o conteúdo ou tenha alguma dúvida, por favor, deixe um comentário nessa postagem.
SaaS Development Tutorials and Goals
Tags: css, webdev, react, saas
Published: 2021-11-03 12:04:14

1. Learn Flexbox: https://www.youtube.com/watch?v=JJSoEo8JSnc
2. Learn CSS: https://www.youtube.com/watch?v=yfoY53QXEnI
3. Learn Authentication: 
   - __Passport.js__:
      - https://medium.com/dailyjs/mern-stack-implementing-sign-in-with-google-made-easy-9bfdfe00d21c 
      - https://www.freecodecamp.org/news/learn-how-to-handle-authentication-with-node-using-passport-js-4a56ed18e81e/
      - https://medium.com/swlh/set-up-an-express-js-app-with-passport-js-and-mongodb-for-password-authentication-6ea05d95335c
   - JWT:
      - https://www.bezkoder.com/react-node-mongodb-auth/
4. Learn Express.js tutorial: https://www.youtube.com/watch?v=L72fhGm1tfE 
5. Learn Redux: 
   - https://redux.js.org/tutorials/fundamentals/part-1-overview
   - https://www.tutorialspoint.com/redux/index.htm 
6. Learn Containers:
   - __Docker__: https://docker-curriculum.com/
   - __K8__: https://kubernetes.io/docs/tutorials/
7. Learn Deployment
   - __Netlify__: https://medium.com/geekculture/how-to-deploy-react-projects-on-netlify-28f72b4ceb8c
   - __Heroku__: https://blog.heroku.com/deploying-react-with-zero-configuration
8. JS Testing:
   - https://jestjs.io/
What's the best question you've been asked in a job interview?
Tags: watercooler, career, discuss, beginners
Published: 2021-11-03 12:00:55

A bit of scrolling through tech communities on Twitter or Reddit can reveal a bottomless pit of complaints about the questions asked in job interviews.

From whiteboarding obscure algorithms in linear time to solving cryptic riddles, most people who've been through a few tech interviews have a horror story of something that caught them wildly off-guard.

But what's less-often discussed are the high quality questions — the ones that really help you differentiate yourself or communicate something about the priorities of the role.

So what's the best question you've been asked in an interview? What did you like about it?

If you conduct interviews, what's your favorite question to ask?
TDD Conference 2021 - Test-Driven Development on Legacy Systems - Maximiliano Contieri
Tags: tdd, oop, conference, agile
Published: 2021-11-03 11:56:06

First International Test Driven Development took place on July 10th. 

In this series, I will include every talk together with my notes and further reading.

Hopefully, a lot of readers will watch and rewatch the talks, as they are worth several reviews.

Let's continue...

## Bio 

Maxi has a PhD in computer science. 
He has been teaching software engineering and working in industry for 25 years. 
He adopted TDD in the mid-2000s and built a financial system from scratch with 25,000 automated tests. Since then, he has been enhancing existing legacy applications by refactoring them with TDD as well. 
He frequently blogs about software design, code smells, and clean code.
 
> TL;DR: We have no excuses to use TDD everywhere 

## Talk

{% youtube Gcx6fosO4t0 %}

*This is my own talk. My own notes will not be very accurate* 😇

# My Personal notes

- TDD is a *development* methodology. Not a testing one.
- It favours KISS and YAGNI principles.
- Systems are less coupled when developed with TDD 
- We promote baby steps
- Myth: *TDD Guaranties good designs*
- We require no side effects on tests. We must be in full control
- Myth: *We cannot use TDD on coupled systems*
- Myth: *TDD cannot be used to improve system performance*
- First names are always very bad
- We should use IDEs and not text editors
- We start TDD with Zombies
- Myth: *Hardcoding is a bad practice*
- Myth: *We can write algorithms without test cases*
- We cannot refactor and change test at the same time
- Myth: *During TDD Process, only the programmers create the tests*
- QAs, Peer Reviewers, Technical support and product owners define the tests
- Myth: *We should test private methods*

# Speaker Links

- Twitter [@mcsee1](https://twitter.com/mcsee1) 
- LinkedIn [@mcsee](https://www.linkedin.com/in/mcsee/)
- DevTo [@mcsee](https://dev.to/mcsee)
- Site [https://maximilianocontieri.com](https://maximilianocontieri.com)
- Medium [https://mcsee.medium.com/](https://mcsee.medium.com/)
 
* * *

Please follow TDD Conference on:

- [YouTube](https://www.youtube.com/channel/UCKn-DadPoyYssfAOMk1LSew)
- [Twitter](https://twitter.com/tddconf)