teleren/devto huggingface dataset:
4 Steps for a good BDD
Tags: bdd
Published: 2020-06-02 13:44:37


First of all, we need to keep in mind that BDD (Behavior Driven Development) is a form of agile software development and that the main objective of BDD is to establish an easy way to communicate the idea to other people. Developers, testers, investors and customers
can understand and discuss software requirements, to create a clearer test and validations to  obtainan a good product/service with fewer defects.

The structure of BDD is:

**Scenario:** a title of your requirements;
**Given:** the state of the system that will receive the behavior/action;
**When**:  the behavior/action that happens and causes the result in the end;
**Then**: the result caused by the behavior in the state;

*"Ok"* - you may think -*"so... there's no error in this methodology"*. Well... not yet. If you are too simple or too detalist you take the risk of not reaching the right point of your issue.
"*And how do I reach the central point of my cases?*". Well, I got these steps:

# **Step01** : A good Scenario 🖼
 
Try to create accessible scenario. Paying attention to the most recurring situations and requirements is a good way to guarantee the integrity and quality of your software. Create scenarios that are easily identified as "Success" and "Failure" because this will help the user to see through the objective.

# **Step02**: a simple  comand has a simple response ⚖️

To execute a scenario, lowering the complexity of the action makes the test more comprehensible and helps the person behind the test o understand the response a little better.

# **Step03**: don't be too much ❌

In addition to avoiding creating very simple or very complex test cases, it is important to create test cases that are recurring. Always prioritize the main actions of your software to guarantee the delivery of the main functions. With the main functions tested, you will be able to spend more time with less recurring actions.

# **Step04**: let the answer guide the way 🗺️

Before all these steps, make sure that the anwsers will make sense with your main objective. Collecting and analyzing responses are points of important attention as these are the ways that will inform your team if the final product needs to evolve and where it needs to evolve.



Well, that's it guys.


**USEFULL LINKS:**
https://circleci.com/blog/how-to-test-software-part-ii-tdd-and-bdd/?utm_medium=SEM&utm_source=gnb&utm_campaign=SEM-gnb-DSA-Eng-ni&utm_content=&utm_term=dynamicSearch-&gclid=CjwKCAjwztL2BRATEiwAvnALcufZo2ZsjCzFbXlep4lpUT_8cLBrdZlzggwsfgbdYLyL0u0JT-b70RoCIGwQAvD_BwE
How To Use The Map Method In Ruby
Tags: ruby, beginners
Published: 2020-06-02 13:39:47

#Map
So, you have an array, a mutable object, and you want to output a change each and everyone of it's contents accordingly without really changing the it's value. You could use a for loop, but it's too long, or you could use the each method but it's what you've been using and repetitive use isn't good. You need something concise and efficient, you should use the map method.

#How does it work?
The map method, is not similar to the function with the same name that appears in python, or js. Unlike map in the mentioned languages, map in ruby doesn't call a function on an enumerable, it is more like an advanced version of each. There is another method that is ***exactly*** the same as map, called collect, in ruby. The only difference between them is popularity.

>Okay, but still why don't I just use each I don't really see the difference?

The answer is simple. Each doesn't return the changed value.

>What?

Yeah, if you want to see the value it must be assigned to a different variable or reassigned to the same one, other wise there is no output change. With map you can just return the value without permanently changing or reassigning a value. That's why it's used more than each. Also, readability in ruby is one part of its benefits and frankly, the syntax of map is just as readable as each but due to its differences the additional things needed to do the same thing make each, overall, a poorer choice in most cases over map. Here's an example.

{% gist https://gist.github.com/OreOlad/a451d2fef291b1d3dc1b546ba253d9ca %}

>So what should I be using now?

IMHO, it all comes down to opinion, but I do suggest that using map instead of each would probably be a better option.

#Later
Hope you liked the post. Bye. :)
Power of the Journey
Tags: codenewbie, firstyearincode
Published: 2020-06-02 12:22:28

Before we dig in.

2020 has meant:

**Australian Bushfires**
**COVID-19**
**Black Lives Matter**

That's not exhaustive.

What you need to know is that I wake up each morning remembering the weight of the world. 

And then I take a step forward.

As I dig into writing about this coding journey here and now, please know I do this because it helps me remember:

