teleren/devto huggingface dataset:
Qualidade de software
Published: 2022-02-07 02:10:50

O desenvolvimento de hardwares mais robustos e eficientes permitiu a criação de softwares cada vez mais complexos, ao passo que a produção de softwares, em geral, só aumentou. Desse modo, em um esforço para controlar a qualidade dos softwares, foram estabelecidos os fundamentos da gestão de qualidade (SOMMERVILLE, 2011).

Duas abordagens são essenciais para a qualidade de software: A garantia de qualidade (Quality Assurance - QA) e o controle de qualidade (Quality Control - QC). A QA se ocupa em garantir que o software seja desenvolvido de modo a atender os requisitos, apresentar menos defeitos e melhores custos, enquanto o QC tem o objetivo  de testar, encontrar e remover os defeitos do software (MACHADO; SOUZA, 2004).

Assim, a qualidade de software está relacionada à qualidade do processo de desenvolvimento de software, ou seja, relacionada ao processo de produção (SOMMERVILLE, 2011). No entanto, é válido ressaltar que para qualidade é necessário que além de cumprir aos requisitos funcionais, o software também deve atender aos requisitos não-funcionais de modo a atender as expectativas do cliente (SOUZA et al., 2020).

Naturalmente, em razão da dificuldade no levantamento de requisitos, do não-entendimento entre desenvolvedores e clientes e incompatibilidade entre o desejável e o alcançável durante a fase de projeto, os produtoss nunca cumprirão todas as especificações. Isso torna a avaliação da qualidade de software um processo subjetivo, em que a equipe de qualidade precisa averiguar se o software é adequado para o uso ou não.




MACHADO, Marcio P.; SOUZA, Sotério F. Métricas e qualidade de software. Departamento de Informática–Universidade Federal do Espírito Santo, p. 1-18, 2004.

SOMMERVILLE, Ian. Engenharia de Software. Nona Edição. 2011.

SOUZA, Bianca Morais et al. Mineração de Repositório de Software: Investigando a qualidade do software em projetos de código aberto. ANALECTA-Centro Universitário Academia, v. 5, n. 5, 2020.
Fixing Font issue with Parcel
Tags: javascript, parcel, beginners, tutorial
Published: 2022-02-07 01:44:06

I just recently started using the parcel bundler for a project I was working on. I set up the dev and build commands, and set my path to `src/index.html`. Unfortunately, all my fonts file in the `src/` folder wouldn't show up in the compiled html file in the `dist` folder.

## how I solved it

I googled around a bit but there weren't that many issues as specific as mine. I read up on github and found out that, one way was to copy the fonts folder from the `src` into the `dist` folder.

If you want to try this out, make sure the server isn't running by pressing `ctrl c` in your terminal. After that, copy the fonts folder to the `dist` folder and then run your build command again. In my case it was `npx parcel` this is because I had specified my source to be `src/index.html` in my package.json

```
{
 "source": "src/index.html",
  "scripts": {
    "dev": "parcel",
    "build": "parcel build"
  },
}
```

And Voila! it worked quite alright.
Storybook plugins "push of undefined" error in webpackFinal after upgrading from webpack4 to webpack5
Tags: storybook, webpack
Published: 2022-02-07 01:36:04

```javascript
webpackFinal: async (config) => {
    config.resolve.plugins.push(new TsconfigPathsPlugin({}));
    
    return config;
  },
```

`TypeError: Cannot read property 'push' of undefined`
The error occurred after upgrading. from `webpack4` to `webpack5`.

```javascript
webpackFinal: async (config) => {
    if (config.resolve.plugins !== undefined) {
      config.resolve.plugins.push(new TsconfigPathsPlugin({}));
    } else {
      config.resolve.plugins = [new TsconfigPathsPlugin({})];
    }
    
    return config;
  },
```

I thought that `config.resolve.plugins` is possible to be not `undefined` in the future. This is why I first checked whether `config.resolve.plugins` is undefined or not then `replace config.resolve.plugins` or `push the plugin into config.resolve.plugins`.
Um pouco sobre qualidade de software
Published: 2022-02-07 01:27:01

Para trabalhar com a qualidade do produto, é necessário entender que existem diversas características que são utilizadas para calcular a qualidade do produto. Sendo necessário sempre manter um meio de medição objetivo para ser mais preciso na hora de avaliação e ficar claro se foi possível atingir a qualidade desejada.

