teleren/devto huggingface dataset:
Confused by Python self scope
Tags: python, discuss
Published: 2021-09-03 13:28:17

*(picture from [Dex Ezekiel](https://unsplash.com/@dexezekiel))*

Today, I was playing with risky naming conflicting (that I generally avoid) and I get confused by a class method/attribute resolution in *python*.

Specifically I was playing with classes and code samples like the following:
```python 
# arg arg arg
class arg():
    def arg(self, arg=None):
        self.arg = arg
        print("arg")

arg = arg()
arg.arg()
```

And I was confused by the scope of `self`:
```python
class parent():
    def __init__(self):
        self.f() # Boom
    def f(self):
        return
    
class child(parent):
    def __init__(self):
        self.f = "not a method"
        super().__init__()
        
child() # Boom (see above)
```

I intended that `self.f()` in parent class would call the *parent* function but it first resolved to child *attribute* and produced and error:
```
Traceback (most recent call last):
  File "module.py", line 17, in <module>
    child()
  File "module.py", line 14, in __init__
    super().__init__("tib")
  File "module.py", line 6, in __init__
    self.f()
TypeError: 'str' object is not callable
```

It's not that strange when you think about it (to get the most "specialized" or "downward" method/attribute) but how do you restrict to the *parent* class scope with just no method resolution?

Do you know dear fellow python developers?

I don't need it, but I'm curious :smiley:

If yes, please comment! :smiley:
Controle seu Android com Expressões Faciais
Tags: android, acessibilidade
Published: 2021-09-03 13:25:52

O Android 12 está chegando e juntamente com ele um recurso bastante interessante, para permitir que um usuário controle o aparelho com expressões faciais.
Há algumas semanas atrás juntamente com o beta do Android 12.0 que foi liberado para alguns modelos Pixel a Google liberou a versão beta 12.0.0.0 do Android Acessibility Suite app. Como o nome já diz, essa app reúne recursos de acessibilidade que permitem que o usuário interaja com o device sem o uso do touchscreen. Esta versão inclui o novo item Camera Switch.
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6ko4sqlsmnu8vr5sou2c.png)

 
Segundo o XDA Developers por enquanto ainda vemos somente alguns gestos, mas outros devem ser incluídos até que a versão final seja liberada ao público:

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h0yft832f97lgacc2ffy.png)

Ao ativado ele mantém um icone persistente e o app roda em segundo plano. Portanto é um grande consumidor de bateria. Salvo esse contratempo, o recurso é excelente e, além de ajudar pessoas com acessibilidade, pode ter várias aplicações fora dela.

