teleren/devto huggingface dataset:
Injeção de dependências com Spring e Lombok
Tags: spring, springboot, java, lombok
Published: 2021-09-09 18:39:41

Já conhecemos algumas formas de injetar objetos numa classe, dentro de um projeto Spring, como anotar com @Autowired um atributo da classe ou um construtor.

Porém, recentemente, aprendi mais 2 formas interessantes que eliminam parte do código fonte, que vou mostrar a seguir, ambas usando Lombok.

### 1ª forma: @AllArgsConstructor

O Lombok possui a annotation `AllArgsConstructor` que cria um construtor com todos os atributos da classe. Porém, usando o atributo da annotation `onConstructor`, permite você especificar qual annotation deve ser incluída no construtor gerado:

``` java
@RestController
@AllArgsConstructor(onConstructor = @__(@Autowired))
public class UserController {

    private UserService userService;
    private Profession professionService;

    /*
     * Ao invés de usar assim:
     *
     * @Autowired
     * private UserService userService;
     *
     * @Autowired
     * private Profession professionService;
     *
    */
}
```

### 2ª forma: @RequiredArgsConstructor

Basta anotar a classe com a annotation `@RequiredArgsConstructor`, que cria um construtor com todos os atributos final da classe. Assim, o Spring injeta pra gente as dependências obrigatórias.

``` java
@RestController
@RequiredArgsConstructor
public class UserController {

    private final UserService userService;
    private final Profession professionService;

    /*
     * Ao invés de usar assim:
     *
     * @Autowired
     * private UserService userService;
     *
     * @Autowired
     * private Profession professionService;
     *
    */
}
```

### Lembrete!

Criar construtores em classes abstratas te obriga a criar construtores nas classes filhas chamando o construtor da classe mãe.

### Referências