Como dito antes existem diversas características, sendo elas:

- Adequação funcional;             
- Confiabilidade;
- Eficiência e execução;           
- Segurança;
- Compatibilidade;                 
- Manutenibilidade ;
- Usabilidade;                     
- Portabilidade.

Dentro dessa características existem sub características, como por exemplo apreensibilidade e operacionalidade que são sub características da Usabilidade. Possuindo então estás propriedades de qualidade, que são mensuráveis e podem ser avaliadas.

A qualidade do produto também pode ser dividia em propriedades internas, que são aquelas medidas pelo desenvolvedor e não pelo usuário, como por exemplo facilidade na manutenção do código, facilidade no entendimento do mesmo, entre outras. que influenciam na outra propriedade, que são as propriedades externas, aquelas visíveis ao usuário.

Então é sempre importante definir qual o grau de qualidade deseja ser alcançado e analisar e verificar quais são as melhores características que devem ser focados para satisfazer os _stakeholders_ e entregando assim o produto com a maior qualidade possível para eles.
Earn more storage space on Dropbox for free
Tags: dropbox, storage
Published: 2022-02-07 01:19:38

#What is Dropbox?
> Dropbox is a file hosting service operated by the American company Dropbox, Inc.

#How much Storage space do I have?
Depending on the type of subscription, Dropbox offers you different amounts of space.
We're here to talk about the free plan which is what you get when you first create a Dropbox account.
With this plan, all you get is **2GB**, which is, in most cases, not sufficient in case you depend a lot on cloud storage services, or you prefer to store your documents and data on the cloud.
# How can I increase my storage space?
Glad you asked, Dropbox itself will ask you to go premium and tempt you into buying more space with a Dropbox Plus plan!

![Dropbox plans comparaison](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qshfg6i80lnn4mfzm10e.png)

Whilst paying for a premium subscription will grant you access to 2TB of storage space and other advantages, there's a workaround to get up to 16 GB of storage for free.