**Nothing is permanent**
**Life is constantly teaching, but it's up to us to learn**
**We can rally together when things get scary**

With that in mind, the power of the journey.

Perhaps the best part about changing careers from education to tech has been hearing from the people. 

Their stories, their zig-zag paths from here to there, and what they learned.

Although no one has taken the same path from point A to point B, there are beautiful themes emerging:

1) **Inquisitiveness** is gold. Thinking, "Well that's weird" and then having the gusto to figure it out.

2) **Embrace the unknown**, because you'll *never* know all the things. 

3) **No door *has to* close all the way.** Show your best self always, and maintain relationships. You just never know.

4) There exists a balance amongst business, team and personal objectives. **Find a way to further all three.**

5) **This is a JOURNEY. Invest in it daily.**

Cannot wait to keep listening, cannot wait to learn from those before me.

Have something to add? I'm all ears.

Be well.
Growth Hacking with NLP and Sentiment Analysis 
Tags: NaturalLanguageProcessing, SentimentAnalysis, python
Published: 2020-06-02 13:39:25

We developed a course, *[Growth Hacking with NLP and Sentiment Analysis](https://www.manning.com/liveproject/growth-hacking-with-nlp-and-sentiment-analysis)* during the past months. We loved working with Manning, and now we are excited to start mentoring our students. Join us if you’d like to learn about applied sentiment analysis using Python and libraries like simpletransformers and scikit-learn.

![](https://i0.wp.com/crowintelligence.org/wp-content/uploads/2020/06/screencapture-manning-liveproject-growth-hacking-with-nlp-and-sentiment-analysis-2020-06-02-09_45_06.png?fit=800%2C670&ssl=1)[![Creative Commons License](https://i2.wp.com/i.creativecommons.org/l/by-nc-sa/4.0/88x31.png?w=800&ssl=1)](http://creativecommons.org/licenses/by-nc-sa/4.0/)
This work is licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-nc-sa/4.0/).
Cyber Security Threats And Best Practices For Remote Workers
Tags: security, productivity, beginners
Published: 2020-06-02 13:38:53

As we are going through unusual and challenging times, our daily habit has been affected in all sorts of ways. For those who are working from home, this is indeed a very difficult time. We are more open to cyber attacks due to the little to no cyber security we have in place while working from home.

Hackers are desperately trying to exploit the opportunity and up to some extent, it’s working. It’s mainly because many organizations and business tasks have gone from an internal network to the open internet without much preparation. This has exposed them to more potential threats.

Some of the common attacks are listed below.

* Email-Phishing
* SMS-Phishing
* Mobile Malware
* Malicious Software
* Ransomware Attacks

###Cyber Security Best Practices For Remote Workers

In this rising time of cyber attacks, taking preventive action against these interventions is a necessity.

* Use antivirus and antispyware software on every computer used in your business and make sure they are frequently updated.
* Limit physical access to your computers and network components.
* Regularly change passwords and ensure that they’re not easy to predict


*more detailed version published at https://beaglesecurity.com/blog/blogs/2020/04/13/Cyber-Security-Threats-and-Best-Practices-for-Remote-Workers.html*
taco_tuesday gem, now with more tacos
Tags: ruby, jokes, news
Published: 2020-06-02 13:30:22

Thanks to [Colin Bartlett](https://dev.to/cbartlett)'s awesome contribution to the `taco_tuesday` gem version `0.2.0` has been released!

In `0.2.0` you can now run 🌮? on Date and Time classes to know if it's a Taco Tuesday.

```ruby
require 'taco_tuesday'

# May 26th 2020 is a Tuesday
tuesday = Date.new(2020, 5, 26)
tuesday.taco_tuesday? #=> true
tuesday.🌮? #=> true

# May 25th 2020 is a Monday
monday = Date.new(2020, 5, 25)
monday.taco_tuesday? #=> false
monday.🌮? #=> false

# Check if today is Taco Tuesday
Date.today.taco_tuesday? #=> Same result as Date.today.tuesday?
Date.today.🌮? #=> Same result as Date.today.taco_tuesday?
```

Or with the Time class:

```ruby
require 'taco_tuesday'

# May 26th 2020 is a Tuesday
tuesday = Time.new(2020, 5, 26)
tuesday.taco_tuesday? #=> true
tuesday.🌮? #=> true

# May 25th 2020 is a Monday
monday = Time.new(2020, 5, 25)
monday.taco_tuesday? #=> false
monday.🌮? #=> false

# Check if today is Taco Tuesday
Time.now.taco_tuesday? #=> Same result as Time.now.tuesday?
Time.now.🌮? #=> Same result as Time.now.taco_tuesday?
```

With the power of both `taco_tuesday?` **AND** `🌮?` you and your ruby apps are sure to never miss another Taco Tuesday!
How do you cover for domain name costs in FOSS projects?
Tags: opensource, discuss, webdev
Published: 2020-06-02 13:10:38

FOSS is Free and Open-Source Project, but how do you earn a little money, just to maintain a domain name?

Do you have to put up some ads or affiliate marketing?

I can get a domain name for cheap, but it is hard to get one for free. Also, yearly renewal costs.

It has go in a wallet of someone, might even be some government.
Array '[]'
Tags: beginners, javascript
Published: 2020-06-02 12:21:01


Array '[]'
===

> All examples are Javascript langage.

One on the must used data structure.

It's used to store one/many data of **same nature** or **different nature**, in order to get ALL of this
data in one place (this array).

## Examples of arrays

```javascript
// same nature elements
['apple', 'orange', 'pineapple']

[ {'name': 'Naruto'}, 'Ninja', []]
// -> different nature, the first is an object, second is a string and the third an empty array
```

> Depending on the langage, sometimes we need to use an extra coding instruction or an array variant in order to use  'different nature' arrays.

## How to use it

Now we need to see how to create an array, make basics instructions like add elements, delete, get and element. You need to learn how to do it in your langage.

The basics operations:

- create

```javascript
//creation 
const fruits = []; 

```

- add element(s)

```javascript 
fruits[0] = 'apple' 
fruits[1] = 'orange'
fruits.push('pineapple') // push add an element at the end of the array

//result: ['apple', 'orange', 'pineapple']

```
  
- delete elements(s)

```javascript
delete fruits[2]
//this is the must primitive way to delete an element but we will see that we don't use it often... most of the time we use 'filters, maps, splice'.

```

- find and element(s)

```javascript
console.log(fruits[1]) //get the second element, 0 is the begining
```
- find and specific element(s) with loops and if condition like

```javascript
fruits.forEach((fruit) => {
  if (fruit === 'orange') console.log(fruit)
})
// we use a forEach iteration to get the orange fruit and print it.
```

## Middle and common operation/function of array

- add element at the end (push) and begining (shift)
- delete the last and first element (pop, unshift)
- concat arrays
- filter elements
- map (like convertion)
- (splice, slice) cut/replace/delete
- find and replace
- clone array
- be confortable with multi dimentional array (array into array)
- sort an array

Check this to JS array method for all of this operations
https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Array#

## Exercises 


- Swap to elements without 3 variables
- Reverse array 
- Nombre pair le + petit
- Intersection of array
- Find Max and Minimum of unsorted array
- Delete repeated numbers of array
- Check if contains a number if they Array
- Not the largest path in path matrix m*m

++ https://www.geeksforgeeks.org/array-data-structure/

# Note

Feel free to send to suggest improvement to this post.
Why you do not like Java?
Tags: discuss
Published: 2020-06-02 13:07:54

I have seen the [StackOverflow Insights](https://insights.stackoverflow.com/survey/2020#technology-most-loved-dreaded-and-wanted-languages-wanted) about *Most Loved, Dreaded, and Wanted Languages* and I have some questions. If you are not a Java developer or you develop Java but do not like. Please, share the whys! 😃
Padrão MVVM
Published: 2020-06-02 12:46:29

O padrão de projeto Model-View-ViewModel (MVVM) foi originalmente criado para aplicativos Windows Presentation Foundation (WPF) usando XAML para separar a interface do usuário (UI) da lógica de negócios e aproveitando ao máximo o data binding (a vinculação de dados).

Aplicações arquitetadas desta forma têm uma camada ViewModel distinta que não possui dependências de sua interface de usuário.

Esta arquitetura em si é otimizada para testes de unidade, bem como para o desenvolvimento multiplataforma.

Como as classes ViewModel de um aplicativo não têm dependências sobre a camada de interface do usuário, você pode facilmente trocar uma interface de usuário iOS por uma interface Android e escrever testes contra a camada ViewModel.
 
O padrão MVVM é composto basicamente dos seguintes elementos:

**Model**: A camada de modelo é a lógica de negócios que impulsiona a aplicação e quaisquer objetos de negócios;

**View**: Esta camada é a interface do usuário. No caso do desenvolvimento cross plataform, ela inclui qualquer código específico da plataforma para conduzir a interface do usuário da aplicação.

**ViewModel**: Esta camada age como a cola em aplicações MVVM. As camadas ViewModel coordenam as operações entre a view e as camadas model. Uma camada ViewModel irá conter propriedades que a View vai obter ou definir, e funções para cada operação que pode ser feita pelo usuário em cada view. A camada ViewModel também evocará operações sobre a camada Model, se necessário.

A figura abaixo mostra um esquema do padrão Model-View-ViewModel :
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/0bwky8qq53k96y1848y2.png)


É importante notar que a interação entre as camadas View e ViewModel é  tradicionalmente criada pela ligação de dados ou databinding.

No entanto, o iOS e o Android não possuem um mecanismos de vinculação de dados embutidos, por isso a abordagem geral neste caso é feita manualmente chamando a camada ViewModel da camada View.

Nota: Você pode usar o Xamarin. Forms para criar aplicações nativas para iOS e Android e aproveitar o mecanismo de databinding embutido do Xamarin Forms.

Fonte: http://www.macoratti.net/16/09/net_mvvm1.htm
Un-template Python HTML Library
Tags: python, django, flask
Published: 2020-06-02 12:44:41

[Un-template is a minimal Python library to modify and render HTML](https://github.com/chr15m/ntpl). The idea is to start with a pure HTML document, choose the bits you want to modify using CSS style selectors, and then change them using declarative Python datastructures. This means you can use pure Python to replace sections of HTML and do all of the "template logic", similar to how declarative front-end frameworks work.

Install it with `pip install ntpl`.

Here's an example. It's a Django view function that returns a web page. A file called `index.html` is loaded, two HTML tags with IDs `content-title` and `content` are replaced with new content. A link tag with ID `home` is replaced completely with a new link tag.

```python
from ntpl import slurp, replace, replaceWith, render

template = slurp("index.html")
faqs = markdown(slurp("FAQ.md"))

def faq(request):
    html = template
    html = replace(html, "#content-title", "FAQ")
    html = replace(html, "#content", faqs)
    html = replaceWith(html, "a#home", render(["a", {"href": "/"}, "home"]))
    return HttpResponse(html)
```

That's basically all there is to it. You can use it like this instead of Django's native internal templating language.

You can [get the source code on GitHub](https://github.com/chr15m/ntpl) or install it with `pip`.

It is inspired by Clojure's [Enlive](https://github.com/cgrand/enlive) and [Hiccup](https://github.com/weavejester/hiccup), this library uses [pyhiccup](https://github.com/nbessi/pyhiccup) and [Beautiful Soup](https://www.crummy.com/software/BeautifulSoup/) to do its work.
HOW TO WRITE A DEFINITION?

Tags: technicalwriting, technicalwriters, definition
Published: 2020-06-02 12:38:48


While writing a technical document, you start with a definition. The definition needs to clearly outline the term you are defining.  Here are some ways you can use while defining a term;

An easy step to get started with a definition is to place a term into a classification and differentiate it from other terms for the same class. For instance, 
<i>The <i>how-to article</i> is a type of <i>expository writing</i> that delivers information on the structural way to perform a particular task to an audience.</i>

The <i>how-to article</i> is a *term*, and <i>expository writing</i> is the *classification*. 

Furthermore, you can add extensions to give precise meaning. For instance, 
<i>The how-to article is a type of expository writing that delivers information on the structural way to perform a particular task to an audience. <i>Expository writing</i> is a type of writing where the author intends to either inform or explain the subject to the reader.</i>

"Expository writing is a type of writing where the author intends to either inform or explain the subject to the reader." is an *extension*.

In the case of defining a term with more than two meanings, you can use qualifiers. The qualifier is used when the general context needs to be established upfront. For instance,

* <i>Bug (Computing): An error in code, program, or system.
- <i>Bug (Biology): An insect.</i>

In the aforementioned case, <i>computing</i> and <i>biology</i> are *qualifiers*.

### As bonus information: 
#### **Process description vs. Mechanism description**
A *mechanism description* delivers details about the physical attributes of a mechanism. A *process description* lists out the steps in the operation of a mechanism or focuses on the working of conceptual parts. Both are different in the context of content delivered.
Keep writing :)
Curved Background Using CSS
Tags: css, html, webdev, weeklyui
Published: 2020-06-02 12:16:20

CSS have an so many awesome properties to make any elements attractive. So here we designed simple Curved Background Using CSS and with the help of basic html tags.

Here we used border-radius CSS properties to make this background rounded/curved. Also, we used flex properties to make our content properly centered and perfectly aligned. To make mobile-friendly we used media queries for the mobile screen side.

Make it yours now by using it, downloading it, and please share it. we will design more elements for you.

[Download Source code](https://w3hubs.com/curved-background-using-css/)
Daily Developer Jokes - Tuesday, Jun 2, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-06-02 12:00:25

---
title: "Daily Developer Jokes - Tuesday, Jun 2, 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=Tuesday%2C%20Jun%202%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/5e1258fbc6e41.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:___ You know what the best thing about booleans is?

___A:___ Even if you are wrong, you are only off by a bit.
 -->
How beneficial is React Native for developing a mobile app?
Published: 2020-06-16 10:46:36

---
title: How beneficial is React Native for developing a mobile app?
published: true
date: 2020-06-02 12:00:00 UTC
tags: 
canonical_url: https://www.ma-no.org/en/programming/javascript/how-beneficial-is-react-native-for-developing-a-mobile-app
---

A substantial alternative of cross-platform app development is fully native development. If you follow the approach of native mobile app development such as react native development company in Bangalore, you will be able to create separate ones for both Android as well as iOS. The framework of React Native is an evolving solution that is considered for a cross-platform app’s future development.Is there any advantage of using React Native?Let us have a look at the advantages of making use of React Native for developing a mobile app. Community is important: React Native is one such platform that is of… !

[Read all ](https://www.ma-no.org/en/programming/javascript/how-beneficial-is-react-native-for-developing-a-mobile-app)
Basics Of GoLang
Tags: beginners, go, backend, tutorial
Published: 2020-06-02 11:47:00


I am working at <a href='https://www.gojek.com/'>Gojek</a> as a Frontend Engineer, and using GO for backend.

And wanted to learn something new, So started looking forward to exploring some new technology.

<h3>Why I picked GO?</h3>
It’s because I wanted to learn something in backend by which I can build web apps end to end. In GO we can do anything, it’s simple to learn and very semantic. Also, I can contribute in my code base

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.


Features:
<ul>
<li>Fast compile times</li>
<li>Ease of development</li>
<li>Fast execution
</li>
</ul>

I have written four blogs while learning Go as <a href='https://blog.suprabha.me/17-basics-of-golang-part-1'>Basics of GoLang Part-1</a>, <a href='https://blog.suprabha.me/18-basics-of-golang-part-2'>Basics of GoLang Part-2</a>, <a href='https://blog.suprabha.me/19-basics-of-golang-part-3'>Basics of GoLang Part-3</a> and <a href='https://blog.suprabha.me/21-basics-of-golang-part-4'>Basics of GoLang Part-4</a>. 👻

Thanks for reading this article ♥

I hope you would find these article useful. Feel free to ping me in comment section or <strong><a href="https://twitter.com/suprabhasupi">@suprabhasupi</a> 😋</strong></p>
<!-- /wp:paragraph -->

<table>
  <tbody>
    <tr>
      <td>
        🌟 <a href="https://twitter.com/suprabhasupi"> Twitter</a>
      </td>
      <td>
        👩🏻‍💻 <a href="https://www.suprabha.me/"> Suprabha.me</a>
      </td>
<td>
        🌟 <a href="https://www.instagram.com/suprabhasupi/"> Instagram</a>
      </td>
    </tr>
  </tbody>
</table>