teleren/devto huggingface dataset:
Code reviews
Tags: codereview, javascript, webdev
Published: 2022-04-04 14:10:12

In the small team of [Learning Locker](https://learningpool.com/solutions/learning-locker-data-cloud/) at Learning Pool, collaboration is key to our success. An important part of that is our code review process, which never fails to offer a kaleidoscope of inspirations.

When a ticket hits the code review column, one of the engineers will pick it up and take a look. We have a code review rota where all engineers participate.

Generally, the ticket description gives a clear understanding of what the pull request should try to achieve, so this is a must-read. We also check that the QA notes match the scope of the ticket. Apart from these, there are generally no set rules on the code review process.

Occasionally, there are team reviews too, where multiple team members jump on a quick call to discuss a pull request. To protect efficiency and prevent burdening reviewers, we try to limit to 3 tickets in code review at any one time.

On a basic level, code reviews help the team become familiar with what others are working on. The main purpose of code reviews is to ensure the code is addressing the problem appropriately and to catch any bugs or potential pitfalls.

In our Learning Locker team, we put a big emphasis on quality. To name a few items from our pull request checklist, the author is responsible for checking that they have considered situations such as long running migrations, boundary testing, evergreen browser testing, or if they have included tests for any new features.

Additionally, inside each pull request, [Codecov bot](https://about.codecov.io/) provides metrics on whether code coverage has increased, and specifies the lines where changes are not covered with tests.

The team enjoys looking at code thoroughly by asking questions and challenging each other through code review suggestions.

We reference our Engineering Guide as best practises for nitpicks, such as naming conventions (the Engineering Guide is being actively maintained and [here's a sneak peek](https://dev.to/learninglocker/5-ways-we-keep-our-code-understandable-for-junior-engineers-3667)). We never forget to give a thumbs-up to a good spot or an insightful comment. Not to mention, it’s also a good opportunity to see new approaches to problems, different coding styles and the latest syntactic sugar!

Upon a “LGTM” the pull request will be thoroughly checked by the QA team, before finally merged and hitting the production platform - a long but worthwhile journey!

---

##Join us
We’re often hiring - you can find all our job listings on [our website](https://learningpool.com/why-work-for-learning-pool/careers/).
Estabelecendo um processo fundamental de revisão de código
Tags: programming, beginners, codereview, braziliandevs
Published: 2022-04-06 01:19:26

O processo de revisão de código começa antes mesmo da revisão, todos devem entender claramente as regras, e concordar com elas, e isso não pode ser alterado durante o processo. Isso inclui, aceitar com antecedentes um estilo de código, configurar ferramentas para fazer as partes chatas como aplicação do estilo, geração de cobertura e etc…


### Montando um processo



* Concordar com algo:
    * Utilizar um estilo de codificação por exemplo.
* Documenta-lo
* Criar um arquivo de configuração importante
    * Para estilo de codificação, pode ser um arquivo que a IDE pode ler e formatar o código.
* Aplica-lo

O tempo do dos desenvolvedores é valioso e caro, devemos focar no que realmente importa, e erros de estilização não devem gastar esse tempo, como solução podemos adotar uma ferramenta que antes do processo de submissão do PR, avalia se o estilo definido está aplicado, e caso contrário, não deixe prosseguir.

Ferramentas de automação podem pegar problemas de:



* Bugs, por exemplo, se um loop é infinito, se a condição booleano é sempre falsa ou verdadeira
* Vulnerabilidade de seguranças
* Code smells

Um exemplo de ferramenta é o SonarLint, disponível para diversas IDEs [ttps://www.sonarlint.org/](https://www.sonarlint.org/)

Podemos também utilizar ferramentas para analisar nosso PR, após sua submissão, como pro exemplo, o SonarQube [https://www.sonarqube.org/](https://www.sonarqube.org/) .


### Quantos revisores o PR deve ter?

Um bom número é dois, porém um deles obrigatoriamente precisar saber as regras de negócios por trás daquele código.


### Não existe carteirada durante a revisão.

Um júnior pode ser um revisor de um PR do pleno ou senior. Mesmo com um maior tempo de experiência todos estamos suscetíveis a erros e aprendizado. Mesmo que o PR de um desenvolvedor senior esteja perfeito, a revisão oferece uma oportunidade de orientação e colaboração entra a equipe e como bonus, diversifica a compreensão do código.

Um desenvolvedor senior deve estar preparado para responder as perguntas que para ele, pode parecer obvias, mas para seus companheiros não serão.

Se tem um novo membro na equipe, ele não pode ter medo de deixar comentário sobre coisas que ele acha que devem ser corrigidas, pois cada pequena ajuda conta. Toda a equipe de ser encorajada a corrigir até mesmo os menores problemas, como erros de digitações em comentários por exemplo.


### Escolhendo soluções

Ao se deparar com um problema, geralmente temos diversos soluções para a resolução, algumas ruins outras boas. Caso o autor do PR escolha uma solução boa, os revisões precisam saber distinguir as boas práticas comuns, do gosto pessoal, e não forçar o autor a seguir a solução do revisor.


### Não deixa uma revisão travada por dias

A revisão deve ser feitos em horas, e não em dias, essa é um convenção importante que todos precisam concordar, pois é responsabilidade de ambas as partes, autor e revisores.
Learning Programming for Web Development, One Year In
Tags: beginners, programming, javascript, student
Published: 2022-04-06 01:04:45

#Introduction
I recently graduated from an online web development programming course. Before that, the only programming experience I had was from a semester long course I took my junior year of high school. Seeing as I am 30 years old now, all I remember from then is `<div></div>`. In this post, I want to go over the things I've learned this year, and what I hope to learn in the future. 

###What I have learned
Over the past year, I learned HTML, CSS, JavaScript, React, Redux, Ruby, Sinatra, and Ruby on Rails. When I say "learned", I mean I was able to complete lab assignments, projects, and live coding challenges which demonstrated competent knowledge and understanding of the languages and frameworks we were using in my course. I have not mastered any one of these tools, but I do have a solid grasp on them and understand the logic behind programming. 

As I worked through the curriculum and projects of my course, the tools we learned early on were used to help us understand how the frameworks built on them work. What would require an effort level of 10/10 to implement then, became an effort level of 2/10 because of helpful libraries and frameworks. However, I have less confidence in my ability to write vanilla JavaScript now than I did three months into my course. So, one of my goals moving forwards is to go back to JavaScript, get more practice with the concepts I am familiar with to gain fluency, as well as learn new concepts.

###What I hope to learn in the near future
You do not really ever stop *learning* how to program. There are always new frameworks and refactored libraries coming out in the massive programming community. Even as I was between projects in my course, React updated `<BrowserRouter />` and I was able to learn how to use their newest version of it on my following project.

Each time I would look up documentation on how to implement a concept in whichever language, I would find myself going down a rabbit hole of linked documentation for relatable problems or concepts that I wanted to explore. However, I think my next main focus will be implementing Redux fully with my React based application I built for my final project.

###Conclusion
This past year has been a fulfilling experience of stressful times with difficult concepts, and amazing highs when I would get those concepts to work and make my ideas come to life. Now that I have whet my appetite for programming and web development, I am excited for the future and learning as much as I can!
SOLID - SRP
Tags: solid, oop, poo, beginners
Published: 2022-04-06 00:44:46

**Princípio da responsabilidade única**

> Uma classe deve ter apenas uma razão para mudar.

Cada classe deve ter uma única responsabilidade dentro do projeto.

**Por exemplo:**

Vamos supor que no nosso projeto exista a seguinte classe:

```c#
    public class PetShop
    {
        public decimal CalculaReceita(){}
        public void PagarFuncionarios(){ }
        public void AdicionarPet(Pet pet) { }
        public Pet BuscarPet(int id) { }
    }
```
Ela é responsável por uma série de tarefas, como calculo de finanças, pagamento de funcionários e cadastro de Pets... Muita coisa, né!?
Neste caso, nós teríamos cinco razões completamente diferentes para alterar uma classe, já quebrando o principio da responsabilidade única. Sem falar no alto acoplamento e na dificuldade de manutenção.

O ideal seria criar uma classe para cada responsabilidade diferente: 

```c#
    public class Receita
    {
        public decimal CalcularReceita() { }
    }

    public class Pagamentos
    {
        public void PagarFuncionarios() { }
    }

    public class PetRepositorio
    {
        public void AdicionarPet(Pet pet) { }
        public Pet BuscarPet(int id) { }
    }
```
Muito mais fácil de entender e bonito de se ver, não é mesmo?
Tracking My Progress With The Data Science Marathon (Week 2).
Published: 2022-04-05 23:47:00

Welcome to week 2 - a continuation of my progress series. 
The previous week was quite a marathon and from that  my guess is that this coming week will be more challenging but I'm still prepared because *Once you begin, there's no quitting*.

#### Monday
This is Day 6 of the data science marathon. 
I did an introduction to  scikit-learn with main focus on ensemble algorithms.
One thing that I always find fascinating is that every time I take a beginner approach towards learning, I always encounter totally new concepts. Today I learnt about the simplicity of the Scikit-learn API design where I looked at the basic interfaces, the submodules of Scikit-learn i.e 
* Datasets : sklearn.datasets
* Preprocessing : sklearn.preprocessing
* Impute : sklearn.impute
* Feature Selection : sklearn.feature_selection
* Linear Models : sklearn.linear_model
* Ensemble Methods : sklearn.ensemble
* Clustering : sklearn.cluster
* Matrix Decomposition : sklearn.decomposition
* Manifold Learning : sklearn.manifold
* Metrics : sklearn.metrics
* Pipeline : sklearn.pipeline
* Model Selection : sklearn.model_selection

Ensemble learning on the other hand is the process by which multiple models, such as classifiers or experts, are strategically generated and combined to solve a particular computational intelligence problem

#### Tuesday
For day 7, my focus was on XGBoost Algorithm which is an ensemble learning technique to build a strong classifier from several weak classifiers in series.
XGBoost stands for “Extreme Gradient Boosting” and it is an optimized distributed gradient boosting library designed to be highly efficient, flexible, and portable to implement Machine Learning algorithms under the Gradient Boosting framework. It provides a parallel tree boosting to solve many data science problems in a fast and accurate way. 

Stay tuned for Wednesday and the rest of the week.

Hope you have a great and fruitful day! 👋 🌱

For any errors observed in this article, please mention them in the comments. 🧑🏻‍💻
⏩ Going native with Spring Boot on Mac M1
Tags: graalvm, knative, springboot
Published: 2022-04-05 22:12:00

## 👉 Intro

I recently saw a great Spring blog post about [Building Native Images with GraalVM and Spring Native on Apple's M1 Architecture](https://spring.io/blog/2022/03/23/building-native-images-with-graalvm-and-spring-native-on-apple-s-m1-architecture).

In the same time we are investigating on porting some of our (innovation dedicated) existing Spring Boot based APIs to [Spring Native](https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/), see related content : 

{% embed https://dev.to/optnc/knative-the-easy-way-to-serverless-a-java-app-3n36 %}

As one of our developers works on an Mac M1, we wanted to give it a try to see what would happen.

This short blog post is about that short experimentation.

## 🎞️ Build & Run  : 2' speedrun

Finally we could enjoy the full and smooth cli based experience : 

1. Setup Java runtime with [GraalVM](https://www.graalvm.org/) [`22.0.0`](https://www.graalvm.org/release-notes/22_0/) with [sdkman](https://sdkman.io/)
2. Build & Install native image (and see resources used : time & memory)
3. Boot the API (`0.4`s.)
4. Perform a first REST query (`0.007` s.) with [`httpie`](https://httpie.io/)
5. Perform a second REST query (`0.003` s.)

Let the show begin :

{% embed https://youtu.be/MyNPzH7oheA %}


## 🍏 More about Apple M1

You can get a full intro/deep dive on Apple M1 Ultra architecture  thanks to this great [Computerphile](https://www.youtube.com/channel/UC9-y-6csu5WGm29I7JiwpnA) episode : 

{% embed https://youtu.be/yG1m7oGZC48 %}


## 🔖 Resources

- API [homepage on Dockerhub](https://hub.docker.com/r/optnc/api-partenaires-mobilis/)
- API on [RapidAPI marketplace](https://rapidapi.com/opt-nc-opt-nc-default/api/partenaires-mobilis/details)
- [Building Native Images with GraalVM and Spring Native on Apple's M1 Architecture](https://spring.io/blog/2022/03/23/building-native-images-with-graalvm-and-spring-native-on-apple-s-m1-architecture)

{% twitter 1511724002150162432 %}
How NOT to optimize your website
Tags: javascript, webdev, css, performance
Published: 2022-04-05 21:40:14

_I make a change, add a huge-ass image on the home screen using it's "image link address", too lazy to download bRo and hit save, "localhost" appears to be load fine, and then I push it to production! _

What we don't see is the face of the user, trying to access your site on a low-band 4G/3G network, which is stuck because of your third party image download. 
If you’re happy making your users frustrated, do follow the points below religiously..

1. Always load the third party JS first! Especially, don't exclude/ remove the npm packages that you don't need. The more the merrier!!

2. Try not to divide your JS into chunks ( code-split ), The bigger the better!!

3. All the images/fonts that you use, SHOULD BE from Third party source, no chance in hell they're from  your origin. 

4. The image that you let the user see first, should of the highest quality and size and should be loaded last. 

5. Lazy Loading of imports and JS is for pussies, refrain using those. 

6. If you find a way, then load the HTML as the last thing to be loaded on to the screen everything else should come first. 

7. DO NOT try using "preconnect" on any &lt; link &gt; tags and avoid going through Script loading strategies from low-grade frameworks like Next.js. 

8. Always remember that higher FCP ( First Contentful Paint ) the better, which means the time taken for your website to show the first content, above steps such as third party scripts loading will help you achieve this feat. 

9. The longer FID ( First Input Delay ) the better, as you'd make the user wait on your page for the longest time possible. 

10. The higher CLS ( Cumulatieve Layout Shift ) the better as the user gets mesmerized when layout keeps changing as the content keeps on showing up, our third party image assets can be leverage here.  



That's all folks! The Web World is yours to rule now!
6 Ways To Create An Object In JavaScript
Tags: javascript, webdev, beginners, programming
Published: 2022-04-05 21:36:24

## What is an Object?

Objects are one of JavaScript's data types. An object can be seen as a collection of properties. A property is a name-value pair.

In other words, a JavaScript object is something very similar to a real-life object or entity.

Think a person. A person has different properties like the name or the age. Well... a person can be modeled as a JavaScript object.

There are many ways to create an object in JavaScript.

## 1. Object() Constructor

1. Use the `Object()` constructor to create an empty object.
2. Set the object's properties.

Example:

```javascript
// Use the `Object()` constructor to create an empty object
var person = Object();

// Set the object's properties
person.name = "John Doe";
person.age = 42;
```

## 2. Create Method

Object.create() can be used to create an object from the prototype of another object.

Example:

```javascript
var person = Object.create(Person)
```

## 3. Object Initializer

1. Write the curly brackets {}.
2. Put all properties (`name: value` pairs) inside the curly brackets.
3. Add commas to separate `name: value` pairs.

This is called Object literal (or Object initializer) and can be used to create an object.

Example:

```javascript
var person = {
    name: "John Doe",
    age: 42
}
```

## 4. Constructor Function

1. Create a Constructor Function.
2. Use the 'new' keyword to create an object from the constructor function.

Example:

```javascript
// Create a Constructor Function
function Person() {
    this.name = "John Doe";
    this.age = 42;
}

// Use the 'new' keyword to create an object from the constructor function
var person = new Person();
```

## 5. ES6 Class (only for JavaScript ES6)

1. Create a ES6 class containing a constructor method.
2. The constructor takes the property values of the object as arguments.

Example:

```javascript
class Person {
    constructor(name, age) {
        this.name = name;
        this.age = age;
    }
}

var person = Person("John Doe", 42);
```

## 6. Singleton Object

A Singleton is an object that can be created only one time. An attempt to create a second object will return a reference to the first object.

Example:

```javascript
var person = new function(){
    this.name = "John Doe";
    this.age = 42;
}
```

## Conclusion

In this blog post we have shown 6 different ways to create an object in JavaScript. Every developer should be aware of these ways and choose the most appropriate way from time to time.

That's all for this post. If you liked this post, follow me on [dev.to](https://dev.to/cscarpitta/) and Twitter ([@cscarpitta94](https://twitter.com/cscarpitta94)) to get notified when I publish new posts. :blush:
April 5th, 2022
Tags: function, method
Published: 2022-04-05 21:22:10

inside JavaScript,

**function **

`function test() {}`

also function can be value. That is, the function for the object's property is called **method**

`objectA = {
    B : function() {}
}`


**Method is a function for the object's property
Function is a function itself.**

Function includes method.
Function is independent from object while a method is not.
Method can access the data inside the class/object



---------



Property and Method

Object is a case made of properties

property is made of key-value pair

**if value is function, we call that as method.**
key is an identifier for identifying a property

`const person = {
    name = 'hyunjin',
    say = function (){console.log('hi')}
}`

name = property, say = method



the main who practice method is the object
the main who practice function is the function itself.
Same visibility into your SDLC as the apps you develop!
Tags: devops, dora, productivity
Published: 2022-04-05 21:06:40

As software engineers, we understand how important it is to instrument our applications. Without Datadog, New Relic, Sumologic, we know that Engineering would grind to a crawl at the first sign of trouble. The same holds true for your Software Delivery Process, i.e. how you review, merge, build and deploy changes, resolve incidents and fix bugs.

With [Faros Community Edition](https://github.com/faros-ai/faros-community-edition), you can now have unprecedented visibility into your Software Delivery Process.

Anyone used to tackling this problem quickly hits a wall: data is in a lot of different places and cannot always be easily leveraged. For example:
* for Change Failure Rate, your incidents are in PagerDuty, your Deployments in CircleCI
* GitHub only gives you metrics for a single repository, and nothing close to PR Cycle Time

![Getting GitHub Stats is Hard](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fk7uqc8l05ec9cywp60x.png)

At this point, you may think “all those systems have APIs! Let’s extract all that data and compute metrics ourselves! I know the perfect place to put it!”.

![A real database](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e65fc2su9l1pjim7fqpk.jpeg)

This is when the REAL fun begins!
* Data Integration is a nightmare
* Linking data is necessary for some metrics (like lead time for changes) but incredibly hard
* If your teams use several systems (say CircleCI and GitHub Actions), you have to deal with data modeling and normalization
* Self-serve can quickly become daunting, and maintenance is hampered

This is why we built [**Faros Community Edition**](https://github.com/faros-ai/faros-community-edition).

Faros Community Edition (CE) is an open-source engineering operations platform that connects the dots between all your operational data sources for a single-pane view across the software development life cycle.

Features to consider:

🗺 **Rich Data Schema**
Connected canonical models for the whole SDLC; 50+ entities, from tasks to deployments

🚰 **Import from a variety of sources**
Easy data import onto our models from Task Management, Version Control, Incident Management, and CI/CD systems

❄️ **Flexible GraphQL API**
Leverage imported data for automation / exploration in our canonical representation

📊 **Preconfigured dashboards**
View well known engineering metrics such as DORA and SPACE

🏗 **Extensibility and shareability**
Build and share custom metrics and dashboards

☁️ 💻 **Container-based deployment**
Run on your laptop, private or public cloud, with no external dependencies

Get started in 10 min, get your questions answered and finally ditch the spreadsheets!

* [GitHub repo](https://github.com/faros-ai/faros-community-edition)
* [1 minute video](https://youtu.be/9nplGxnyAqw)
* [Quickstart guide](https://community.faros.ai/docs/quickstart)