- [Lombok (AllArgsConstructor)](https://projectlombok.org/api/lombok/AllArgsConstructor.html)
- [Lombok (RequiredArgsConstructor)](https://projectlombok.org/api/lombok/RequiredArgsConstructor.html)
- [Baeldung](https://www.baeldung.com/spring-injection-lombok)
Question
Tags: javascript
Published: 2021-09-09 18:16:07

Hey I am new, i am stuck with a problem, basically i want to to get user's location then use google's  reverse geocoding everything works until i want to store the value in a global variable can you guys please help me out, I have used comments to point the problem
here's the code : 
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Google Maps GeoCoding</title>
  </head>
  <body>
    <header>
      <h1 id="address">Reverse GeoCoding with Google Maps</h1>
    </header>
    <!-- write some stuff about a place here -->
    <script>
      var a ;
          async function fetchData(url){
  let response = await fetch(url);
  let data = await response.json();
  console.log(data.results[0].formatted_address); // This Works
  a = data.results[0].formatted_address ;
  return data;
}

async function showPosition(position){
  const KEY = "AIzaSyCRZ75XgjXdkev6luazjoYprnujWe9JSaY";
  let lat = position.coords.latitude;
  let long = position.coords.longitude;
  let url = https://maps.googleapis.com/maps/api/geocode/json?latlng=${lat},${long}&key=${KEY};
  let data = await fetchData(url);
  //console.log(data);

}

function getLocation() {
  if (navigator.geolocation) {
      navigator.geolocation.getCurrentPosition(showPosition);
  } else { 
      console.log("Geolocation is not supported by this browser.");
  }
}

window.addEventListener("load", getLocation);


document.getElementById('address').innerText = a ;
console.log(a); // This Doesn't Work
  </script>
    </script>
  </body>
</html>
📨 Why Phishing Attacks Work
Tags: phishing, security, cybersecurity
Published: 2021-09-09 18:11:34

#### 🔐 Phishing is the most common cyberattack vector today, and yet people still fall for it. We look at the causes and possible solutions. 

### <br>

Phishing is a type of social engineering attack, generally delivered by email,  with the intent of stealing the target’s login credentials and other sensitive data, such as credit card information or ID scans, to steal their identity.

A noteworthy trait of phishing is the **element of surprise**: these emails arrive when the victim doesn’t expect them. Criminals can time emails so victims will receive them when distracted by something else, such as work. It’s impossible to be focused on being productive and attentive to suspicious emails all the time, and fraudsters know it.

The emails are crafted in such a way to avoid snapping the victim out of autopilot and comply with the fraudsters’ requests. They may [impersonate someone](https://www.youtube.com/watch?v=lyF8I-xzZ_k), often entities or colleagues trusted by the victim, and exploit biases we all have as humans to increase the likelihood of compliance.

## Statistics 

In my last article, I wrote about how U2F security keys work and how they secure people against phishing. Now, why do we need U2F keys to prevent phishing attacks, to begin with? Do people still fall for the Nigerian prince scam?

According to the 2020 edition of the [FBI Annual Internet Crime Report](https://www.ic3.gov/Media/PDF/AnnualReport/2020_IC3Report.pdf), phishing attacks were by far the most common attack, representing 32.35% of all cyberattacks last year, with 241,342 occurrences registered. This figure increased more than tenfold in the last five years, up from 19,465 in 2015.

Despite improvements made to email filters throughout the years — [Google filters out 100 million spam emails per day](https://cloud.google.com/blog/products/identity-security/protecting-against-cyber-threats-during-covid-19-and-beyond) for Gmail users — phishing attacks  are still popular for two reasons:

1. They don’t require complex expertise to pull off: crafting convincing  emails and creating fake websites, and
2. They are easily scalable, which ends up being much more time-efficient than, for example, trying to break into a server.

It’s frequently said that humans are the weak link in security, and it’s no different from phishing. For example, fraudsters capitalized with great success on people’s fear during [last year with the COVID-19 pandemic](https://auth0.com/blog/phishing-goes-viral-covid-19-themes-in-cybercrime/).

The 0.1% of phishing emails that pass through email filters is still enough to be extremely profitable for scammers, and that they should be doing more of it,  which means users should be even more careful in the upcoming years.

[Read more...](https://auth0.com/blog/why-phishing-attacks-work/?utm_source=content_synd&utm_medium=sc&utm_campaign=phishing)
What is Roblox Studio and How to Become a Roblox Developer?
Tags: productivity, android, quide, development
Published: 2021-09-09 18:09:41

At this post, I will try to cover some information about Roblox, why you should use the Studio Creator and which programming languages you need to use in order to become a successful developer at this gaming creation platform. Let's get started.

##What is Roblox?##

[Roblox ](https://en.wikipedia.org/wiki/Roblox) is one of the most popular online multiplayer gaming platforms in the world. Beside only playing games, the users might create their own games. Furthermore, it was developed and published by the Roblox Corporation on September 1, 2006. This platform is compatible with various operating systems such as Windows, Android, iOS, Xbox One, macOS, Macintosh and few other. This platform has million of players and developers from different ages and different countries around the world.

##Roblox Studio Overview##

Roblox Studio is a great free game development program that can be also used on different operating systems. Further, in order to start using it, the user must register for a new Roblox account and download the Studio launcher from the official website. 
This program have a lot of great features that users might find useful. For example, there is an option for adding plugins, adding objects or even adding pre-made templates from the marketplace. 

###What Users Create using the Roblox Studio###

It is mostly used for creating games and in-game items. For example, the users create such a lot of in-game items using this platform such as clothes, hats, hair templates etc. Some of them even create their own unique [Roblox hair codes](https://www.tornadocodes.com/roblox-hair-codes-ids/) and [Roblox outfits ids](https://www.tornadocodes.com/roblox-clothes-codes-outfit-ids/) for their games. Each of the items has its own unique code/id which usually contains unique numbers (characters).

###How to Become a Roblox Developer?###

The Roblox Studio is necessary along with the Lua programming language, so I can recommend you to start with mastering these two. Since it is a web-based drag-and-drop code builder, you will learn them in a very short period of time. Just try to avoid copying other games. Try to make something unique and your game can become popular with million of players overnight. There is no doubt that this platform can make you famous in a very short time. 

###Are developers geting paid by Roblox?###

To sum up the developers don't get paid by Roblox for creating the games. However, they earn money whenever the player purchase a different kind of virtual in-game item. This is even better, since your earnings can be unlimited and you can always create a new virtual items which will be premium and the users must pay in order to get them.
Gender diversity makes teams communicate more effectively
Tags: inclusion, communication
Published: 2021-09-09 18:03:30

---
canonical_url: https://chuniversiteit.nl/papers/gender-diversity-and-women-in-software-teams
---

> _Software teams could use more women, but they aren’t lining up yet_

**I read and summarise software engineering papers for fun, and today we’re having a look at [Gender diversity and women in software teams: How do they affect community smells?](https://doi.org/10.1109/ICSE-SEIS.2019.00010) (2019) by Catolino et al.**

Software development teams in western countries largely consist of males or are even male-only. Hiring policies that favour women over men can help restore the balance somewhat, but are also controversial. Do these policies actually make economical sense? Spoiler alert: yes, they do.

## Why it matters
The key to good software development is good communication and collaboration between team members. Women tend to be better at these things, but most software teams don’t have even a single female member.

Since communication is such an important part of software development, one might expect that teams with women are better equipped to avoid so-called “community smells” and thus outperform male-only teams.

## How the study was conducted
The authors compared data about communication flows from 20 male-only open source projects with 20 open source projects from teams with at least one female member.

## What discoveries were made
Development teams without women indeed suffer from more community smells than teams that have any positive number of women – even if it’s just one. Given what we already know about social group dynamics this is hardly a surprise.

There are many types of **community smell**, but the authors chose to further analyse four types that are likely to be affected by the presence of women:

* The community consists of multiple **organisational siloes** that don’t communicate much with each other – and when they do, communication is handled by just one or two group members;

* Community members are overwhelmed by a **black cloud** of information due to a lack of structured communication;

* There are **lone wolves** who work on their own and do not collaborate or communicate with others;

* One member handles all communication across two or more subcommunities and thus results in **radio silence**.

The presence of women clearly affects whether the black clouds and radio silence smells (which are related to quality of communication) occur.

It’s not as clear for the organisational silo and lone wolf smells (which have to do with organisational structure), as the authors only find a partial relation between gender diversity and the two smells.

The results confirm that gender diversity in teams is a good thing to strive for and underlines the importance of team composition as a way to combat community smells.
VPN (Virtual Private Network) Nedir?
Tags: privacy, devops, vpn
Published: 2021-09-09 17:58:54

VPN, Sanal özel ağlar olarak tanımlanır. **Virtual Private Network** kelimelerinin kısaltması olarak kullanılır. Genel olarak şirketlerin şubeleri arasındaki iletişimi şifreleyerek güvenli iletişim sağlamasını amaçlamaktadır. [VPN](https://vpnbedava.com/vpn-nedir), birçok farklı protokol ve teknolojiyi bir arada kullanmaktadır. Bir bilgisayardan karşı taraftaki diğer bilgisayar arasındaki iletişim kriptolama yapılarak güvenli bir tünel kurulması sağlanır. Bu tünel içerisinden geçen veri şifrelendiği için araya giren veya girmeye çalışan kişiler yalnızca kriptolu veriyi görebileceği için güvenliğiniz sağlanmıştır. Bu kriptolama seviyesi ne kadar iyiyse gizliliğiniz de o kadar güvenli olur. Aynı zamanda tüm veri akışınızı (DNS istekleriniz de dahil olmak üzere) bu tünel içerisine aldığınız takdirde tam bir koruma sağlamış olursunuz. Virtual Private Network (Sanal Özel Ağ) teriminin kısaltılmış halidir ve en temel anlamıyla internete başka bir IP adresi üzerinden bağlanmanızı sağlayan hizmettir. Bu özel bilgisayar ağı, örneğin yerel bir ağa fiziksel erişimi bulunmayan, dışarıdaki bir kişi tarafından ağ kaynaklarına erişmekte kullanılabilir. VPN'ler, güvenilmeyen ağlara bağlanırken bağlantıyı şifrelemek ve güvenli hale getirmek için de kullanılır. Bunun yanında VPN'ler, farklı konumlarda bulunabildiğinden, sizi ülkelerin kısıtlamalarından (yasaklı web siteleri ve IP'ler gibi) da kurtarırlar. VPN'ler (Virtual Private Network) basit bir şekilde açıklamak gerekirse internete şifreli bağlantı üzerinden daha güvenli biçimde bağlanmanızı sağlarlar.

## Neden VPN kullanılır?
VPN, internet bağlantınızı güvenli hale getirir ve herhangi bir siteye bağlanırken sizin bağlantınızı şifreler, kimliğinizin bulunamamasını sağlar. VPN programları gönderdiğiniz ve aldığınız tüm verileri kendisi şifrelediğinden 3. şahısların ne yaptığınızı asla görmesine izin vermeyen bir güvenlik sistemi olarakda kullanılabilir. Bu nedenledir ki şirketler ve bankalar, farklı mekânlardaki çalışanlarıyla/ofisleriyle bağlantı kurmak için VPN hizmetini kullanırlar. Böylelikle, kilometrelerce ötedeki kişilerle bile, şirket içerisinde kurdukları ağ kadar güvenli bir şekilde bağlanırlar.

[https://vpnbedava.com/vpn-nedir](https://vpnbedava.com/vpn-nedir)
Flutter Sqflite Error ! Please Help...
Published: 2021-09-09 17:48:21






My error : error DatabaseException(near "INTEGER": syntax error (code 1): , while compiling: CREATE TABLE commercant(
I/flutter ( 5164): id INTEGER PRIMARY KEY,
I/flutter ( 5164): nom TEXT,
I/flutter ( 5164): departement TEXT,
I/flutter ( 5164): districtActiviter TEXT,
I/flutter ( 5164): categorie TEXT,
I/flutter ( 5164): marcher TEXT,
I/flutter ( 5164): gameProduit TEXT,
I/flutter ( 5164): telephone TEXT,
I/flutter ( 5164): whatsapp TEXT,
I/flutter ( 5164): email TEXT,
I/flutter ( 5164): favorite INTEGER) sql ' CREATE TABLE commercant(
I/flutter ( 5164): id INTEGER PRIMARY KEY,
I/flutter ( 5164): nom TEXT,
I/flutter ( 5164): departement TEXT,
I/flutter ( 5164): districtActiviter TEXT,
I/flutter ( 5164): categorie TEXT,
I/flutter ( 5164): marcher TEXT,
I/flutter ( 5164): gameProduit TEXT,
I/flutter ( 5164): telephone TEXT,
I/flutter ( 5164): whatsapp TEXT,
I/flutt
Promise in Javascript
Tags: javascript, beginners
Published: 2021-09-09 17:36:53

A promise is one of the most confusing concepts in javascript for someone new to Javascript. It may look quite complicated to understand at first sight, but it is quite simple and is not rocket science.

Promise in javascript is similar to promise in real life, like how we promise to do a task like cleaning the room, it is a guarantee that we are going to do something in the future.


## Why do we need Promise?

Before Promise, callback functions were used for performing asynchronous operations. Since it was confusing and had limitations in functionality, Promise was introduced in ES6. 

If there are multiple asynchronous operations to be done and if we try to use good-old Callbacks for them, we’ll find ourselves quickly inside a situation called Callback hell. 


### A simple promise function

``` 
let promise = new Promise((resolve, reject) => { 
  let task_performed = true;
  if(task_performed) { 
    resolve('Success!'); 
  } else { 
    reject('Failed!'); 
  } 
}); 
```

## Different states of Promise

The 3 states of promise object are:
1. Pending
2. Resolved
3. Rejected

**Pending:** It is the initial state of the Promise before Promise succeeds or fails. When we request data from the server by using a Promise, it will be in pending mode until we receive our data.

**Resolved:** It is the state where a promise is fulfilled successfully. It's like when we use a promise to get data from the server, we get the resolved state when the data is successfully received.

**Rejected:** It is the state where a promise is not fulfilled due to some error.

![Promise flow](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ahu64bdoidbdxpto6fxi.png)

The .then() method is called after a promise is resolved. We can use it to decide what to do with the resolved promise.

```
let promise = new Promise((resolve, reject) => { 
  let task_performed = true;
  if(task_performed) { 
    resolve('Success!'); 
  } else { 
    reject('Failed!'); 
  } 
}); 

promise.then((response) => console.log(response))
```


We also know that not all Promises will be resolved every time. What if the promise gets rejected? We use the .catch() method after a promise is rejected. It can be used for throwing a new error or logging the details to the console.

```
let promise = new Promise((resolve, reject) => { 
  let task_performed = true;
  if(task_performed) { 
    resolve('Success!'); 
  } else { 
    reject('Failed!'); 
  } 
}); 

promise.then((response) => console.log(response))
.catch((error) => console.log(error))
```
Define a haskell function that returns true when the binary representation of a number has more 0s than 1s.
Tags: haskell, programming, help
Published: 2021-09-09 17:25:07

Define a function moreZeros :: Int -> Bool such that moreZeros n returns True exactly when the binary representation of n has strictly more 0s than 1s.

Test cases:
moreZeros 0     = True
moreZeros 1	= False
moreZeros 2     = False
moreZeros 4	= True
What are some of your biggest questions about Ruby on Rails? Answer to be featured on our podcast 🎧
Tags: podcast, discuss, ruby, rails
Published: 2021-09-09 16:59:51

---
title: What are some of your biggest questions about Ruby on Rails? Answer to be featured on our podcast 🎧  
published: true
description: 
tags: podcast, discuss, ruby, rails
---

The [DevDiscuss Podcast](dev.to/devdiscuss) begins with an interview and ends with commentary from listeners — and we like to feature the _actual_ voices from our community!

To inform an upcoming episode of the show, we'd like to know...

> ### **What are some of your biggest questions about Ruby on Rails?**

For your chance to hear your actual comments on an upcoming episode, answer the question above by:

- Calling our Google Voice at +1 (929)500-1513 and leave a message 📞

- Sending a voice memo to pod@dev.to 🎙

- OR, leaving a comment here (we'll read your response aloud for you) 🗣

Please send in your recordings by Wednesday, September 15th at 1 PM, ET (5 PM UTC, 10 AM PT)

#### Voice recordings will be given priority placement 😉

Catch up on recent episodes of the show [here](https://dev.to/devdiscuss) 👀
25 CSS generator tool for developer . MUST Check
Tags: webdev, codenewbie, css, tools
Published: 2021-09-09 16:27:09

Here you find best tools for background gradient, color combination, box shadow, Neumorphism and more


#A) Background Gradient generator 

1. https://cssgradient.io
2. https://mycolor.space
3. https://uigradients.com/#Cherry
4. https://gradienta.io
5. https://css-gradient.com

#B) Color combinations 

6) https://colors.muz.li
7) https://coolors.co
8) https://design-seeds.com
9) https://picular.co
10) https://colorion.co

#C) Favicon  maker 

11) https://formito.com/tools/favicon
12) https://redketchup.io/favicon-generator
13) https://favicon.io
14) https://ionos.com/tools/favicon-generator

#D) Attractive shapes with border-radius

15) https://9elements.github.io/fancy-border-radius/

#E) Neumorphism css generator

16) https://neumorphism.io/#e0e0e0
17) https://hype4.academy/tools/neumorphism-generator

#F) Glassmorphism css generator

18) https://ui.glass/generator/
19) https://hype4.academy/tools/glassmorphism-generator
20) https://markodenic.com/tools/glassmorphism-css-generator/ 

#G) Box shadow measurement 

21) https://shadows.brumm.af
22) https://box-shadow.dev