Just visit Dropbox website on your browser and head to your account settings and then choose "refer a friend" from the tabs. Here's the link to it in case you couldn't find your way there: ["Referals"](https://www.dropbox.com/account/referrals), after that you'll read :
> **Get up to 16 GB for referrals**
> Earn 500 MB for every friend who installs the Dropbox desktop app—and your friend will get 500 MB too. ...

Next thing to do is copy the invite link Dropbox provides
Share that link with your friends and family and you'll earn 500MB for each person clicking your link and signing up for a Dropbox account. and they also get a bonus of 500 MB.
 
# Extra out of charge 500 MB
If you don't have Dropbox app installed on your device yet or you just want to test it out, use my referral link [https://www.dropbox.com/referrals/AADxXRDPeFLUNQUWs2JaYYR627TXlpI7H3Y?src=global9](https://www.dropbox.com/referrals/AADxXRDPeFLUNQUWs2JaYYR627TXlpI7H3Y?src=global9) and you'll get extra 500, I get extra 500, everyone happy 😄 .

#Final words
Don't hesitate to leave any questions you may have for me in the comments. I'll be pleased to reply and subscribe for more interesting content like this one.
My first mini-game
Published: 2022-02-07 01:16:23

Hi,

 I just completed a tic-tac-toe game. It was very fun creating it and I am sure there are a lot of things that can be improved as I am a beginner coder. If you have any suggestions on it please let me know. Here it is: 

https://github.com/fritsche09/CS-project/blob/master/tic-tac-toe.py
How use dompdf to generate a simple invoice pdf?
Tags: php, html, css, dompdf
Published: 2022-02-07 00:34:45


![Invoice formato with PHP](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j2irve1r72f5wrdcb9f8.PNG)At this moment to understand the basis in composer I have decided to create a simple pdf generator with Dompdf package.

This package is awesome and simple, to create a pdf invoice solution for download or create an automatic invoice delivery system.

The idea for monetization:
A create simple auth token system with API_KEY and token to receive JSON data for generating pdf in a simple PHP hosting.
Free hosting for testing this:

[Free PHP Hosting](https://www.000webhost.com/)

Ok, the code:

### Step 1:
run this, for a run this you need to install composer
`composer require dompdf/dompdf
`
The Dompdf documentation: : 
[Dompdf Documentation](https://packagist.org/packages/dompdf/dompdf)

### Step 2: 
Load vendor.autoload.php package 

```php
require 'vendor/autoload.php';
```

### Step 3: 
Use the main class to create functionalities

```php
// Cargar paquete para usar el modulo de Dompdf
use Dompdf\Dompdf;
use Dompdf\Options;
```

### Create an instance of the class Dompdf
```php
$dompdf = new Dompdf();
```

### Enable remote origins (for download image)
If not enable this, the image not render in the pdf file and break the template format preset
```php
$options = new Options();
$options->set('isRemoteEnabled', true);
$dompdf = new Dompdf($options);
```
### Step 4: 
Create an HTML template, with a text string
```php
$htmlTemplate = '
<style>
//all styles for the custom template 
</style>

<html>
  <head>
    <htmlcontent>
    .......
</html>
';
```


To pass dynamic vars using this format into the string 
```php
'.$contenidoDinamico.'
```
For creating bucle with PHP array using the other var to generate a string with Concat operator (htmlinfo.= 'bucleGetInfo') or array method to push data

### Step 5:
Load HTML with loadHtml method of the class instance previously named
```php
$dompdf->loadHtml($content);
```

### Step 6:
Set a size for the page with the setPaper Method
```php
$dompdf->setPaper('A4','landscape');
```

### Step 7:
Server compiled and fusion HTML with a PDF format to create a pdf image:
```php
$dompdf->render();
```

### Step 8: 
Write this information of saving in temporal server memory for sending a file to the client request
```php
$dompdf->stream($fileName);
```

[Link al repo](https://github.com/syntaxter/pdf_generator)
<br>


[Siguemente en las redes como @syntaxter](https://www.instagram.com/syntaxter/)

{% user syntaxter %}
12 LOC Infinite scroll
Tags: rails, ruby, hotwire, viewcomponents
Published: 2022-02-07 00:21:27

A kinda self referencing, recursive turbo frame using streams to append the response frame to itself. 
What's more this would be a nice ViewComponent abstraction with lines 3-5 as args

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3ocjg1hzc4d4rg63x9ho.jpg)
Notes on Python
Tags: python
Published: 2022-02-07 16:48:12

---
title: Notes on Python
published: true
date: 2022-02-07 00:00:00 UTC
tags: python
canonical_url: https://recology.info/2022/02/python-notes/
---

It’s been interesting switching jobs with respect to programming languages. I used to write 95% R - now I write 95% Python.

I have been using Python for many years, but not seriously or getting paid either. I’ve learned alot in the first 6 months.

Some Python things learned:

## Functions and methods

I used to think functions and methods were the same thing. But during the last 6 months I learned that functions and methods are not the same. Well, they’re not that different. A function outside a class is just called a [function](https://docs.python.org/3/glossary.html#term-function) while a function inside a class is called a [method](https://docs.python.org/3/glossary.html#term-method). They could be exactly the same and do the same thing, but one is outside a class and the other inside a class.

```python
class Stuff(object):
  def things():
    return 5

def things():
    return 5

Stuff.things()
# 5
things()
# 5

```

## .sort and sorted

`.sort` called on an object changes the object in place and `sorted()` creates a new object.

```python
x = [4,1,7,2,6,5,3]
z = x.sort()
# nothing returned, z = None
sorted(x)
# [1, 2, 3, 4, 5, 6, 7]

```

## context managers

I’d surely used a [context manager](https://docs.python.org/3/glossary.html#term-context-manager) in Python before but didn’t realize what was happening. The code base I work in uses many [with](https://docs.python.org/3/reference/compound_stmts.html#with) statements and these are used with context managers like:

```python
with EXPRESSION as TARGET:
    SUITE

```

In the above case I often create a connection to a database using the `with` statement, then once the block is exited, the connection is cleaned up.

## imports

Coming from R, it’s so nice in Python to be able to import specific functions, classes, etc. rather than having to load an entire file or package in R. In addition, `as` in Python imports is really nice to have.

Python

```python
from x import y
import pandas as pd

```

R

```r
require(x)
library(x)

```

Sometimes I run into circular import issues in Python (as I did in R), which I’ve yet to find a neat solution to sorting out.
A 15-year Puppet Journey
Tags: puppet, cfgmgmt, devops, community
Published: 2022-02-06 22:59:02

---
title: A 15-year Puppet Journey
published: true
description: 
tags: puppet,cfgmgmt,devops,community
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2ufldxkli3cw6efd7np6.png
---

*Note: this is a personal blog post. It does not concern Camptocamp's partnership with Puppet Inc., which remains unchanged.*


In 2006, I landed my first gig as a Systems Administrator. One of my main roles was taking care of a Cfengine server and repository for about 4000 machines, and finishing its migration from Cfengine 1 to Cfengine 2.

Like many people in this position at that time, discovering Puppet was akin to a revelation. Leaving aside its slowness (in comparison to Cfengine), its DSL, file templates, and the extensibility of the Resource Abstraction Layer were nothing short of a little revolution.

Then Augeas was presented to me, and I enjoyed the concept so much I got involved in the project and started writing many lenses.

I joined Camptocamp in 2012 in large part because of the role the company played in the Puppet community. Together with my colleague [Mickaël](https://github.com/mcanevet), we took to standardising and modernising our Puppet stack and modules, and got deeply involved in the community, writing plugins (puppet-lint plugins, [facterdb](https://github.com/voxpupuli/facterdb)/rspec-puppet-facter) and tools ([prometheus-puppetdb-sd](https://www.camptocamp.com/fr/actualites-evenements/news_integrating_prometheus), [puppetfile-updater](https://github.com/camptocamp/puppetfile-updater), [puppet-ghostbuster](https://www.camptocamp.com/fr/actualites-evenements/news_cleaning_up_puppet_code), etc.).

![Puppet Community](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3bgtu2pv4ftg5suj31rv.jpg)

Over the years, I've had the pleasure of teaching Puppet training courses at all levels and consulting on all sorts of layers (modules, Ruby plugins, TDD, etc.) and stacks (Puppet Enterprise, Foreman, Docker-based, and more…).

In the last couple of years though, my work has mostly revolved around containers and Kubernetes. I have kept maintaining Puppet- and Augeas-related code, but often without using these projects myself for production needs.

For that reason, I started donating such projects to [Voxpupuli](https://voxpupuli.org), as I believe they will receive better care than I can currently give them.

Truth be told, I've delayed all this for months —maybe years— because the Puppet community is awesome and it's always been a pleasure to contribute to it. I've even gotten back quite a bit last year, reviving [puppet-catalog-diff](https://forge.puppet.com/modules/camptocamp/catalog_diff) and participating in various Puppet Camps.

It's been fun, but I need to focus on other projects now, and it's probably better if things are set in a clear manner.

So farewell Puppet community, keep being an awesome and welcoming place, & thanks for all the 🐟!
CSS Only Accordion
Tags: css, html, accordion, javascript
Published: 2022-02-06 22:33:56

Accordions don't even need to have fancy JavaScript plugins. Surely we can do it simply in Vanilla JavaScript, but sometimes it's best to even look at other solutions.

Today we will look into doing a CSS-only accordion with the input hack.
There are multiple ways of doing it with CSS. But today, we will look into just the input hack.For the HTML part we are going to use the following:
```html
<div class="accordion">
  <input type="checkbox" id="tab1" />
  <label class="accordion-label" for="tab1">Item 1</label>
  <div class="accordion-content">
    Lorem ipsum dolor sit amet consectetur, adipisicing elit. Ipsum, reiciendis!
  </div>
</div>
```
This will generate one accordion for us. As you can see, we use a checkbox and a label. The label will be our accordion title
CSS for the Accordion:

```CSS
input {
  position: absolute;
  opacity: 0;
  z-index: -1;
}
.accordion {
  margin: 10px;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 4px 4px -2px rgba(0, 0, 0, 0.5);
}
.accordion-label {
  display: flex;
  justify-content: space-between;
  padding: 1em;
  font-weight: bold;
  cursor: pointer;
  background: #333;
  color: #fff;
}
.accordion-content {
  max-height: 0;
  padding: 0 1em;
  background: white;
  transition: all 0.35s;
}
input:checked ~ .accordion-content {
  max-height: 100vh;
  padding: 1em;
}
```
Let's loop through this in more detail step by step:
`
input {
  position: absolute;
  opacity: 0;
  z-index: -1;
}`
We don't need the input visible, so we give it a postion: absolute; and z-index: -1 to hide it. We set the opacity: 0 so it's not visible to the user.
`.accordion {
  margin: 10px;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 4px 4px -2px rgba(0, 0, 0, 0.5);
}`
For the main accordion styling, we do some simple styling.

We set a margin of 10px to give it some space. Then we make the corners rounded with border-radius: 5px;. Then we also set the overflow: hidden to not make the accordion content show before clicking the label. Lastly, we set a nice box-shadow to give it a clean effect.
`.accordion-label {
  display: flex;
  padding: 1em;
  font-weight: bold;
  cursor: pointer;
  background: #333;
  color: #fff;
}`
The label we give a display: flex to make full width. Then we add some padding, make the font bold, add a cursor: pointer, and add some color to make it pop.
`.accordion-content {
  max-height: 0;
  padding: 0 1em;
  background: white;
  transition: all 0.35s;
}`
We set the content div to have a max-height: 0 give it a small padding, and add a transition to make it animated once it opens.
`input:checked ~ .accordion-content {
  max-height: 100vh;
  padding: 1em;
}`
No for the magic, once the input is checked we set the max-height: 100vh (100% of the viewport) and add the overall padding to the content div.

The ~ is a general sibling selector it will select a sibling that follows the first one.

See the following Codepen for a demo:


{% codepen https://codepen.io/rebelchris/pen/eYpJvxN %}

Or see this example a bit more styled and more options:

{% codepen https://codepen.io/rebelchris/pen/WNQQoMx %}
JavaScript: Binary Search
Tags: javascript, algorithms
Published: 2022-02-06 22:02:42

Today I will be writing about how to solve the Binary Search algorithm problem on Leetcode. 

The problem: 

> 
Given an array of integers nums which is sorted in ascending order, and an integer target, write a function to search target in nums. If target exists, then return its index. Otherwise, return -1.
>
You must write an algorithm with O(log n) runtime complexity.

```
var search = function(nums, target) { 
};
```

**Step 1. Create 2 pointers, left and right to point to the beginning and end of the array.**

```
var search = function(nums, target) {
    let left = 0; 
    let right = nums.length - 1 
};
```

Considering the given example array `[-1,0,3,5,9,12]`, left would point to -1 and right would point to 12.

**Step 2. Create while loop.**
We will set left = right because they will eventually meet. We also want to find a middle element.  

```
var search = function(nums, target) {
    //step 1. create 2 pointers, left and right to point to first and last elements. 
    let left = 0; 
    let right = nums.length - 1 
 
    while (left <= right){
        let middle = left + Math.floor((right - left) / 2)
    }
};
```

**Step 3. Write if-statement to calculate middle element.**
If the middle element === target, return middle. 

```
var search = function(nums, target) {
    let left = 0; 
    let right = nums.length - 1 

    while (left <= right){
        let middle = left + Math.floor((right - left) / 2)
     
            if(nums[middle] === target){
                return middle 
            } else if (middle < target) {
                left = middle + 1  
            } else { 
                right = middle - 1
            }
    }
};
```

**Step 4. Return -1 if element does not match target.** 

``````
var search = function(nums, target) {
    let left = 0; 
    let right = nums.length - 1 

    while (left <= right){
        let middle = left + Math.floor((right - left) / 2)
     
            if(nums[middle] === target){
                return middle 
            } else if (middle < target) {
                left = middle + 1  
            } else { 
                right = middle - 1
            }
    }
return -1
};
```
Software Engineer Interview Questions, Answers & Tips
Tags: poll, beginners, career, webdev
Published: 2022-02-06 22:02:11

I have given 30+ interview till now which I think are way more enough to know the tech industry so far and I want to share my experience as well. So I'm thinking to write an interview guide. Should I write about Language-Specific interview or Behavioral & Cultural questions.

Please let me know in below comment section. 

Thanks in Advance
Day 8 of 100DaysOfCode
Tags: 100daysofcode, challenge, webdev, python
Published: 2022-02-06 21:09:07

## Day 8 of 100 Days Of Code

Here can you find what I learned (& published) yesterday.

### What I published / coded (updated) yesterday?
* Started with improving simple-amari.py documentation
* coding the v1.0.1 simple-amari.py version
* Improving my website
* Ended with the blog post.