teleren/devto huggingface dataset:
is it time to be @brave ?
Tags: browser, brave, chromium, discuss
Published: 2020-02-11 12:19:21

still searching for a solution to the "20 browser tabs shouldnt use 100% cpu" dilema (btw migrating off gmail is helping a lot)

should i be brave ? and try the [brave](https://github.com/brave/brave-browser) browser if so ! then how brave ? 

should i try to 
* [install brave from .deb](https://brave-browser.readthedocs.io/en/latest/installing-brave.html#linux) 

or 
* [build brave locally](https://github.com/brave/brave-browser/wiki/Linux-Development-Environment)

oh dear im not that brave my vm only has 20G of free space and not the 100G you need to compile chromium 

can you share any experiences of how brave you have been ? :)

thanks for all the feedback im also not seeing much difference in resource usage via top

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

STOP PRESS

goodbye brave i dont want to see ultravpn popup ads

```
# aptitude remove brave-browser
```
Why we should (or shouldn't) separate login details from profile details (Spring Security)
Tags: discuss
Published: 2020-02-11 12:07:19

Do people usually separate out login details (such as username/password/account lock status etc) into a separate entity (db table), or do they just have a single user entity which also includes things like name, avatar etc.? 

I have always gone with a separation between account (aka login) details and profile (i.e. personal) details. However, more recently I'm struggling to see the benefit of doing so. The only use-case I can think of is if a user can have multiple logins and we'd want to map each of those to a single profile. However, our use case doesn't cover that. 

Thoughts :)
Need coding problems to practice STL algorithms
Tags: help, cpp, stl
Published: 2020-02-11 11:36:36

I am creating a list of coding problems which I can provide to my juniors to get habitual to using STL algorithm rather writing their own algorithm.

If you have any intuitive coding problem in mind where we can use the STL algorithm efficiently, you will be a great help. Combination of more than one algorithm is also good.

For example: Trim spaces from following string.
```c++
int main()
{
    string input_string = "1         2  3   4 5 55 5     ";
    
    // Your code
    
    return 0;
}
```

- Output
```
12345555
```

Here we can apply `std::unique`, perfectly.
Let build something as a community PT.1 (Idea)
Published: 2020-02-11 11:35:27

Hey Devs,

I was thinking, let's see if we as a community, can all build a product together.

This will all be for fun, and to see what cool project we can build together.

So we will do this in parts.

For part 1, we will decide what idea we want to make into a product.

The idea with the highest votes will be what we go forward with.

I look forward to seeing what we make a community
Python inline if
Tags: python, beginners
Published: 2020-02-11 10:39:36

In coding, you often use branching. A branch in code is executed conditionally. Without branching, you only have a list of instructions and it would always do the same, no matter what happens. 

Many programming languages support branching. <a href="https://python.org">Python</a> also supports branching. Developers speak of <a href="https://pythonbasics.org/if-statements/">if-statements</a> instead of branching. 

## Branching in Python

Python does not have a trailing if statement.
In Python there these two kinds of ifs:

* if <a href="https://pythonbasics.org/if-statements/">statements</a>

```python
if condition: statement
if condition:
    code_block
```

* if **expression** (python > 2.5)

```python
expression_if_true if condition else expression_if_false
```

You can check your Python version with 

```python
python --version
```

## If-expression

So you can do the following if expression:

```python
a = False
print("hello" if a else "world")
```

You can change the variable a to see the difference. It will return "hello" or "world" depending on the value of a.

An if-expression must always be an if-else expression, the following will throw an error because else is missing:

```python
a = False

print("hello" if a)
```

Returns if you run it:

```python
python example.py
  File "example.py", line 4
    print("hello" if a)
                      ^
SyntaxError: invalid syntax
```

So the else for the if-expression in mandatory.

**Related links:**
* <a href="https://docs.python.org/2.5/whatsnew/pep-308.html">If expressions</a>
* <a href="https://pythonbasics.org/">Learn Python</a>
Docker Error - Permission denied connecting Docker daemon socket
Tags: docker, errors
Published: 2021-07-01 19:45:07

---
title: Docker Error - Permission denied connecting Docker daemon socket
published: true
date: 2020-02-11 10:30:00 UTC
tags: Docker,error
canonical_url: https://blog.g33kzone.com/docker-error-permission-denied-connecting-docker-daemon-socket
---

Post Docker installation, you may face the following error if you execute Docker commands without "sudo".

docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock:  
Post http://%2Fvar%2Frun%2Fdocker.sock/v1.38/containers/create: dial unix /var/run/docker.sock: connect: permission denied.

The following steps will help resolve this issue

Create the docker group & add your user

- Create the docker group

```
sudo groupadd docker

```
- Add your user to the docker group

```
sudo usermod -aG docker ${USER}

```

You might need to log out and log back in so that your group membership is re-evaluated
.COM might be costing more from 2020
Tags: domains, internet, web, com
Published: 2020-02-11 10:24:41

---
title: .COM might be costing more from 2020
published: true
description: Cost will most likely increase for .COM domain owners.
tags: domains, internet, web, .com
---

Prices for acquiring and renewing .COM domains may rise from this year onwards so I thought I might put a short article together on what is happening and how you can minimise impact on your domains.
 
The measure is likely to be put in place after [amendments were proposed to the .COM Registry Agreement](https://www.icann.org/public-comments/com-amendment-3-2020-01-03-en?utm_source=Iterable&utm_medium=email&utm_campaign=Service_DomCPIv3_20200210) and according to the document ICANN and VeriSign were the only two parties that took part of negotiations.

Something similar has happened before with the [removal of price caps for .org](https://pricecaps.org/) domains last year. The price cap had been in place since 1999 for .COM and .NET domains too.

## How does it impact .com domains?

These amendments could mean that, within 10 years, .COM domains could cost around 70% more than the current wholesale price.

VeriSign will be able to increase domain prices up to 7% each year for three years with a two year freeze in between every three year period.

It is unsure yet how clear these costs could impact domain owners but “it is likely that most of these increases will be paid by domain name registrants”, Namecheap states in [an article on the subject](https://www.namecheap.com/blog/icann-allows-com-price-increases-gets-more-money/?utm_source=Iterable&utm_medium=email&utm_campaign=Service_DomCPIv3_20200210).

## What can we do to mitigate these changes?

You could extend your .COM domains to up to 10 years before prices increase as the amendments will have a six month notice period before changes can be made.

Finally, you could [leave a comment with your thoughts on the proposed changes](https://www.icann.org/public-comments/com-amendment-3-2020-01-03-en?utm_source=Iterable&utm_medium=email&utm_campaign=Service_DomCPIv3_20200210) on ICANN until the 14th of Feb 2020 or discuss the subject on social media ([@ICANN on Twitter](https://twitter.com/ICANN)).
Advanced TypeScript Exercises - Question 2
Tags: typescript, javascript
Published: 2020-02-11 10:15:14

--- series: Advanced TypeScript Exercises ---

In this question I will ask you, why TS fails here. And I can say there is a valid reason why such construct is wrong, its not a language bug. Can you spot why, and what is example type which proves TypeScript rightly prevents such code to compile?

```ts
type User = {
  id: number;
  kind: string;
};

function makeCustomer<T extends User>(u: T): T {
  // Below error, why?
  return {
    id: u.id,
    kind: 'customer'
  }
}
```
You can start playing with this code here - [Playground link](https://www.typescriptlang.org/play/index.html?ssl=1&ssc=1&pln=12&pc=2#code/C4TwDgpgBAqgzhATlAvFA3gKClAlgEwC4oA7AVwFsAjJAbmygGtcSio5hEWBzegX3qYAZmRIBjYLgD2JKBQCGjCAGEyHKRSQAeACpQIAD2ARWcWAkQA+ABRliOgJT2MDAPSuoAIQgAbKQHd9REQpRAAaKH8ACxAAfgZECGAyRFksHBwCYjIAOgIwhhxmVmIAcjE1YA0kUoY+TD4gA). 
Post your answers in comments. Have fun! Answer will be published soon!

**This series is just starting**. If you want to know about new exciting questions from advanced TypeScript please follow me on [dev.to](https://dev.to/macsikora) and [twitter](https://twitter.com/macsikora).
os.walk()
Tags: python, beginners
Published: 2020-02-11 10:13:12

How do you get the filenames in a directory? You can do that automatically with <a href="https://python.org/">Python</a>, including all files in sub directories.

To get started, you need to import the os module, this contains operating system specific functionality.

In Python, you can use OS.walk(). OS.walk() gets the filenames in a directory. It does so by walking the <a href="https://pythonspot.com/python-tree/">tree</a> either top-down or bottom-up.

You should know the <a href="https://pythonbasics.org">basics of Python</a> or this will be a bit confusing.

## OS.walk()

Calling the OS.walk() method returns a 3-<a href="https://pythonspot.com/python-tuples/">tuple</a> (dirpath, dirnames, filenames).

```python
os.walk(top, topdown=True, onerror=None, followlinks=False)
```

* *dirpath* is a string, the path to the directory. 
* *topdown* is an optional argument
* *onerror* is an optional argument, by default errors are ignored
* *followlinks* is false will not walk down into symbolic links that resolve to directories

The function returns lists for dirnames and filesnames, so you can use a <a href="https://pythonbasics.org/for-loops/">for loop</a> to parse it.

To output the files in a directory you can run the code below:

```python
import os

for root, dirs, files in os.walk("/etc/"):
    for name in files:
        print( root + "/" + name)
```

This outputs all files in the directory, including sub-directories. To get all sub directories you can just change files to dirs:

```python
import os

for root, dirs, files in os.walk("/etc/"):
    for name in dirs:
        print( root + "/" + name)
```

You can get the file size too:

```python
import os
from os.path import join, getsize
from pathlib import Path

# needs Python 3.5+
home = str(Path.home())

for root, dirs, files in os.walk(home + "/Desktop/"):
    print(root, "consumes", end=" ")
    print(sum(getsize(join(root, name)) for name in files), end=" ")
    print("bytes in", len(files), "non-directory files")
```

I've used this line to get the home directory in Python 3.5:

```python
from pathlib import Path
home = str(Path.home())
```

If you have an older Python version you can use

```python
from os.path import expanduser
home = expanduser("~")
```

**Related links:**
* <a href="https://docs.python.org/3/library/os.html">Python os module</a>
* <a href="https://pythonbasics.org/">Learn Python</a>
Javascript object reamp
Published: 2022-12-09 14:09:12

---
title: Javascript object reamp
published: true
date: 2020-02-11 09:59:30 UTC
tags: 
canonical_url: https://blog.niradler.com/javascript-object-reamp
---

in my daily job as a full stack js developer I often need to manipulate js objects, either remove fields or transform to a new structure etc.

I decided to create an npm module [object-remap](https://github.com/niradler/object-remap), to make this repeated task more reliable, reduce code, and create cleaner code.

let's look at the examples:

```
const objectRemap = require("object-remap");

const obj = {
  a: 1,
  b: 2,
  c: 3,
  d: {
    e: 4,
    f: [1, 2, 3]
  }
};

//simple usage
const fields = ["a", "b", "c"];

let newObj = objectRemap(obj, fields);
console.log({ obj, newObj });
/*
{
  obj: { a: 1, b: 2, c: 3, d: { e: 4, f: [Array] } },
  newObj: { a: 1, b: 2, c: 3}
}
*/

//advance usage
const fieldsMap = [
  {
    origin: "a",
    target: "a"
  },
  {
    origin: "d.e",
    target: "e"
  },
  {
    origin: "d.f",
    target: "f",
    formatter: data => `${data.length} items`
  }
];

newObj = objectRemap(obj, fieldsMap);
console.log({ obj, newObj });
/*
{ 
  obj: { a: 1, b: 2, c: 3, d: { e: 4, f: [Array] } },
  newObj: { a: 1, e: 4, f: '3 items' } 
}
*/

```

for getting started install the package with npm:

```
npm i -S object-remap

```
“Family Tree” Data Structure
Tags: 100daysofcode, oop, functional
Published: 2020-02-11 09:58:10

There is no right or wrong programming paradigm. 
In family tree, it's obvious to choose OOP instead of functional programing.
I have no idea how to implement this kind of data into functional programming.
Check out this answer, isn't it just stunning and amazing? 
 
{% stackoverflow 3304670 %}
javascript add remove the element from array
Tags: javascript
Published: 2020-02-11 09:47:52

When we work with JavaScript arrays. Sometimes we need to add or remove elements or items from the end or beginning of a JavaScript array. So don’t worry, there are four amazing ways in JavaScript to remove or add the beginning or starting elements/items of JavaScript.


#javascript add remove the element from first and last of an array

There are four inbuilt methods in JavaScript to remove or add the last beginning elements/items from the array are:-


unshift(): Add elements/items to the first of an array.
shift(): Remove an element/item from the first or beginning of an array.
pop(): Remove an element/item from the last or end of an array.
push(): Add elements/items to the last or end of an array.

For Examples visit this link #https://www.tutsmake.com/shift-unshift-push-pop-array-methods-in-javascript/
Laravel 6 Currency Exchange Rate Calculator
Tags: laravel, php
Published: 2020-02-11 09:42:28

Laravel 6 creates a currency exchange rate calculator or converter example tutorial. In this tutorial, we will learn how to create currency exchange rates calculator in laravel applications without using any package with examples.

This tutorial has the purpose of how to easily create a currency converter application in laravel without using any package. And also you can download laravel currency converter application here

https://github.com/tutsmake/laravel-currency-converter-application

Laravel Currency Exchange Rate Example Tutorial
Just follow the below steps and create a currency exchange rate calculator in laravel application:

#Laravel 6 Currency Exchange Rate Calculator

Install Laravel Fresh New Setup
Signup and Get API KEY
Create Route & Controller
Create the blade view
Start Development Server

Read more https://www.tutsmake.com/laravel-6-currency-exchange-rate-calculator/
Avoiding Sensor Positioning Challenges
Tags: longrangeproximitysensors
Published: 2020-02-11 09:37:58

Proper sensor positioning is just as crucial to process accuracy as choosing the right sensor for the process. The long range sensor is often the ideal choice for automated manufacturing processes where greater distance is required to protect the sensor. But even with the benefits of this choice, users must balance the needs for high accuracy with hysteresis. https://www.htmsensors.com/blog/avoiding-sensor-positioning-challenges/
GitKraken - The tool I can't git without
Tags: git, productivity
Published: 2020-02-11 08:44:06

We have all been there at the beginning of learning git - jumping through courses and blogs, reading documentation, trying to learn commands by heart, practising etc. I was there too, struggling to get a grip of what git actually is and how it works. I am willing to present you **GitKraken**, the tool which will save you an unimaginable amount of time which you would have spent on re-reading git documentation or strolling through some git cheat-sheets.

![GitKraken](https://www.gitkraken.com/img/og/og-git-client.png)

This tool is amazing and I cannot enjoy it enough. It provides all the features git has to offer in just a click away. It has a beautiful colorful representation of the branches and their flow, as well as a toolbar with all the commands you constatly use.

![Toolbar](https://dev-to-uploads.s3.amazonaws.com/i/9iusvmgd507wk471s8fx.PNG)

It also has a sidebar to view all your existing local and remote branches, and offers all of the necessary options you need to work with them.

![Branches](https://dev-to-uploads.s3.amazonaws.com/i/the671n3ivwkxt9cpjil.PNG)

My favorite part of using this git tool: The diff view. It feels so empowering to be able to see the changes in the repo with a neat diff tool. This is another thing that GitKraken offers. It offers three different diff views, one of which lets you discard od stage only chunks of a modified file, you can clearly see who has worked on these changes and list all the files which have been modified. Besides this it has a very similar and interactive conflict resolver GUI as well.

![Diff](https://dev-to-uploads.s3.amazonaws.com/i/fd5itfxund2bhlytbmpe.PNG)

Additionally, GitKraken has some other features called GloBoards and Timelines (NEW), which you can use for issue tracking or project/task management and tracking current milestones. It is also a part of the [Student Developer Pack](https://education.github.com/pack), from which as a student you can get a free PRO account for a whole year.

I very much recommend using this tool to everyone who is working with git on a daily basis and does not feel as cool about manually typing commands in the terminal as in the beginning. You can read more about GitKraken [here](https://www.gitkraken.com/)

Thanks for reading!
Professional communication skills - Intro
Tags: career, communication, growth
Published: 2020-02-11 08:40:58

---
title: Professional communication skills - Intro
published: true
description: 
tags: career, communication, growth
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/ryfs6i56jpnjs3l9vye2.png
series: Professional Communication Skills
---

For most of us, talking to people within our realms is relatively easy. We all care about similar things, use the same tools, solve similar problems. But when we need to break out of our bubble to collaborate with other functions (design, product, marketing, business, etc.), communication gets harder and harder. 

Part of what makes this difficult is that these communication skills are often not emphasized early in our careers. It's usually after we've caught up on the technical skills that these ~~soft~~ professional skills become more important.

As junior engineers, our day-to-day work often requires hours of continuous individual focus, solving new technical problems, and communicating via Slack with our peers. Occasionally we'll have a 1-on-1 with a manager or participate in team meetings. Most of these interactions involve largely similar communication styles. 

After a few years, as you try to level up and start leading projects, you'll immediately start running into problems if you use the same communication styles as before. At first, you'll work with engineers outside of your team, who won't have the same technical background and goals as you. Then more closely with the engineering and product managers, who care about entirely non-technical problems. Eventually you'll scale out of the product org to working with business and legal, who basically speak a different language. How you're used to communicating with fellow engineers on your team is probably not going to work very well when you're working with these other groups of people. 

Yet being able to communicate effectively is incredibly important. You have to be able to work across teams and organizations to solve the really big problems. You have to talk to all kinds of different people and convince them to believe in you and trust in you. All of that requires effective communication skills.

In these upcoming articles, I'll do some deep dives into some of the skills that have helped me improve. Stick around!

- [Professional communication skills intro](https://dev.to/xinranw/professional-communication-skills-2kh7)
- [Identify your audience](https://dev.to/xinranw/professional-communication-skills-part-2-1hia)
- Figure out what your audience actually cares about
- Adjust the information and terminology you use for your audience
- Change your communication medium for your audience
Abstract Classes in PHP 
Published: 2020-02-11 08:40:40

To understand abstract classes we can use an example which uses shapes.
 
First off, we will create the following folder structure. 

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

And after, lets see whats in each of those files,

In the shapefeatures.abstract.php file we will have the following written

```
<?php

abstract class ShapeFeatures {

  public function getBackgroundColour(){
      return "Color";
  }   

}
```


In the Triangle.class.php file we'll have the following

```
<?php

Class Triangle extends ShapeFeatures{

  public function FindColor(){
            return $this-> getBackgroundColour();
        } 

    }
```

And in the index.php file we will have this,


```
<?php 

include_once "abstract/shapefeatures.abstract.php";
include_once "classes/Triangle.class.php";

$tri = new Triangle();
echo $tri -> FindColor();
?>
```

So you can see we extend Triangle to shapefeatures- And we don't create an object of shapefeatures, and when we extend a class to an abstract class all the features of the abstract class is available to it ,  hence we can easily do what we've done in the index.php file (ie. successfully execute findColor() from the triangle object which has a method thats declared in the abstract class )

Please note that this example is used as it makes it easier to understand the use of abstract class, once you understand the concept of abstract classes I recommend checking out https://phpenthusiast.com/blog/the-decorator-design-pattern-in-php-explained  and more resources.
Web Scraping con Python: Guía Paso a Paso
Tags: webscraping
Published: 2020-02-11 08:23:49

Introducción
 

El web scraping es una técnica que podría ayudarnos a transformar datos HTML no estructurados en datos estructurados en una hoja de cálculo o base de datos. Además de usar Python para escribir códigos, acceder a los datos del sitio web con API o data extraction herramientas como Octoparse (http://www.octoparse.es/) son otras opciones alternativas para el web scraping.

 

Para algunos sitios web grandes como Airbnb o Twitter, proporcionarían API para que los desarrolladores accedan a sus datos. API significa interfaz de programación de aplicaciones, que es el acceso para que dos aplicaciones se comuniquen entre sí. Para la mayoría de las personas, API es el enfoque más óptimo para obtener datos proporcionados por el propio sitio web.

Sin embargo, la mayoría de los sitios web no tienen servicios API. A veces, incluso si proporcionan API, los datos que podría obtener no son los que desea. Por lo tanto, escribir una secuencia de comandos de Python para crear un rastreador web se convierte en otra solución poderosa y flexible.