teleren/devto huggingface dataset:
Day 2: learning linear regression
Tags: machinelearning, python, 100daysofcode
Published: 2021-01-16 00:19:55

Well I'm back again (that's a good start to my 100 days of learning machine learning).
![Confetti raining down on a corgi, because I'm a good puppy](https://thumbs.gfycat.com/FlatComposedHornbill.webp)

# Day 2
I moved onto the next chapter of the scikit-learn data camp course. Today was all about linear regression. I can really see what people mean that it only takes a few lines of code to do machine learning. Both KNN (see yesterday's post) and linear regression use like 10 lines top. So that's nice.

Anyway, today I managed to get a linear regression model working which I'm pretty happy about. I also now know what ridge regression and lasso regression is. They were always just mystery words that people would throw out sometimes. Like if you order a a plain black coffee and then they say do you want sugar or milk with that. I'd just look at them in confusion and be like "I just wanted coffee??". But now I understand that lasso and ridge regression are just ways to supplement linear regression if you need them. Just like milk and sugar with coffee (I think, I don't actually drink coffee) 

![Alex from modern family spitting out a drink, basically my reaction to drinking coffee](https://thumbs.gfycat.com/WarmheartedForthrightGuernseycow.webp)

I'm unsure what my next step should be. I could carry on with the course and learn a bit more about hyper parameters or I could jump over to kaggle and try building my first model. I want to do both so it's just a question of which one I do first. What do you think I should do?

Be back on Monday for day 3, have a good weekend!
![Jake the dog sleeping in a drawer, I accidentally carried on the puppy theme](https://thumbs.gfycat.com/SomeJoyousDove.webp)
Django Rest Framework
Tags: django
Published: 2021-01-16 00:10:30

Hi everyone,
I have two models Clients and Users and I have serializers for the two models. If I add depth=1 in my UserSerializer then I can not add a record, but if I remove it then I am able to add a record, what am I doing wrong?

 
    # My Client Serializer
      class ClientSerializer(serializers.ModelSerializer):
        class Meta:
          model = Clients
          fields = '__all__'
          read_only_fields = ('id','client_public_key')


    # My User Serializer
      class UserSerializer(serializers.ModelSerializer):
        class Meta:
          model = Users
          depth = 1
          fields = '__all__'
          read_only_fields = ('id','user_public_key')
How football made me a better team player at work
Tags: software, teammates, sports, football
Published: 2021-01-17 16:11:16

---
title: How football made me a better team player at work
published: true
date: 2021-01-16 00:00:00 UTC
tags: software,teammates,sports,football
canonical_url: https://www.manuelobregozo.com/thoughts/team-sports-made-me-a-better-team-player
---

I became a football player (non-professional, of course) before I became a software developer, which I think helped me a lot when it came to working in teams.

It could be related to the fact I had a good coach and team-mates as soon as I started playing this sport, who thought me that there were never individuals on a team, that we were all part of the same engine that was helping the wheel to keep spinning. And it is a team effort to change and improve these situations in which there are players who are not performing well, and to detect it as soon as possible.

We have never discussed errors or improvements directly on the field (unless it was something urgent), we have always addressed all situations at the end of the game or even a day later, in private in case it was necessary, to avoid public shaming while pointing fingers.

During difficult times, is was not possible to point any fingers or blame others, there was always room to share ideas with the coaches and the captains, concerns and encourage those who were having problems. In other words, **we were there for each other**. 

Does the topic sound familiar to you? I think at some point they may also be applicable to the software world, and if we were to map the structure of teams, we could match captains and coaches with leaders and managers. But I don't see people looking for resources to make teams perform better as a team, although it is very common to have the space to discuss this in agile methodologies rituals such as retrospective meetings where, in my experience, it generally focused mainly on deliverables. But lately I've noticed that it's becoming a common topic in tech talks and meet-ups.

Moreover, It also helped me understand the importance of working hard but always with a purpose, because the lack of guidance or plan can make us to get exhausted in vain, meritocracy can be a delicate subject in here as well, and it does not always come with good results.

In general, I choose group recognition over individual ones, I really enjoy the success of my partners, which in football terms can be translated into that I prefer to give an assist to a teammate rather than scoring a screamer at the end of a game.

That is why I will always be self-critical of myself, but with the goal in mind of doing better for my team.
How to show useful stats about your open source activities on your Github profile
Tags: programming, life
Published: 2021-04-07 08:45:39

---
title: How to show useful stats about your open source activities on your Github profile
published: true
date: 2021-01-16 00:00:00 UTC
tags: Programming,Life
canonical_url: https://domenicoluciani.com/2021/01/16/github-profile-stats.html
---

I’ve finally found the time to customise my Github’s profile. It shows some interesting stats about my activities, without any external browser extension, how?

Read the [article](https://domenicoluciani.com/2021/01/16/github-profile-stats.html)!
Python Logging Handlers
Tags: python, logging, linux, programming
Published: 2021-01-13 20:55:15

No <a href="https://dev.to/wendrewdevelop/gerando-logs-com-python-25k4" target="_blank">artigo anterior<a/> vimos como podemos gerar mensagens de erro, aviso e informativas do sistema. Agora, iremos aprofundar um pouco mais nesse assunto e iremos entender o que são os *Handlers*.

Os principais *Handlers* são:

1. **StreamHandler:** Retorna a mensagem/log no terminal;
2. **FileHandler:** Envia o log para um arquivo definido pelo desenvolvedor;
3. **NullHandler:** não faz nenhuma formatação ou saída. É essencialmente um manipulador *no-op* (sem operação).

Na <a href="https://docs.python.org/3/library/logging.handlers.html" target="_blank">documentação oficial<a/> podemos contar um numero maior de *Handlers*, mas nesse artigo iremos usar apenas o **StreamHandler** e o **FileHandler**.


Vamos começar criando nosso arquivo *.py*, no meu caso irá se chamar **app.py**, mas pode atribuir o nome que desejar. Após isso, iremos começar a escrever o nosso codigo...

```python
# Comece importando o módulo logging

import logging
```

Agora, vamos definir nossa instancia do objeto getLogger() e o nivel de nosso log (nesse caso iremos definir o nivel de DEBUG).

```python
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
```

Vamos então definir as propriedades do nosso handler:
```python
# Vamos começar testando o FileHandler
# O nome do nosso arquivo de log será LOG.log
fh = logging.FileHandler('LOG.log')

# Definindo o level do nosso handler
# Nesse caso, também será DEBUG
fh.setLevel(logging.DEBUG)
```

Após definirmos as propriedades, de fato iremos criar o nosso handler:

```python
logger.addHandler(fh)
```
Por fim, vamos criar uma simples saida de texto para o nosso logger:

```python
logger.debug('Olá, sou a mensagem de log dentro do seu arquivo.')
```

Execute usando o script: 
```sh python app.py ```

Depois de executar o codigo, olhe na raiz da pasta que agora terá um arquivo com o nome *LOG.lg* contendo o seguinte conteúdo:
![log](https://dev-to-uploads.s3.amazonaws.com/i/4w761gs07h95w0vapbh9.png)
 
Agora, iremos testar o modo **StreamHandler**. Para isso iremos mudar apenas uma linha do codigo:

```python
# de
fh = logging.FileHandler('LOG.log')

# para
fh = logging.StreamHandler()
```

O restante do código pode manter da forma como estava. Se preferir, pode apagar o arquivo *LOG.log* para perceber que utilizando o *StreamHandler* o arquivo não será criado.

Rode no terminal:
```sh python app.py ```

O seu retorno será no próprio terminal:
![log2](https://dev-to-uploads.s3.amazonaws.com/i/6gl3it6817m0yop59fe2.png)

O modo **StreamHandler** é usado, especialmente, para que os desenvolvedores tenham um retorno visual mais rapido, é comum o **StreamHandler** ser usado juntamente ao **FileHandler**.

## Concluindo ##

Você tem varios manipuladores de logs disponives, hoje utilizamos os mais comuns, pois a usabilidade é, basicamente, a mesma, só muda a forma como você irá aplicar em seu ambiente.
Coding With Your Voice
Tags: productivity
Published: 2021-01-15 23:00:53

Ever thought about giving up the keyboard entirely and controlling the computer with your voice?  I have.  It makes me feel like a total wizard, Harry Potter style.

I wrote an introductory tutorial on how to use my preferred voice control software, Talon, to navigate to gmail.com, write an email, and send it with pure voice control commands.  Here it is! 

https://ataraxy.consulting/write-a-gmail-with-talon/
Day 289 : 2 Hype
Tags: hiphop, code, coding, lifelongdev
Published: 2021-01-15 22:46:34

_liner notes_:
- Professional : Pretty good day today. Had a team meeting to end out the current sprint and plan the next one. Worked on finishing up the demo application for my blog post and did an outline and more research for the post. Not a bad way to end the week.

- Personal : Last night, pretty much worked on this week's radio show. Went through a bunch of tracks! Did some more work on my upcoming blog post. Then I fell asleep. Too hype! haha

![A river running through 2 very large green mountains in Fjaðrárgljúfur, Iceland](https://dev-to-uploads.s3.amazonaws.com/i/5djbvevn0jbspav4u6j3.jpg)

Going to finish up the pre-show work, maybe code and hopefully watch the new episode of Wandavision on Disney+. I've been paying for the service and not even using it. haha. Think that's it.

Have a great night and weekend!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube rp8QmidCcsk %}
JavaScript-HTML Link
Tags: html, javascript, codenewbie, beginners
Published: 2021-01-15 22:29:55

{% youtube xCTY2WYnFG0 %}

--- 
### Internal JavaScript
HTML Document allows JavaScript programs to be inserted in a `<script>` tag. The `<script>` tag is placed just before the closing `<body/>` tag. This allows the **HTML parser** to load all HTML content first before loading the JavaScript program. 

![Internal JavaScript](https://dev-to-uploads.s3.amazonaws.com/i/euc90wozkkgg8b7hltqr.gif)

The `<script>` tag can also be placed just before the closing `<head/>`, but it is a bad practice because the `<script>` tag slows down the display of HTML contents.

**index.html**
```html
<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Internal JavaScript</title>
</head>

<body>
	<p>This is the paragraph</p>

	<script>
		console.log('Hello World!')
	</script>
</body>

</html>
```
[Edit on Stackblitz](https://stackblitz.com/edit/js-mnh5kh?devtoolsheight=33&file=index.html)

---
[![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1613668162316/G1zfmhxQd.png)](https://www.cssigniter.com/members/aff/go/belloosagienoah)

---
### External JavaScript
The `src` attribute in the `<script>` tag links an HTML document to an external JavaScript file.
 
JavaScript programs can also be placed in an external file.  When the same JavaScript code is needed on different web pages, external scripts are the best option. 

**index.html**
```html
<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Internal JavaScript</title>
</head>

<body>
	<p>This is the paragraph</p>

	<script src='index.js'></script>
</body>

</html>
```

JavaScript programs can be written in an external or separate file.

**script.js**

```js
console.log("Hello World!");
```

Alternatively, the `<script>` tag can be placed just before the closing `</head>` tag but including the `defer` attribute in it.

**script.js**
```html
<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>External JavaScript</title>
	<script src='index.js' defer></script>
</head>

<body>
	<p>This is the paragraph</p>
</body>

</html>
```

> The `defer` attribute makes sure the **HTML Parser** loads the HTML contents first before loading the script tag. It is the same as having the `<script>` tag before the closing `</body>` tag.

[Edit on Stackblitz](https://stackblitz.com/edit/web-platform-vzwkjb?devtoolsheight=33&file=script.js)

#### Happy Coding!!!

---

[![Buy me a Coffee](https://res.cloudinary.com/bizstak/image/upload/v1610317510/ko-fi-trans_fr3su4.png)](https://www.buymeacoffee.com/techstackmedia)

---
#### Techstack Media | Hostgator
Techstack article is sponsored by **[Hostgator](https://partners.hostgator.com/MaZ1N)**.

- A ton of website hosting options 
- 99.9% uptime guarantee 
- Free SSL certificate 
- Easy WordPress installs 
- A free domain for a year
Some ansible tricks
Tags: ansible, devops, automation, linux
Published: 2021-01-15 17:35:15


![Ansible](https://dev-to-uploads.s3.amazonaws.com/i/d1m8edn571qzdthwchxj.png)

In this blog post, I will share some (basic) tricks about Ansible :smiley:

It could possibly prevent you to get bitten :mask:

## Quote when using vars
When not using variables, you can quote (or not) indifferently:
```yaml
- name: Copy
  copy:
    src: foobar
    dest: /tmp/foobar
```

Or (with quotes):
```yaml
- name: Copy
  copy:
    src: "foobar"
    dest: "/tmp/foobar"
```

But as soon as you use variables, you should use quotes!
```yaml
- name: Copy
  copy:
    src: "{{ filename }}"
    dest: "/tmp/{{ filename }}"
```

Not all ansible versions have the same behaviour for this! Latest versions of Ansible are more flexible, but are not able to completely handle it (depends where the variable is positioned).

For more info, see [YAML gotcha](https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#when-to-quote-variables-a-yaml-gotcha)

## Extra quote when passing extra variable in command line
When using the `--extra-vars` (or `-e`) to pass variables in the command line, take care of adding an extra quote to protect spaces:
```bash
                            # here v          and here v
$ ansible-playbook playbook.yml -e 'protectme="foo bar"'
                            #     to protect this ^
```

## sh gotcha
This is broken:
```yaml
---
- hosts: servers
  tasks:
  - name: Broken
    shell: '[[ -z "" ]] && true'
```
Why? Because it is executed by `/bin/sh`... not `bash` !

You can transform it to a `sh` compatible version like this:
```yaml
---
- hosts: servers
  tasks:
  - name: Working
    shell: 'test -z "" && true'
```

Or specify the executable in the `args`:
```yaml
---
- hosts: servers
  tasks:
  - name: Broken
    shell: '[[ -z "" ]] && true'
    args:
      executable: /bin/bash
```

## Precedence of vars
Some are obvious, but not all :grin:

Here is my reminder:
1. CLI extra var `-e variable="foo"` will override...
2. role vars (`roles/common/vars/main.yml`) that overrides...
3. playbook vars (`playbook.yml`) that are taken in priority over...
4. role default vars (`roles/common/default/main.yml`)

For more infos, check the official doc about [complete list of precedence](https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#ansible-variable-precedence)

## Edit variable after initialization

You can do this with the module [set fact](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/set_fact_module.html#ansible-collections-ansible-builtin-set-fact-module)!
```yaml
- name:
  set_fact:
    var1: "new value"
```

## Conclusion
That's all for the tricks.

Happy provisioning! :smiley:

![Happy provisioning](https://dev-to-uploads.s3.amazonaws.com/i/zat57oucm3twctukfnlr.jpeg)
Very Interesting ReactJs Projects
Tags: javascript, react, firebase, mernstack
Published: 2021-01-15 21:49:57

so, we had last this Vanilla Javascript Music Player: https://github.com/kotaid/vanilla-js-audio-player

and this time we want to get some Reactjs Stuff, we will be doing Some Interesting Projects Tha's gonna cover some parts of react, fierbase, or maybe instead NodeJs And MongoDb, styled components, framer motion, and other good stuff...

projects will be:

     1-A FullStack Recipe App.
     2-A Telegram Clone App.
     3-A Images Stock Sites Favorites Manager.

details of each project will be at it time, would like to know your thoughts, ideas. Stay tunned...
Learn Responsive Design - Codecademy PRO version
Tags: tutorial, webdev, css, beginners
Published: 2021-01-15 21:48:01

**TL;DR:** I completed a **Learn Responsive Design** course in **Getting More Advanced with Design** module on Codecademy. This is a part of the 🔗 [**Codecademy Web Development Career Path**](https://youtube.com/playlist?list=PL7K3igiHYVk1_ulFuHesiv7BP_ALn82o8) series.



You can find the video on YouTube below ⬇️
{% youtube bFDmwjUX9w4 %}

*If you like the video, don't forget to smash that like icon* 👍 *and subscribe* ❤️*. It will help a lot! Thanks!* 🙏



⏱️ Chapters:
🔗 [0:00](https://www.youtube.com/watch?v=bFDmwjUX9w4) Intro
🔗 [0:36](https://www.youtube.com/watch?v=bFDmwjUX9w4&t=36s) Relative Measurements
🔗 [3:11](https://www.youtube.com/watch?v=bFDmwjUX9w4&t=191s) Em
🔗 [8:28](https://www.youtube.com/watch?v=bFDmwjUX9w4&t=508s) Rem
🔗 [12:15](https://www.youtube.com/watch?v=bFDmwjUX9w4&t=735s) Percentages: Height & Width
🔗 [17:53](https://www.youtube.com/watch?v=bFDmwjUX9w4&t=1073s) Percentages: Padding & Margin
🔗 [23:18](https://www.youtube.com/watch?v=bFDmwjUX9w4&t=1398s) Width: Minimum & Maximum
🔗 [26:25](https://www.youtube.com/watch?v=bFDmwjUX9w4&t=1585s) Height: Minimum & Maximum
🔗 [28:38](https://www.youtube.com/watch?v=bFDmwjUX9w4&t=1718s) Scaling Images and Videos
🔗 [34:25](https://www.youtube.com/watch?v=bFDmwjUX9w4&t=2065s) Scaling Background Images
🔗 [36:11](https://www.youtube.com/watch?v=bFDmwjUX9w4&t=2171s) Review: Relative Measurements
🔗 [38:42](https://www.youtube.com/watch?v=bFDmwjUX9w4&t=2322s) Responsive Web Design
🔗 [42:23](https://www.youtube.com/watch?v=bFDmwjUX9w4&t=2543s) Media Queries
🔗 [47:33](https://www.youtube.com/watch?v=bFDmwjUX9w4&t=2853s) Range
🔗 [51:08](https://www.youtube.com/watch?v=bFDmwjUX9w4&t=3068s) Dots Per Inch (DPI)
🔗 [54:53](https://www.youtube.com/watch?v=bFDmwjUX9w4&t=3293s) And Operator
🔗 [58:23](https://www.youtube.com/watch?v=bFDmwjUX9w4&t=3503s) Comma Separated List
🔗 [1:01:06](https://www.youtube.com/watch?v=bFDmwjUX9w4&t=3666s) Breakpoints
🔗 [1:05:43](https://www.youtube.com/watch?v=bFDmwjUX9w4&t=3943s) Review: Media Queries
🔗 [1:07:45](https://www.youtube.com/watch?v=bFDmwjUX9w4&t=4065s) Tsunami Coffee Project
🔗 [1:21:49](https://www.youtube.com/watch?v=bFDmwjUX9w4&t=4909s) Quiz Sizing Elements
🔗 [1:28:36](https://www.youtube.com/watch?v=bFDmwjUX9w4&t=5316s) Quiz Media Queries



📚 Materials/References:
🔗 [Learn Responsive Design cheatsheet](https://www.codecademy.com/learn/paths/web-development/tracks/getting-more-advanced-with-design/modules/learn-responsive-design-module/cheatsheet)

Thanks for reading! I hope you find it useful.
Intro to Data Structures Part 3, Even More Array Techniques
Tags: javascript
Published: 2021-01-15 21:31:37

**Intro**

Over my last two blogs we went over how to create and manipulate arrays through techniques such as `push()`, `pop()`, `slice()`, and `splice()`. On this final blog on arrays, we will look at how to combine arrays and how to iterate through arrays.

**How to Combine Arrays**
One cool feature of the spread operator, that we didn't go over in the last blog, is how to combine arrays. The syntax to combine arrays is very simple:

```
let myArray = ['dog','cat','horse'];
let myNewArray = ['bird',...myArray,'pig','cow']

console.log(myNewArray) [ 'bird', 'dog', 'cat', 'horse', 'pig', 'cow' ]
```
Using the spread operator we easily combined the two arrays.

**Find the Index of an Element**

Once we start writing long arrays it may be difficult to remember the index location of a certain element. Luckily Javascript has a built in method called `indexOf()` that can find the element easily. Here is the syntax for `indexOf()` using our previous example:

```
let myArray = ['dog','cat','horse'];

let myNewArray = ['bird',...myArray,'pig','cow']

myNewArray.indexOf('dog') // 1
myNewArray.indexOf('pig') // 4
myNewArray.indexOf('snake') // -1 Will return -1 if element can't be found
```

As you can see `indexOf()` can be incredible useful for both finding if an element exists and the index it is located at. 

**Iterate Through an Array**

Very often when working with arrays we may need to iterate through each item. Using a `for` loop we can do this easily:

```
let myArr = ['dog', 'cat', 'whale','snake'];

for(let i = 0; i < myArr.length; i++){
  console.log(`These are the animals in my zoo ${myArr[i]}`)
}

// 'These are the animals in my zoo dog'
// 'These are the animals in my zoo cat'
// 'These are the animals in my zoo whale'
// 'These are the animals in my zoo snake'
```
As you can see by using a `for` loop we were able to iterate through every element in our array and add them to our custom sentence.

**Conclusion**
After finishing this third blog you are fully prepared to create and manipulate arrays, one of the more commonly used data structure. In our next blog we will look at another common data structure, objects.
Cleaner Flutter Vol. 4: Hiring Repositories
Tags: flutter, dart, clean, architecture
Published: 2021-01-15 21:27:23

---
title: Cleaner Flutter Vol. 4: Hiring Repositories
published: true
description: How we define the use of repositories on our project
tags: flutter, dart, clean, architecture
cover_image: https://images.unsplash.com/photo-1429216967620-ece20ff3a5f9
---

> ⚠️ This article was deprecated. ⚠️
>
> Check out the updated full article on my personal [blog](https://marcossevilla.dev/cleaner-flutter-vol-4).

You can find even more and keep in contact with me on my socials:

- [GitHub](https://github.com/marcossevilla)
- [LinkedIn](https://www.linkedin.com/in/marcossevilla)
- [Twitch](https://www.twitch.tv/noscopedevs)
- [Twitter](https://twitter.com/MarcosJSevilla)
- [YouTube](https://www.youtube.com/noscopedevs)
New Javascript 2021 features explained with examples and how you can use them today!
Tags: webdev, javascript, tutorial, beginners
Published: 2021-01-15 21:24:25

Every year Javascript comes with a new set of features!

This year we also have some cool features we can use!

Learn how to use them with real world examples and how to update your project to use them too!

{% youtube hxmFYToenxE %}

You can find the link to the code in the video description!


**👋Say Hello!** [Instagram](https://www.instagram.com/lampewebdev/) | [Twitter](https://twitter.com/lampewebdev) | [LinkedIn](https://www.linkedin.com/in/michael-lazarski-25725a87) | [Medium](https://medium.com/@lampewebdevelopment) | [Twitch](https://dev.to/twitch_live_streams/lampewebdev) | [YouTube](https://www.youtube.com/channel/UCYCe4Cnracnq91J0CgoyKAQ)
💻 Why Developers Should Look into Clojure
Tags: programming, clojure
Published: 2021-01-15 20:31:24

⚙️ A high-level overview of Clojure, a functional programming language based on LISP and powered by the JVM.
[Read more](https://auth0.com/blog/why-developers-should-look-into-clojure/?utm_source=facebookgroup&utm_medium=sc&utm_campaign=clojure)