teleren/devto huggingface dataset:
Plot with python (matplotlib, seaborn)
Tags: python, beginners
Published: 2020-02-10 13:42:28

Do you want to make beautiful charts with <a href="https://python.org">Python</a>? You can with matplotlib or seaborn.

<a href="https://matplotlib.org/">Matplotlib</a> is a plotting library for the Python programming language. It lets you create charts like a <a href="https://pythonbasics.org/matplotlib-bar-chart/">bar chart</a>, <a href="https://pythonbasics.org/matplotlib-line-chart/">line chart</a> and many other basic charts.

<a href="https://seaborn.pydata.org/">Seaborn</a> is a Python data visualization library based on matplotlib.It provides a high-level interface for drawing attractive and informative statistical graphics.

You should know the <a href="https://pythonbasics.org">basics of Python</a> before trying to make plots.

## Example

So is it complicated to make a plot? It depends. Creating a plot can be as simple as 3 lines of code:

```python
import matplotlib.pyplot as plt

plt.bar([1,2,3,4,5], [10,20,30,40,50])
plt.show()
```

where it's x-values and y-values in the bar parameters. This shows a simple bar chart:

![bar chart](https://dev-to-uploads.s3.amazonaws.com/i/32bqx2dj61ejgbepq5ta.png)

Now that is with matplotlib alone. What about seaborn?

With seaborn you can change the colors, add a grid etc. There are also many other <a href="https://seaborn.pydata.org/examples/index.html">plots</a>. You'll see seaborn looks a lot more modern:

```python
import matplotlib.pyplot as plt
import seaborn as sns

sns.set(style="darkgrid")

plt.bar([1,2,3,4,5], [10,20,30,40,50], color="m")
plt.title("seaborn")
plt.show()
```

![seaborn plot](https://dev-to-uploads.s3.amazonaws.com/i/ll5s80m7xlgujxomqcz2.png)

You can learn both modules, and because seaborn is based on matplotlib, there isn't much of a difference in learning curve.

**Related links:**
* <a href="https://pythonbasics.org/seaborn-distplot/">Seaborn with Python tutorial</a>
* <a href="https://gumroad.com/l/mpdp">Matplotlib Data visualization course</a>
* <a href="https://pythonspot.com/matplotlib-line-chart/">Matplotlib tutorial</a>
Most Popular Programming Languages 2010 - 2023 (extrapolated)
Tags: language, programming, popular
Published: 2020-02-10 13:23:34

Most popular programming languages by pull requests on GitHub public repositories. Original GitHub data is for 2012 - 2020. Rest of the data is extrapolated using linear regression.

Animation on YT: https://www.youtube.com/watch?v=LjWn2aJ3o2g
Finding memory bloat in Firefox tabs
Tags: browsers, firefox, performance
Published: 2020-02-10 13:12:59

---
title: Finding memory bloat in Firefox tabs
description: How to find problems with excessive web page resource consumption in Firefox using the about:memory report
tags: browsers, firefox, performance
published: true
---

I use a lot of tabs and as a consequence I can frequently find myself in a situation where my browsers are consuming all the resources my machine has. Chrome has some excellent tooling for solving this in the form of the Task Manager.

Firefox has equally good tools but they are not as neatly packaged and require a bit of practiced eye to understand.

The other day though the [memory diagnostics](https://developer.mozilla.org/en-US/docs/Mozilla/Performance/about:memory) proved invaluable in revealing some unexpected features of pages that were causing memory-bloat and in turn causing lots of memory paging and CPU-use that was crowding out the applications that I actually wanted to be focusing on.

Despite closing down a number of tabs that I thought would be resource hungry Firefox was still consuming large amounts of CPU.

Opening up the memory report and hitting the "Measure" button generates a tree of all the memory allocation Firefox is using. For the most part you can scroll through the panels until you get to the Web Content section, there are multiple panels here depending on what the pages are doing. Really though you're just looking at the first number in the tree and looking for big numbers.

When you've found a bit number you then traverse through the tree visually looking at the window allocations.

In my case there were two pages at the top of tree that were using three times as much memory as anything else. The first was a page that I thought was just a static image, however the memory report told me there was a Youtube embed on the page.

Sure enough scrolling down the page after the image there was a lot of "subscription" promotion including a video embed.

The second page was again something that I thought was a text and pictures page that was a design moodboard. The memory report revealed though that there were several Gfycat embeds all of which were consuming a lot of memory. Again scrolling through the page the top half was all reasonable while the bottom-half had a lot of unnecessary animated screen captures (it's the web, link to the demo for the love of hypertext).

In both cases I had been fooled by long pages where the content at the top and bottom were very different and I had wasted a lot of time speculating from experience about what might be consuming resources when a minute or two with the report and closing two windows resolved my issue immediately.
Folks, what are some conferences in DevOps/SRE space that you look forward to? 
Tags: kubernetes, sre, devops
Published: 2020-02-10 13:12:49

This is what I have till now. Please add any suggestions in comments

![Image](https://pbs.twimg.com/media/EQaLqEiUYAYdFOO?format=jpg&name=900x900)
Read CSV in Python
Tags: python, beginners
Published: 2020-02-10 13:07:15

A csv file is a file in which data is separated by a delimiter (often a comma). Many office programs can store data in a csv format (<a href="https://sites.google.com/a/temple.edu/googleapps1/tip-of-the-day/april28-exportagooglespreadsheetintovariousformats">Google Sheet</a>, <a href="https://answers.microsoft.com/en-us/msoffice/forum/all/how-to-save-excel-file-in-csv-with-comma-delimited/7ee047dc-8f37-42d4-9be9-954fcf5de2da">Microsoft Excel</a> etc).

The file format is just that simple: a bunch of data which is divided using a delimiter (sometimes called the separator). Example CSV file data:

```
1/2/2020,5,5,8,white
1/3/2020,3,5,2,blue
1/4/2020,2,9,1,green
```

CSV only stores data (values), not formatting. So if you save as a csv file, you lose all formatting you had before. Now for Python programs, formatting is totally irrelevant.

![csv file loses formatting](https://dev-to-uploads.s3.amazonaws.com/i/n7ju06igw72k58xsqvfs.png)

## read csv

In Python, you can read a csv file. You can then use its data in your program. There are several ways to read a csv file with Python.

* without any module 
* read with csv module
* read with <a href="https://pythonspot.com/pandas-read-csv/">pandas module</a> module

To read a csv without any module, <a href="https://pythonbasics.org/read-file/">read the file</a> first and then use the <a href="https://pythonbasics.org/split/">split</a> function with delimiter to extract values (*txt.split(",")*).


If you deal with data a lot, I recommend to use the <a href="https://pandas.pydata.org/">Pandas module</a>. Pandas is a fast, powerful, flexible and easy to use open source data analysis and manipulation tool, built on top of the Python programming language. 

You can use pandas to read other data sources too (like <a href="https://pythonspot.com/read-excel-with-pandas/">excel</a>).  A good course for Pandas is <a href="https://gumroad.com/l/KmxqY">data analysis with pandas</a>

## csv module

With the csv module you can read a csv file like this. First import the csv module. Then read the file, define the delimiter and iterate row by row.

```python
import csv

with open('example.csv') as csvfile:
    csvfile = csv.reader(csvfile, delimiter=',')
    for row in csvfile:
        print(row)
```

Every row is a list of values in the csv file.

```bash
$ python3 example.py 
['1/2/2020', '5', '5', '8', 'white']
['1/3/2020', '3', '5', '2', 'blue']
['1/4/2020', '2', '9', '1', 'green']
```

**Related links:**
* <a href="https://pythonspot.com/files-spreadsheets-csv/">More csv module examples</a>
* <a href="https://pythonbasics.org/">Learn Python</a>
Daily Developer Jokes - Monday, Feb 10, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-02-10 13:00:20

---
title: "Daily Developer Jokes - Monday, Feb 10, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Monday%2C%20Feb%2010%2C%202020"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e125988c2636.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ Why did the web developer always go to the wrong hotel room?

___A:___ They were in room 301.
 -->
Como configurar o React Router no Apache2
Tags: react, apache2, ptbr
Published: 2020-02-20 16:26:41

---
title: Como configurar o React Router no Apache2
published: true
date: 2020-02-10 12:59:44 UTC
tags: React,Apache2,pt-br
canonical_url: https://www.paulocollares.com.br/programacao/configurar-o-react-router-no-apache2/
---

![Como configurar o React Router no Apache2](https://www.paulocollares.com.br/wp-content/uploads/2020/02/configurar-o-react-router-no-apache2-1024x576.png)

Como configurar o Apache2 para funcionar adequadamente com as rotas do React Router. Com essas configurações será possível recarregar a pagina ou acessar uma rota diretamente pela URL no navegador.

1. Adicione a linha ‘homepage’ no package.json:

```
"homepage": "/meu-site",
```

2. Adicione o atributo ‘basename’ na tag BrowserRouter:

```
<BrowserRouter basename="/meu-site">
```

3. Habilite o modulo ‘rewrite’ no apache:

```
sudo a2enmod rewrite
```

4. Edite o arquivo ‘/etc/apache2/sites-available/000-default.conf’ e adicione a regra de reescrita dentro da tag VirtualHost:

```
<Directory "/var/www/html/meu-site">
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^ index.html [L]
</Directory>
```

5. Reinicie o serviço do Apache:

```
sudo service apache2 restart
```

6. Crie um diretório com o nome ‘meu-site’ em ‘/var/www/html’ e copie o código compilado para ele.

[]’s
Creating data with Knex in a REST API
Tags: knes, api, backend
Published: 2020-02-10 12:54:18

---
title: Creating data with Knex in a REST API
published: true
description: Using Knex to create new records a REST API
tags: knes, api, backend
cover_image: https://ferrariwebdevelopment.s3.us-east-2.amazonaws.com/assets/20191213-knex-post.jpeg
---

## Using Knex to insert data into a database table

In previous articles we have seen how to get both a collection of records and one single record as a response to a `GET` `API` request.
We used *Knex*, a popular query builder, to connect to a SQLite database and retrieve the records sent back by route handlers in our `API`.

Now we want to look at creating new records from an `API` request.
Creating new data involves using the `POST` `HTTP` verb, so we need a `router.post()` handler for the request:

```js
router.post('/', (req, res) => {

  // handle the route here

});
```

To create a new record we need its data, which is passed to our `API` in the request body. We need to first extract data from the body:

```js
const postData = req.body;
```

Once we have the `postData`, we use the `insert()` method of Knex to pass data to the database.
`insert()` will do the same thing as the `INSERT` statement in plain `SQL`, and add a new record.

This method will return an array that contains the `IDs` of the new records created.
Since we are creating one new record, our array will contain one element, but if we created *multiple* records instead, by passing an array of objects to `insert()`, we would get back all the `IDs` of the records created.

We can save this returned array in a variable and display it back to the client.
Here's the code for the post route handler:

```js
router.post('/', async (req, res) => {
  const postData = req.body;

  try {
    const ids = await db('posts').insert(postData);
    res.status(201).json(ids);
  } catch (err) {
    res.status(500).json({message: "Error creating new post", error: err})
  }

});
```

Note that we are using `async/await` syntax because we are using promises.

If we now make a test post, the new record gets inserted correctly into the database.
We can test that the feature works as expected by making a `POST` request with Insomnia and passing a new record object in the body:

![POST record](https://dev-to-uploads.s3.amazonaws.com/i/q3mod71foi3911p5wzda.png)

As you can see in the screenshot, we get a `201` status code, meaning new record created, and we get back an array with the `ID` or the new record.

---

*I write daily about web development. If you like this article, feel free to share it with your friends and colleagues.*

*You can receive articles like this in your inbox by [subscribing to my newsletter](https://cesare.substack.com).*
Clean Architecture for ASP.NET Core
Tags: architecture, aspnetcore, rxweb
Published: 2020-02-10 12:40:06

When we are building an RESTful service based enterprise application, at that time we have to cover many things in our base project such as providing high-end security, maintaining performance, capacity, scalability, extensibility, data consistency, validation and that too by following best design practices, proper coding standards and naming conventions. This sounds very clumsy and difficult to maintain🤔.

But here I will show you a solution I have found on [visual studio marketplace](https://marketplace.visualstudio.com/items?itemName=AjayOjha.rxwebcleanarchitecture) that fulfills all my software requirements along with OWASP top security standards, with domain driven practices, bounded context pattern, unit of work pattern, CQRS, inversion of control and lot more along with scaffolding many necessary things. Isn’t this interesting😃???

# Clean Architecture of AspNetCore API
RxWeb Project template follows the practices of Clean Architecture with good design patterns which can be necessary for any data driven enterprise application.
Let’s quickly see the high level code snippet of by using this architecture libraries. 

![Clean Architecture]
(https://ajayojha.gallerycdn.vsassets.io/extensions/ajayojha/rxwebcleanarchitecture/1.1/1579884216857/Untitled__2.png)

The above code represents implementation of the following features:
*	Data Audit Logging
*	Single Database Multitenant
*	Unique Validation
*	Conditional Validation
*	Centralized Value encryption
*	Value Sanitization
*	Timezone conversion

# How To 
## 1) Download and Install
Download and install the template of Clean Architecture of ASP.NET Core from [visual studio marketplace](https://marketplace.visualstudio.com/items?itemName=AjayOjha.rxwebcleanarchitecture)

## 2) Create a New Project
Create a new project by selecting the installed template and check the option of "place solution and folder in same directory" as below:

![Create Project](https://ajayojha.gallerycdn.vsassets.io/extensions/ajayojha/rxwebcleanarchitecture/1.1/1579884216857/Project_template__1.png
)

## 3) Examine The Project Structure
The project structure is divided into several layers of Models, Domain services,Bounded context, Application core and API which adds the practices of seperation of concerns for simplification and maintanable code.

The project solution contains six projects. They are :

![Create Project](https://new.rxweb.io/assets/rxwebcore/Images/dependency-chart1.png)

## 4) Run The Project 
Run the project and test the authentication api. Here is the output of the project 
![Login Api]
(https://new.rxweb.io/assets/rxwebcore/Images/login-api.gif)

Your project is ready for creating and testing web APIs.

Feel free to share your suggestions and comments. You can also share your inputs on [gitter](https://gitter.im/rxweb-project/rxweb) channel.
Accessible Todo App
Tags: a11y, todoapp, react, redux
Published: 2020-02-10 12:39:54

I create an Todo App using React-Redux. It is a common todo app with accessible features. You can use your keyboard or screen reader to reach your todo items and edit them. Your data has stored locally in your browser so that you can also come back later. 

You can contribute to the project or use it your own will freely. You can look at the code or view the demo in the links below. 

- [Project's Github Repository](https://github.com/afozbek/react-todo-app)
- [Live App](https://todo.furkanozbek.com)

Thank you ❤️
*Furkan*
Migrate From Magento 1 to Magento in Record Time
Tags: opensource, magento, webdev, magentoservice
Published: 2020-02-10 12:21:25

Stay Updated - Not Outdated with Magento 1 to Magento 2 Migration


##Why Magento 1 to Magento 2 migration is the need of the hour?


1. First of all, because M1 is coming to an end (kind of obvious).

2. All the support for the older version will cease to exist after June 2020.

3. No new extensions, plugins add-ons for older version is being launched anymore, keeping in mind that most of the businesses are switching to M2.
 
4. Without access to the new security patches, the older version will be weak, so will be your business if you are not planning to move to Magento 2.

5. In the absence of updates, the sites will become laggy and performance will be affected drastically.

6. Lastly, you will never want your business to suffer, revenue to depreciate and old customers to leave because of poor site performance.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/0y3i7vd2rpfbmyonl5gy.jpg)

[Migrate From Magento 1 to Magento 2 Now](https://cedcommerce.com/magento-services/magento-1-to-magento-2-migration)


##Perks of Magento Migration

Get a highly secure website with better performance than ever. Give your customers smooth shopping experience with 2 step check-out process for faster checkout. Rigged dashboard with the enhanced operating speed.

1. Better website performance

2. 50% Faster page load speed

3. Up to 40% faster checkouts

4. Innate dashboard

5. Reduced checkout time

6. SEO and Mobile friendly

7. No data loss

8. Security patches included

9. Entirely secure

Read this [Magento 2 Migration case study](https://cedcommerce.com/blog/case-study-magento-migration-cotton-cashmere-in-minimum-price/) to learn how the cotton-cashmere store in Netherland, accomplished a successful migration to Magento 2.3 from Magento 1 without affecting the sales and conversions in record time.
About remote work, workers, and collaboration
Published: 2020-02-10 12:03:27

You can test how fast the visual is, [here](https://beecanvas.com).


> Like any other startup, quickly iterating ideas is crucial for us to bring better tools to the marketplace. We’ve carefully honed a remote working platform that works better than any other.

> BeeCanvas is a platform that seamlessly integrates a virtual whiteboard and meeting room through the cloud. By enabling remote teams to work better together, wherever they are, we’re able to make a huge leap towards freeing up hours and years of productive time.


![Idea](https://dev-to-uploads.s3.amazonaws.com/i/jgbawgcn37djycgmna4w.gif)
Pasos sobre cómo obtener un informe de crédito gratuito
Tags: creditos
Published: 2020-02-10 07:47:43

Los informes de crédito <a href="https://creditosenlinea.co/">creditos en linea sin buro urgentes</a> son documentos que contienen información sobre su historial de crédito. Mostrará si se ha retrasado en hacer los pagos y qué tan tarde se hicieron. También muestra si ha omitido algún pago y contiene detalles de sus direcciones anteriores y actuales, su número de seguro social, sus cuentas de tarjeta de crédito y si tiene saldos.

En el mundo actual, los puntajes de crédito son muy importantes ya que los propietarios, bancos, agencias de seguros, proveedores de servicios públicos, entre otros, a menudo se refieren a ellos cuando evalúan varias solicitudes. A la luz de eso, es vital asegurarse de que los informes de crédito estén actualizados y sean precisos.

En el pasado, los estadounidenses tuvieron que pagar una suma de $ 9.50 cada uno para revisar sus informes de crédito. Hoy, sin embargo, hay una nueva decisión que autoriza a todos los estadounidenses a recibir informes de crédito todos los años sin costo alguno.

La ley establece que Equifax, Trans-Union y Experians, que son las principales agencias de informes, previa solicitud, deben proporcionar una copia de los logros crediticios de un consumidor de forma gratuita una vez al año.Pasos a seguir para adquirir un informe gratuito y cómo recibir uno pagando.

Solicite su informe. Hay tres formas de solicitar un informe gratuito. Lo más fácil es en línea. Para ver su informe al instante, visite. Este es un sitio web copatrocinado por todas las compañías de informes de crédito. Asegúrese de no cometer un error con la URL, ya que algunos oportunistas han creado URL similares y tratarán de venderle el informe. Hay otros casos en los que tiene derecho a obtener otro informe de crédito gratuito como;

Si tiene alguna solicitud denegada debido a la información en su informe de crédito, se le otorgan hasta 60 días desde el momento en que se le informó que su solicitud fue denegada para comunicarse con la agencia que emitió ese informe y solicitar una copia.

Si no está empleado y planea comenzar a buscar trabajo dentro de dos meses.Si recibe asistencia social del gobierno.En el caso de que sea víctima de fraude de identidad y tenga razones para creer que se debe a imprecisiones en su informe.

Puede obtener un informe gratuito de todas las agencias de informes de crédito de una fuente centralizada, que incluye un número de teléfono gratuito, un sitio web o una dirección postal. Ir detrás del sistema centralizado retrasará el proceso y es posible que no obtenga la información requerida. Sin embargo, el procedimiento que se sigue para obtener su informe en cada agencia varía de una organización a otra.