teleren/devto huggingface dataset:
Hobbies Nao Projetos
Tags: career
Published: 2020-05-11 13:40:33

![crosswords](https://vinimelo.dev/images/hobbies-vs-projects/crosswords.jpg)

## Introdução

Na vida de uma pessoa da área de tecnologia, sempre pensamos um passo à frente
em nossas carreiras, no próximo projeto, na próxima grande mudança de emprego,
naquela palestra que te dará visibilidade ou mesmo naquela contribuição em
projetos Open Source que fará toda a diferença em algum momento no futuro.

Hoje quero dizer que isso, na verdade, não importa tanto!


## Projetos Pessoais

Crescimento pessoal, evolução e grandes objetivos são as frases que todo coach
diz e, nós mesmos, já até internalizamos esse tipo de atitude sempre que iniciamos
algo ou para planejar nossas vidas e ações. Mas isso não é o que realmente importa.

Em um mundo cada vez mais preocupado com o **ter**, e não com o **ser**, estamos perdendo
oportunidades ótimas de nos desenvolvermos fora das telas do computador; hoje em dia o
diferente não é ter milhares de sites criados, um portfólio imenso ou contribuído em 
inúmeros projetos Open Source, o diferente é fazer escalada nos sábados, andar de bicicleta
pro trabalho, fazer Ioga todas as quartas ou jogar tênis de mesa toda terça e quinta.


## Vocabulário

Nosso vocabulário mundano tem diminuído muito com a extrema especialização que estamos vivendo,
cada vez mais as pessoas se juntam com outras pessoas similares, que falam e fazem sempre as
mesmas coisas e que, juntos, parecem mais uma colônia de formigas do que seres humanos únicos,
criativos e cativantes.

Àquela conversa no meio do cafézinho está cada vez mais rasa, não conseguimos deixar de tocar
no assunto trabalho, nós não somos os nossos trabalhos. Há muito mais vida fora do trabalho
do que dentro dele, nós trabalhamos para viver ou vivemos para trabalhar? Não existe mais nada
de interessante fora nossa bolha? E fora do nosso trabalho? 

Sem falar nas nossas crenças, calorosas e opinativas. Sabemos de tudo mas, ao mesmo tempo, não 
sabemos de nada. Não vivemos mais sem o Google ou o Wikipédia, nossas falas estão marcadas
por aquilo que ouvimos falar e não por aquilo que realmente vivenciamos ou sentimos.

![Climbing a rock](https://vinimelo.dev/images/hobbies-vs-projects/rock-climbing-in-the-black-hills-1361456-1920x1440.jpg)

## Hobbies

E, talvez, a salvação desse destino sejam os Hobbies...

Criar novas formas de se divertir, experimentar uma caminhada na praia, ler um livro ao pôr do sol,
sair do computador. 

Tentar entender o que o outro sente, realmente se importar com outras pessoas e não somente com o que
ela faz, com o que ela têm ou com quem ela anda.

Somos mais do que isso e podemos ser melhores do que estamos sendo.

A evolução na vida não se dá só por aquilo que entregamos, mas como entregamos, com empatia,
com respeito e entendendo a real necessidade do outro lado.

Que criemos novos Hobbies, novas formas de ver o mundo, novos horizontes, novas perspectivas
e não novos projetos!

### Fim

Quer ver mais posts como esse?
Veja no [meu blog](https://vinimelo.dev)
Platforms Characteristics
Tags: socialvr, virtualreality, develop, design
Published: 2020-05-11 13:32:14

As social beings, humans look for connection to shorten the social distance. Many individuals and organizations are utilizing virtual reality (VR) for the first time. Social VR platforms are seeing a dramatic increase in use. Businesses also are using VR to communicate across distances, to prototype solutions, and guide decisions. In this article, we invite you to come along with us as we travel together, a European developer (me) and an American designer Heather Dodds, Ph.D., into virtual space to discover that the most important connection is behind the avatar. 

We considered Social VR platforms in this article, from a 2D perspective. 

Read more about it here - https://www.linkedin.com/pulse/platforms-characteristics-tiago-martins-peres-%E6%9D%8E%E5%A4%A7%E4%BB%81/

 #UserExperience #Technology #AltspaceVR #Hubs #FrameVR #VirBELA #SomniumSpace #Engage #rumii #RecRoom #iSeeVC #JanusXR #VESTAJanusXR #Sansar #NeosVR #Anyland #Cryptovoxels #sinespace #3D #2D #virtualconferences
Material III in 20 Minutes (Adding Search)
Tags: angular, typescript, material
Published: 2020-05-11 13:30:52

In the previous articles we have the Material Table up and running, bound to a JSON file, and styled in a nice way.  Today we want to add Search function.

```html
<div appGrid columns=".1fr .7fr">
  <label>Search</label>
  <input type="text">
</div> 
```
We start off with a div. It uses [our appGrid directive](https://dev.to/jwp/angular-no-css-columnar-grid-4aa) which sets the style to display:grid and sets the width of the label to .1fr; and the input width of .7fr.

**The Search Box**

  ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/87vsi67vnzj9jvoce8f1.png)

Next we want to capture keyup events and use a filter to change the view of the table.

```typescript
<div appGrid columns=".1fr .7fr">
  <label>Search</label>
  <input #search (keyup)='onSearchKeyUp(search)' type="text">
</div> 
```
We give the input a name and tell it to call onSearchKeyUp when the user types. It sends in the actual input element to the event handler.

```typescript
  onSearchKeyUp(search){
    var currentFilter = search.value;
    this.dataSource.filter = currentFilter;
  }
```
That's all you need to add a Search filter. As you type; the grid is filtered, and returns to 'normal state' by removing the text from the search.  If you add a button named "Clear" or "Reset" this is the code to clear the filter.

```typescript
  onClearClicked(){
    this.dataSource.filter = "";
  }
```
As you can see the response is excellent!

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/olmwayogo012m5iqj56r.gif)

Next up: Sortable column headers

JWP2020
Contiguous Array Sum
Published: 2020-05-11 13:14:41

Hello! Today I'm going to to take you through an interesting toy problem that has known to show up in coding interviews. The goal is to create a function called contiguous or maximum array sum, that takes in an array of any size containing both positive and negative integers, and outputs the largest sum of contiguous numbers, which could be a single number or a series of numbers in the array.

What's interesting about this problem is that it can be solved surprisingly fast (magic) using a key principle that is found all across the wide world of programming. The key is to solve the larger big-picture problem by breaking it down into the smallest possible example of the problem. While we aren't necessarily going to recurse in the solution, we use this principle to save computation time and avoid unnecessary calculations.If we can solve the problem in an optimal sub-structure, the 
solution will remain the same in the larger example. 

So to solve this problem, you must use an array of integers with mixed signs, as a an array of positive integers will always have the entire set as the largest contiguous sum. 

The brute force method was what came to mind when I first saw this problem, which was checking every number with every other number and then comparing each sum to find the largest sum. 
 
So here's our input:
```
[-1, 3, 3, 4, -2, 0]
```

A contiguous sub array can be any length, but it must be a subset of the original array and have the items in their respective order without any breaks. 

And if we use Kadane's algorithm, we can get an O(n) solution rather than the quadratic time complexity the brute force method gives us. This algorithm saves the value of the previous contiguous sub array sum as the best sum, so that the current sum can be immediately compared to it during the initial loop through the number. Having to not compute the sum for the entire sub array each time, we can simply add the next number to the previous sum.

We loop through the numbers and keep track of the current and best sums,
and after the loop passes one time, we can deduce our answer for this problem.

And here's the final code solution:

```
let currentSum = 0;
  let bestSum = nums[0];
  
  nums.forEach(num => {
  	currentSum = Math.max(num, currentSum + num);
    bestSum = Math.max(bestSum, currentSum);
  });
  
  return bestSum;
```
Daily Challenge #240 - ATM
Tags: challenge
Published: 2020-05-11 12:58:39

---
title: Daily Challenge #240 - ATM
published: true
series: Daily Challenge
description: Try to find the minimal number of bills that must be used to cash out n.
tags: challenge
---

There's an ATM with unlimited money in bills of 10, 20, 50, 100, 200, and 500 dollars. You're given an amount of money `n` to withdraw with `1<=n<=1500`. 

Try to find the minimal number of bills that must be used to cash out `n`, or output `-1` if it's impossible. 

**Example:**
solve(1250) => 4 bills (500x2, 50x1, 200x1)
solve 1500 => 3 bills ($500x3)

**Tests:**
solve(10)
solve(550)
solve(770)

Good luck~! 

***
_This [challenge](https://www.codewars.com/kata/5635e7cb49adc7b54500001c) comes from Sanan07 on CodeWars. Thank you to [CodeWars](<https://codewars.com/>), who has licensed redistribution of this challenge under the [2-Clause BSD License](<https://opensource.org/licenses/BSD-2-Clause>)!_

_Want to propose a challenge idea for a future post?  Email **yo+challenge@dev.to** with your suggestions!_
Introducing Outside The Box Model Podcast
Tags: html, webdev, podcast
Published: 2020-05-11 12:48:59

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

Proud to present the first episode of Outside the Box Model. A deep dive into the human experience of software development and the impact of open source communities. I’m your host Ethan and today we have a spectacular guest, Jacob Schatz. He’s written two books, published many open source content, worked at top companies as a software engineer, now is building his own venture at https://tilig.com/, a Password manager for everyone, and still has time to play the piano. 

About Jacob Schatz:

@tilighq employee #1 · http://tilig.com · The password manager for the rest of us! · Previously early engineer and Lead Frontend and UX @gitlab and @meltanodata

https://open.spotify.com/show/2QSOPWKbWigFI0yMkSeGQS
https://anchor.fm/outside-the-box-model

At the end of the podcast, the guest asked a question to the audience. Jacob asks you, what are you excited about learning next? Let's start a discussion below. 

And if you are looking for more resources online check out my article to Learn The Fundamentals https://dev.to/ethaneisenhard/learn-the-fundamentals-of-web-dev-54od
VimTrick: Non-greedy pattern matching
Tags: vim
Published: 2020-05-11 12:37:53

Good morning Vim users of Dev.to! Another Monday has arrived and that means another in my series of Vim tricks and tips...

You might already know that pattern matching in Vim is greedy by default. That means, it will select the largest string that matches your pattern. For example, suppose you have:

```
{
  "name": "Andy",
  "last": "Dufresnes",
  "id": 37927
}
```

If you pattern match with `/”.*”`, Vim will select the entire string on that line: `"name": "Andy"`. But what if what we really want is just the first `"name"`?

Instead of `.*` use `.\{-}` and Vim will select just the smallest string that matches the pattern instead of the largest.

I have screenshots and more details over on my post on [VimTricks](https://vimtricks.substack.com/p/vimtrick-minimize-greed).

Let me know if you find this helpful! I still have not internalized it for every day use but I've found it very helpful when I do recall it!
Best Time to Buy and Sell Stock
Tags: codinginterview, problemsolving, cpp, leetcode
Published: 2020-05-11 12:20:02

---
title: Best Time to Buy and Sell Stock
published: true
tags: coding-interview, problem-solving, cpp, leetcode
series: Blind75 - Array
cover_image: https://images.unsplash.com/photo-1583752028088-91e3e9880b46?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1567&q=80
---

## [🔗](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/) Problem Description: 
Say you have an array for which the _i_<sup>th</sup> element is the price of a given stock on day _i_.

If you were only permitted to complete at most one transaction (i.e., buy one and sell one share of the stock), design an algorithm to find the maximum profit.

Note that you cannot sell a stock before you buy one.

**Example 1:**
```
Input: [7,1,5,3,6,4]
Output: 5
Explanation: Buy on day 2 (price = 1) and sell on day 5 (price = 6), profit = 6-1 = 5. 
Not 7-1 = 6, as selling price needs to be larger than buying price.
```

**Example 2:**
```
Input: [7,6,4,3,1]
Output: 0
Explanation: In this case, no transaction is done, i.e. max profit = 0.
```
---
## Solution Approach
We can solve that by iterating over the given array of prices once! We have to keep track of the minimum-price we have seen so far and in each day we'll check if we can maximize our profit by calculating the difference between minimum price we have seen so far and the price of the current day. Let's see an example -

```
A = [7, 1, 5, 3, 6]
maxProfit = 0, minPrice = MAX

In each iteration we'll do these
    minPrice = min(A[i], minPrice)
    maxProfit = max(maxProfit, A[i] - minPrice)

i = 0
minPrice = min(7, MAX) ::= 7
maxProfit = max(0, 7 - 7) ::= 0

i = 1
minPrice = min(1, 7) ::= 1
maxProfit = max(0, 1 - 1) ::= 0

i = 2
minPrice = min(5, 1) ::= 1
maxProfit = max(0, 5 - 1) ::= 4

i = 3
minPrice = min(3, 1) ::= 1
maxProfit = max(4, 3 - 1) ::= 4

i = 4
minPrice = min(6, 1) ::= 1
maxProfit = max(4, 6 - 1) ::= 5

return maxProfit ::= 5
```
Here's the code -

```cpp
class Solution {
public:
    int maxProfit(vector<int>& prices) {
        int maxProfit = 0;
        int minPrice = INT_MAX;

        int size = prices.size();
        for(int i=0; i<size; i++) {
            int diff = prices[i] - minPrice;
            minPrice = min(minPrice, prices[i]);
            maxProfit = max(maxProfit, diff);
        }

        return maxProfit;
    }
};
```
---
## Complexity Analysis

### Time Complexity `O(n)`
Linear time solution; only traversing the array

### Space Complexity `O(1)`
Constant space
Professional Liability Insurance for IT Professionals
Tags: business, devops, liability
Published: 2020-05-11 12:13:22

Your clients are counting on your expertise to keep their systems running so they can keep the revenue coming and business growing. Without the technology they count on, most businesses would quickly falter. That's why it's so important for technology services providers to carry professional liability insurance to protect their businesses in case something unexpected happens.

This type of insurance – also called E&O; or errors and omissions coverage – protects your business against the high costs associated with claims that your business is negligent in providing your professional services.

What an E&O Policy Covers
Suppose you're responsible for establishing a backup system for your client's customer account information. Due to a technical problem the automatic backups you scheduled never happen, and several weeks' worth of data are lost before the problem is discovered. Or, you've been hired to develop a new order entry system for a client and a coding error corrupts the data. Your customer suddenly faces potential lost income as well as the cost of rebuilding their customer database.

If your client sues you for causing them a financial loss – whether those accusations are justified or unfounded – this coverage helps to pay for your legal defense, judgments, or settlements you may be required to pay to compensate your client. It also typically includes coverage for your income lost while you're fighting your case in court as well as certain other expenses you may incur.

It's important to know that this type of policy operates on a "claims made" basis. This means that for a mistake to be covered, the alleged error must have occurred and the claim filed while the policy was in force. So, to ensure the most complete protection, it's smart to continue your coverage even after your client project is complete.

About Author:

Christian is a web-developer at [research paper service](https://mypaperswriting.com/research-paper-writing-service). Our team are experts in writing, helping bloggers, students and other people by improving their writing ability.
Blind75: Array
Tags: codinginterview, problemsolving, cpp, leetcode
Published: 2020-05-11 12:12:49

---
title: Blind75: Array
published: true
tags: coding-interview, problem-solving, cpp, leetcode
series: Blind75
cover_image: https://images.unsplash.com/photo-1561117089-3fb7c944887f?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1018&q=80
---

| #  | Array Problems                                        |
| -- | ----------------------------------------------------- |
| 1  | [Two Sum](https://dev.to/uraniumreza/two-sum-196f)    |
| 2  | [Best Time to Buy and Sell Stock](https://dev.to/uraniumreza/best-time-to-buy-and-sell-stock-4gpn)                             |
| 3  | Contains Duplicate                                    |
| 4  | Product of Array Except Self                          |
| 5  | Maximum Subarray                                      |
| 6  | Maximum Product Subarray                              |
| 7  | Find Minimum in Rotated Sorted Array                  |
| 8  | Search in Rotated Sorted Array                        |
| 9  | 3Sum                                                  |
| 10 | Container with most Water                             |
Daily Developer Jokes - Monday, May 11, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-05-11 12:00:03

---
title: "Daily Developer Jokes - Monday, May 11, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Monday%2C%20May%2011%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/5e1258a87ad7e.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:
___!false___

It's funny 'cause it's true.
 -->
php RFC:__toArray()
Tags: php
Published: 2020-05-11 11:53:25



This is a new RFC under discussion, proposed for php version 8. It is  to add a new magic method called __toArray() to allow a class to control how it is represented when converted to an array.



```php
class Person
{
    protected $name;
    protected $email;
 
    public $another = 'value';
 
    public function __construct(string $name, string $email)
    {
        $this->name = $name;
        $this->email  = $email;
    }
 
    public function __toArray()
    {
        return [
            'name' => $this->name,
            'email'  => $this->email,
        ];
    }
}
 
$person = new Person('John Doe', 'jon@example.com');

$personArray = (array) $person; // casting triggers __toArray()
# Result
/*
 [
   "name" => "John Doe",
   "email" => "jon@example.com"
 ]
*/
```


Calling any objects implemented __toArray() magic method on any array context including type hinting(only when using weak typing) and return types can get array version of the object.



## Usage

```php
function foo(array $person) {
    print_r($person);
}
 
// Output
/*
[
  "name" => "John Doe"
  "email"=> "jon@example.com"
}
*/
```

```php
function bar(Person $person): array {
    return $person;
}
 
print_r(bar($person));
 
// Output
/*
[
  "name" =>"John Doe"
  "email"=>"jon@example.com"
]
*/
```

```php
declare(strict_types=1);
 
function bar(Person $person): array {
    return (array) $person;
}

/*
[
  "name" =>"John Doe"
  "email"=>"jon@example.com"
]
*/
 // Note: without the array type casting before return would trigger an error here.
```
This is similar to PHP's current implementation of __toString(),
 a copy of the given object's value as an array 
is made upon conversion.

However this proposal does not allow accessing and setting values as you would in a normal array, that functionality remains with classes implementing the ArrayAccess interface.

For more information take a look at the [RFC](https://wiki.php.net/rfc/to-array/)
Which automation framework is best for testing?
Tags: testautomationframeworks, testautomation
Published: 2020-05-11 11:51:07

"For any automated testing process, test mechanization structures have unmistakable significance. The use of structures helps the groups in the support of diminished costs, less testing endeavors, and to accomplish a better yield on speculation (ROI). Notwithstanding these, systems are additionally a significant factor to improve the productivity of a test, increment the test inclusion, reuse of the code, etc. Obviously, endeavors need to pick a legitimate test mechanization system for their testing procedure." 

Top test automation framework tools in 2020 

1. Selenium: 

Selenium is one of the well-known <a href="https://www.testingxperts.com/blog/test-automation-frameworks">test automation frameworks</a>. It is an open-source computerization device with a decent interest in the market. Selenium is rich with testing apparatuses; it robotizes the code across different programs, for example, Firefox, Internet Explorer, Chrome, and so forth., and OS, for example, Mac, Windows, and Linux. Additionally, it underpins different dialects like Java, C#, PHP, Python, Ruby, and so on and helps in the production of cutting edge and complex robotization contents. 

2. Watir: 

Watir is an open-source web robotization structure instrument with Ruby as its content language. It bolsters cross-program testing, information driven testing, and permits computerization of web applications created in any language. It assists with incorporating with the BDD (Behavior Driven Development) devices, for example, RSpec, Test/Unit, Cucumber, and so on. By utilizing Ruby as the language, it will be simpler to interface with the database, read the spreadsheets/information records, and structure a code as a reusable library. 

3. Cucumber: 

Cucumber is an open-source device for Behavior Driven Development (BDD). It basically centers around end-client experience and it is utilized for composing acknowledgment tests. It mostly bolsters programming dialects like Java, Python, Ruby, Groovy, Scala, Perl, PHP, and so on. Additionally, the code written in Cucumber can be executed on different other robotization structures, for example, Ruby, Selenium, and so forth. 

4. Appium: 

Appium is only intended for versatile application testing. It is planned in such a way that there is no compelling reason to revamp or adjust to play out a test. It is a cross-stage, consequently tests can be performed across different stages, for example, Android, Mac, Windows. Additionally, it reuses the code of Android, iOS, and Windows. 

5. Apache JMeter: 

JMeter is an open-source structure intended for testing burden and execution across various applications, servers, convention types. It is cross-stage, totally compact and arranged with unadulterated Java.