Fonte: [XDA Developer](https://www.xda-developers.com/android-camera-switches-control-phone-with-face/)
The Unexpected Powers of Sisterhood (in Tech)
Tags: womenintech, career, codeiscolorful, codenewbie
Published: 2021-09-03 13:22:03

Apologies in advance, this might get a bit cheesy. 

But can we just take a moment to appreciate the massive amount of support women give each other in this industry on a daily basis  - without even blinking an eye? 

**Tl; dr:** *No hard feelings if emotional outbursts by strangers on the internet are not your thing - just stop reading here. Before you do, though, take a moment to give your favorite colleague a call. The one who likely saved your butt every other week, who supports you with mysterious bugs, has your back in front of the client and always speaks out if something doesn’t seem right. You know who to call.* 

I recently talked to someone about work and was utterly surprised by the fact that rather than focussing on the actual issue at hand, they raised another issue I had never thought about. How there was a *‘surprising amount of support among women and there seemed to be no cat fights at all’*. 

I was pretty startled by this. From my point of view, that statement by itself screamed **internalised misogyny**. Why would there be cat fights? Why should women be particularly competitive or assertive in an environment where they are already underrepresented? Why do these sexist stereotypes still exist? But after I got over my initial anger, I realised the reality couldn’t be further from it. 

I have never worked in an environment before, where there were as little women as in tech. Yet, **I have never felt more supported by my female colleagues**. Now looking back at the past two years, literally 99% of the people who really went out of their way to support me, didn’t identify as male. And not to blame or point fingers. Just a fact. 

They created an environment where it’s ok and encouraged to ask an extensive amount of questions; where it’s ok to struggle, to have bad days and who help you get back up. They are here for it: the **fight for more equality, the passionate discussions and dance parties**. And they are so incredibly happy for you if things turn your way. I have no words for what it means to me to have a little **squad of cheerleaders who celebrate everyone's win like their own**. 

**Thank you so much for making everything a little better** - every day. 

I’m not crying. You are.
And now please go call that colleague. And the other one. Make sure they know.
How to Communicate thru your Backlog
Tags: sofwaredevelopment, agilemethodology, teamwork
Published: 2021-09-03 12:49:23

---
title: How to Communicate thru your Backlog
published: true
date: 2021-09-03 12:40:35 UTC
tags: sofwaredevelopment,agilemethodology,teamwork
canonical_url: https://medium.com/chingu/how-to-communicate-thru-your-backlog-ac231240beb5
---

#### Sprint 1 — Friday

![](https://cdn-images-1.medium.com/max/1024/1*mE0zZ-CQ7PG5wJaoIjvN-A.jpeg)<figcaption>Photo by <a href="https://unsplash.com/@austindistel?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Austin Distel</a> on <a href="https://unsplash.com/s/photos/communicate-team?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption>

### Communication is the Key to Success

By now you might be tired of hearing about how important it is to communicate with your teammates. But the reason is it is the single most important contributor to the success of Voyage Teams!

There are multiple ways to communicate — realtime team meetings, posts in your team channel, and DM’s to name a few. But have you also realized that your **_Project Backlog_** is also an effective way to let your teammates know what you are doing and how you are progressing?

The Project Backlog shouldn’t be a static document you create and then forget! It is a map that not only let you know what should be done, but also a running log that’s useful for maintaining a record of your **status** , **issues** & **questions** , and **accomplishments** related to a particular task.

> It takes communication + collaboration + technical expertise to be successful

Updating it in every sprint at the point in time when new information becomes available makes it a resource for everyone on the team to answer questions like:

1. What should be done next?
2. What needs to be done to make sure no one is waiting on you?
3. What questions or issues have come up that need to be resolved?
4. Who needs help and how you can assist them?
5. Are members working towards the same goal and is there any confusion over what needs to be done?

Tools like [ZenHub](https://www.zenhub.com/), [Jira](https://www.atlassian.com/software/jira), and [Trello](https://trello.com) that integrate with GitHub provide other useful features to help such as being able to cross-reference tasks, automatically update backlog tasks when PR’s are processed, and tracking dependencies between tasks.

However, keep in mind that the tools you use can make the job easier, but _they all start with everyone’s commitment to sharing information openly, frankly, and in a timely manner_.

And once you‘ve created your Backlog you’ll be ready to start planning your first sprint and you find that planning what you need to do becomes easier! This video shows you how to go about that.

{% youtube lumOOOKZzto %}

### Before you Go!

Chingu helps you to get out of “Tutorial Purgatory” by transforming what you’ve learned into experience. The experience to boost your Developer career and help you get jobs.

You can learn more about **Chingu** & how to join us at [https://chingu.io](https://chingu.io/)

* * *
Golang - Conversão de tipos
Published: 2021-09-03 12:29:07

A conversão de tipos é o ato de forçar uma expressão a utilizar e retornar um determinado tipo. Também chamamos esta modalidade de “Casting”. A conversão de um tipo de dado em número ou em literal é muito comum em situações de programação.

Como o Go é uma linguagem de tipagem estática, os tipos de dados são vinculados às variáveis e não aos valores. Isso significa que, se você definir uma variável como `int`, ela só poderá ser uma `int`, você não poderá atribuir-lhe uma `string` sem converter o tipo de dados da variável.

####Inteiro para float

No exemplo abaixo, iremos converter um número inteiro para ponto flutuante, ao final a variável `numero2` ficará com o valor `100.00` ao invés de `100`.

```
var numero1 int64 = 100
var numero2 float64 = float64(numero1)
```



####Float para inteiro


O Go pode converter os floats em inteiros, mas o programa perderá a precisão do float.

Envolver os floats em inteiros, ou um de seus tipos de dados de arquitetura independente, funciona de maneira similar à que usou para converter de um tipo inteiro a outro tipo.


```
var numero1 float64 = 99.9
var numero2 int = int(numero1)
```

A variável `numero2` terá o valor `99` ao invés `99.9`.


####Números para strings

Para converter números em strings, podemos usar o método `strconv.Itoa`, ele faz parte do pacote `strconv`. Ele faz a conversão de números ou variáveis para string.

Inicialmente faremos a conversão de um número inteiro para strings através do método `strconv.Itoa`:

```
package main

import (
    "fmt"
    "strconv"
)

func main() {
    numero := strconv.Itoa(5)
    fmt.Printf(numero)
}
```

No caso da necessidade de converter um float em string, podemos usar o método `ftm.Sprint`, a partir do pacote `fmt`.

```
package main

import (
    "fmt"
)

func main() {
    fmt.Println(fmt.Sprint(421.034))
}
```





####Strings para números


----

That's all folks! :v:
Laura Castro on Property-Based Testing in Elixir
Tags: elixir, propertybasedtesting, pbt, beam
Published: 2021-09-03 12:07:58

Laura Castro, a Professor at University of A Coruña, gave a lecture to my [Introduction to Functional Programming class](https://github.com/adolfont/caes005-introduction-to-functional-programming) at the Federal University of Technology - Paraná (UTFPR) on July 29th, 2021.

YouTube: {% youtube 6gu9EXRraG8 %}



Her slides are at https://www.slideshare.net/lauramcastro/why-on-earth-would-i-test-if-i-have-to-just-let-it-crash

Repos:
- https://gitlab.com/lauramcastro/analytic-tableaux-elixir
- https://gitlab.com/lauramcastro/elixir-echo

Correction: PropEr [1][2] is not part of OTP.  Dialyzer [3] is. Both were developed by Kostis Sagonas and his team.

- [1] https://proper-testing.github.io/
- [2] https://github.com/proper-testing/proper
- [3] http://erlang.org/doc/apps/dialyzer/index.html

Laura on Twitter: https://twitter.com/lauramcastro

Laura's websites: 
- https://about.me/laura.castro and https://sites.google.com/view/lauracastro
- Laura Castro's publications on Google Scholar https://scholar.google.com/citations?user=uWBv3OMAAAAJ&hl=en

Tweet about this lecture: 
{% twitter 1420775358736044038 %}
10 FREE Udemy courses for you to learn HTML and CSS
Tags: html, css, programming, beginners
Published: 2021-09-03 12:04:57

_If you found value in this thread you will most likely enjoy my tweets too so make sure you follow me on [Twitter](https://twitter.com/VladPasca5)  for more information about web development and how to improve as a developer. This article was first published on my [Blog](https://vladpasca.hashnode.dev/)_

1. Build a Quiz App with HTML and CSS

https://www.udemy.com/course/build-a-quiz-app-with-html-css-and-javascript/

2. Get to know HTML Learn HTML Basics

https://www.udemy.com/course/html-online-course/

3. HTML5 and CSS3 Fundamentals

https://www.udemy.com/course/html5-fundamentals-for-beginners/

4. Build a Website in less than 2 Hours! (Step by Step)

https://www.udemy.com/course/build-a-website-in-less-than-2-hours-step-by-step/

5. HTML Basics

https://www.udemy.com/course/colorcode-html-basics/

6. HTML and CSS - Movie Website

https://www.udemy.com/course/html-css-and-javascript-for-intermediate/

7. Start with HTML5/CSS3 & Bootstrap (2021)

https://www.udemy.com/course/html-css-bootstrap/

8. CSS Basics

https://www.udemy.com/course/colorcode-css-basics/

9. CSS Flexbox Quick introduction to using FlexBox CSS style

https://www.udemy.com/course/css-flexbox-course/

10. Learn HTML5 with CSS Free

https://www.udemy.com/course/learn-html5-with-css-free/

_I hope found this useful and if you did please let me know. If you have any questions feel free to DM me on  [Twitter](https://twitter.com/VladPasca5)._
A Nice Developer Joke For Today
Tags: jokes, dailydeveloperjokes
Published: 2021-09-03 12:00:17

---
title: "A Nice Developer Joke For Today"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
published: true
tags: #jokes, #dailydeveloperjokes
---

Hi there! Here's today's Daily Developer Joke. We hope you enjoy it; it's a good one.

![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1259d7cf335.png)

---

For more jokes, and to submit your own joke to get featured, check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/). We're also open sourced, so feel free to view [our GitHub Profile](https://github.com/dailydeveloperjokes).

### Leave this post a ❤️ if you liked today's joke, and stay tuned for tomorrow's joke too!

_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:
I went to a street where the houses were numbered 8k, 16k, 32k, 64k, 128k, 256k and 512k.

It was a trip down Memory Lane.
 -->
How to install Django
Published: 2021-09-03 10:55:24

What is Django?
It is a web-based Python program that enables you to easily build powerful web applications. Django is an open-source framework for backend web applications based on Python — one of the top web development languages. To make use of Django, it must be first installed and a virtual environment will be created as well.
1.cd into your project folder
2. create the virtual environment (env/scripts/activate)
3.pip install Django
4. Then go ahead to create your project and app

Benefits of using Django:
1. Django is highly secure.
2. It creates default admin panel.
3. You can create a SEO using Django.
4. It offers detailed documentation.
return Task vs return await Task
Tags: dotnet, csharp, coding, programming
Published: 2021-09-03 14:18:35

---
title: return Task vs return await Task
published: true
date: 2021-09-03 10:50:00 UTC
tags: dotnet,csharp,coding,programming
canonical_url: https://craignicol.wordpress.com/2021/09/03/return-task-vs-return-await-task/
cover_image: https://craignicol.files.wordpress.com/2021/01/wp-1609625215982.jpg?w=1200
---

_The asychronous pattern in C# is great for simplifying the boilerplate of dealing with threads. It makes things look simple, but as with all abstractions, there are leaks_ .

In most cases, when an async method calls another and there’s no chain (e.g. public method calling a private method directly) return Task is fine, and avoids the overhead of the await state machine for that method.

BUT never do inside a using, or other scoped construct where the object required by the inner call requires context to successfully complete.

In the following example, the first variation, without the await, returns a database call that escapes from the context of the database connection at the end of the method, so when the call is made, the database connection has been closed. You need the await in the second example to postpone the disposal of the database connection until the GetUserAsync call returns.

In this example it’s fairly obvious, but the same pattern can cause threads to unravel far from where this fray was introduced.

```csharp

class UserDetailsRepository
{
    public UserDetailsRepository(IDbConnectionFactory dbConnectionFactory)
    {
        _dbConnectionFactory = dbConnectionFactory;
    }

    public Task<UserDetailsResult> GetUserDetails(string userId, CancellationToken cancellationToken = default)
    {
        using (var dbConnection = _dbConnectionFactory.CreateConnection())
        {
            return GetUserAsync(userId, dbConnection, cancellationToken);
        }
    }

    public async Task<UserDetailsResult> GetUserDetailsAsync(string userId, CancellationToken cancellationToken = default)
    {
        using (var dbConnection = _dbConnectionFactory.CreateConnection())
        {
            return await GetUserAsync(userId, dbConnection, cancellationToken);
        }
    }
}

```
Laravel Livewire Generate Slug Example
Tags: laravel
Published: 2021-09-03 10:40:44

Hello Friends,

In this blog, I would like to share with you how to generate slug in laravel livewire .I will show you a complete example for generate slug example with laravel livewire. We will talk about how to create unique slug in laravel.

Livewire is a full-stack framework for Laravel that makes building dynamic interfaces simple, without leaving the comfort of Laravel.Livewire relies solely on AJAX requests to do all its server communicaton.

More..
https://www.nicesnippets.com/blog/laravel-livewire-generate-slug-example
Create a Netflix clone from Scratch: JavaScript PHP + MySQL Day 39
Tags: php, javascript, webdev, tutorial
Published: 2021-09-03 10:31:13

Netflix provides streaming movies and TV shows to over 75 million subscribers across
the globe. Customers can watch as many shows/ movies as they want as long as they are
connected to the internet for a monthly subscription fee of about ten dollars. Netflix produces
original content and also pays for the rights to stream feature films and shows.

In this video,we will be learning about File Upload in Php

{% youtube JEQYqiWshQc %}


If you like my work, please consider
[![Buy me a coffee](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jm11knj7d8zwcvo150q2.png)](https://www.buymeacoffee.com/cglikpo)
so that I can bring more projects, more articles for you

If you want to learn more about Web Development, feel free to [follow me on Youtube!](https://www.youtube.com/c/ChristopherGlikpo)
Robust CSV export
Published: 2021-09-18 17:50:15

---
title: Robust CSV export
published: true
date: 2021-09-03 10:23:08 UTC
tags: 
canonical_url: https://dcblog.dev/robust-csv-export
---

This article will show you how to export data to a CSV format inside a PHP based project. This export is an improvement on the comparatively basic version which was recommended previously. The main benefits of this method are special characters will not break the CSV export process and instead are treated properly inside the CSV.

There is an optional fourth parameter to specify the delimiter. By default, this will be a comma character.

```

function csv(array $headerFields, array $records, string $filename, string $delimiter = ',')
{
    //create a file pointer
    $f = fopen('php://memory', 'w');
    
    //set column headers
    fputcsv($f, $headerFields, $delimiter);
    
    foreach($records as $row) {
        //output each row of the data,
        fputcsv($f, array_values($row), $delimiter);
    }

    //move back to beginning of file
    fseek($f, 0);
    
    //set headers to download file rather than displayed
    header('Content-Type: text/csv');
    header('Content-Disposition: attachment; filename="'.$filename.'";');
    
    //output all remaining data on a file pointer
    fpassthru($f);
}
```

**Usage**

```

$filename = 'test.csv';
$headerFields = array('First Name', 'Last Name', 'Company', 'Challenge 1', 'Challenge 2', 'Challenge 3', 'Created');

$records = [];
foreach($contacts as $row) {
    $records[] = array(
        $row->firstName, 
        $row->lastName, 
        $row->companyName, 
        $row->challenge1, 
        $row->challenge2, 
        $row->challenge3, 
        $row->created_at
    );
}

csv($headerFields, $records, $filename);
```
Prestashop B2B Whole sale module
Tags: prestashop, b2b
Published: 2021-09-03 10:08:45

Prestashop b2b wholesale module is an eCommerce improvement platform. Covering a huge variety of eCommerce-developed markets. We at addify develop top rate exceptional Prestashop modules. Addify has been developing plugins, extensions, and modules for some time now and offers its customers premium quality products with great customer support. One of our top-rated Prestashop modules is Prestashop B2B & wholesale which offers great functionality and unique feature of wholesalers online.

https://addify.co/product/prestashop-b2b-wholesale-module/
Deploy React App to IIS
Tags: react, beginners
Published: 2021-09-03 09:51:46

---
title: Deploy React App to IIS
published: true
description: Deploy React App to IIS
tags: react, beginner
---

I'm having difficulty deploying my react app on a Windows server (IIS). I have executed the npm run build command and copied the build folder to the server, however the app display a blank page when I browse to the website.

Please assist, been struggling with this for two days now.



When I look at the developer console in Chrome I get these errors below:

localhost/:1 GET http://localhost/static/js/2.74a5bd4f.chunk.js net::ERR_ABORTED 404 (Not Found)
localhost/:1 GET http://localhost/static/css/main.2cfecded.chunk.css net::ERR_ABORTED 404 (Not Found)
localhost/:1 GET http://localhost/static/css/2.818011ed.chunk.css net::ERR_ABORTED 404 (Not Found)
localhost/:1 GET http://localhost/static/js/main.ac3e9509.chunk.js net::ERR_ABORTED 404 (Not Found)
localhost/:1 GET http://localhost/static/js/2.74a5bd4f.chunk.js net::ERR_ABORTED 404 (Not Found)
localhost/:1 GET http://localhost/static/js/main.ac3e9509.chunk.js net::ERR_ABORTED 404 (Not Found)
manifest.json:1 GET http://localhost/manifest.json 404 (Not Found)
manifest.json:1 Manifest: Line: 1, column: 1, Syntax error.
Como atualizar manualmente o Oh-My-ZSH
Tags: ohmyzsh, terminal
Published: 2021-09-03 09:51:29

Ao usar [oh-my-zsh](https://ohmyz.sh/), serão raras as vezes que você terá que fazer essa atualização manualmente. 

Mas, se como eu, você digita o comando logo que o terminal abriu, já  deve ter perdido alguma das atualizações automáticas. Ao menos que o comando digitado comece com 'y' ou 'n'. Caso contrário, é certeza de que digitou algum outro comando que sem querer perdeu a opção de atualizar o terminal automaticamente. 

A boa notícia é que existe um jeito de atualizar o terminal manualmente. 

[Oh-my-zsh](https://ohmyz.sh/) vem com seu próprio utilitário de linha de comando `omz` . Você pode executar manualmente uma atualização oh-my-zsh usando `omz update` no seu terminal:
```
omz update
```
Prontinho! Esse comando verifica o upstream do oh-my-zsh em busca de alterações desde a última atualização.
Looking for Contributors/Collaborators for Open-Source Projects
Tags: contributorswanted, githunt, github, programming
Published: 2021-09-03 09:48:36

**I'm looking for Contributors or Collaborators for already started Open-Source Project and new Ideas to develop.**

***Any contribution is welcome and all profiles are accepted!!!***

The only thing that you need to have  is the willingness to work with other people, and inside a future community of contributors and collaborators. 

Here we have an **inclusive environment** and **mentoring**.

If you want more information, you can *comment* this post or *write to me on connect* or *write an email to zigrazor@gmail.com* .

Thank you in advance,
See you soon.