#H) SVG icons (easy to use )

23) https://tablericons.com
24) https://icons8.com 
25) https://ionic.io/ionicons

---------------------------------------------------------------
##[Twitter](https://twitter.com/Sahilsaif2002)
My First Experience Contributing to Open Source
Tags: opensource, programming, codenewbie, javascript
Published: 2021-09-09 16:24:15

  In the beginning of the year if someone would of told me that in I would make my first contribution to open source I would of laughed in their face. However as of September 6th, 2021 I actually made my first contribution to open source and I feel really good about it.
I would like to tell you more about my experience with Open Source.

My First Experience Contributing to Open Source

  I heard about open source for a while now since I've been learning how to code. I was encouraged by my friend who is a professional developer now at GitHub to contribute to beginner friendly projects that are out there like Open Sauced, and Virtual Coffee. She not only showed me how Open Source works but she also found me a beginner friendly issue on the VirtualCoffee.io. What was amazing is that I have received so much support on how to get started with the issue from the Virtual Coffee Community. It made me feel good getting support which gave me the confidence in tackling and fixing the issue.

  The issue was regarding re-wording the documentation about the monthly newsletter. It was my very first time making a pull request for an Open Source issue and as a result it was successful. When all the necessary changes were made the maintainers release the updates into production. It was a great feeling for me.


Why it took me so long to contribute?

  Honestly I had major imposter syndrome. I stayed far away from Open Source because I didn't feel that my coding skills were worthy enough to contribute to any projects. It really intimidating to put yourself out there and I definitely felt insecure. My friend encouraged me to take on an easy task to ease my way into the open source world. 

Final Remarks

  I'm very happy that I was able to contribute to Virtual Coffee. It not only gave my experience in creating Pull Request for an open source project but I was able to increase my Git/Github skills which will be valuable in the future.

For those who took the time to read this thank you very much and have a blessed day!